From 884a3dec4a6865ba90c5c7287f6f7d3270b1753f Mon Sep 17 00:00:00 2001
From: Gani Georgiev <gani.georgiev@gmail.com>
Date: Thu, 19 Dec 2024 22:39:22 +0200
Subject: [PATCH] update js sdk

---
 ...mjGo_HC.js => AuthMethodsDocs-DubXYrz3.js} |   2 +-
 ...cPt_azs.js => AuthRefreshDocs-Bv2HZYxd.js} |   2 +-
 ...5RbS.js => AuthWithOAuth2Docs-C6WI1jtR.js} |   2 +-
 ...XeUQhkk.js => AuthWithOtpDocs-BwTrTztG.js} |   2 +-
 ...rN.js => AuthWithPasswordDocs-CepW6s1g.js} |   2 +-
 ...s-DePxQqVe.js => BatchApiDocs-CI-AGdP4.js} |   2 +-
 ...tor-8naseTA8.js => CodeEditor-kYUfoxD0.js} |   2 +-
 ...-C9nzLaaI.js => CreateApiDocs-dx3XBFzI.js} |   2 +-
 ...-CJmwjOMw.js => DeleteApiDocs-Dwxzpd42.js} |   2 +-
 ...FSlIcs-.js => EmailChangeDocs-M95lizJx.js} |   2 +-
 ...Io4uvz.js => FieldsQueryParam-JXZpoc_D.js} |   2 +-
 ...js => FilterAutocompleteInput-CXrfVJaY.js} |   2 +-
 ...cs-D4zfzAhd.js => ListApiDocs-GWn-CPMs.js} |   2 +-
 ...-FV_9CRnx.js => PageInstaller-CPCvh_Gv.js} |   2 +-
 ... => PageOAuth2RedirectFailure-DNk27lv-.js} |   2 +-
 ... => PageOAuth2RedirectSuccess-8Lc5-IG-.js} |   2 +-
 ... PageRecordConfirmEmailChange-CjqCY8Sq.js} |   2 +-
 ...ageRecordConfirmPasswordReset-B5ksiewx.js} |   2 +-
 ...PageRecordConfirmVerification-JwH6c-NG.js} |   2 +-
 ...SuperuserConfirmPasswordReset-C-QLe07z.js} |   2 +-
 ...SuperuserRequestPasswordReset-DL6nXs9m.js} |   2 +-
 ...fkA3g.js => PasswordResetDocs-C2FJxDCy.js} |   2 +-
 ...osG30JV.js => RealtimeApiDocs-BZWtgnO2.js} |   2 +-
 ...-C65dej9I.js => UpdateApiDocs-XHS3RD1Q.js} |   2 +-
 ...u5MtMJ.js => VerificationDocs-Cnw3YmXh.js} |   2 +-
 ...cs-DsJmXTBN.js => ViewApiDocs-CWljd9ob.js} |   2 +-
 .../{index-CH-gyH77.js => index-CEH5UG_e.js}  |  18 +--
 .../{index-Bw7x2V1B.js => index-DCriA6MP.js}  | 134 +++++++++---------
 ui/dist/index.html                            |   2 +-
 ui/package-lock.json                          |  38 +++--
 ui/package.json                               |   2 +-
 31 files changed, 120 insertions(+), 126 deletions(-)
 rename ui/dist/assets/{AuthMethodsDocs-CmjGo_HC.js => AuthMethodsDocs-DubXYrz3.js} (97%)
 rename ui/dist/assets/{AuthRefreshDocs-DcPt_azs.js => AuthRefreshDocs-Bv2HZYxd.js} (98%)
 rename ui/dist/assets/{AuthWithOAuth2Docs-CJcj5RbS.js => AuthWithOAuth2Docs-C6WI1jtR.js} (98%)
 rename ui/dist/assets/{AuthWithOtpDocs-CXeUQhkk.js => AuthWithOtpDocs-BwTrTztG.js} (99%)
 rename ui/dist/assets/{AuthWithPasswordDocs-Cqv3HyrN.js => AuthWithPasswordDocs-CepW6s1g.js} (98%)
 rename ui/dist/assets/{BatchApiDocs-DePxQqVe.js => BatchApiDocs-CI-AGdP4.js} (99%)
 rename ui/dist/assets/{CodeEditor-8naseTA8.js => CodeEditor-kYUfoxD0.js} (99%)
 rename ui/dist/assets/{CreateApiDocs-C9nzLaaI.js => CreateApiDocs-dx3XBFzI.js} (99%)
 rename ui/dist/assets/{DeleteApiDocs-CJmwjOMw.js => DeleteApiDocs-Dwxzpd42.js} (98%)
 rename ui/dist/assets/{EmailChangeDocs-5FSlIcs-.js => EmailChangeDocs-M95lizJx.js} (99%)
 rename ui/dist/assets/{FieldsQueryParam-DvIo4uvz.js => FieldsQueryParam-JXZpoc_D.js} (96%)
 rename ui/dist/assets/{FilterAutocompleteInput-DbGqmGAP.js => FilterAutocompleteInput-CXrfVJaY.js} (98%)
 rename ui/dist/assets/{ListApiDocs-D4zfzAhd.js => ListApiDocs-GWn-CPMs.js} (99%)
 rename ui/dist/assets/{PageInstaller-FV_9CRnx.js => PageInstaller-CPCvh_Gv.js} (98%)
 rename ui/dist/assets/{PageOAuth2RedirectFailure-U4FK74Ke.js => PageOAuth2RedirectFailure-DNk27lv-.js} (88%)
 rename ui/dist/assets/{PageOAuth2RedirectSuccess-DxO2GykN.js => PageOAuth2RedirectSuccess-8Lc5-IG-.js} (88%)
 rename ui/dist/assets/{PageRecordConfirmEmailChange-DsgNrJ_Y.js => PageRecordConfirmEmailChange-CjqCY8Sq.js} (98%)
 rename ui/dist/assets/{PageRecordConfirmPasswordReset-CKnBpNvm.js => PageRecordConfirmPasswordReset-B5ksiewx.js} (98%)
 rename ui/dist/assets/{PageRecordConfirmVerification-C6uR9qGl.js => PageRecordConfirmVerification-JwH6c-NG.js} (98%)
 rename ui/dist/assets/{PageSuperuserConfirmPasswordReset-y4vpPRrL.js => PageSuperuserConfirmPasswordReset-C-QLe07z.js} (98%)
 rename ui/dist/assets/{PageSuperuserRequestPasswordReset-C2RIJeZg.js => PageSuperuserRequestPasswordReset-DL6nXs9m.js} (98%)
 rename ui/dist/assets/{PasswordResetDocs-D6vfkA3g.js => PasswordResetDocs-C2FJxDCy.js} (99%)
 rename ui/dist/assets/{RealtimeApiDocs-2osG30JV.js => RealtimeApiDocs-BZWtgnO2.js} (99%)
 rename ui/dist/assets/{UpdateApiDocs-C65dej9I.js => UpdateApiDocs-XHS3RD1Q.js} (99%)
 rename ui/dist/assets/{VerificationDocs-Whu5MtMJ.js => VerificationDocs-Cnw3YmXh.js} (99%)
 rename ui/dist/assets/{ViewApiDocs-DsJmXTBN.js => ViewApiDocs-CWljd9ob.js} (98%)
 rename ui/dist/assets/{index-CH-gyH77.js => index-CEH5UG_e.js} (78%)
 rename ui/dist/assets/{index-Bw7x2V1B.js => index-DCriA6MP.js} (77%)

diff --git a/ui/dist/assets/AuthMethodsDocs-CmjGo_HC.js b/ui/dist/assets/AuthMethodsDocs-DubXYrz3.js
similarity index 97%
rename from ui/dist/assets/AuthMethodsDocs-CmjGo_HC.js
rename to ui/dist/assets/AuthMethodsDocs-DubXYrz3.js
index c69b9453..7ef3d9df 100644
--- a/ui/dist/assets/AuthMethodsDocs-CmjGo_HC.js
+++ b/ui/dist/assets/AuthMethodsDocs-DubXYrz3.js
@@ -1,4 +1,4 @@
-import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-Bw7x2V1B.js";import{F as De}from"./FieldsQueryParam-DvIo4uvz.js";function we(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=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:`
+import{S as Be,i as Ce,s as Te,V as Le,X as J,h as c,z as w,j as k,c as ae,k as h,n as d,o as a,m as ne,H as Q,Y as $e,Z as Se,E as je,_ as qe,G as Ee,t as z,a as I,v as u,d as ie,p as oe,J as He,l as N,q as Re,W as Ue}from"./index-DCriA6MP.js";import{F as De}from"./FieldsQueryParam-JXZpoc_D.js";function we(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=w(o),b=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(v,y){d(v,l,y),a(l,p),a(l,b),i||(f=Re(l,"click",m),i=!0)},p(v,y){s=v,y&4&&o!==(o=s[8].code+"")&&Q(p,o),y&6&&N(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ue({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ae(o.$$.fragment),p=k(),h(l,"class","tab-item"),N(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&N(l,"active",s[1]===s[8].code)},i(i){b||(z(o.$$.fragment,i),b=!0)},o(i){I(o.$$.fragment,i),b=!1},d(i){i&&u(l),ie(o)}}}function Fe(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,y,g=n[0].name+"",O,ce,V,M,W,L,X,A,U,re,D,S,de,Y,F=n[0].name+"",Z,ue,K,j,x,P,ee,fe,te,T,le,q,se,B,E,$=[],me=new Map,pe,H,_=[],be=new Map,C;M=new Le({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${n[3]}');
diff --git a/ui/dist/assets/AuthRefreshDocs-DcPt_azs.js b/ui/dist/assets/AuthRefreshDocs-Bv2HZYxd.js
similarity index 98%
rename from ui/dist/assets/AuthRefreshDocs-DcPt_azs.js
rename to ui/dist/assets/AuthRefreshDocs-Bv2HZYxd.js
index d272e1d8..186a0fdc 100644
--- a/ui/dist/assets/AuthRefreshDocs-DcPt_azs.js
+++ b/ui/dist/assets/AuthRefreshDocs-Bv2HZYxd.js
@@ -1,4 +1,4 @@
-import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-Bw7x2V1B.js";import{F as et}from"./FieldsQueryParam-DvIo4uvz.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(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"),I(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&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(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)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,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,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:`
+import{S as Ue,i as xe,s as Ke,V as Qe,W as Ne,X as K,h as s,z as k,j as p,c as Q,k as b,n as d,o,m as W,H as de,Y as Le,Z as We,E as Ge,_ as Ie,G as Xe,t as V,a as z,v as u,d as G,J as Oe,p as Ye,l as I,q as Ze}from"./index-DCriA6MP.js";import{F as et}from"./FieldsQueryParam-JXZpoc_D.js";function Ve(r,a,l){const n=r.slice();return n[5]=a[l],n}function ze(r,a,l){const n=r.slice();return n[5]=a[l],n}function je(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"),I(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&&I(l,"active",a[1]===a[5].code)},d(v){v&&u(l),i=!1,h()}}}function Je(r,a){let l,n,m,_;return n=new Ne({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),Q(n.$$.fragment),m=p(),b(l,"class","tab-item"),I(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)&&I(l,"active",a[1]===a[5].code)},i(i){_||(V(n.$$.fragment,i),_=!0)},o(i){z(n.$$.fragment,i),_=!1},d(i){i&&u(l),G(n)}}}function tt(r){var De,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,B,X,S,j,ue,J,M,pe,Y,N=r[0].name+"",Z,he,fe,U,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,q,ie,H,ce,R,E,y=[],Pe=new Map,qe,L,$=[],Ae=new Map,A;v=new Qe({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${r[3]}');
diff --git a/ui/dist/assets/AuthWithOAuth2Docs-CJcj5RbS.js b/ui/dist/assets/AuthWithOAuth2Docs-C6WI1jtR.js
similarity index 98%
rename from ui/dist/assets/AuthWithOAuth2Docs-CJcj5RbS.js
rename to ui/dist/assets/AuthWithOAuth2Docs-C6WI1jtR.js
index 2866690d..669fa5d1 100644
--- a/ui/dist/assets/AuthWithOAuth2Docs-CJcj5RbS.js
+++ b/ui/dist/assets/AuthWithOAuth2Docs-C6WI1jtR.js
@@ -1,4 +1,4 @@
-import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-Bw7x2V1B.js";import{F as Ye}from"./FieldsQueryParam-DvIo4uvz.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(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",k),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 je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(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),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:`
+import{S as Ee,i as Je,s as xe,V as ze,W as Ve,X as Q,h as o,z as _,j as h,c as G,k as p,n as r,o as a,m as I,H as pe,Y as Ue,Z as Ne,E as Qe,_ as Ge,G as Ie,t as V,a as E,v as c,d as K,J as Be,p as Ke,l as X,q as Xe}from"./index-DCriA6MP.js";import{F as Ye}from"./FieldsQueryParam-JXZpoc_D.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l){let n,i=l[5].code+"",f,g,d,b;function k(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=_(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",k),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 je(s,l){let n,i,f,g;return i=new Ve({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),G(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),I(i,n,null),a(n,f),g=!0},p(d,b){l=d;const k={};b&4&&(k.content=l[5].body),i.$set(k),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(V(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),K(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,D,Y,A,J,be,x,P,me,Z,z=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,y,oe,ge,B,S,se,_e,ie,ke,m,ve,C,we,$e,Oe,re,Ae,ce,ye,Se,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],Re=new Map,De,L,w=[],Pe=new Map,R;v=new ze({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${s[3]}');
diff --git a/ui/dist/assets/AuthWithOtpDocs-CXeUQhkk.js b/ui/dist/assets/AuthWithOtpDocs-BwTrTztG.js
similarity index 99%
rename from ui/dist/assets/AuthWithOtpDocs-CXeUQhkk.js
rename to ui/dist/assets/AuthWithOtpDocs-BwTrTztG.js
index a3bf4692..964655d6 100644
--- a/ui/dist/assets/AuthWithOtpDocs-CXeUQhkk.js
+++ b/ui/dist/assets/AuthWithOtpDocs-BwTrTztG.js
@@ -1,4 +1,4 @@
-import{S as ee,i as te,s as le,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-Bw7x2V1B.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=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&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"),F(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),G(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||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,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 O=U(s[2]);const j=l=>l[4].code;for(let l=0;l<O.length;l+=1){let o=ie(s,O,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=H("/api/collections/"),n=p("strong"),m=H(u),y=H("/auth-with-otp"),M=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>',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=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(P,"class","tabs-header compact combined left"),g(D,"class","tabs-content"),g(q,"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,y),b(l,M,o),b(l,C,o),b(l,B,o),b(l,A,o),b(l,V,o),b(l,R,o),b(l,W,o),b(l,q,o),h(q,P);for(let f=0;f<w.length;f+=1)w[f]&&w[f].m(P,null);h(q,E),h(q,D);for(let f=0;f<k.length;f+=1)k[f]&&k[f].m(D,null);I=!0},p(l,[o]){(!I||o&1)&&u!==(u=l[0].name+"")&&X(m,u),o&6&&(i=U(l[2]),w=Z(w,o,v,1,l,i,$,P,ge,re,null,ce)),o&6&&(O=U(l[2]),Q(),k=Z(k,o,j,1,l,O,N,D,ke,de,null,ie),x())},i(l){if(!I){for(let o=0;o<O.length;o+=1)J(k[o]);I=!0}},o(l){for(let o=0;o<k.length;o+=1)L(k[o]);I=!1},d(l){l&&(_(t),_(M),_(C),_(B),_(A),_(V),_(R),_(W),_(q));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 Oe(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,X as U,h as p,j as S,z as H,k as g,n as b,o as h,H as X,Y as Z,Z as ge,E as Q,_ as ke,G as x,t as J,a as L,v as _,J as oe,l as Y,q as ae,W as we,c as F,m as G,d as K,V as $e,$ as se,p as Te,a0 as ne}from"./index-DCriA6MP.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=H(a),c=S(),g(e,"class","tab-item"),Y(e,"active",t[1]===t[4].code),this.first=e},m(m,y){b(m,e,y),h(e,d),h(e,c),r||(n=ae(e,"click",u),r=!0)},p(m,y){t=m,y&4&&a!==(a=t[4].code+"")&&X(d,a),y&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"),F(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),G(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||(J(a.$$.fragment,r),c=!0)},o(r){L(a.$$.fragment,r),c=!1},d(r){r&&_(e),K(a)}}}function Pe(s){let t,e,a,d,c,r,n,u=s[0].name+"",m,y,M,C,B,A,V,R,W,q,P,w=[],$=new Map,E,D,k=[],N=new Map,I,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 O=U(s[2]);const j=l=>l[4].code;for(let l=0;l<O.length;l+=1){let o=ie(s,O,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=H("/api/collections/"),n=p("strong"),m=H(u),y=H("/auth-with-otp"),M=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>',V=S(),R=p("div"),R.textContent="Responses",W=S(),q=p("div"),P=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(P,"class","tabs-header compact combined left"),g(D,"class","tabs-content"),g(q,"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,y),b(l,M,o),b(l,C,o),b(l,B,o),b(l,A,o),b(l,V,o),b(l,R,o),b(l,W,o),b(l,q,o),h(q,P);for(let f=0;f<w.length;f+=1)w[f]&&w[f].m(P,null);h(q,E),h(q,D);for(let f=0;f<k.length;f+=1)k[f]&&k[f].m(D,null);I=!0},p(l,[o]){(!I||o&1)&&u!==(u=l[0].name+"")&&X(m,u),o&6&&(i=U(l[2]),w=Z(w,o,v,1,l,i,$,P,ge,re,null,ce)),o&6&&(O=U(l[2]),Q(),k=Z(k,o,j,1,l,O,N,D,ke,de,null,ie),x())},i(l){if(!I){for(let o=0;o<O.length;o+=1)J(k[o]);I=!0}},o(l){for(let o=0;o<k.length;o+=1)L(k[o]);I=!1},d(l){l&&(_(t),_(M),_(C),_(B),_(A),_(V),_(R),_(W),_(q));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 Oe(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-Cqv3HyrN.js b/ui/dist/assets/AuthWithPasswordDocs-CepW6s1g.js
similarity index 98%
rename from ui/dist/assets/AuthWithPasswordDocs-Cqv3HyrN.js
rename to ui/dist/assets/AuthWithPasswordDocs-CepW6s1g.js
index 1fc364ce..ce0ffe64 100644
--- a/ui/dist/assets/AuthWithPasswordDocs-Cqv3HyrN.js
+++ b/ui/dist/assets/AuthWithPasswordDocs-CepW6s1g.js
@@ -1,4 +1,4 @@
-import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-Bw7x2V1B.js";import{F as Tt}from"./FieldsQueryParam-DvIo4uvz.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]+"")&&X(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=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(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||(G(n.$$.fragment,r),b=!0)},o(r){K(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,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:`
+import{S as kt,i as gt,s as vt,V as St,X as B,W as _t,h as s,z as f,j as u,c as ae,k,n as c,o as t,m as oe,H as X,Y as ct,Z as wt,E as yt,_ as $t,G as Pt,t as G,a as K,v as d,d as se,$ as Rt,J as dt,p as Ct,l as ne,q as Ot}from"./index-DCriA6MP.js";import{F as Tt}from"./FieldsQueryParam-JXZpoc_D.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]+"")&&X(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=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&X(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||(G(n.$$.fragment,r),b=!0)},o(r){K(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,H,pe,C,x,Fe,ee,L,Me,ue,te=i[0].name+"",he,Ue,be,j,fe,O,me,qe,Y,T,_e,Be,ke,He,E,ge,Le,ve,Se,V,we,A,ye,je,N,D,$e,Ye,Pe,Ee,v,Ve,M,Ne,Je,Ie,Re,Qe,Ce,ze,Ge,Ke,Oe,Xe,Ze,U,Te,J,Ae,W,I,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;R=new St({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${i[5]}');
diff --git a/ui/dist/assets/BatchApiDocs-DePxQqVe.js b/ui/dist/assets/BatchApiDocs-CI-AGdP4.js
similarity index 99%
rename from ui/dist/assets/BatchApiDocs-DePxQqVe.js
rename to ui/dist/assets/BatchApiDocs-CI-AGdP4.js
index 4e31ec40..316ab852 100644
--- a/ui/dist/assets/BatchApiDocs-DePxQqVe.js
+++ b/ui/dist/assets/BatchApiDocs-CI-AGdP4.js
@@ -1,4 +1,4 @@
-import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-Bw7x2V1B.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:`
+import{S as St,i as Lt,s as jt,V as At,W as It,X as Z,h as o,z as _,j as i,c as Re,k as b,n as d,o as t,m as Te,C as Mt,D as Nt,H as Ut,Y as Pt,Z as zt,E as Jt,_ as Wt,G as Gt,t as Q,a as x,v as u,d as Pe,J as Ft,p as Kt,l as ee,q as Vt}from"./index-DCriA6MP.js";function Bt(a,s,n){const c=a.slice();return c[6]=s[n],c}function Et(a,s,n){const c=a.slice();return c[6]=s[n],c}function Ot(a,s){let n,c,y;function f(){return s[5](s[6])}return{key:a,first:null,c(){n=o("button"),n.textContent=`${s[6].code} `,b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),c||(y=Vt(n,"click",f),c=!0)},p(r,h){s=r,h&10&&ee(n,"active",s[1]===s[6].code)},d(r){r&&u(n),c=!1,y()}}}function Ht(a,s){let n,c,y,f;return c=new It({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Re(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){d(r,n,h),Te(c,n,null),t(n,y),f=!0},p(r,h){s=r,(!f||h&10)&&ee(n,"active",s[1]===s[6].code)},i(r){f||(Q(c.$$.fragment,r),f=!0)},o(r){x(c.$$.fragment,r),f=!1},d(r){r&&u(n),Pe(c)}}}function Xt(a){var pt,mt,bt,ht,ft,_t,yt,kt;let s,n,c=a[0].name+"",y,f,r,h,F,g,U,Fe,P,B,Be,E,Ee,Oe,te,le,q,oe,O,ae,H,se,I,ne,z,ie,w,ce,He,re,S,J,Ie,k,W,Se,de,Le,C,G,je,ue,Ae,K,Me,pe,Ne,D,Ue,me,ze,Je,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ye,p,_e,Ze,ye,Qe,ke,xe,$e,et,ge,tt,ve,lt,ot,at,Ce,st,R,De,L,qe,T,j,v=[],nt=new Map,it,A,$=[],ct=new Map,M,we,rt;q=new At({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${a[2]}');
diff --git a/ui/dist/assets/CodeEditor-8naseTA8.js b/ui/dist/assets/CodeEditor-kYUfoxD0.js
similarity index 99%
rename from ui/dist/assets/CodeEditor-8naseTA8.js
rename to ui/dist/assets/CodeEditor-kYUfoxD0.js
index 0a403465..d2c8d328 100644
--- a/ui/dist/assets/CodeEditor-8naseTA8.js
+++ b/ui/dist/assets/CodeEditor-kYUfoxD0.js
@@ -1,4 +1,4 @@
-import{S as wt,i as Tt,s as vt,h as qt,k as Rt,a1 as OO,n as _t,I as IO,v as jt,O as Yt,T as Vt,U as Wt,Q as Ut,J as Gt,y as zt}from"./index-Bw7x2V1B.js";import{P as Ct,N as Et,w as At,D as Mt,x as jO,T as tO,I as YO,y as I,z as n,A as Lt,L as D,B as J,F as Y,G as K,H as VO,J as F,v as z,K as _e,M as Bt,O as Nt,Q as je,R as Ye,U as Ve,E as j,V as We,W as g,X as It,Y as Dt,b as C,e as Jt,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 la,c as na,d as oa,s as Qa,h as ca,a as pa,p as ha,q as DO,C as eO}from"./index-CH-gyH77.js";var JO={};class sO{constructor(O,t,a,r,s,i,l,o,c,h=0,Q){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=c,this.lookAhead=h,this.parent=Q}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let l=s.dynamicPrecedence(r);if(l&&(this.score+=l),a==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 o=this.stack.length-(a-1)*3-(O&262144?6:0),c=o?this.stack[o-2]:this.p.ranges[0].from,h=this.reducePos-c;h>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=h));let Q=o?this.stack[o-1]:0,f=this.bufferBase+this.buffer.length-Q;if(r<s.minRepeatTerm||O&131072){let p=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,p,f+4,!0)}if(O&262144)this.state=this.stack[o];else{let p=this.stack[o-3];this.state=s.getGoto(p,r,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(r,c)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,l=this.buffer.length;if(l==0&&i.parent&&(l=i.bufferBase-i.parent.bufferBase,i=i.parent),l>0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let o=i;o>0&&this.buffer[o-2]>a;o-=4)if(this.buffer[o-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)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]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,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,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new ua(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;s<t.length;s+=2)(i=t[s+1])!=this.state&&this.p.parser.hasAction(i,O)&&r.push(t[s],i);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let i=t[s+1];r.some((l,o)=>o&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r<t.length&&a.length<4;r+=2){let s=t[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(t[r],this.pos),i.reducePos=this.pos,i.score-=200,a.push(i)}return a}forceReduce(){let{parser:O}=this.p,t=O.stateSlot(this.state,5);if(!(t&65536))return!1;if(!O.validAction(this.state,t)){let a=t>>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,c=this.stack.length-l*3;if(c>=0&&O.getGoto(this.stack[c],o,!1)>=0)return l<<19|65536|o}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(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 t=0;t<this.stack.length;t+=3)if(this.stack[t]!=O.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(O){return this.p.parser.dialect.flags[O]}shiftContext(O,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,O,this,this.p.stream.reset(t)))}reduceContext(O,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,O,this,this.p.stream.reset(t)))}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 t=new KO(this.curContext.tracker,O);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}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,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class ua{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-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 lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a<e.length;){let s=0;for(;;){let i=e.charCodeAt(a++),l=!1;if(i==126){s=65535;break}i>=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}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,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;s<a.from;){if(!r)return null;let i=this.ranges[--r];s-=a.from-i.to,a=i}for(;t<0?s>a.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&O<this.range.to)return O;for(let t of this.ranges)if(t.to>O)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t<this.chunk.length)a=this.pos+O,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(O,1);if(s==null)return-1;if(a=s,a>=this.chunk2Pos&&a<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(a-this.chunk2Pos);else{let i=this.rangeIndex,l=this.range;for(;l.to<=a;)l=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=a),a+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=O,this.token.end=a}acceptTokenTo(O,t){this.token.value=O,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:O,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=O,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let O=this.input.chunk(this.pos),t=this.pos+O.length;this.chunk=t>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,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.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,t){if(O>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class W{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ue(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}W.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class nO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ue(this.data,O,t,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(a,O.token),O.acceptToken(this.elseToken,r))}}nO.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ue(e,O,t,a,r,s){let i=0,l=1<<a,{dialect:o}=t.p.parser;O:for(;l&e[i];){let c=e[i+1];for(let p=i+3;p<c;p+=2)if((e[p+1]&l)>0){let d=e[p];if(o.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let h=O.next,Q=0,f=e[i+2];if(O.next<0&&f>Q&&e[c+f*3-3]==65535){i=e[c+f*3-1];continue O}for(;Q<f;){let p=Q+f>>1,d=c+p+(p<<1),P=e[d],S=e[d+1]||65536;if(h<P)f=p;else if(h>=S)Q=p+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function fa(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)<r}const Z=typeof process<"u"&&JO&&/\bparse\b/.test(JO.LOG);let uO=null;function Oe(e,O,t){let a=e.cursor(YO.IncludeAnonymous);for(a.moveTo(O);;)if(!(t<0?a.childBefore(O):a.childAfter(O)))for(;;){if((t<0?a.to<O:a.from>O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,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 t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let a=this.trees[t],r=this.index[t];if(r==a.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=a.children[r],i=this.start[t]+a.positions[r];if(i>O)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i<this.safeFrom)return null;let l=i+s.length;if(l<=this.safeTo){let o=s.prop(jO.lookAhead);if(!o||l+o<this.fragment.to)return s}}this.index[t]++,i+s.length>=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,o=0;for(let c=0;c<s.length;c++){if(!(1<<c&i))continue;let h=s[c],Q=this.tokens[c];if(!(a&&!h.fallback)&&((h.contextual||Q.start!=O.pos||Q.mask!=i||Q.context!=l)&&(this.updateCachedToken(Q,h,O),Q.mask=i,Q.context=l),Q.lookAhead>Q.end+25&&(o=Math.max(Q.lookAhead,o)),Q.value!=0)){let f=t;if(Q.extended>-1&&(t=this.addActions(O,Q.extended,Q.end,t)),t=this.addActions(O,Q.value,Q.end,t),!h.extend&&(a=Q,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return o&&O.setLookAhead(o),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i<s.specialized.length;i++)if(s.specialized[i]==O.value){let l=s.specializers[i](this.stream.read(O.start,O.end),a);if(l>=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;s<r;s+=3)if(this.actions[s]==O)return r;return this.actions[r++]=O,this.actions[r++]=t,this.actions[r++]=a,r}addActions(O,t,a,r){let{state:s}=O,{parser:i}=O.p,{data:l}=i;for(let o=0;o<2;o++)for(let c=i.stateSlot(s,o?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=T(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(T(l,c+2),t,a,r));break}l[c]==t&&(r=this.putAction(T(l,c+1),t,a,r))}return r}}class Sa{constructor(O,t,a,r){this.parser=O,this.input=t,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(t,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=a.length&&this.stream.end-s>O.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=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 l=O[i];for(;;){if(this.tokens.mainToken=null,l.pos>t)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!a.length){let i=r&&ga(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 "+t);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,a);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(a.length>i)for(a.sort((l,o)=>o.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i<a.length-1;i++){let l=a[i];for(let o=i+1;o<a.length;o++){let c=a[o];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)a.splice(o--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i<a.length;i++)a[i].pos<this.minStackPos&&(this.minStackPos=a[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,t,a){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 c=O.curContext&&O.curContext.tracker.strict,h=c?O.curContext.hash:0;for(let Q=this.fragments.nodeAt(r);Q;){let f=this.parser.nodeSet.types[Q.type.id]==Q.type?s.getGoto(O.state,Q.type.id):-1;if(f>-1&&Q.length&&(!c||(Q.prop(jO.contextHash)||0)==h))return O.useNode(Q,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(Q.type.id)})`),!0;if(!(Q instanceof tO)||Q.children.length==0||Q.positions[0]>0)break;let p=Q.children[0];if(p instanceof tO&&Q.positions[0]==0)Q=p;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let o=this.tokens.getActions(O);for(let c=0;c<o.length;){let h=o[c++],Q=o[c++],f=o[c++],p=c==o.length||!a,d=p?O:O.split(),P=this.tokens.mainToken;if(d.apply(h,Q,P?P.start:d.pos,f),Z&&console.log(i+this.stackID(d)+` (via ${h&65536?`reduce of ${s.getName(h&65535)}`:"shift"} for ${s.getName(Q)} @ ${r}${d==O?"":", split"})`),p)return!0;d.pos>r?t.push(d):a.push(d)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i<O.length;i++){let l=O[i],o=t[i<<1],c=t[(i<<1)+1],h=Z?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let Q=l.split(),f=h;for(let p=0;Q.forceReduce()&&p<10&&(Z&&console.log(f+this.stackID(Q)+" (via force-reduce)"),!this.advanceFully(Q,a));p++)Z&&(f=this.stackID(Q)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,a);this.stream.end>l.pos?(c==l.pos&&(c++,o=0),l.recoverByDelete(o,c),Z&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),ee(l,a)):(!r||r.score<l.score)&&(r=l)}return r}stackToTree(O){return O.close(),tO.build({buffer:lO.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 t=(uO||(uO=new WeakMap)).get(O);return t||uO.set(O,t=String.fromCodePoint(this.nextStackID++)),t+O}}function ee(e,O){for(let t=0;t<O.length;t++){let a=O[t];if(a.pos==e.pos&&a.sameState(e)){O[t].score<e.score&&(O[t]=e);return}}O.push(e)}class ma{constructor(O,t,a){this.source=O,this.flags=t,this.disabled=a}allows(O){return!this.disabled||this.disabled[O]==0}}const dO=e=>e;class Ge{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 q 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 t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<O.repeatNodeCount;l++)t.push("");let a=Object.keys(O.topRules).map(l=>O.topRules[l][1]),r=[];for(let l=0;l<t.length;l++)r.push([]);function s(l,o,c){r[l].push([o,o.deserialize(String(c))])}if(O.nodeProps)for(let l of O.nodeProps){let o=l[0];typeof o=="string"&&(o=jO[o]);for(let c=1;c<l.length;){let h=l[c++];if(h>=0)s(h,o,l[c++]);else{let Q=l[c+-h];for(let f=-h;f>0;f--)s(l[c++],o,Q);c++}}}this.nodeSet=new Et(t.map((l,o)=>At.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:a.indexOf(o)>-1,error:o==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(o)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(te),this.states=M(O.states,Uint32Array),this.data=M(O.stateData),this.goto=M(O.goto),this.maxTerm=O.maxTerm,this.tokenizers=O.tokenizers.map(l=>typeof l=="number"?new W(i,l):l),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,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&a)return o;for(let c=s+(i>>1);s<c;s++)if(r[s]==O)return o;if(l)return-1}}hasAction(O,t){let a=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(O,r?2:1),i;;s+=3){if((i=a[s])==65535)if(a[s+1]==1)i=a[s=T(a,s+2)];else{if(a[s+1]==2)return T(a,s+2);break}if(i==t||i==0)return T(a,s+1)}return 0}stateSlot(O,t){return this.states[O*6+t]}stateFlag(O,t){return(this.stateSlot(O,0)&t)>0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):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=T(this.data,s+2);else break;r=t(T(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=T(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(q.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}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 t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!a[s])for(let i=this.dialects[t[s]],l;(l=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new ma(O,a,r)}static deserialize(O){return new q(O)}}function T(e,O){return e[O]|e[O+1]<<16}function ga(e){let O=null;for(let t of e){let a=t.p.stoppedAt;(t.pos==t.p.stream.end||a!=null&&t.pos>a)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.score<t.score)&&(O=t)}return O}function te(e){if(e.external){let O=e.extend?1:0;return(t,a)=>e.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,oO=6,ze=7,Ce=8,Ee=9,Ae=10,Ta=11,va=12,qa=13,fO=57,Ra=14,re=58,Me=20,_a=22,Le=23,ja=24,XO=26,Be=27,Ya=28,Va=31,Wa=34,Ua=36,Ga=37,za=0,Ca=1,Ea={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},Aa={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 Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Ne(e){return e==9||e==10||e==13||e==32}let se=null,le=null,ne=0;function yO(e,O){let t=e.pos+O;if(ne==t&&le==e)return se;let a=e.peek(O);for(;Ne(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,ne=t,se=r?r.toLowerCase():a==La||a==Ba?void 0:null}const Ie=60,QO=62,WO=47,La=63,Ba=33,Na=45;function oe(e,O){this.name=e,this.parent=O}const Ia=[oO,Ae,ze,Ce,Ee],Da=new Ge({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new oe(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==oO||r==Ua?new oe(yO(a,1)||"",e):e},strict:!1}),Ja=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let t=e.next==WO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ra:oO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(Ta);if(r&&Aa[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(za))return e.acceptToken(va);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(qa)}else{if(a=="script")return e.acceptToken(ze);if(a=="style")return e.acceptToken(Ce);if(a=="textarea")return e.acceptToken(Ee);if(Ea.hasOwnProperty(a))return e.acceptToken(Ae);r&&ie[r]&&ie[r][a]?e.acceptToken(fO,-1):e.acceptToken(oO)}},{contextual:!0}),Ka=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Na)O++;else if(e.next==QO&&O>=2){t>=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 x((e,O)=>{if(e.next==WO&&e.peek(1)==QO){let t=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==QO&&e.acceptToken(ae,1)});function UO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==WO||s>=2&&s<a&&r.next==e.charCodeAt(s-2))s++,i++;else if((s==2||s==a)&&Ne(r.next))i++;else if(s==a&&r.next==QO){l>i?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=UO("script",Za,ba),er=UO("style",xa,ka),tr=UO("textarea",Xa,ya),ar=I({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),rr=q.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Da,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&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebhSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXhSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vchS`P!a`!cpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WihSkWc!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QchSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Or,er,tr,Ha,Ja,Ka,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:509},tokenPrec:511});function De(e,O){let t=Object.create(null);for(let a of e.getChildren(Le)){let r=a.getChild(ja),s=a.getChild(XO)||a.getChild(Be);r&&(t[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 t}function Qe(e,O){let t=e.getChild(_a);return t?O.read(t.from,t.to):" "}function $O(e,O,t){let a;for(let r of t)if(!r.attrs||r.attrs(a||(a=De(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Je(e=[],O=[]){let t=[],a=[],r=[],s=[];for(let l of e)(l.tag=="script"?t:l.tag=="style"?a:l.tag=="textarea"?r:s).push(l);let i=O.length?Object.create(null):null;for(let l of O)(i[l.name]||(i[l.name]=[])).push(l);return Lt((l,o)=>{let c=l.type.id;if(c==Ya)return $O(l,o,t);if(c==Va)return $O(l,o,a);if(c==Wa)return $O(l,o,r);if(c==Me&&s.length){let h=l.node,Q=h.firstChild,f=Q&&Qe(Q,o),p;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(p||(p=De(Q,o))))){let P=h.lastChild,S=P.type.id==Ga?P.from:h.to;if(S>Q.to)return{parser:d.parser,overlay:[{from:Q.to,to:S}]}}}}if(i&&c==Le){let h=l.node,Q;if(Q=h.firstChild){let f=i[o.read(Q.from,Q.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=Qe(h.parent,o))continue;let d=h.lastChild;if(d.type.id==XO){let P=d.from+1,S=d.lastChild,k=d.to-(S&&S.isError?0:1);if(k>P)return{parser:p.parser,overlay:[{from:P,to:k}]}}else if(d.type.id==Be)return{parser:p.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,ce=1,sr=100,lr=101,pe=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],nr=58,or=40,Fe=95,Qr=91,rO=45,cr=46,pr=35,hr=37,ur=38,dr=92,fr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==or?sr:a==2&&O.canShift(pe)?pe:lr);break}}}),Pr=new x(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==pr||O==cr||O==Qr||O==nr&&L(e.peek(1))||O==rO||O==ur)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==hr&&(e.advance(),e.acceptToken(ce)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(ce)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),gr={__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},xr=q.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<<HdO9sQWO,5;^OOQP1G/Y1G/YOOQS-E8V-E8VO${QdO'#EZO9{QWO,5;ZOOQT1G.u1G.uOOQP<<Hd<<HdOOQS7+$k7+$kO:TQdO7+%]OOQO7+%d7+%dOOQO,5:k,5:kO3{QdO'#EaO7rQWO,5:zOOQS,5:z,5:zOOQS-E8^-E8^OOQS1G0U1G0UO:[QtO,5:wOOQS-E8Z-E8ZOOQO<<Ho<<HoOOQPAN>OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<<Hw<<HwOOQO,5:{,5:{OOQO-E8_-E8_OOQS1G0f1G0f",stateData:";o~O#ZOS#[QQ~OUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XRO#bTO~OQfOUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XeO#bTO~O#U#gP~P!ZO#[jO~O#XlO~O]qO^qOqsOtoOxrO!OtO!RvO#VuO#bnO~O!TwO~P#pO`}O#WzO#XyO~O#X!OO~O#X!QO~OQ![Ob!TOf![Oh![On!YOq!ZO#W!WO#X!SO#e!UO~Ob!^O!d!`O!g!aO#X!]O!T#hP~Oh!fOn!YO#X!eO~Oh!hO#X!hO~Ob!^O!d!`O!g!aO#X!]O~O!Y#hP~P%jO]WX]!WX^WXqWXtWXxWX!OWX!RWX!TWX#VWX#bWX~O]!mO~O!Y!nO#U#gX!S#gX~O#U#gX!S#gX~P!ZO#]!qO#^!qO#_!sO~OUYOXYO]VO^VOqXOxWO#XRO#bTO~OtoO!TwO~O`!zO#WzO#XyO~O!S#gP~P!ZOb#RO~Ob#SO~Op#TO|#UO~OP#WObgXjgX!YgX!dgX!ggX#XgXagXQgXfgXhgXngXqgXtgX!XgX#UgX#WgX#egXpgX!SgX~Ob!^Oj#XO!d!`O!g!aO#X!]O!Y#hP~Ob#[O~Op#`O#X#]O~Ob!^O!d!`O!g!aO#X#aO~Ot#eO!b#dO!T#hX!Y#hX~Ob#hO~Oj#XO!Y#jO~O!Y#kO~Oh#lOn!YO~O!T#mO~O!TwO!b#dO~O!TwO!Y#pO~O!X#rO!Y!Va#U!Va!S!Va~P${O!Y#QX#U#QX!S#QX~P!ZO!Y!nO#U#ga!S#ga~O#]!qO#^!qO#_#xO~O]qO^qOqsOxrO!OtO!RvO#VuO#bnO~Ot#Oa!T#Oaa#Oa~P.pOp#zO|#{O~O]qO^qOqsOxrO#bnO~Ot}i!O}i!R}i!T}i#V}ia}i~P/qOt!Pi!O!Pi!R!Pi!T!Pi#V!Pia!Pi~P/qOt!Qi!O!Qi!R!Qi!T!Qi#V!Qia!Qi~P/qO!S#|O~Oa#fP~P(aOa#cP~P${Oa$TOj#XO~O!Y$VO~Oa$WOh$XOo$XO~Op$ZO#X#]O~O]!`Xa!^X!b!^X~O]$[O~Oa$]O!b#dO~Ot#eO!T#ha!Y#ha~O!b#dOt!ca!T!ca!Y!caa!ca~O!Y$bO~O!S$iO#X$dO#e$cO~Oj#XOt$kO!X$mO!Y!Vi#U!Vi!S!Vi~P${O!Y#Qa#U#Qa!S#Qa~P!ZO!Y!nO#U#gi!S#gi~Oa#fX~P#pOa$qO~Oj#XOQ!{Xa!{Xb!{Xf!{Xh!{Xn!{Xq!{Xt!{X#W!{X#X!{X#e!{X~Ot$sOa#cX~P${Oa$uO~Oj#XOp$vO~Oa$wO~O!b#dOt#Ra!T#Ra!Y#Ra~Oa$yO~P.pOP#WOtgX!TgX~O#e$cOt!sX!T!sX~Ot${O!TwO~O!S%PO#X$dO#e$cO~Oj#XOQ#PXb#PXf#PXh#PXn#PXq#PXt#PX!X#PX!Y#PX#U#PX#W#PX#X#PX#e#PX!S#PX~Ot$kO!X%SO!Y!Vq#U!Vq!S!Vq~P${Oj#XOp%TO~OtoOa#fa~Ot$sOa#ca~Oa%WO~P${Oj#XOQ#Pab#Paf#Pah#Pan#Paq#Pat#Pa!X#Pa!Y#Pa#U#Pa#W#Pa#X#Pa#e#Pa!S#Pa~Oa!}at!}a~P${O#Zo#[#ej!R#e~",goto:"-g#jPPP#kP#nP#w$WP#w$g#wPP$mPPP$s$|$|P%`P$|P$|%z&^PPPP$|&vP&z'Q#wP'W#w'^P#wP#w#wPPP'd'y(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:[mr],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%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!X[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYxQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QS|So`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!RQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l<cYo`Oy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=WUo`Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=qUo`#e[Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l>[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new nO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const he=["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})),ue=["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}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(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 t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const de=new _e,Tr=["Declaration"];function vr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=de.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(YO.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return de.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(Tr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const qr=e=>O=>{let{state:t,pos:a}=O,r=z(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.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:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:ue,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:he,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,vr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:he,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:ue,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Rr=qr(e=>e.name=="VariableName"),cO=D.define({name:"css",parser:xr.configure({props:[J.add({Declaration:Y()}),K.add({"Block KeyframeList":VO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _r(){return new F(cO,cO.data.of({autocomplete:Rr}))}const jr=314,Yr=315,fe=1,Vr=2,Wr=3,Ur=4,Gr=316,zr=318,Cr=319,Er=5,Ar=6,Mr=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,Lr=59,TO=47,Br=42,Nr=43,Ir=45,Dr=60,Jr=44,Kr=63,Fr=46,Hr=91,Oi=new Ge({start:!1,shift(e,O){return O==Er||O==Ar||O==zr?e:O==Cr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Gr)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==TO&&((a=e.peek(1))==TO||a==Br)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(jr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(Yr)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Nr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(fe);e.acceptToken(a?fe:Vr)}}else t==Kr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Wr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Mr)||(e.advance(),e.next==TO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Jr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Ur,-t)}),si=I({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),"NewExpression/VariableName":n.className,PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer asserts":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},ni={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},oi={__proto__:null,"<":189},Qi=q.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQO<qQ`O'#HTO>YQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0LrO'#IUO?oQ!0MxO'#CiO@qQpO'#DjQOQ`OOO%[QlO'#EOOAXQ`O'#ERO:YQMhO'#ElOAdQ`O'#ElOAoQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Do'#DoOOQ!0Lb'#Jt'#JtO%[QlO'#JtOOQO'#Jw'#JwOOQO'#If'#IfOBoQpO'#EeOOQ!0Lb'#Ed'#EdOOQ!0Lb'#J{'#J{OCkQ!0MSO'#EeOCuQpO'#EUOOQO'#Jv'#JvODZQpO'#JwOEhQpO'#EUOCuQpO'#EePEuO&2DjO'#CbPOOO)CD{)CD{OOOO'#I^'#I^OFQO#tO,59UOOQ!0Lh,59U,59UOOOO'#I_'#I_OF`O&jO,59UOFnQ!L^O'#DaOOOO'#Ia'#IaOFuO#@ItO,59yOOQ!0Lf,59y,59yOGTQlO'#IbOGhQ`O'#JrOIgQ!fO'#JrO+}QlO'#JrOInQ`O,5:POJUQ`O'#EnOJcQ`O'#KROJnQ`O'#KQOJnQ`O'#KQOJvQ`O,5;[OJ{Q`O'#KPOOQ!0Ln,5:[,5:[OKSQlO,5:[OMQQ!0MxO,5:dOMqQ`O,5:lON[Q!0LrO'#KOONcQ`O'#J}O9ZQ`O'#J}ONwQ`O'#J}O! PQ`O,5;ZO! UQ`O'#J}O!#ZQ!fO'#JqOOQ!0Lh'#Ci'#CiO%[QlO'#EQO!#yQ!fO,5:qOOQS'#Jx'#JxOOQO-E<h-E<hO9aQ`O,5=^O!$aQ`O,5=^O!$fQlO,5;XO!&iQMhO'#EiO!(SQ`O,5;XO!(XQlO'#DwO!(cQpO,5;bO!(kQpO,5;bO%[QlO,5;bOOQ['#FS'#FSOOQ['#FU'#FUO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cOOQ['#FY'#FYO!(yQlO,5;sOOQ!0Lf,5;x,5;xOOQ!0Lf,5;y,5;yOOQ!0Lf,5;{,5;{O%[QlO'#InO!*|Q!0LrO,5<hO%[QlO,5;cO!&iQMhO,5;cO!+kQMhO,5;cO!-]QMhO'#E[O%[QlO,5;vOOQ!0Lf,5;z,5;zO!-dQ,UO'#FiO!.aQ,UO'#KVO!-{Q,UO'#KVO!.hQ,UO'#KVOOQO'#KV'#KVO!.|Q,UO,5<ROOOW,5<_,5<_O!/_QlO'#FuOOOW'#Im'#ImO7VO7dO,5<PO!/fQ,UO'#FwOOQ!0Lf,5<P,5<PO!0VQ$IUO'#CwOOQ!0Lh'#C{'#C{O!0jO#@ItO'#DPO!1WQMjO,5<dO!1_Q`O,5<gO!2zQ(CWO'#GWO!3XQ`O'#GXO!3^Q`O'#GXO!4|Q(CWO'#G]O!6RQpO'#GaOOQO'#Gm'#GmO!+rQMhO'#GlOOQO'#Go'#GoO!+rQMhO'#GnO!6tQ$IUO'#JjOOQ!0Lh'#Jj'#JjO!7OQ`O'#JiO!7^Q`O'#JhO!7fQ`O'#CuOOQ!0Lh'#Cy'#CyO!7qQ`O'#C{OOQ!0Lh'#DT'#DTOOQ!0Lh'#DV'#DVO1SQ`O'#DXO!+rQMhO'#GOO!+rQMhO'#GQO!7vQ`O'#GSO!7{Q`O'#GTO!3^Q`O'#GZO!+rQMhO'#G`O;zQ`O'#JiO!8QQ`O'#EoO!8oQ`O,5<fOOQ!0Lb'#Cr'#CrO!8wQ`O'#EpO!9qQpO'#EqOOQ!0Lb'#KP'#KPO!9xQ!0LrO'#K_O9kQ!0LrO,5=bO`QlO,5>rOOQ['#Jf'#JfOOQ[,5>s,5>sOOQ[-E<Z-E<ZO!;wQ!0MxO,5:`O!9lQpO,5:^O!>bQ!0MxO,5:hO%[QlO,5:hO!@xQ!0MxO,5:jOOQO,5@x,5@xO!AiQMhO,5=^O!AwQ!0LrO'#JgO9UQ`O'#JgO!BYQ!0LrO,59ZO!BeQpO,59ZO!BmQMhO,59ZO:YQMhO,59ZO!BxQ`O,5;XO!CQQ`O'#H`O!CfQ`O'#KbO%[QlO,5;|O!9lQpO,5<OO!CnQ`O,5=yO!CsQ`O,5=yO!CxQ`O,5=yO9kQ!0LrO,5=yO;zQ`O,5=iOOQO'#Cw'#CwO!DWQpO,5=fO!D`QMhO,5=gO!DkQ`O,5=iO!DpQ!bO,5=lO!DxQ`O'#K^O>wQ`O'#HVO9aQ`O'#HXO!D}Q`O'#HXO:YQMhO'#HZO!ESQ`O'#HZOOQ[,5=o,5=oO!EXQ`O'#H[O!EjQ`O'#CoO!EoQ`O,59PO!EyQ`O,59PO!HOQlO,59POOQ[,59P,59PO!H`Q!0LrO,59PO%[QlO,59PO!JkQlO'#HcOOQ['#Hd'#HdOOQ['#He'#HeO`QlO,5={O!KRQ`O,5={O`QlO,5>RO`QlO,5>TO!KWQ`O,5>VO`QlO,5>XO!K]Q`O,5>[O!KbQlO,5>bOOQ[,5>h,5>hO%[QlO,5>hO9kQ!0LrO,5>jOOQ[,5>l,5>lO# lQ`O,5>lOOQ[,5>n,5>nO# lQ`O,5>nOOQ[,5>p,5>pO#!YQpO'#D]O%[QlO'#JtO#!{QpO'#JtO##VQpO'#DkO##hQpO'#DkO#%yQlO'#DkO#&QQ`O'#JsO#&YQ`O,5:UO#&_Q`O'#ErO#&mQ`O'#KSO#&uQ`O,5;]O#&zQpO'#DkO#'XQpO'#ETOOQ!0Lf,5:m,5:mO%[QlO,5:mO#'`Q`O,5:mO>wQ`O,5;WO!BeQpO,5;WO!BmQMhO,5;WO:YQMhO,5;WO#'hQ`O,5@`O#'mQ07dO,5:qOOQO-E<d-E<dO#(sQ!0MSO,5;POCuQpO,5:pO#(}QpO,5:pOCuQpO,5;PO!BYQ!0LrO,5:pOOQ!0Lb'#Eh'#EhOOQO,5;P,5;PO%[QlO,5;PO#)[Q!0LrO,5;PO#)gQ!0LrO,5;PO!BeQpO,5:pOOQO,5;V,5;VO#)uQ!0LrO,5;PPOOO'#I['#I[P#*ZO&2DjO,58|POOO,58|,58|OOOO-E<[-E<[OOQ!0Lh1G.p1G.pOOOO-E<]-E<]OOOO,59{,59{O#*fQ!bO,59{OOOO-E<_-E<_OOQ!0Lf1G/e1G/eO#*kQ!fO,5>|O+}QlO,5>|OOQO,5?S,5?SO#*uQlO'#IbOOQO-E<`-E<`O#+SQ`O,5@^O#+[Q!fO,5@^O#+cQ`O,5@lOOQ!0Lf1G/k1G/kO%[QlO,5@mO#+kQ`O'#IhOOQO-E<f-E<fO#+cQ`O,5@lOOQ!0Lb1G0v1G0vOOQ!0Ln1G/v1G/vOOQ!0Ln1G0W1G0WO%[QlO,5@jO#,PQ!0LrO,5@jO#,bQ!0LrO,5@jO#,iQ`O,5@iO9ZQ`O,5@iO#,qQ`O,5@iO#-PQ`O'#IkO#,iQ`O,5@iOOQ!0Lb1G0u1G0uO!(cQpO,5:sO!(nQpO,5:sOOQS,5:u,5:uO#-qQdO,5:uO#-yQMhO1G2xO9aQ`O1G2xOOQ!0Lf1G0s1G0sO#.XQ!0MxO1G0sO#/^Q!0MvO,5;TOOQ!0Lh'#GV'#GVO#/zQ!0MzO'#JjO!$fQlO1G0sO#2VQ!fO'#JuO%[QlO'#JuO#2aQ`O,5:cOOQ!0Lh'#D]'#D]OOQ!0Lf1G0|1G0|O%[QlO1G0|OOQ!0Lf1G1e1G1eO#2fQ`O1G0|O#4zQ!0MxO1G0}O#5RQ!0MxO1G0}O#7iQ!0MxO1G0}O#7pQ!0MxO1G0}O#:WQ!0MxO1G0}O#<nQ!0MxO1G0}O#<uQ!0MxO1G0}O#<|Q!0MxO1G0}O#?dQ!0MxO1G0}O#?kQ!0MxO1G0}O#AxQ?MtO'#CiO#CsQ?MtO1G1_O#CzQ?MtO'#JqO#D_Q!0MxO,5?YOOQ!0Lb-E<l-E<lO#FlQ!0MxO1G0}O#GiQ!0MzO1G0}OOQ!0Lf1G0}1G0}O#HlQMjO'#JzO#HvQ`O,5:vO#H{Q!0MxO1G1bO#IoQ,UO,5<VO#IwQ,UO,5<WO#JPQ,UO'#FnO#JhQ`O'#FmOOQO'#KW'#KWOOQO'#Il'#IlO#JmQ,UO1G1mOOQ!0Lf1G1m1G1mOOOW1G1x1G1xO#KOQ?MtO'#JpO#KYQ`O,5<aO!(yQlO,5<aOOOW-E<k-E<kOOQ!0Lf1G1k1G1kO#K_QpO'#KVOOQ!0Lf,5<c,5<cO#KgQpO,5<cO#KlQMhO'#DROOOO'#I`'#I`O#KsO#@ItO,59kOOQ!0Lh,59k,59kO%[QlO1G2OO!7{Q`O'#IpO#LOQ`O,5<yOOQ!0Lh,5<v,5<vO!+rQMhO'#IsO#LlQMjO,5=WO!+rQMhO'#IuO#M_QMjO,5=YO!&iQMhO,5=[OOQO1G2R1G2RO#MiQ!dO'#CrO#M|Q(CWO'#EpO$ RQpO'#GaO$ iQ!dO,5<rO$ pQ`O'#KYO9ZQ`O'#KYO$!OQ`O,5<tO!+rQMhO,5<sO$!TQ`O'#GYO$!fQ`O,5<sO$!kQ!dO'#GVO$!xQ!dO'#KZO$#SQ`O'#KZO!&iQMhO'#KZO$#XQ`O,5<wO$#^QlO'#JtO$#hQpO'#GbO##hQpO'#GbO$#yQ`O'#GfO!3^Q`O'#GjO$$OQ!0LrO'#IrO$$ZQpO,5<{OOQ!0Lp,5<{,5<{O$$bQpO'#GbO$$oQpO'#GcO$%QQpO'#GcO$%VQMjO,5=WO$%gQMjO,5=YOOQ!0Lh,5=],5=]O!+rQMhO,5@TO!+rQMhO,5@TO$%wQ`O'#IwO$&VQ`O,5@SO$&_Q`O,59aOOQ!0Lh,59g,59gO$'UQ$IYO,59sOOQ!0Lh'#Jn'#JnO$'wQMjO,5<jO$(jQMjO,5<lO@iQ`O,5<nOOQ!0Lh,5<o,5<oO$(tQ`O,5<uO$(yQMjO,5<zO$)ZQ`O,5@TO$)iQ`O'#J}O!$fQlO1G2QO$)nQ`O1G2QO9ZQ`O'#KQO9ZQ`O'#ErO%[QlO'#ErO9ZQ`O'#IyO$)sQ!0LrO,5@yOOQ[1G2|1G2|OOQ[1G4^1G4^OOQ!0Lf1G/z1G/zOOQ!0Lf1G/x1G/xO$+uQ!0MxO1G0SOOQ[1G2x1G2xO!&iQMhO1G2xO%[QlO1G2xO#-|Q`O1G2xO$-yQMhO'#EiOOQ!0Lb,5@R,5@RO$.WQ!0LrO,5@ROOQ[1G.u1G.uO!BYQ!0LrO1G.uO!BeQpO1G.uO!BmQMhO1G.uO$.iQ`O1G0sO$.nQ`O'#CiO$.yQ`O'#KcO$/RQ`O,5=zO$/WQ`O'#KcO$/]Q`O'#KcO$/kQ`O'#JPO$/yQ`O,5@|O$0RQ!fO1G1hOOQ!0Lf1G1j1G1jO9aQ`O1G3eO@iQ`O1G3eO$0YQ`O1G3eO$0_Q`O1G3eOOQ[1G3e1G3eO!DkQ`O1G3TO!&iQMhO1G3QO$0dQ`O1G3QOOQ[1G3R1G3RO!&iQMhO1G3RO$0iQ`O1G3RO$0qQpO'#HPOOQ[1G3T1G3TO!5|QpO'#I{O!DpQ!bO1G3WOOQ[1G3W1G3WOOQ[,5=q,5=qO$0yQMhO,5=sO9aQ`O,5=sO$#yQ`O,5=uO9UQ`O,5=uO!BeQpO,5=uO!BmQMhO,5=uO:YQMhO,5=uO$1XQ`O'#KaO$1dQ`O,5=vOOQ[1G.k1G.kO$1iQ!0LrO1G.kO@iQ`O1G.kO$1tQ`O1G.kO9kQ!0LrO1G.kO$3|Q!fO,5AOO$4ZQ`O,5AOO9ZQ`O,5AOO$4fQlO,5=}O$4mQ`O,5=}OOQ[1G3g1G3gO`QlO1G3gOOQ[1G3m1G3mOOQ[1G3o1G3oO>rQ`O1G3qO$4rQlO1G3sO$8vQlO'#HrOOQ[1G3v1G3vO$9TQ`O'#HxO>wQ`O'#HzOOQ[1G3|1G3|O$9]QlO1G3|O9kQ!0LrO1G4SOOQ[1G4U1G4UOOQ!0Lb'#G^'#G^O9kQ!0LrO1G4WO9kQ!0LrO1G4YO$=dQ`O,5@`O!(yQlO,5;^O9ZQ`O,5;^O>wQ`O,5:VO!(yQlO,5:VO!BeQpO,5:VO$=iQ?MtO,5:VOOQO,5;^,5;^O$=sQpO'#IcO$>ZQ`O,5@_OOQ!0Lf1G/p1G/pO$>cQpO'#IiO$>mQ`O,5@nOOQ!0Lb1G0w1G0wO##hQpO,5:VOOQO'#Ie'#IeO$>uQpO,5:oOOQ!0Ln,5:o,5:oO#'cQ`O1G0XOOQ!0Lf1G0X1G0XO%[QlO1G0XOOQ!0Lf1G0r1G0rO>wQ`O1G0rO!BeQpO1G0rO!BmQMhO1G0rOOQ!0Lb1G5z1G5zO!BYQ!0LrO1G0[OOQO1G0k1G0kO%[QlO1G0kO$>|Q!0LrO1G0kO$?XQ!0LrO1G0kO!BeQpO1G0[OCuQpO1G0[O$?gQ!0LrO1G0kOOQO1G0[1G0[O$?{Q!0MxO1G0kPOOO-E<Y-E<YPOOO1G.h1G.hOOOO1G/g1G/gO$@VQ!bO,5<hO$@_Q!fO1G4hOOQO1G4n1G4nO%[QlO,5>|O$@iQ`O1G5xO$@qQ`O1G6WO$@yQ!fO1G6XO9ZQ`O,5?SO$ATQ!0MxO1G6UO%[QlO1G6UO$AeQ!0LrO1G6UO$AvQ`O1G6TO$AvQ`O1G6TO9ZQ`O1G6TO$BOQ`O,5?VO9ZQ`O,5?VOOQO,5?V,5?VO$BdQ`O,5?VO$)iQ`O,5?VOOQO-E<i-E<iOOQS1G0_1G0_OOQS1G0a1G0aO#-tQ`O1G0aOOQ[7+(d7+(dO!&iQMhO7+(dO%[QlO7+(dO$BrQ`O7+(dO$B}QMhO7+(dO$C]Q!0MzO,5=WO$EhQ!0MzO,5=YO$GsQ!0MzO,5=WO$JUQ!0MzO,5=YO$LgQ!0MzO,59sO$NlQ!0MzO,5<jO%!wQ!0MzO,5<lO%%SQ!0MzO,5<zOOQ!0Lf7+&_7+&_O%'eQ!0MxO7+&_O%(XQlO'#IdO%(fQ`O,5@aO%(nQ!fO,5@aOOQ!0Lf1G/}1G/}O%(xQ`O7+&hOOQ!0Lf7+&h7+&hO%(}Q?MtO,5:dO%[QlO7+&yO%)XQ?MtO,5:`O%)fQ?MtO,5:hO%)pQ?MtO,5:jO%)zQMhO'#IgO%*UQ`O,5@fOOQ!0Lh1G0b1G0bOOQO1G1q1G1qOOQO1G1r1G1rO%*^Q!jO,5<YO!(yQlO,5<XOOQO-E<j-E<jOOQ!0Lf7+'X7+'XOOOW7+'d7+'dOOOW1G1{1G1{O%*iQ`O1G1{OOQ!0Lf1G1}1G1}OOOO,59m,59mO%*nQ!dO,59mOOOO-E<^-E<^OOQ!0Lh1G/V1G/VO%*uQ!0MxO7+'jOOQ!0Lh,5?[,5?[O%+iQMhO1G2eP%+pQ`O'#IpPOQ!0Lh-E<n-E<nO%,^QMjO,5?_OOQ!0Lh-E<q-E<qO%-PQMjO,5?aOOQ!0Lh-E<s-E<sO%-ZQ!dO1G2vO%-bQ!dO'#CrO%-xQMhO'#KQO$#^QlO'#JtOOQ!0Lh1G2^1G2^O%.PQ`O'#IoO%.eQ`O,5@tO%.eQ`O,5@tO%.mQ`O,5@tO%.xQ`O,5@tOOQO1G2`1G2`O%/WQMjO1G2_O!+rQMhO1G2_O%/hQ(CWO'#IqO%/uQ`O,5@uO!&iQMhO,5@uO%/}Q!dO,5@uOOQ!0Lh1G2c1G2cO%2_Q!fO'#CiO%2iQ`O,5=OOOQ!0Lb,5<|,5<|O%2qQpO,5<|OOQ!0Lb,5<},5<}OCfQ`O,5<|O%2|QpO,5<|OOQ!0Lb,5=Q,5=QO$)iQ`O,5=UOOQO,5?^,5?^OOQO-E<p-E<pOOQ!0Lp1G2g1G2gO##hQpO,5<|O$#^QlO,5=OO%3[Q`O,5<}O%3gQpO,5<}O!+rQMhO'#IsO%4aQMjO1G2rO!+rQMhO'#IuO%5SQMjO1G2tO%5^QMjO1G5oO%5hQMjO1G5oOOQO,5?c,5?cOOQO-E<u-E<uOOQO1G.{1G.{O!9lQpO,59uO%[QlO,59uOOQ!0Lh,5<i,5<iO%5uQ`O1G2YO!+rQMhO1G2aO!+rQMhO1G5oO!+rQMhO1G5oO%5zQ!0MxO7+'lOOQ!0Lf7+'l7+'lO!$fQlO7+'lO%6nQ`O,5;^OOQ!0Lb,5?e,5?eOOQ!0Lb-E<w-E<wO%6sQ!dO'#K[O#'cQ`O7+(dO4UQ!fO7+(dO$BuQ`O7+(dO%6}Q!0MvO'#CiO%7nQ!0LrO,5=RO%8PQ!0MvO,5=RO%8dQ`O,5=ROOQ!0Lb1G5m1G5mOOQ[7+$a7+$aO!BYQ!0LrO7+$aO!BeQpO7+$aO!$fQlO7+&_O%8lQ`O'#JOO%9TQ`O,5@}OOQO1G3f1G3fO9aQ`O,5@}O%9TQ`O,5@}O%9]Q`O,5@}OOQO,5?k,5?kOOQO-E<}-E<}OOQ!0Lf7+'S7+'SO%9bQ`O7+)PO9kQ!0LrO7+)PO9aQ`O7+)PO@iQ`O7+)POOQ[7+(o7+(oO%9gQ!0MvO7+(lO!&iQMhO7+(lO!DfQ`O7+(mOOQ[7+(m7+(mO!&iQMhO7+(mO%9qQ`O'#K`O%9|Q`O,5=kOOQO,5?g,5?gOOQO-E<y-E<yOOQ[7+(r7+(rO%;`QpO'#HYOOQ[1G3_1G3_O!&iQMhO1G3_O%[QlO1G3_O%;gQ`O1G3_O%;rQMhO1G3_O9kQ!0LrO1G3aO$#yQ`O1G3aO9UQ`O1G3aO!BeQpO1G3aO!BmQMhO1G3aO%<QQ`O'#I}O%<fQ`O,5@{O%<nQpO,5@{OOQ!0Lb1G3b1G3bOOQ[7+$V7+$VO@iQ`O7+$VO9kQ!0LrO7+$VO%<yQ`O7+$VO%[QlO1G6jO%[QlO1G6kO%=OQ!0LrO1G6jO%=YQlO1G3iO%=aQ`O1G3iO%=fQlO1G3iOOQ[7+)R7+)RO9kQ!0LrO7+)]O`QlO7+)_OOQ['#Kf'#KfOOQ['#JQ'#JQO%=mQlO,5>^OOQ[,5>^,5>^O%[QlO'#HsO%=zQ`O'#HuOOQ[,5>d,5>dO9ZQ`O,5>dOOQ[,5>f,5>fOOQ[7+)h7+)hOOQ[7+)n7+)nOOQ[7+)r7+)rOOQ[7+)t7+)tO%>PQpO1G5zO%>kQ?MtO1G0xO%>uQ`O1G0xOOQO1G/q1G/qO%?QQ?MtO1G/qO>wQ`O1G/qO!(yQlO'#DkOOQO,5>},5>}OOQO-E<a-E<aOOQO,5?T,5?TOOQO-E<g-E<gO!BeQpO1G/qOOQO-E<c-E<cOOQ!0Ln1G0Z1G0ZOOQ!0Lf7+%s7+%sO#'cQ`O7+%sOOQ!0Lf7+&^7+&^O>wQ`O7+&^O!BeQpO7+&^OOQO7+%v7+%vO$?{Q!0MxO7+&VOOQO7+&V7+&VO%[QlO7+&VO%?[Q!0LrO7+&VO!BYQ!0LrO7+%vO!BeQpO7+%vO%?gQ!0LrO7+&VO%?uQ!0MxO7++pO%[QlO7++pO%@VQ`O7++oO%@VQ`O7++oOOQO1G4q1G4qO9ZQ`O1G4qO%@_Q`O1G4qOOQS7+%{7+%{O#'cQ`O<<LOO4UQ!fO<<LOO%@mQ`O<<LOOOQ[<<LO<<LOO!&iQMhO<<LOO%[QlO<<LOO%@uQ`O<<LOO%AQQ!0MzO,5?_O%C]Q!0MzO,5?aO%EhQ!0MzO1G2_O%GyQ!0MzO1G2rO%JUQ!0MzO1G2tO%LaQ!fO,5?OO%[QlO,5?OOOQO-E<b-E<bO%LkQ`O1G5{OOQ!0Lf<<JS<<JSO%LsQ?MtO1G0sO%NzQ?MtO1G0}O& RQ?MtO1G0}O&#SQ?MtO1G0}O&#ZQ?MtO1G0}O&%[Q?MtO1G0}O&']Q?MtO1G0}O&'dQ?MtO1G0}O&'kQ?MtO1G0}O&)lQ?MtO1G0}O&)sQ?MtO1G0}O&)zQ!0MxO<<JeO&+rQ?MtO1G0}O&,oQ?MvO1G0}O&-rQ?MvO'#JjO&/xQ?MtO1G1bO&0VQ?MtO1G0SO&0aQMjO,5?ROOQO-E<e-E<eO!(yQlO'#FpOOQO'#KX'#KXOOQO1G1t1G1tO&0kQ`O1G1sO&0pQ?MtO,5?YOOOW7+'g7+'gOOOO1G/X1G/XO&0zQ!dO1G4vOOQ!0Lh7+(P7+(PP!&iQMhO,5?[O!+rQMhO7+(bO&1RQ`O,5?ZO9ZQ`O,5?ZOOQO-E<m-E<mO&1aQ`O1G6`O&1aQ`O1G6`O&1iQ`O1G6`O&1tQMjO7+'yO&2UQ!dO,5?]O&2`Q`O,5?]O!&iQMhO,5?]OOQO-E<o-E<oO&2eQ!dO1G6aO&2oQ`O1G6aO&2wQ`O1G2jO!&iQMhO1G2jOOQ!0Lb1G2h1G2hOOQ!0Lb1G2i1G2iO%2qQpO1G2hO!BeQpO1G2hOCfQ`O1G2hOOQ!0Lb1G2p1G2pO&2|QpO1G2hO&3[Q`O1G2jO$)iQ`O1G2iOCfQ`O1G2iO$#^QlO1G2jO&3dQ`O1G2iO&4WQMjO,5?_OOQ!0Lh-E<r-E<rO&4yQMjO,5?aOOQ!0Lh-E<t-E<tO!+rQMhO7++ZOOQ!0Lh1G/a1G/aO&5TQ`O1G/aOOQ!0Lh7+'t7+'tO&5YQMjO7+'{O&5jQMjO7++ZO&5tQMjO7++ZO&6RQ!0MxO<<KWOOQ!0Lf<<KW<<KWO&6uQ`O1G0xO!&iQMhO'#IxO&6zQ`O,5@vO&8|Q!fO<<LOO!&iQMhO1G2mO&9TQ!0LrO1G2mOOQ[<<G{<<G{O!BYQ!0LrO<<G{O&9fQ!0MxO<<IyOOQ!0Lf<<Iy<<IyOOQO,5?j,5?jO&:YQ`O,5?jO&:_Q`O,5?jOOQO-E<|-E<|O&:mQ`O1G6iO&:mQ`O1G6iO9aQ`O1G6iO@iQ`O<<LkOOQ[<<Lk<<LkO&:uQ`O<<LkO9kQ!0LrO<<LkOOQ[<<LW<<LWO%9gQ!0MvO<<LWOOQ[<<LX<<LXO!DfQ`O<<LXO&:zQpO'#IzO&;VQ`O,5@zO!(yQlO,5@zOOQ[1G3V1G3VOOQO'#I|'#I|O9kQ!0LrO'#I|O&;_QpO,5=tOOQ[,5=t,5=tO&;fQpO'#EeO&;mQpO'#GdO&;rQ`O7+(yO&;wQ`O7+(yOOQ[7+(y7+(yO!&iQMhO7+(yO%[QlO7+(yO&<PQ`O7+(yOOQ[7+({7+({O9kQ!0LrO7+({O$#yQ`O7+({O9UQ`O7+({O!BeQpO7+({O&<[Q`O,5?iOOQO-E<{-E<{OOQO'#H]'#H]O&<gQ`O1G6gO9kQ!0LrO<<GqOOQ[<<Gq<<GqO@iQ`O<<GqO&<oQ`O7+,UO&<tQ`O7+,VO%[QlO7+,UO%[QlO7+,VOOQ[7+)T7+)TO&<yQ`O7+)TO&=OQlO7+)TO&=VQ`O7+)TOOQ[<<Lw<<LwOOQ[<<Ly<<LyOOQ[-E=O-E=OOOQ[1G3x1G3xO&=[Q`O,5>_OOQ[,5>a,5>aO&=aQ`O1G4OO9ZQ`O7+&dO!(yQlO7+&dOOQO7+%]7+%]O&=fQ?MtO1G6XO>wQ`O7+%]OOQ!0Lf<<I_<<I_OOQ!0Lf<<Ix<<IxO>wQ`O<<IxOOQO<<Iq<<IqO$?{Q!0MxO<<IqO%[QlO<<IqOOQO<<Ib<<IbO!BYQ!0LrO<<IbO&=pQ!0LrO<<IqO&={Q!0MxO<= [O&>]Q`O<= ZOOQO7+*]7+*]O9ZQ`O7+*]OOQ[ANAjANAjO&>eQ!fOANAjO!&iQMhOANAjO#'cQ`OANAjO4UQ!fOANAjO&>lQ`OANAjO%[QlOANAjO&>tQ!0MzO7+'yO&AVQ!0MzO,5?_O&CbQ!0MzO,5?aO&EmQ!0MzO7+'{O&HOQ!fO1G4jO&HYQ?MtO7+&_O&J^Q?MvO,5=WO&LeQ?MvO,5=YO&LuQ?MvO,5=WO&MVQ?MvO,5=YO&MgQ?MvO,59sO' mQ?MvO,5<jO'#pQ?MvO,5<lO'&UQ?MvO,5<zO''zQ?MtO7+'jO'(XQ?MtO7+'lO'(fQ`O,5<[OOQO7+'_7+'_OOQ!0Lh7+*b7+*bO'(kQMjO<<K|OOQO1G4u1G4uO'(rQ`O1G4uO'(}Q`O1G4uO')]Q`O7++zO')]Q`O7++zO!&iQMhO1G4wO')eQ!dO1G4wO')oQ`O7++{O')wQ`O7+(UO'*SQ!dO7+(UOOQ!0Lb7+(S7+(SOOQ!0Lb7+(T7+(TO!BeQpO7+(SOCfQ`O7+(SO'*^Q`O7+(UO!&iQMhO7+(UO$)iQ`O7+(TO'*cQ`O7+(UOCfQ`O7+(TO'*kQMjO<<NuOOQ!0Lh7+${7+${O!+rQMhO<<NuO'*uQ!dO,5?dOOQO-E<v-E<vO'+PQ!0MvO7+(XO!&iQMhO7+(XOOQ[AN=gAN=gO9aQ`O1G5UOOQO1G5U1G5UO'+aQ`O1G5UO'+fQ`O7+,TO'+fQ`O7+,TO9kQ!0LrOANBVO@iQ`OANBVOOQ[ANBVANBVOOQ[ANArANArOOQ[ANAsANAsO'+nQ`O,5?fOOQO-E<x-E<xO'+yQ?MtO1G6fOOQO,5?h,5?hOOQO-E<z-E<zOOQ[1G3`1G3`O',TQ`O,5=OOOQ[<<Le<<LeO!&iQMhO<<LeO&;rQ`O<<LeO',YQ`O<<LeO%[QlO<<LeOOQ[<<Lg<<LgO9kQ!0LrO<<LgO$#yQ`O<<LgO9UQ`O<<LgO',bQpO1G5TO',mQ`O7+,ROOQ[AN=]AN=]O9kQ!0LrOAN=]OOQ[<= p<= pOOQ[<= q<= qO',uQ`O<= pO',zQ`O<= qOOQ[<<Lo<<LoO'-PQ`O<<LoO'-UQlO<<LoOOQ[1G3y1G3yO>wQ`O7+)jO'-]Q`O<<JOO'-hQ?MtO<<JOOOQO<<Hw<<HwOOQ!0LfAN?dAN?dOOQOAN?]AN?]O$?{Q!0MxOAN?]OOQOAN>|AN>|O%[QlOAN?]OOQO<<Mw<<MwOOQ[G27UG27UO!&iQMhOG27UO#'cQ`OG27UO'-rQ!fOG27UO4UQ!fOG27UO'-yQ`OG27UO'.RQ?MtO<<JeO'.`Q?MvO1G2_O'0UQ?MvO,5?_O'2XQ?MvO,5?aO'4[Q?MvO1G2rO'6_Q?MvO1G2tO'8bQ?MtO<<KWO'8oQ?MtO<<IyOOQO1G1v1G1vO!+rQMhOANAhOOQO7+*a7+*aO'8|Q`O7+*aO'9XQ`O<= fO'9aQ!dO7+*cOOQ!0Lb<<Kp<<KpO$)iQ`O<<KpOCfQ`O<<KpO'9kQ`O<<KpO!&iQMhO<<KpOOQ!0Lb<<Kn<<KnO!BeQpO<<KnO'9vQ!dO<<KpOOQ!0Lb<<Ko<<KoO':QQ`O<<KpO!&iQMhO<<KpO$)iQ`O<<KoO':VQMjOANDaO':aQ!0MvO<<KsOOQO7+*p7+*pO9aQ`O7+*pO':qQ`O<= oOOQ[G27qG27qO9kQ!0LrOG27qO!(yQlO1G5QO':yQ`O7+,QO';RQ`O1G2jO&;rQ`OANBPOOQ[ANBPANBPO!&iQMhOANBPO';WQ`OANBPOOQ[ANBRANBRO9kQ!0LrOANBRO$#yQ`OANBROOQO'#H^'#H^OOQO7+*o7+*oOOQ[G22wG22wOOQ[ANE[ANE[OOQ[ANE]ANE]OOQ[ANBZANBZO';`Q`OANBZOOQ[<<MU<<MUO!(yQlOAN?jOOQOG24wG24wO$?{Q!0MxOG24wO#'cQ`OLD,pOOQ[LD,pLD,pO!&iQMhOLD,pO';eQ!fOLD,pO';lQ?MvO7+'yO'=bQ?MvO,5?_O'?eQ?MvO,5?aO'AhQ?MvO7+'{O'C^QMjOG27SOOQO<<M{<<M{OOQ!0LbANA[ANA[O$)iQ`OANA[OCfQ`OANA[O'CnQ!dOANA[OOQ!0LbANAYANAYO'CuQ`OANA[O!&iQMhOANA[O'DQQ!dOANA[OOQ!0LbANAZANAZOOQO<<N[<<N[OOQ[LD-]LD-]O'D[Q?MtO7+*lOOQO'#Ge'#GeOOQ[G27kG27kO&;rQ`OG27kO!&iQMhOG27kOOQ[G27mG27mO9kQ!0LrOG27mOOQ[G27uG27uO'DfQ?MtOG25UOOQOLD*cLD*cOOQ[!$(![!$(![O#'cQ`O!$(![O!&iQMhO!$(![O'DpQ!0MzOG27SOOQ!0LbG26vG26vO$)iQ`OG26vO'GRQ`OG26vOCfQ`OG26vO'G^Q!dOG26vO!&iQMhOG26vOOQ[LD-VLD-VO&;rQ`OLD-VOOQ[LD-XLD-XOOQ[!)9Ev!)9EvO#'cQ`O!)9EvOOQ!0LbLD,bLD,bO$)iQ`OLD,bOCfQ`OLD,bO'GeQ`OLD,bO'GpQ!dOLD,bOOQ[!$(!q!$(!qOOQ[!.K;b!.K;bO'GwQ?MvOG27SOOQ!0Lb!$( |!$( |O$)iQ`O!$( |OCfQ`O!$( |O'ImQ`O!$( |OOQ!0Lb!)9Eh!)9EhO$)iQ`O!)9EhOCfQ`O!)9EhOOQ!0Lb!.K;S!.K;SO$)iQ`O!.K;SOOQ!0Lb!4/0n!4/0nO!(yQlO'#DxO1PQ`O'#EVO'IxQ!fO'#JpO'JPQ!L^O'#DtO'JWQlO'#D|O'J_Q!fO'#CiO'LuQ!fO'#CiO!(yQlO'#EOO'MVQlO,5;XO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO'#InO( YQ`O,5<hO!(yQlO,5;cO( bQMhO,5;cO(!{QMhO,5;cO!(yQlO,5;vO!&iQMhO'#GlO( bQMhO'#GlO!&iQMhO'#GnO( bQMhO'#GnO1SQ`O'#DXO1SQ`O'#DXO!&iQMhO'#GOO( bQMhO'#GOO!&iQMhO'#GQO( bQMhO'#GQO!&iQMhO'#G`O( bQMhO'#G`O!(yQlO,5:hO(#SQpO'#D]O(#^QpO'#JtO!(yQlO,5@mO'MVQlO1G0sO(#hQ?MtO'#CiO!(yQlO1G2OO!&iQMhO'#IsO( bQMhO'#IsO!&iQMhO'#IuO( bQMhO'#IuO(#rQ!dO'#CrO!&iQMhO,5<sO( bQMhO,5<sO'MVQlO1G2QO!(yQlO7+&yO!&iQMhO1G2_O( bQMhO1G2_O!&iQMhO'#IsO( bQMhO'#IsO!&iQMhO'#IuO( bQMhO'#IuO!&iQMhO1G2aO( bQMhO1G2aO'MVQlO7+'lO'MVQlO7+&_O!&iQMhOANAhO( bQMhOANAhO($VQ`O'#EmO($[Q`O'#EmO($dQ`O'#F[O($iQ`O'#EwO($nQ`O'#KRO($yQ`O'#KPO(%UQ`O,5;XO(%ZQMjO,5<dO(%bQ`O'#GXO(%gQ`O'#GXO(%lQ`O,5<fO(%tQ`O,5;XO(%|Q?MtO1G1_O(&TQ`O,5<sO(&YQ`O,5<sO(&_Q`O,5<uO(&dQ`O,5<uO(&iQ`O1G2QO(&nQ`O1G0sO(&sQMjO<<K|O(&zQMjO<<K|O7eQMhO'#F{O9UQ`O'#FzOAdQ`O'#ElO!(yQlO,5;sO!3^Q`O'#GXO!3^Q`O'#GXO!3^Q`O'#GZO!3^Q`O'#GZO!+rQMhO7+(bO!+rQMhO7+(bO%-ZQ!dO1G2vO%-ZQ!dO1G2vO!&iQMhO,5=[O!&iQMhO,5=[",stateData:"((P~O'zOS'{OSTOS'|RQ~OPYOQYOSfOY!VOaqOdzOeyOj!POnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]XO!guO!jZO!mYO!nYO!oYO!qvO!swO!vxO!z]O$V|O$miO%g}O%i!QO%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO%x!UO&U!WO&[!XO&^!YO&`!ZO&b![O&e!]O&k!^O&q!_O&s!`O&u!aO&w!bO&y!cO(RSO(TTO(WUO(_VO(m[O~OWtO~P`OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oa!wOq!nO!Q!oO!`!yO!a!vO!b!vO!z;wO#R!pO#S!pO#T!xO#U!pO#V!pO#Y!zO#Z!zO(S!lO(TTO(WUO(c!mO(m!sO~O'|!{O~OP]XR]X[]Xa]Xp]X!O]X!Q]X!Z]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X'x]X(_]X(p]X(w]X(x]X~O!e%QX~P(qO_!}O(T#PO(U!}O(V#PO~O_#QO(V#PO(W#PO(X#QO~Ov#SO!S#TO(`#TO(a#VO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R;{O(TTO(WUO(_VO(m[O~O!Y#ZO!Z#WO!W(fP!W(tP~P+}O![#cO~P`OPYOQYOSfOd!jOe!iOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(TTO(WUO(_VO(m[O~On#mO!Y#iO!z]O#g#lO#h#iO(R;|O!i(qP~P.iO!j#oO(R#nO~O!v#sO!z]O%g#tO~O#i#uO~O!e#vO#i#uO~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!Z$_O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~Oa(dX'x(dX'u(dX!i(dX!W(dX!](dX%h(dX!e(dX~P1qO#Q$dO#^$eO$P$eOP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#t(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX!](eX%h(eX~Oa(eX'x(eX'u(eX!W(eX!i(eXt(eX!e(eX~P4UO#^$eO~O$[$hO$^$gO$e$mO~OSfO!]$nO$h$oO$j$qO~Oh%VOj%cOn%WOp%XOq$tOr$tOx%YOz%ZO|%[O!Q${O!]$|O!g%aO!j$xO#h%bO$V%_O$s%]O$u%^O$x%`O(R$sO(TTO(WUO(_$uO(w$}O(x%POg([P~O!j%dO~O!Q%gO!]%hO(R%fO~O!e%lO~Oa%mO'x%mO~O!O%qO~P%[O(S!lO~P%[O%m%uO~P%[Oh%VO!j%dO(R%fO(S!lO~Oe%|O!j%dO(R%fO~O#t$RO~O!O&RO!]&OO!j&QO%i&UO(R%fO(S!lO(TTO(WUO`)UP~O!v#sO~O%r&WO!Q)QX!])QX(R)QX~O(R&XO~Oj!PO!s&^O%i!QO%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO~Od&cOe&bO!v&`O%g&aO%z&_O~P<POd&fOeyOj!PO!]&eO!s&^O!vxO!z]O%g}O%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO%x!UO~Ob&iO#^&lO%i&gO(S!lO~P=UO!j&mO!s&qO~O!j#oO~O!]XO~Oa%mO'v&yO'x%mO~Oa%mO'v&|O'x%mO~Oa%mO'v'OO'x%mO~O'u]X!W]Xt]X!i]X&Y]X!]]X%h]X!e]X~P(qO!`']O!a'UO!b'UO(S!lO(TTO(WUO~Oq'SO!Q'RO!Y'VO(c'QO![(gP![(vP~P@]Ol'`O!]'^O(R%fO~Oe'eO!j%dO(R%fO~O!O&RO!j&QO~Oq!nO!Q!oO!z;wO#R!pO#S!pO#U!pO#V!pO(S!lO(TTO(WUO(c!mO(m!sO~O!`'kO!a'jO!b'jO#T!pO#Y'lO#Z'lO~PAwOa%mOh%VO!e#vO!j%dO'x%mO(p'nO~O!n'rO#^'pO~PCVOq!nO!Q!oO(TTO(WUO(c!mO(m!sO~O!]XOq(kX!Q(kX!`(kX!a(kX!b(kX!z(kX#R(kX#S(kX#T(kX#U(kX#V(kX#Y(kX#Z(kX(S(kX(T(kX(W(kX(c(kX(m(kX~O!a'jO!b'jO(S!lO~PCuO'}'vO(O'vO(P'xO~O_!}O(T'zO(U!}O(V'zO~O_#QO(V'zO(W'zO(X#QO~Ot'|O~P%[Ov#SO!S#TO(`#TO(a(PO~O!Y(RO!W'UX!W'[X!Z'UX!Z'[X~P+}O!Z(TO!W(fX~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!Z(TO!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~O!W(fX~PGpO!W(YO~O!W(sX!Z(sX!e(sX!i(sX(p(sX~O#^(sX#i#bX![(sX~PIsO#^(ZO!W(uX!Z(uX~O!Z([O!W(tX~O!W(_O~O#^$eO~PIsO![(`O~P`OR#zO!O#yO!Q#{O!j#xO(_VOP!la[!lap!la!Z!la!n!la#P!la#l!la#m!la#n!la#o!la#p!la#q!la#r!la#s!la#t!la#u!la#w!la#y!la#z!la(p!la(w!la(x!la~Oa!la'x!la'u!la!W!la!i!lat!la!]!la%h!la!e!la~PKZO!i(aO~O!e#vO#^(bO(p'nO!Z(rXa(rX'x(rX~O!i(rX~PMvO!Q%gO!]%hO!z]O#g(gO#h(fO(R%fO~O!Z(hO!i(qX~O!i(jO~O!Q%gO!]%hO#h(fO(R%fO~OP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#t(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX~O!e#vO!i(eX~P! dOR(lO!O(kO!j#xO#Q$dO!z!ya!Q!ya~O!v!ya%g!ya!]!ya#g!ya#h!ya(R!ya~P!#eO!v(pO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]XO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~O#i(vO~O!Y(xO!i(iP~P%[O(c(zO(m[O~O!Q(|O!j#xO(c(zO(m[O~OP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]!eO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(R)ZO(TTO(WUO(_VO(m[O~O!Z$_Oa$pa'x$pa'u$pa!i$pa!W$pa!]$pa%h$pa!e$pa~Oj)bO~P!&iOh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|%[O!Q${O!]$|O!g%aO!j$xO#h%bO$V%_O$s%]O$u%^O$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~Og(nP~P!+rO!O)gO!e)fO!]$]X$Y$]X$[$]X$^$]X$e$]X~O!e)fO!](yX$Y(yX$[(yX$^(yX$e(yX~O!O)gO~P!-{O!O)gO!](yX$Y(yX$[(yX$^(yX$e(yX~O!])iO$Y)mO$[)hO$^)hO$e)nO~O!Y)qO~P!(yO$[$hO$^$gO$e)uO~Ol$yX!O$yX#Q$yX'w$yX(w$yX(x$yX~OgkXg$yXlkX!ZkX#^kX~P!/qOv)wO(`)xO(a)zO~Ol*TO!O)|O'w)}O(w$}O(x%PO~Og){O~P!0uOg*UO~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q*WO!]*XO!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(TTO(WUO(_$uO(w$}O(x%PO~O!Y*[O(R*VO!i(|P~P!1dO#i*^O~O!j*_O~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(R*aO(TTO(WUO(_$uO(w$}O(x%PO~O!Y*dO!W(}P~P!3cOp*pOq!nO!Q*fO!`*nO!a*hO!b*hO!j*_O#Y*oO%_*jO(S!lO(TTO(WUO(c!mO~O![*mO~P!5WO#Q$dOl(^X!O(^X'w(^X(w(^X(x(^X!Z(^X#^(^X~Og(^X#}(^X~P!6YOl*uO#^*tOg(]X!Z(]X~O!Z*vOg([X~Oj%cO(R&XOg([P~Oq*yO~O!j+OO~O(R(tO~On+TO!Q%gO!Y#iO!]%hO!z]O#g#lO#h#iO(R%fO!i(qP~O!e#vO#i+UO~O!Q%gO!Y+WO!Z([O!]%hO(R%fO!W(tP~Oq'YO!Q+YO!Y+XO(TTO(WUO(c(zO~O![(vP~P!9]O!Z+ZOa)RX'x)RX~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~Oa!ha!Z!ha'x!ha'u!ha!W!ha!i!hat!ha!]!ha%h!ha!e!ha~P!:TOR#zO!O#yO!Q#{O!j#xO(_VOP!pa[!pap!pa!Z!pa!n!pa#P!pa#l!pa#m!pa#n!pa#o!pa#p!pa#q!pa#r!pa#s!pa#t!pa#u!pa#w!pa#y!pa#z!pa(p!pa(w!pa(x!pa~Oa!pa'x!pa'u!pa!W!pa!i!pat!pa!]!pa%h!pa!e!pa~P!<kOR#zO!O#yO!Q#{O!j#xO(_VOP!ra[!rap!ra!Z!ra!n!ra#P!ra#l!ra#m!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#w!ra#y!ra#z!ra(p!ra(w!ra(x!ra~Oa!ra'x!ra'u!ra!W!ra!i!rat!ra!]!ra%h!ra!e!ra~P!?ROh%VOl+dO!]'^O%h+cO~O!e+fOa(ZX!](ZX'x(ZX!Z(ZX~Oa%mO!]XO'x%mO~Oh%VO!j%dO~Oh%VO!j%dO(R%fO~O!e#vO#i(vO~Ob+qO%i+rO(R+nO(TTO(WUO![)VP~O!Z+sO`)UX~O[+wO~O`+xO~O!]&OO(R%fO(S!lO`)UP~Oh%VO#^+}O~Oh%VOl,QO!]$|O~O!],SO~O!O,UO!]XO~O%m%uO~O!v,ZO~Oe,`O~Ob,aO(R#nO(TTO(WUO![)TP~Oe%|O~O%i!QO(R&XO~P=UO[,fO`,eO~OPYOQYOSfOdzOeyOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!guO!jZO!mYO!nYO!oYO!qvO!vxO!z]O$miO%g}O(TTO(WUO(_VO(m[O~O!]!eO!s!gO$V!kO(R!dO~P!FRO`,eOa%mO'x%mO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oa,kOj!OO!swO%k!OO%l!OO%m!OO~P!HkO!j&mO~O&[,qO~O!],sO~O&m,uO&o,vOP&jaQ&jaS&jaY&jaa&jad&jae&jaj&jan&jap&jaq&jar&jax&jaz&ja|&ja!Q&ja!U&ja!V&ja!]&ja!g&ja!j&ja!m&ja!n&ja!o&ja!q&ja!s&ja!v&ja!z&ja$V&ja$m&ja%g&ja%i&ja%k&ja%l&ja%m&ja%p&ja%r&ja%u&ja%v&ja%x&ja&U&ja&[&ja&^&ja&`&ja&b&ja&e&ja&k&ja&q&ja&s&ja&u&ja&w&ja&y&ja'u&ja(R&ja(T&ja(W&ja(_&ja(m&ja![&ja&c&jab&ja&h&ja~O(R,{O~Oh!cX!Z!PX![!PX!e!PX!e!cX!j!cX#^!PX~O!Z!cX![!cX~P# qO!e-QO#^-POh(hX!Z#fX![#fX!e(hX!j(hX~O!Z(hX![(hX~P#!dOh%VO!e-SO!j%dO!Z!_X![!_X~Oq!nO!Q!oO(TTO(WUO(c!mO~OP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]!eO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(TTO(WUO(_VO(m[O~O(R<rO~P##yO!Z-WO![(gX~O![-YO~O!e-QO#^-PO!Z#fX![#fX~O!Z-ZO![(vX~O![-]O~O!a-^O!b-^O(S!lO~P##hO![-aO~P'_Ol-dO!]'^O~O!W-iO~Oq!ya!`!ya!a!ya!b!ya#R!ya#S!ya#T!ya#U!ya#V!ya#Y!ya#Z!ya(S!ya(T!ya(W!ya(c!ya(m!ya~P!#eO!n-nO#^-lO~PCVO!a-pO!b-pO(S!lO~PCuOa%mO#^-lO'x%mO~Oa%mO!e#vO#^-lO'x%mO~Oa%mO!e#vO!n-nO#^-lO'x%mO(p'nO~O'}'vO(O'vO(P-uO~Ot-vO~O!W'Ua!Z'Ua~P!:TO!Y-zO!W'UX!Z'UX~P%[O!Z(TO!W(fa~O!W(fa~PGpO!Z([O!W(ta~O!Q%gO!Y.OO!]%hO(R%fO!W'[X!Z'[X~O#^.QO!Z(ra!i(raa(ra'x(ra~O!e#vO~P#,PO!Z(hO!i(qa~O!Q%gO!]%hO#h.UO(R%fO~On.ZO!Q%gO!Y.WO!]%hO!z]O#g.YO#h.WO(R%fO!Z'_X!i'_X~OR._O!j#xO~Oh%VOl.bO!]'^O%h.aO~Oa#ai!Z#ai'x#ai'u#ai!W#ai!i#ait#ai!]#ai%h#ai!e#ai~P!:TOl=|O!O)|O'w)}O(w$}O(x%PO~O#i#]aa#]a#^#]a'x#]a!Z#]a!i#]a!]#]a!W#]a~P#.{O#i(^XP(^XR(^X[(^Xa(^Xp(^X!Q(^X!j(^X!n(^X#P(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#s(^X#t(^X#u(^X#w(^X#y(^X#z(^X'x(^X(_(^X(p(^X!i(^X!W(^X'u(^Xt(^X!](^X%h(^X!e(^X~P!6YO!Z.oO!i(iX~P!:TO!i.rO~O!W.tO~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O(_VO[#kia#kip#ki!Z#ki#P#ki#m#ki#n#ki#o#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#l#ki~P#2kO#l$OO~P#2kOP$[OR#zOp$aO!O#yO!Q#{O!j#xO!n$[O#l$OO#m$PO#n$PO#o$PO(_VO[#kia#ki!Z#ki#P#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#p#ki~P#5YO#p$QO~P#5YOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO(_VOa#ki!Z#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#u#ki~P#7wOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO(_VO(x#}Oa#ki!Z#ki#y#ki#z#ki'x#ki(p#ki(w#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#w$UO~P#:_O#w#ki~P#:_O#u$SO~P#7wOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO(_VO(w#|O(x#}Oa#ki!Z#ki#z#ki'x#ki(p#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#y#ki~P#=TO#y$WO~P#=TOP]XR]X[]Xp]X!O]X!Q]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X!Z]X![]X~O#}]X~P#?rOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO#w<VO#y<XO#z<YO(_VO(p$YO(w#|O(x#}O~O#}.vO~P#BPO#Q$dO#^<`O$P<`O#}(eX![(eX~P! dOa'ba!Z'ba'x'ba'u'ba!i'ba!W'bat'ba!]'ba%h'ba!e'ba~P!:TO[#kia#kip#ki!Z#ki#P#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O#l$OO#m$PO#n$PO#o$PO(_VO(w#ki(x#ki~P#EROl=|O!O)|O'w)}O(w$}O(x%POP#kiR#ki!Q#ki!j#ki!n#ki#l#ki#m#ki#n#ki#o#ki(_#ki~P#ERO!Z.zOg(nX~P!0uOg.|O~Oa$Oi!Z$Oi'x$Oi'u$Oi!W$Oi!i$Oit$Oi!]$Oi%h$Oi!e$Oi~P!:TO$[.}O$^.}O~O$[/OO$^/OO~O!e)fO#^/PO!]$bX$Y$bX$[$bX$^$bX$e$bX~O!Y/QO~O!])iO$Y/SO$[)hO$^)hO$e/TO~O!Z<ZO![(dX~P#BPO![/UO~O!e)fO$e(yX~O$e/WO~Ot/XO~P!&iOv)wO(`)xO(a/[O~O!Q/_O~O(w$}Ol%`a!O%`a'w%`a(x%`a!Z%`a#^%`a~Og%`a#}%`a~P#LTO(x%POl%ba!O%ba'w%ba(w%ba!Z%ba#^%ba~Og%ba#}%ba~P#LvO!ZfX!efX!ifX!i$yX(pfX~P!/qO!Y/hO!Z([O(R/gO!W(tP!W(}P~P!1dOp*pO!`*nO!a*hO!b*hO!j*_O#Y*oO%_*jO(S!lO(TTO(WUO~Oq<oO!Q/iO!Y+XO![*mO(c<nO![(vP~P#NaO!i/jO~P#.{O!Z/kO!e#vO(p'nO!i(|X~O!i/pO~O!Q%gO!Y*[O!]%hO(R%fO!i(|P~O#i/rO~O!W$yX!Z$yX!e%QX~P!/qO!Z/sO!W(}X~P#.{O!e/uO~O!W/wO~OnkO(R/xO~P.iOh%VOp/}O!e#vO!j%dO(p'nO~O!e+fO~Oa%mO!Z0RO'x%mO~O![0TO~P!5WO!a0UO!b0UO(S!lO~P##hOq!nO!Q0VO(TTO(WUO(c!mO~O#Y0XO~Og%`a!Z%`a#^%`a#}%`a~P!0uOg%ba!Z%ba#^%ba#}%ba~P!0uOj%cO(R&XOg'kX!Z'kX~O!Z*vOg([a~Og0bO~OR0cO!O0cO!Q0dO#Q$dOl{a'w{a(w{a(x{a!Z{a#^{a~Og{a#}{a~P$&dO!O)|O'w)}Ol$ra(w$ra(x$ra!Z$ra#^$ra~Og$ra#}$ra~P$'`O!O)|O'w)}Ol$ta(w$ta(x$ta!Z$ta#^$ta~Og$ta#}$ta~P$(RO#i0gO~Og%Sa!Z%Sa#^%Sa#}%Sa~P!0uOl0iO#^0hOg(]a!Z(]a~O!e#vO~O#i0lO~O!Z+ZOa)Ra'x)Ra~OR#zO!O#yO!Q#{O!j#xO(_VOP!pi[!pip!pi!Z!pi!n!pi#P!pi#l!pi#m!pi#n!pi#o!pi#p!pi#q!pi#r!pi#s!pi#t!pi#u!pi#w!pi#y!pi#z!pi(p!pi(w!pi(x!pi~Oa!pi'x!pi'u!pi!W!pi!i!pit!pi!]!pi%h!pi!e!pi~P$*OOh%VOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(TTO(WUO(_$uO(w$}O(x%PO~On0vO%[0wO(R0tO~P$,fO!e+fOa(Za!](Za'x(Za!Z(Za~O#i0|O~O[]X!ZfX![fX~O!Z0}O![)VX~O![1PO~O[1QO~Ob1SO(R+nO(TTO(WUO~O!]&OO(R%fO`'sX!Z'sX~O!Z+sO`)Ua~O!i1VO~P!:TO[1YO~O`1ZO~O#^1^O~Ol1aO!]$|O~O(c(zO![)SP~Oh%VOl1jO!]1gO%h1iO~O[1tO!Z1rO![)TX~O![1uO~O`1wOa%mO'x%mO~O(R#nO(TTO(WUO~O#Q$dO#^$eO$P$eOP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX~O#t1zO&Y1{Oa(eX~P$2PO#^$eO#t1zO&Y1{O~Oa1}O~P%[Oa2PO~O&c2SOP&aiQ&aiS&aiY&aia&aid&aie&aij&ain&aip&aiq&air&aix&aiz&ai|&ai!Q&ai!U&ai!V&ai!]&ai!g&ai!j&ai!m&ai!n&ai!o&ai!q&ai!s&ai!v&ai!z&ai$V&ai$m&ai%g&ai%i&ai%k&ai%l&ai%m&ai%p&ai%r&ai%u&ai%v&ai%x&ai&U&ai&[&ai&^&ai&`&ai&b&ai&e&ai&k&ai&q&ai&s&ai&u&ai&w&ai&y&ai'u&ai(R&ai(T&ai(W&ai(_&ai(m&ai![&aib&ai&h&ai~Ob2YO![2WO&h2XO~P`O!]XO!j2[O~O&o,vOP&jiQ&jiS&jiY&jia&jid&jie&jij&jin&jip&jiq&jir&jix&jiz&ji|&ji!Q&ji!U&ji!V&ji!]&ji!g&ji!j&ji!m&ji!n&ji!o&ji!q&ji!s&ji!v&ji!z&ji$V&ji$m&ji%g&ji%i&ji%k&ji%l&ji%m&ji%p&ji%r&ji%u&ji%v&ji%x&ji&U&ji&[&ji&^&ji&`&ji&b&ji&e&ji&k&ji&q&ji&s&ji&u&ji&w&ji&y&ji'u&ji(R&ji(T&ji(W&ji(_&ji(m&ji![&ji&c&jib&ji&h&ji~O!W2bO~O!Z!_a![!_a~P#BPOq!nO!Q!oO!Y2hO(c!mO!Z'VX!['VX~P@]O!Z-WO![(ga~O!Z']X![']X~P!9]O!Z-ZO![(va~O![2oO~P'_Oa%mO#^2xO'x%mO~Oa%mO!e#vO#^2xO'x%mO~Oa%mO!e#vO!n2|O#^2xO'x%mO(p'nO~Oa%mO'x%mO~P!:TO!Z$_Ot$pa~O!W'Ui!Z'Ui~P!:TO!Z(TO!W(fi~O!Z([O!W(ti~O!W(ui!Z(ui~P!:TO!Z(ri!i(ria(ri'x(ri~P!:TO#^3OO!Z(ri!i(ria(ri'x(ri~O!Z(hO!i(qi~O!Q%gO!]%hO!z]O#g3TO#h3SO(R%fO~O!Q%gO!]%hO#h3SO(R%fO~Ol3[O!]'^O%h3ZO~Oh%VOl3[O!]'^O%h3ZO~O#i%`aP%`aR%`a[%`aa%`ap%`a!Q%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a'x%`a(_%`a(p%`a!i%`a!W%`a'u%`at%`a!]%`a%h%`a!e%`a~P#LTO#i%baP%baR%ba[%baa%bap%ba!Q%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba'x%ba(_%ba(p%ba!i%ba!W%ba'u%bat%ba!]%ba%h%ba!e%ba~P#LvO#i%`aP%`aR%`a[%`aa%`ap%`a!Q%`a!Z%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a'x%`a(_%`a(p%`a!i%`a!W%`a'u%`a#^%`at%`a!]%`a%h%`a!e%`a~P#.{O#i%baP%baR%ba[%baa%bap%ba!Q%ba!Z%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba'x%ba(_%ba(p%ba!i%ba!W%ba'u%ba#^%bat%ba!]%ba%h%ba!e%ba~P#.{O#i{aP{a[{aa{ap{a!j{a!n{a#P{a#l{a#m{a#n{a#o{a#p{a#q{a#r{a#s{a#t{a#u{a#w{a#y{a#z{a'x{a(_{a(p{a!i{a!W{a'u{at{a!]{a%h{a!e{a~P$&dO#i$raP$raR$ra[$raa$rap$ra!Q$ra!j$ra!n$ra#P$ra#l$ra#m$ra#n$ra#o$ra#p$ra#q$ra#r$ra#s$ra#t$ra#u$ra#w$ra#y$ra#z$ra'x$ra(_$ra(p$ra!i$ra!W$ra'u$rat$ra!]$ra%h$ra!e$ra~P$'`O#i$taP$taR$ta[$taa$tap$ta!Q$ta!j$ta!n$ta#P$ta#l$ta#m$ta#n$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#w$ta#y$ta#z$ta'x$ta(_$ta(p$ta!i$ta!W$ta'u$tat$ta!]$ta%h$ta!e$ta~P$(RO#i%SaP%SaR%Sa[%Saa%Sap%Sa!Q%Sa!Z%Sa!j%Sa!n%Sa#P%Sa#l%Sa#m%Sa#n%Sa#o%Sa#p%Sa#q%Sa#r%Sa#s%Sa#t%Sa#u%Sa#w%Sa#y%Sa#z%Sa'x%Sa(_%Sa(p%Sa!i%Sa!W%Sa'u%Sa#^%Sat%Sa!]%Sa%h%Sa!e%Sa~P#.{Oa#aq!Z#aq'x#aq'u#aq!W#aq!i#aqt#aq!]#aq%h#aq!e#aq~P!:TO!Y3dO!Z'WX!i'WX~P%[O!Z.oO!i(ia~O!Z.oO!i(ia~P!:TO!W3gO~O#}!la![!la~PKZO#}!ha!Z!ha![!ha~P#BPO#}!pa![!pa~P!<kO#}!ra![!ra~P!?ROg'ZX!Z'ZX~P!+rO!Z.zOg(na~OSfO!]3{O$c3|O~O![4QO~Ot4RO~P#.{Oa$lq!Z$lq'x$lq'u$lq!W$lq!i$lqt$lq!]$lq%h$lq!e$lq~P!:TO!W4TO~P!&iO!Q4UO~O!O)|O'w)}O(x%POl'ga(w'ga!Z'ga#^'ga~Og'ga#}'ga~P%+uO!O)|O'w)}Ol'ia(w'ia(x'ia!Z'ia#^'ia~Og'ia#}'ia~P%,hO(p$YO~P#.{O!WfX!W$yX!ZfX!Z$yX!e%QX#^fX~P!/qO(R<xO~P!1dO!Q%gO!Y4XO!]%hO(R%fO!Z'cX!i'cX~O!Z/kO!i(|a~O!Z/kO!e#vO!i(|a~O!Z/kO!e#vO(p'nO!i(|a~Og${i!Z${i#^${i#}${i~P!0uO!Y4aO!W'eX!Z'eX~P!3cO!Z/sO!W(}a~O!Z/sO!W(}a~P#.{OP]XR]X[]Xp]X!O]X!Q]X!W]X!Z]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X~O!e%XX#t%XX~P%0XO!e#vO#t4fO~Oh%VO!e#vO!j%dO~Oh%VOp4kO!j%dO(p'nO~Op4pO!e#vO(p'nO~Oq!nO!Q4qO(TTO(WUO(c!mO~O(w$}Ol%`i!O%`i'w%`i(x%`i!Z%`i#^%`i~Og%`i#}%`i~P%3xO(x%POl%bi!O%bi'w%bi(w%bi!Z%bi#^%bi~Og%bi#}%bi~P%4kOg(]i!Z(]i~P!0uO#^4wOg(]i!Z(]i~P!0uO!i4zO~Oa$nq!Z$nq'x$nq'u$nq!W$nq!i$nqt$nq!]$nq%h$nq!e$nq~P!:TO!W5QO~O!Z5RO!])OX~P#.{Oa]Xa$yX!]]X!]$yX%]]X'x]X'x$yX!Z]X!Z$yX~P!/qO%]5UOa%Za!]%Za'x%Za!Z%Za~OlmX!OmX'wmX(wmX(xmX~P%7nOn5VO(R#nO~Ob5]O%i5^O(R+nO(TTO(WUO!Z'rX!['rX~O!Z0}O![)Va~O[5bO~O`5cO~Oa%mO'x%mO~P#.{O!Z5kO#^5mO![)SX~O![5nO~Op5tOq!nO!Q*fO!`!yO!a!vO!b!vO!z;wO#R!pO#S!pO#T!pO#U!pO#V!pO#Y5sO#Z!zO(S!lO(TTO(WUO(c!mO(m!sO~O![5rO~P%:ROl5yO!]1gO%h5xO~Oh%VOl5yO!]1gO%h5xO~Ob6QO(R#nO(TTO(WUO!Z'qX!['qX~O!Z1rO![)Ta~O(TTO(WUO(c6SO~O`6WO~O#t6ZO&Y6[O~PMvO!i6]O~P%[Oa6_O~Oa6_O~P%[Ob2YO![6dO&h2XO~P`O!e6fO~O!e6hOh(hi!Z(hi![(hi!e(hi!j(hip(hi(p(hi~O!Z#fi![#fi~P#BPO#^6iO!Z#fi![#fi~O!Z!_i![!_i~P#BPOa%mO#^6rO'x%mO~Oa%mO!e#vO#^6rO'x%mO~O!Z(rq!i(rqa(rq'x(rq~P!:TO!Z(hO!i(qq~O!Q%gO!]%hO#h6yO(R%fO~O!]'^O%h6|O~Ol7QO!]'^O%h6|O~O#i'gaP'gaR'ga['gaa'gap'ga!Q'ga!j'ga!n'ga#P'ga#l'ga#m'ga#n'ga#o'ga#p'ga#q'ga#r'ga#s'ga#t'ga#u'ga#w'ga#y'ga#z'ga'x'ga(_'ga(p'ga!i'ga!W'ga'u'gat'ga!]'ga%h'ga!e'ga~P%+uO#i'iaP'iaR'ia['iaa'iap'ia!Q'ia!j'ia!n'ia#P'ia#l'ia#m'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#w'ia#y'ia#z'ia'x'ia(_'ia(p'ia!i'ia!W'ia'u'iat'ia!]'ia%h'ia!e'ia~P%,hO#i${iP${iR${i[${ia${ip${i!Q${i!Z${i!j${i!n${i#P${i#l${i#m${i#n${i#o${i#p${i#q${i#r${i#s${i#t${i#u${i#w${i#y${i#z${i'x${i(_${i(p${i!i${i!W${i'u${i#^${it${i!]${i%h${i!e${i~P#.{O#i%`iP%`iR%`i[%`ia%`ip%`i!Q%`i!j%`i!n%`i#P%`i#l%`i#m%`i#n%`i#o%`i#p%`i#q%`i#r%`i#s%`i#t%`i#u%`i#w%`i#y%`i#z%`i'x%`i(_%`i(p%`i!i%`i!W%`i'u%`it%`i!]%`i%h%`i!e%`i~P%3xO#i%biP%biR%bi[%bia%bip%bi!Q%bi!j%bi!n%bi#P%bi#l%bi#m%bi#n%bi#o%bi#p%bi#q%bi#r%bi#s%bi#t%bi#u%bi#w%bi#y%bi#z%bi'x%bi(_%bi(p%bi!i%bi!W%bi'u%bit%bi!]%bi%h%bi!e%bi~P%4kO!Z'Wa!i'Wa~P!:TO!Z.oO!i(ii~O#}#ai!Z#ai![#ai~P#BPOP$[OR#zO!O#yO!Q#{O!j#xO!n$[O(_VO[#kip#ki#P#ki#m#ki#n#ki#o#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#l#ki~P%MQO#l<PO~P%MQOP$[OR#zOp<]O!O#yO!Q#{O!j#xO!n$[O#l<PO#m<QO#n<QO#o<QO(_VO[#ki#P#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#p#ki~P& YO#p<RO~P& YOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO(_VO#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#u#ki~P&#bOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO(_VO(x#}O#y#ki#z#ki#}#ki(p#ki(w#ki!Z#ki![#ki~O#w<VO~P&%cO#w#ki~P&%cO#u<TO~P&#bOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO#w<VO(_VO(w#|O(x#}O#z#ki#}#ki(p#ki!Z#ki![#ki~O#y#ki~P&'rO#y<XO~P&'rOa#{y!Z#{y'x#{y'u#{y!W#{y!i#{yt#{y!]#{y%h#{y!e#{y~P!:TO[#kip#ki#P#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki!Z#ki![#ki~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O#l<PO#m<QO#n<QO#o<QO(_VO(w#ki(x#ki~P&*nOl=}O!O)|O'w)}O(w$}O(x%POP#kiR#ki!Q#ki!j#ki!n#ki#l#ki#m#ki#n#ki#o#ki(_#ki~P&*nO#Q$dOP(^XR(^X[(^Xl(^Xp(^X!O(^X!Q(^X!j(^X!n(^X#P(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#s(^X#t(^X#u(^X#w(^X#y(^X#z(^X#}(^X'w(^X(_(^X(p(^X(w(^X(x(^X!Z(^X![(^X~O#}$Oi!Z$Oi![$Oi~P#BPO#}!pi![!pi~P$*OOg'Za!Z'Za~P!0uO![7dO~O!Z'ba!['ba~P#BPO!W7eO~P#.{O!e#vO(p'nO!Z'ca!i'ca~O!Z/kO!i(|i~O!Z/kO!e#vO!i(|i~Og${q!Z${q#^${q#}${q~P!0uO!W'ea!Z'ea~P#.{O!e7lO~O!Z/sO!W(}i~P#.{O!Z/sO!W(}i~O!W7oO~Oh%VOp7tO!j%dO(p'nO~O!e#vO#t7vO~Op7yO!e#vO(p'nO~O!O)|O'w)}O(x%POl'ha(w'ha!Z'ha#^'ha~Og'ha#}'ha~P&3oO!O)|O'w)}Ol'ja(w'ja(x'ja!Z'ja#^'ja~Og'ja#}'ja~P&4bO!W7{O~Og$}q!Z$}q#^$}q#}$}q~P!0uOg(]q!Z(]q~P!0uO#^7|Og(]q!Z(]q~P!0uOa$ny!Z$ny'x$ny'u$ny!W$ny!i$nyt$ny!]$ny%h$ny!e$ny~P!:TO!e6hO~O!Z5RO!])Oa~O!]'^OP$SaR$Sa[$Sap$Sa!O$Sa!Q$Sa!Z$Sa!j$Sa!n$Sa#P$Sa#l$Sa#m$Sa#n$Sa#o$Sa#p$Sa#q$Sa#r$Sa#s$Sa#t$Sa#u$Sa#w$Sa#y$Sa#z$Sa(_$Sa(p$Sa(w$Sa(x$Sa~O%h6|O~P&7SO%]8QOa%Zi!]%Zi'x%Zi!Z%Zi~Oa#ay!Z#ay'x#ay'u#ay!W#ay!i#ayt#ay!]#ay%h#ay!e#ay~P!:TO[8SO~Ob8UO(R+nO(TTO(WUO~O!Z0}O![)Vi~O`8YO~O(c(zO!Z'nX!['nX~O!Z5kO![)Sa~O![8cO~P%:RO(m!sO~P$$oO#Y8dO~O!]1gO~O!]1gO%h8fO~Ol8iO!]1gO%h8fO~O[8nO!Z'qa!['qa~O!Z1rO![)Ti~O!i8rO~O!i8sO~O!i8vO~O!i8vO~P%[Oa8xO~O!e8yO~O!i8zO~O!Z(ui![(ui~P#BPOa%mO#^9SO'x%mO~O!Z(ry!i(rya(ry'x(ry~P!:TO!Z(hO!i(qy~O%h9VO~P&7SO!]'^O%h9VO~O#i${qP${qR${q[${qa${qp${q!Q${q!Z${q!j${q!n${q#P${q#l${q#m${q#n${q#o${q#p${q#q${q#r${q#s${q#t${q#u${q#w${q#y${q#z${q'x${q(_${q(p${q!i${q!W${q'u${q#^${qt${q!]${q%h${q!e${q~P#.{O#i'haP'haR'ha['haa'hap'ha!Q'ha!j'ha!n'ha#P'ha#l'ha#m'ha#n'ha#o'ha#p'ha#q'ha#r'ha#s'ha#t'ha#u'ha#w'ha#y'ha#z'ha'x'ha(_'ha(p'ha!i'ha!W'ha'u'hat'ha!]'ha%h'ha!e'ha~P&3oO#i'jaP'jaR'ja['jaa'jap'ja!Q'ja!j'ja!n'ja#P'ja#l'ja#m'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#w'ja#y'ja#z'ja'x'ja(_'ja(p'ja!i'ja!W'ja'u'jat'ja!]'ja%h'ja!e'ja~P&4bO#i$}qP$}qR$}q[$}qa$}qp$}q!Q$}q!Z$}q!j$}q!n$}q#P$}q#l$}q#m$}q#n$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#w$}q#y$}q#z$}q'x$}q(_$}q(p$}q!i$}q!W$}q'u$}q#^$}qt$}q!]$}q%h$}q!e$}q~P#.{O!Z'Wi!i'Wi~P!:TO#}#aq!Z#aq![#aq~P#BPO(w$}OP%`aR%`a[%`ap%`a!Q%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a#}%`a(_%`a(p%`a!Z%`a![%`a~Ol%`a!O%`a'w%`a(x%`a~P&HgO(x%POP%baR%ba[%bap%ba!Q%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba#}%ba(_%ba(p%ba!Z%ba![%ba~Ol%ba!O%ba'w%ba(w%ba~P&JnOl=}O!O)|O'w)}O(x%PO~P&HgOl=}O!O)|O'w)}O(w$}O~P&JnOR0cO!O0cO!Q0dO#Q$dOP{a[{al{ap{a!j{a!n{a#P{a#l{a#m{a#n{a#o{a#p{a#q{a#r{a#s{a#t{a#u{a#w{a#y{a#z{a#}{a'w{a(_{a(p{a(w{a(x{a!Z{a![{a~O!O)|O'w)}OP$raR$ra[$ral$rap$ra!Q$ra!j$ra!n$ra#P$ra#l$ra#m$ra#n$ra#o$ra#p$ra#q$ra#r$ra#s$ra#t$ra#u$ra#w$ra#y$ra#z$ra#}$ra(_$ra(p$ra(w$ra(x$ra!Z$ra![$ra~O!O)|O'w)}OP$taR$ta[$tal$tap$ta!Q$ta!j$ta!n$ta#P$ta#l$ta#m$ta#n$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#w$ta#y$ta#z$ta#}$ta(_$ta(p$ta(w$ta(x$ta!Z$ta![$ta~Ol=}O!O)|O'w)}O(w$}O(x%PO~OP%SaR%Sa[%Sap%Sa!Q%Sa!j%Sa!n%Sa#P%Sa#l%Sa#m%Sa#n%Sa#o%Sa#p%Sa#q%Sa#r%Sa#s%Sa#t%Sa#u%Sa#w%Sa#y%Sa#z%Sa#}%Sa(_%Sa(p%Sa!Z%Sa![%Sa~P'%sO#}$lq!Z$lq![$lq~P#BPO#}$nq!Z$nq![$nq~P#BPO![9dO~O#}9eO~P!0uO!e#vO!Z'ci!i'ci~O!e#vO(p'nO!Z'ci!i'ci~O!Z/kO!i(|q~O!W'ei!Z'ei~P#.{O!Z/sO!W(}q~Op9lO!e#vO(p'nO~O[9nO!W9mO~P#.{O!W9mO~O!e#vO#t9tO~Og(]y!Z(]y~P!0uO!Z'la!]'la~P#.{Oa%Zq!]%Zq'x%Zq!Z%Zq~P#.{O[9yO~O!Z0}O![)Vq~O#^9}O!Z'na!['na~O!Z5kO![)Si~P#BPO!Q:PO~O!]1gO%h:SO~O(TTO(WUO(c:XO~O!Z1rO![)Tq~O!i:[O~O!i:]O~O!i:^O~O!i:^O~P%[O#^:aO!Z#fy![#fy~O!Z#fy![#fy~P#BPO%h:fO~P&7SO!]'^O%h:fO~O#}#{y!Z#{y![#{y~P#BPOP${iR${i[${ip${i!Q${i!j${i!n${i#P${i#l${i#m${i#n${i#o${i#p${i#q${i#r${i#s${i#t${i#u${i#w${i#y${i#z${i#}${i(_${i(p${i!Z${i![${i~P'%sO!O)|O'w)}O(x%POP'gaR'ga['gal'gap'ga!Q'ga!j'ga!n'ga#P'ga#l'ga#m'ga#n'ga#o'ga#p'ga#q'ga#r'ga#s'ga#t'ga#u'ga#w'ga#y'ga#z'ga#}'ga(_'ga(p'ga(w'ga!Z'ga!['ga~O!O)|O'w)}OP'iaR'ia['ial'iap'ia!Q'ia!j'ia!n'ia#P'ia#l'ia#m'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#w'ia#y'ia#z'ia#}'ia(_'ia(p'ia(w'ia(x'ia!Z'ia!['ia~O(w$}OP%`iR%`i[%`il%`ip%`i!O%`i!Q%`i!j%`i!n%`i#P%`i#l%`i#m%`i#n%`i#o%`i#p%`i#q%`i#r%`i#s%`i#t%`i#u%`i#w%`i#y%`i#z%`i#}%`i'w%`i(_%`i(p%`i(x%`i!Z%`i![%`i~O(x%POP%biR%bi[%bil%bip%bi!O%bi!Q%bi!j%bi!n%bi#P%bi#l%bi#m%bi#n%bi#o%bi#p%bi#q%bi#r%bi#s%bi#t%bi#u%bi#w%bi#y%bi#z%bi#}%bi'w%bi(_%bi(p%bi(w%bi!Z%bi![%bi~O#}$ny!Z$ny![$ny~P#BPO#}#ay!Z#ay![#ay~P#BPO!e#vO!Z'cq!i'cq~O!Z/kO!i(|y~O!W'eq!Z'eq~P#.{Op:pO!e#vO(p'nO~O[:tO!W:sO~P#.{O!W:sO~Og(]!R!Z(]!R~P!0uOa%Zy!]%Zy'x%Zy!Z%Zy~P#.{O!Z0}O![)Vy~O!Z5kO![)Sq~O(R:zO~O!]1gO%h:}O~O!i;QO~O%h;VO~P&7SOP${qR${q[${qp${q!Q${q!j${q!n${q#P${q#l${q#m${q#n${q#o${q#p${q#q${q#r${q#s${q#t${q#u${q#w${q#y${q#z${q#}${q(_${q(p${q!Z${q![${q~P'%sO!O)|O'w)}O(x%POP'haR'ha['hal'hap'ha!Q'ha!j'ha!n'ha#P'ha#l'ha#m'ha#n'ha#o'ha#p'ha#q'ha#r'ha#s'ha#t'ha#u'ha#w'ha#y'ha#z'ha#}'ha(_'ha(p'ha(w'ha!Z'ha!['ha~O!O)|O'w)}OP'jaR'ja['jal'jap'ja!Q'ja!j'ja!n'ja#P'ja#l'ja#m'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#w'ja#y'ja#z'ja#}'ja(_'ja(p'ja(w'ja(x'ja!Z'ja!['ja~OP$}qR$}q[$}qp$}q!Q$}q!j$}q!n$}q#P$}q#l$}q#m$}q#n$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#w$}q#y$}q#z$}q#}$}q(_$}q(p$}q!Z$}q![$}q~P'%sOg%d!Z!Z%d!Z#^%d!Z#}%d!Z~P!0uO!W;ZO~P#.{Op;[O!e#vO(p'nO~O[;^O!W;ZO~P#.{O!Z'nq!['nq~P#BPO!Z#f!Z![#f!Z~P#BPO#i%d!ZP%d!ZR%d!Z[%d!Za%d!Zp%d!Z!Q%d!Z!Z%d!Z!j%d!Z!n%d!Z#P%d!Z#l%d!Z#m%d!Z#n%d!Z#o%d!Z#p%d!Z#q%d!Z#r%d!Z#s%d!Z#t%d!Z#u%d!Z#w%d!Z#y%d!Z#z%d!Z'x%d!Z(_%d!Z(p%d!Z!i%d!Z!W%d!Z'u%d!Z#^%d!Zt%d!Z!]%d!Z%h%d!Z!e%d!Z~P#.{Op;fO!e#vO(p'nO~O!W;gO~P#.{Op;nO!e#vO(p'nO~O!W;oO~P#.{OP%d!ZR%d!Z[%d!Zp%d!Z!Q%d!Z!j%d!Z!n%d!Z#P%d!Z#l%d!Z#m%d!Z#n%d!Z#o%d!Z#p%d!Z#q%d!Z#r%d!Z#s%d!Z#t%d!Z#u%d!Z#w%d!Z#y%d!Z#z%d!Z#}%d!Z(_%d!Z(p%d!Z!Z%d!Z![%d!Z~P'%sOp;rO!e#vO(p'nO~Ot(dX~P1qO!O%qO~P!(yO(S!lO~P!(yO!WfX!ZfX#^fX~P%0XOP]XR]X[]Xp]X!O]X!Q]X!Z]X!ZfX!j]X!n]X#P]X#Q]X#^]X#^fX#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X~O!efX!i]X!ifX(pfX~P'JlOP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]XO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(R)ZO(TTO(WUO(_VO(m[O~O!Z<ZO![$pa~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<fO!Q${O!]$|O!g=wO!j$xO#h<lO$V%_O$s<hO$u<jO$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~Oj)bO~P( bOp!cX(p!cX~P# qOp(hX(p(hX~P#!dO![]X![fX~P'JlO!WfX!W$yX!ZfX!Z$yX#^fX~P!/qO#i<OO~O!e#vO#i<OO~O#^<`O~O#t<SO~O#^<pO!Z(uX![(uX~O#^<`O!Z(sX![(sX~O#i<qO~Og<sO~P!0uO#i<yO~O#i<zO~O!e#vO#i<{O~O!e#vO#i<qO~O#}<|O~P#BPO#i<}O~O#i=OO~O#i=TO~O#i=UO~O#i=VO~O#i=WO~O#}=XO~P!0uO#}=YO~P!0uO#Q#R#S#U#V#Y#g#h#s$m$s$u$x%[%]%g%h%i%p%r%u%v%x%z~'|T#m!V'z(S#nq#l#op!O'{$['{(R$^(c~",goto:"$8f)ZPPPPPP)[PP)_P)pP+Q/VPPPP6aPP6wPP<oP@cP@yP@yPPP@yPCRP@yP@yP@yPCVPC[PCyPHsPPPHwPPPPHwKzPPPLQLrPHwPHwPP! QHwPPPHwPHwP!#XHwP!&o!'t!'}P!(q!(u!(q!,SPPPPPPP!,s!'tPP!-T!.uP!2RHwHw!2W!5d!:Q!:Q!>PPPP!>XHwPPPPPPPPPP!AhP!BuPPHw!DWPHwPHwHwHwHwHwPHw!EjP!HtP!KzP!LO!LY!L^!L^P!HqP!Lb!LbP# hP# lHwPHw# r#$wCV@yP@yP@y@yP#&U@y@y#(h@y#+`@y#-l@y@y#.[#0p#0p#0u#1O#0p#1ZPP#0pP@y#1s@y#5r@y@y6aPPP#9wPPP#:b#:bP#:bP#:x#:bPP#;OP#:uP#:u#;c#:u#;}#<T#<W)_#<Z)_P#<b#<b#<bP)_P)_P)_P)_PP)_P#<h#<kP#<k)_P#<oP#<rP)_P)_P)_P)_P)_P)_)_PP#<x#=O#=Z#=a#=g#=m#=s#>R#>X#>c#>i#>s#>y#?Z#?a#@R#@e#@k#@q#AP#Af#CZ#Ci#Cp#E[#Ej#G[#Gj#Gp#Gv#G|#HW#H^#Hd#Hn#IQ#IWPPPPPPPPPPP#I^PPPPPPP#JR#MY#Nr#Ny$ RPPP$&mP$&v$)o$0Y$0]$0`$1_$1b$1i$1qP$1w$1zP$2h$2l$3d$4r$4w$5_PP$5d$5j$5n$5q$5u$5y$6u$7^$7u$7y$7|$8P$8V$8Y$8^$8bR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R<m;z%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y,k,n,s-d-l-z.Q.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3d4q5y6Z6[6_6r8i8x9SS#q];w!r)]$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sU*{%[<e<fQ+q&OQ,a&eQ,h&mQ0r+dQ0u+fQ1S+rQ1y,fQ3W.bQ5V0wQ5]0}Q6Q1rQ7O3[Q8U5^R9Y7Q'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s!S!nQ!r!v!y!z$|'U']'^'j'k'l*h*l*n*o-W-^-`-p0U0X1g5q5s%[$ti#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}Q&V|Q'S!eS'Y%h-ZQ+q&OQ,a&eQ0f+OQ1S+rQ1X+xQ1x,eQ1y,fQ5]0}Q5f1ZQ6Q1rQ6T1tQ6U1wQ8U5^Q8X5cQ8q6WQ9|8YQ:Y8nR<o*XrnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VR,c&i&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=r=s[#]WZ#W#Z'V(R!b%im#h#i#l$x%d%g([(f(g(h*W*[*_+W+X+Z,j-Q.O.U.V.W.Y/h/k2[3S3T4X6h6yQ%vxQ%zyS&P|&UQ&]!TQ'a!hQ'c!iQ(o#sS+k%{%|Q+o&OQ,Y&`Q,^&bS-g'd'eQ.d(pQ0{+lQ1R+rQ1T+sQ1W+wQ1l,ZS1p,_,`Q2t-hQ5[0}Q5`1QQ5e1YQ6P1qQ8T5^Q8W5bQ9x8SR:w9y!U$zi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y!^%xy!i!u%z%{%|'T'c'd'e'i's*g+k+l-T-g-h-o/{0O0{2m2t2{4i4j4m7s9pQ+e%vQ,O&YQ,R&ZQ,]&bQ.c(oQ1k,YU1o,^,_,`Q3].dQ5z1lS6O1p1qQ8m6P#f=t#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}o=u<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YW%Ti%V*v=pS&Y!Q&gQ&Z!RQ&[!SQ+S%cR+|&W%]%Si#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}T)x$u)yV*{%[<e<fW'Y!e%h*X-ZS({#y#zQ+`%qQ+v&RS.](k(lQ1b,SQ4x0cR8^5k'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s$i$^c#Y#e%p%r%t(Q(W(r(w)P)Q)R)S)T)U)V)W)X)Y)[)^)`)e)o+a+u-U-s-x-}.P.n.q.u.w.x.y/]0j2c2f2v2}3c3h3i3j3k3l3m3n3o3p3q3r3s3t3w3x4P5O5Y6k6q6v7V7W7a7b8`8|9Q9[9b9c:c:y;R;x=gT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ'W!eR2i-W!W!nQ!e!r!v!y!z$|'U']'^'j'k'l*X*h*l*n*o-W-^-`-p0U0X1g5q5sR1d,UnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&w!^Q't!xS(q#u<OQ+i%yQ,W&]Q,X&_Q-e'bQ-r'mS.m(v<qS0k+U<{Q0y+jQ1f,VQ2Z,uQ2],vQ2e-RQ2r-fQ2u-jS5P0l=VQ5W0zS5Z0|=WQ6j2gQ6n2sQ6s2zQ8R5XQ8}6lQ9O6oQ9R6tR:`8z$d$]c#Y#e%r%t(Q(W(r(w)P)Q)R)S)T)U)V)W)X)Y)[)^)`)e)o+a+u-U-s-x-}.P.n.q.u.x.y/]0j2c2f2v2}3c3h3i3j3k3l3m3n3o3p3q3r3s3t3w3x4P5O5Y6k6q6v7V7W7a7b8`8|9Q9[9b9c:c:y;R;x=gS(m#p'gQ(}#zS+_%p.wS.^(l(nR3U._'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sS#q];wQ&r!XQ&s!YQ&u![Q&v!]R2R,qQ'_!hQ+b%vQ-c'aS.`(o+eQ2p-bW3Y.c.d0q0sQ6m2qW6z3V3X3]5TU9U6{6}7PU:e9W9X9ZS;T:d:gQ;b;UR;j;cU!wQ'^-`T5o1g5q!Q_OXZ`st!V!Z#d#h%d%l&g&i&p&r&s&u(h,n,s.V2S2V]!pQ!r'^-`1g5qT#q];w%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SS({#y#zS.](k(l!s=^$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sU$fd)],hS(n#p'gU*s%R(u3vU0e*z.i7]Q5T0rQ6{3WQ9X7OR:g9Ym!tQ!r!v!y!z'^'j'k'l-`-p1g5q5sQ'r!uS(d#g1|S-n'i'uQ/n*ZQ/{*gQ2|-qQ4]/oQ4i/}Q4j0OQ4o0WQ7h4WS7s4k4mS7w4p4rQ9g7iQ9k7oQ9p7tQ9u7yS:o9l9mS;Y:p:sS;e;Z;[S;m;f;gS;q;n;oR;t;rQ#wbQ'q!uS(c#g1|S(e#m+TQ+V%eQ+g%wQ+m%}U-m'i'r'uQ.R(dQ/m*ZQ/|*gQ0P*iQ0x+hQ1m,[S2y-n-qQ3R.ZS4[/n/oQ4e/yS4h/{0WQ4l0QQ5|1nQ6u2|Q7g4WQ7k4]U7r4i4o4rQ7u4nQ8k5}S9f7h7iQ9j7oQ9r7wQ9s7xQ:V8lQ:m9gS:n9k9mQ:v9uQ;P:WS;X:o:sS;d;Y;ZS;l;e;gS;p;m;oQ;s;qQ;u;tQ=a=[Q=l=eR=m=fV!wQ'^-`%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SS#wz!j!r=Z$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sR=a=r%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SQ%ej!^%wy!i!u%z%{%|'T'c'd'e'i's*g+k+l-T-g-h-o/{0O0{2m2t2{4i4j4m7s9pS%}z!jQ+h%xQ,[&bW1n,],^,_,`U5}1o1p1qS8l6O6PQ:W8m!r=[$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ=e=qR=f=r%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SY#bWZ#W#Z(R!b%im#h#i#l$x%d%g([(f(g(h*W*[*_+W+X+Z,j-Q.O.U.V.W.Y/h/k2[3S3T4X6h6yQ,i&m!p=]$Z$n)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sR=`'VU'Z!e%h*XR2k-Z%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y,k,n,s-d-l-z.Q.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3d4q5y6Z6[6_6r8i8x9S!r)]$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ,h&mQ0r+dQ3W.bQ7O3[R9Y7Q!b$Tc#Y%p(Q(W(r(w)X)Y)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;x!P<U)[)o-U.w2c2f3h3q3r3w4P6k7W7a7b8`8|9[9b9c:y;R=g!f$Vc#Y%p(Q(W(r(w)U)V)X)Y)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;x!T<W)[)o-U.w2c2f3h3n3o3q3r3w4P6k7W7a7b8`8|9[9b9c:y;R=g!^$Zc#Y%p(Q(W(r(w)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;xQ4V/fz=s)[)o-U.w2c2f3h3w4P6k7W7a7b8`8|9[9b9c:y;R=gQ=x=zR=y={'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sS$oh$pR3|/P'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/P/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sT$kf$qQ$ifS)h$l)lR)t$qT$jf$qT)j$l)l'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/P/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sT$oh$pQ$rhR)s$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9S!s=q$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s#glOPXZst!Z!`!o#S#d#o#{$n%l&i&l&m&p&r&s&u&y'R'`(|)q*f+Y+d,k,n,s-d.b/Q/i0V0d1j1z1{1}2P2S2V2X3[3{4q5y6Z6[6_7Q8i8x!U%Ri$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y#f(u#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}Q+P%`Q/^)|o3v<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!U$yi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=yQ*`$zU*i$|*X*lQ+Q%aQ0Q*j#f=c#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n=d<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YQ=h=tQ=i=uQ=j=vR=k=w!U%Ri$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y#f(u#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}o3v<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YnoOXst!Z#d%l&p&r&s&u,n,s2S2VS*c${*WQ,|&|Q,}'OR4`/s%[%Si#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}Q,P&ZQ1`,RQ5i1_R8]5jV*k$|*X*lU*k$|*X*lT5p1g5qS/y*f/iQ4n0VT7x4q:PQ+g%wQ0P*iQ0x+hQ1m,[Q5|1nQ8k5}Q:V8lR;P:W!U%Oi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=yx*P$v)c*Q*r+R/q0^0_3y4^4{4|4}7f7z9v:l=b=n=oS0Y*q0Z#f<a#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n<b<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!d<t(s)a*Y*b.e.h.l/Y/f/v0p1]3`4S4_4c5h7R7U7m7p7}8P9i9q9w:q:u;W;];h=z={`<u3u7X7[7`9]:h:k;kS=P.g3aT=Q7Z9`!U%Qi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y|*R$v)c*S*q+R/b/q0^0_3y4^4s4{4|4}7f7z9v:l=b=n=oS0[*r0]#f<c#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n<d<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!h<v(s)a*Y*b.f.g.l/Y/f/v0p1]3^3`4S4_4c5h7R7S7U7m7p7}8P9i9q9w:q:u;W;];h=z={d<w3u7Y7Z7`9]9^:h:i:k;kS=R.h3bT=S7[9arnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VQ&d!UR,k&mrnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VR&d!UQ,T&[R1[+|snOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VQ1h,YS5w1k1lU8e5u5v5zS:R8g8hS:{:Q:TQ;_:|R;i;`Q&k!VR,d&gR6T1tR:Y8nS&P|&UR1T+sQ&p!WR,n&qR,t&vT2T,s2VR,x&wQ,w&wR2^,xQ'w!{R-t'wSsOtQ#dXT%os#dQ#OTR'y#OQ#RUR'{#RQ)y$uR/Z)yQ#UVR(O#UQ#XWU(U#X(V-{Q(V#YR-{(WQ-X'WR2j-XQ.p(wS3e.p3fR3f.qQ-`'^R2n-`Y!rQ'^-`1g5qR'h!rQ.{)cR3z.{U#_W%g*WU(]#_(^-|Q(^#`R-|(XQ-['ZR2l-[t`OXst!V!Z#d%l&g&i&p&r&s&u,n,s2S2VS#hZ%dU#r`#h.VR.V(hQ(i#jQ.S(eW.[(i.S3P6wQ3P.TR6w3QQ)l$lR/R)lQ$phR)r$pQ$`cU)_$`-w<[Q-w;xR<[)oQ/l*ZW4Y/l4Z7j9hU4Z/m/n/oS7j4[4]R9h7k$e*O$v(s)a)c*Y*b*q*r*|*}+R.g.h.j.k.l/Y/b/d/f/q/v0^0_0p1]3^3_3`3u3y4S4^4_4c4s4u4{4|4}5h7R7S7T7U7Z7[7^7_7`7f7m7p7z7}8P9]9^9_9i9q9v9w:h:i:j:k:l:q:u;W;];h;k=b=n=o=z={Q/t*bU4b/t4d7nQ4d/vR7n4cS*l$|*XR0S*lx*Q$v)c*q*r+R/q0^0_3y4^4{4|4}7f7z9v:l=b=n=o!d.e(s)a*Y*b.g.h.l/Y/f/v0p1]3`4S4_4c5h7R7U7m7p7}8P9i9q9w:q:u;W;];h=z={U/c*Q.e7Xa7X3u7Z7[7`9]:h:k;kQ0Z*qQ3a.gU4t0Z3a9`R9`7Z|*S$v)c*q*r+R/b/q0^0_3y4^4s4{4|4}7f7z9v:l=b=n=o!h.f(s)a*Y*b.g.h.l/Y/f/v0p1]3^3`4S4_4c5h7R7S7U7m7p7}8P9i9q9w:q:u;W;];h=z={U/e*S.f7Ye7Y3u7Z7[7`9]9^:h:i:k;kQ0]*rQ3b.hU4v0]3b9aR9a7[Q*w%UR0a*wQ5S0pR8O5SQ+[%jR0o+[Q5l1bS8_5l:OR:O8`Q,V&]R1e,VQ5q1gR8b5qQ1s,aS6R1s8oR8o6TQ1O+oW5_1O5a8V9zQ5a1RQ8V5`R9z8WQ+t&PR1U+tQ2V,sR6c2VYrOXst#dQ&t!ZQ+^%lQ,m&pQ,o&rQ,p&sQ,r&uQ2Q,nS2T,s2VR6b2SQ%npQ&x!_Q&{!aQ&}!bQ'P!cQ'o!uQ+]%kQ+i%yQ+{&VQ,c&kQ,z&zW-k'i'q'r'uQ-r'mQ0R*kQ0y+jS1v,d,gQ2_,yQ2`,|Q2a,}Q2u-jW2w-m-n-q-sQ5W0zQ5d1XQ5g1]Q5{1mQ6V1xQ6a2RU6p2v2y2|Q6s2zQ8R5XQ8Z5fQ8[5hQ8a5pQ8j5|Q8p6US9P6q6uQ9R6tQ9{8XQ:U8kQ:Z8qQ:b9QQ:x9|Q;O:VQ;S:cR;a;PQ%yyQ'b!iQ'm!uU+j%z%{%|Q-R'TU-f'c'd'eS-j'i'sQ/z*gS0z+k+lQ2g-TS2s-g-hQ2z-oS4g/{0OQ5X0{Q6l2mQ6o2tQ6t2{U7q4i4j4mQ9o7sR:r9pS$wi=pR*x%VU%Ui%V=pR0`*vQ$viS(s#v+fS)a$b$cQ)c$dQ*Y$xS*b${*WQ*q%OQ*r%QQ*|%]Q*}%^Q+R%bQ.g<aQ.h<cQ.j<gQ.k<iQ.l<kQ/Y)wQ/b*PQ/d*RQ/f*TQ/q*^S/v*d/hQ0^*tQ0_*ul0p+c,Q.a1a1i3Z5x6|8f9V:S:f:};VQ1]+}Q3^<tQ3_<vQ3`<yS3u<^<_Q3y.zS4S/_4UQ4^/rQ4_/sQ4c/uQ4s0YQ4u0[Q4{0gQ4|0hQ4}0iQ5h1^Q7R<}Q7S=PQ7T=RQ7U=TQ7Z<bQ7[<dQ7^<hQ7_<jQ7`<lQ7f4VQ7m4aQ7p4fQ7z4wQ7}5RQ8P5UQ9]<zQ9^<uQ9_<wQ9i7lQ9q7vQ9v7|Q9w8QQ:h=OQ:i=QQ:j=SQ:k=UQ:l9eQ:q9nQ:u9tQ;W=XQ;]:tQ;h;^Q;k=YQ=b=pQ=n=xQ=o=yQ=z=|R={=}Q*z%[Q.i<eR7]<fnpOXst!Z#d%l&p&r&s&u,n,s2S2VQ!fPS#fZ#oQ&z!`W'f!o*f0V4qQ'}#SQ)O#{Q)p$nS,g&i&lQ,l&mQ,y&yS-O'R/iQ-b'`Q.s(|Q/V)qQ0m+YQ0s+dQ2O,kQ2q-dQ3X.bQ4O/QQ4y0dQ5v1jQ6X1zQ6Y1{Q6^1}Q6`2PQ6e2XQ7P3[Q7c3{Q8h5yQ8t6ZQ8u6[Q8w6_Q9Z7QQ:T8iR:_8x#[cOPXZst!Z!`!o#d#o#{%l&i&l&m&p&r&s&u&y'R'`(|*f+Y+d,k,n,s-d.b/i0V0d1j1z1{1}2P2S2V2X3[4q5y6Z6[6_7Q8i8xQ#YWQ#eYQ%puQ%rvS%tw!gS(Q#W(TQ(W#ZQ(r#uQ(w#xQ)P$OQ)Q$PQ)R$QQ)S$RQ)T$SQ)U$TQ)V$UQ)W$VQ)X$WQ)Y$XQ)[$ZQ)^$_Q)`$aQ)e$eW)o$n)q/Q3{Q+a%sQ+u&QS-U'V2hQ-s'pS-x(R-zQ-}(ZQ.P(bQ.n(vQ.q(xQ.u;vQ.w;yQ.x;zQ.y;}Q/]){Q0j+UQ2c-PQ2f-SQ2v-lQ2}.QQ3c.oQ3h<OQ3i<PQ3j<QQ3k<RQ3l<SQ3m<TQ3n<UQ3o<VQ3p<WQ3q<XQ3r<YQ3s.vQ3t<]Q3w<`Q3x<mQ4P<ZQ5O0lQ5Y0|Q6k<pQ6q2xQ6v3OQ7V3dQ7W<qQ7a<sQ7b<{Q8`5mQ8|6iQ9Q6rQ9[<|Q9b=VQ9c=WQ:c9SQ:y9}Q;R:aQ;x#SR=g=sR#[WR'X!el!tQ!r!v!y!z'^'j'k'l-`-p1g5q5sS'T!e-WU*g$|*X*lS-T'U']S0O*h*nQ0W*oQ2m-^Q4m0UR4r0XR(y#xQ!fQT-_'^-`]!qQ!r'^-`1g5qQ#p]R'g;wR)d$dY!uQ'^-`1g5qQ'i!rS's!v!yS'u!z5sS-o'j'kQ-q'lR2{-pT#kZ%dS#jZ%dS%jm,jU(e#h#i#lS.T(f(gQ.X(hQ0n+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c&gtmOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList const 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 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 asserts 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:378,context:Oi,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,276],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_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Up(X!b'z0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(V#S$h&j'{0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Up(X!b'{0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!n),Q(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(T':f$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(X!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Up(X!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$h&j(Up(X!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$h&j(X!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(X!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(UpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(UpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Up(X!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$h&j(m%1l(Up(X!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$h&j(Up(X!b$[#t(R,2j(c$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+dHRk$h&j(Up(X!b$[#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$h&j(Up(X!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$h&j$P(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(x+JY$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$h&j#y(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(W';W$h&j(UpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$h&j(UpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$h&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$c`$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(UpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$c`(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!j/.^$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!i!Lf$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$h&j(Up(X!b(S%&f#o(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$h&j(Up(X!b#l(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$h&j(Up(X!bp+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!Z+Jf$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$h&j(Up(X!b!O.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_!Y!L^$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$h&j(Up(X!b#m(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$h&j(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$h&j(X!b!V7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$h&j!V7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$h&j!V7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!V7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!V7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$h&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$h&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$h&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$h&j(X!b!V7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(X!b!V7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(X!b!V7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(X!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(X!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$h&j(Up!V7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$h&j(Up!V7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Up!V7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Up!V7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(UpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$h&j(UpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$h&j(Up(X!b!V7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Up(X!b!V7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Up(X!b!V7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Up(X!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$h&j(Up(X!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$h&j(Up(X!b'|0/l!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$h&j(Up(X!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$h&j(X!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$h&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(X!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$h&j(UpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(UpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Up(X!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$h&j$P(Ch(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Y#t$h&j(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!e$b$h&j#})Lv(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#P-<U(Up(X!b$m7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$j&j(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#p(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$P(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#q(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#^*!Y$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#i(Cl$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#q(Ch$e#|$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#q(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#p(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#p(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(p(Ct$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$h&j#z(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!z$Ip$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!Q0,v$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$h&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$h&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$h&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$h&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$h&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!W#)l$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#w(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$h&j(Up(X!b(_+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$h&j(Up(X!b(R,2j$^#t(c$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$h&j(Up(X!b$^#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!]#Hb(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(w+JY$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_![(CdtBr$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!o7`$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Up(X!b'z0/l$[#t(R,2j(c$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%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$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(Up(X!b'{0/l$[#t(R,2j(c$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:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new nO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOv~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!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(a~~",141,338),new nO("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:e=>li[e]||-1},{term:341,get:e=>ni[e]||-1},{term:93,get:e=>oi[e]||-1}],tokenPrec:15116}),tt=[g("function ${name}(${params}) {\n	${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n	${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n	${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n	${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try {
+import{S as wt,i as Tt,s as vt,h as qt,k as Rt,a1 as OO,n as _t,I as IO,v as jt,O as Yt,T as Vt,U as Wt,Q as Ut,J as Gt,y as zt}from"./index-DCriA6MP.js";import{P as Ct,N as Et,w as At,D as Mt,x as jO,T as tO,I as YO,y as I,z as n,A as Lt,L as D,B as J,F as Y,G as K,H as VO,J as F,v as z,K as _e,M as Bt,O as Nt,Q as je,R as Ye,U as Ve,E as j,V as We,W as g,X as It,Y as Dt,b as C,e as Jt,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 la,c as na,d as oa,s as Qa,h as ca,a as pa,p as ha,q as DO,C as eO}from"./index-CEH5UG_e.js";var JO={};class sO{constructor(O,t,a,r,s,i,l,o,c,h=0,Q){this.p=O,this.stack=t,this.state=a,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=c,this.lookAhead=h,this.parent=Q}toString(){return`[${this.stack.filter((O,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,t,a=0){let r=O.parser.context;return new sO(O,[],t,a,a,0,[],0,r?new KO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var t;let a=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos<this.pos-25;i&&this.setLookAhead(this.pos);let l=s.dynamicPrecedence(r);if(l&&(this.score+=l),a==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 o=this.stack.length-(a-1)*3-(O&262144?6:0),c=o?this.stack[o-2]:this.p.ranges[0].from,h=this.reducePos-c;h>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=h));let Q=o?this.stack[o-1]:0,f=this.bufferBase+this.buffer.length-Q;if(r<s.minRepeatTerm||O&131072){let p=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,p,f+4,!0)}if(O&262144)this.state=this.stack[o];else{let p=this.stack[o-3];this.state=s.getGoto(p,r,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(r,c)}storeNode(O,t,a,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let i=this,l=this.buffer.length;if(l==0&&i.parent&&(l=i.bufferBase-i.parent.bufferBase,i=i.parent),l>0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(t==a)return;if(i.buffer[l-2]>=t){i.buffer[l-2]=a;return}}}if(!s||this.pos==a)this.buffer.push(O,t,a,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let o=i;o>0&&this.buffer[o-2]>a;o-=4)if(this.buffer[o-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>a;)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]=t,this.buffer[i+2]=a,this.buffer[i+3]=r}}shift(O,t,a,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(t,a),t<=this.p.parser.maxNode&&this.buffer.push(t,a,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||t<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,a),this.shiftContext(t,a),t<=i.maxNode&&this.buffer.push(t,a,r,4)}}apply(O,t,a,r){O&65536?this.reduce(O):this.shift(O,t,a,r)}useNode(O,t){let a=this.p.reused.length-1;(a<0||this.p.reused[a]!=O)&&(this.p.reused.push(O),a++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(t,r),this.buffer.push(a,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,t=O.buffer.length;for(;t>0&&O.buffer[t-2]>O.reducePos;)t-=4;let a=O.buffer.slice(t),r=O.bufferBase+t;for(;O&&r==O.bufferBase;)O=O.parent;return new sO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,a,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,t){let a=O<=this.p.parser.maxNode;a&&this.storeNode(O,this.pos,t,4),this.storeNode(0,this.pos,t,a?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(O){for(let t=new ua(this);;){let a=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,O);if(a==0)return!1;if(!(a&65536))return!0;t.reduce(a)}}recoverByInsert(O){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,i;s<t.length;s+=2)(i=t[s+1])!=this.state&&this.p.parser.hasAction(i,O)&&r.push(t[s],i);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let i=t[s+1];r.some((l,o)=>o&1&&l==i)||r.push(t[s],i)}t=r}let a=[];for(let r=0;r<t.length&&a.length<4;r+=2){let s=t[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(t[r],this.pos),i.reducePos=this.pos,i.score-=200,a.push(i)}return a}forceReduce(){let{parser:O}=this.p,t=O.stateSlot(this.state,5);if(!(t&65536))return!1;if(!O.validAction(this.state,t)){let a=t>>19,r=t&65535,s=this.stack.length-a*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;t=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:O}=this.p,t=[],a=(r,s)=>{if(!t.includes(r))return t.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,c=this.stack.length-l*3;if(c>=0&&O.getGoto(this.stack[c],o,!1)>=0)return l<<19|65536|o}}else{let l=a(i,s+1);if(l!=null)return l}})};return a(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 t=0;t<this.stack.length;t+=3)if(this.stack[t]!=O.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(O){return this.p.parser.dialect.flags[O]}shiftContext(O,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,O,this,this.p.stream.reset(t)))}reduceContext(O,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,O,this,this.p.stream.reset(t)))}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 t=new KO(this.curContext.tracker,O);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}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,t){this.tracker=O,this.context=t,this.hash=O.strict?O.hash(t):0}}class ua{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let t=O&65535,a=O>>19;a==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(a-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class lO{constructor(O,t,a){this.stack=O,this.pos=t,this.index=a,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,t=O.bufferBase+O.buffer.length){return new lO(O,t,t-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 lO(this.stack,this.pos,this.index)}}function M(e,O=Uint16Array){if(typeof e!="string")return e;let t=null;for(let a=0,r=0;a<e.length;){let s=0;for(;;){let i=e.charCodeAt(a++),l=!1;if(i==126){s=65535;break}i>=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}t?t[r++]=s:t=new O(s)}return t}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,t){this.input=O,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=FO,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(O,t){let a=this.range,r=this.rangeIndex,s=this.pos+O;for(;s<a.from;){if(!r)return null;let i=this.ranges[--r];s-=a.from-i.to,a=i}for(;t<0?s>a.to:s>=a.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-a.to,a=i}return s}clipPos(O){if(O>=this.range.from&&O<this.range.to)return O;for(let t of this.ranges)if(t.to>O)return Math.max(O,t.from);return this.end}peek(O){let t=this.chunkOff+O,a,r;if(t>=0&&t<this.chunk.length)a=this.pos+O,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(O,1);if(s==null)return-1;if(a=s,a>=this.chunk2Pos&&a<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(a-this.chunk2Pos);else{let i=this.rangeIndex,l=this.range;for(;l.to<=a;)l=this.ranges[++i];this.chunk2=this.input.chunk(this.chunk2Pos=a),a+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-a)),r=this.chunk2.charCodeAt(0)}}return a>=this.token.lookAhead&&(this.token.lookAhead=a+1),r}acceptToken(O,t=0){let a=t?this.resolveOffset(t,-1):this.pos;if(a==null||a<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=O,this.token.end=a}acceptTokenTo(O,t){this.token.value=O,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:O,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=O,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let O=this.input.chunk(this.pos),t=this.pos+O.length;this.chunk=t>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,t){if(t?(this.token=t,t.start=O,t.lookAhead=O+1,t.value=t.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,t){if(O>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,t-this.chunkPos);if(O>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,t-this.chunk2Pos);if(O>=this.range.from&&t<=this.range.to)return this.input.read(O,t);let a="";for(let r of this.ranges){if(r.from>=t)break;r.to>O&&(a+=this.input.read(Math.max(r.from,O),Math.min(r.to,t)))}return a}}class W{constructor(O,t){this.data=O,this.id=t}token(O,t){let{parser:a}=t.p;Ue(this.data,O,t,this.id,a.data,a.tokenPrecTable)}}W.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class nO{constructor(O,t,a){this.precTable=t,this.elseToken=a,this.data=typeof O=="string"?M(O):O}token(O,t){let a=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ue(this.data,O,t,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(a,O.token),O.acceptToken(this.elseToken,r))}}nO.prototype.contextual=W.prototype.fallback=W.prototype.extend=!1;class x{constructor(O,t={}){this.token=O,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ue(e,O,t,a,r,s){let i=0,l=1<<a,{dialect:o}=t.p.parser;O:for(;l&e[i];){let c=e[i+1];for(let p=i+3;p<c;p+=2)if((e[p+1]&l)>0){let d=e[p];if(o.allows(d)&&(O.token.value==-1||O.token.value==d||fa(d,O.token.value,r,s))){O.acceptToken(d);break}}let h=O.next,Q=0,f=e[i+2];if(O.next<0&&f>Q&&e[c+f*3-3]==65535){i=e[c+f*3-1];continue O}for(;Q<f;){let p=Q+f>>1,d=c+p+(p<<1),P=e[d],S=e[d+1]||65536;if(h<P)f=p;else if(h>=S)Q=p+1;else{i=e[d+2],O.advance();continue O}}break}}function HO(e,O,t){for(let a=O,r;(r=e[a])!=65535;a++)if(r==t)return a-O;return-1}function fa(e,O,t,a){let r=HO(t,a,O);return r<0||HO(t,a,e)<r}const Z=typeof process<"u"&&JO&&/\bparse\b/.test(JO.LOG);let uO=null;function Oe(e,O,t){let a=e.cursor(YO.IncludeAnonymous);for(a.moveTo(O);;)if(!(t<0?a.childBefore(O):a.childAfter(O)))for(;;){if((t<0?a.to<O:a.from>O)&&!a.type.isError)return t<0?Math.max(0,Math.min(a.to-1,O-25)):Math.min(e.length,Math.max(a.from+1,O+25));if(t<0?a.prevSibling():a.nextSibling())break;if(!a.parent())return t<0?0:e.length}}class $a{constructor(O,t){this.fragments=O,this.nodeSet=t,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 t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let a=this.trees[t],r=this.index[t];if(r==a.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=a.children[r],i=this.start[t]+a.positions[r];if(i>O)return this.nextStart=i,null;if(s instanceof tO){if(i==O){if(i<this.safeFrom)return null;let l=i+s.length;if(l<=this.safeTo){let o=s.prop(jO.lookAhead);if(!o||l+o<this.fragment.to)return s}}this.index[t]++,i+s.length>=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+s.length}}}class Pa{constructor(O,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(a=>new aO)}getActions(O){let t=0,a=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,o=0;for(let c=0;c<s.length;c++){if(!(1<<c&i))continue;let h=s[c],Q=this.tokens[c];if(!(a&&!h.fallback)&&((h.contextual||Q.start!=O.pos||Q.mask!=i||Q.context!=l)&&(this.updateCachedToken(Q,h,O),Q.mask=i,Q.context=l),Q.lookAhead>Q.end+25&&(o=Math.max(Q.lookAhead,o)),Q.value!=0)){let f=t;if(Q.extended>-1&&(t=this.addActions(O,Q.extended,Q.end,t)),t=this.addActions(O,Q.value,Q.end,t),!h.extend&&(a=Q,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return o&&O.setLookAhead(o),!a&&O.pos==this.stream.end&&(a=new aO,a.value=O.p.parser.eofTerm,a.start=a.end=O.pos,t=this.addActions(O,a.value,a.end,t)),this.mainToken=a,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let t=new aO,{pos:a,p:r}=O;return t.start=a,t.end=Math.min(a+1,r.stream.end),t.value=a==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(O,t,a){let r=this.stream.clipPos(a.pos);if(t.token(this.stream.reset(r,O),a),O.value>-1){let{parser:s}=a.p;for(let i=0;i<s.specialized.length;i++)if(s.specialized[i]==O.value){let l=s.specializers[i](this.stream.read(O.start,O.end),a);if(l>=0&&a.p.parser.dialect.allows(l>>1)){l&1?O.extended=l>>1:O.value=l>>1;break}}}else O.value=0,O.end=this.stream.clipPos(r+1)}putAction(O,t,a,r){for(let s=0;s<r;s+=3)if(this.actions[s]==O)return r;return this.actions[r++]=O,this.actions[r++]=t,this.actions[r++]=a,r}addActions(O,t,a,r){let{state:s}=O,{parser:i}=O.p,{data:l}=i;for(let o=0;o<2;o++)for(let c=i.stateSlot(s,o?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=T(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(T(l,c+2),t,a,r));break}l[c]==t&&(r=this.putAction(T(l,c+1),t,a,r))}return r}}class Sa{constructor(O,t,a,r){this.parser=O,this.input=t,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(t,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=a.length&&this.stream.end-s>O.bufferLength*4?new $a(a,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,t=this.minStackPos,a=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 l=O[i];for(;;){if(this.tokens.mainToken=null,l.pos>t)a.push(l);else{if(this.advanceStack(l,a,O))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!a.length){let i=r&&ga(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 "+t);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,a);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(a.length>i)for(a.sort((l,o)=>o.score-l.score);a.length>i;)a.pop();a.some(l=>l.reducePos>t)&&this.recovering--}else if(a.length>1){O:for(let i=0;i<a.length-1;i++){let l=a[i];for(let o=i+1;o<a.length;o++){let c=a[o];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)a.splice(o--,1);else{a.splice(i--,1);continue O}}}a.length>12&&a.splice(12,a.length-12)}this.minStackPos=a[0].pos;for(let i=1;i<a.length;i++)a[i].pos<this.minStackPos&&(this.minStackPos=a[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,t,a){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 c=O.curContext&&O.curContext.tracker.strict,h=c?O.curContext.hash:0;for(let Q=this.fragments.nodeAt(r);Q;){let f=this.parser.nodeSet.types[Q.type.id]==Q.type?s.getGoto(O.state,Q.type.id):-1;if(f>-1&&Q.length&&(!c||(Q.prop(jO.contextHash)||0)==h))return O.useNode(Q,f),Z&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(Q.type.id)})`),!0;if(!(Q instanceof tO)||Q.children.length==0||Q.positions[0]>0)break;let p=Q.children[0];if(p instanceof tO&&Q.positions[0]==0)Q=p;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),Z&&console.log(i+this.stackID(O)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(O.stack.length>=8400)for(;O.stack.length>6e3&&O.forceReduce(););let o=this.tokens.getActions(O);for(let c=0;c<o.length;){let h=o[c++],Q=o[c++],f=o[c++],p=c==o.length||!a,d=p?O:O.split(),P=this.tokens.mainToken;if(d.apply(h,Q,P?P.start:d.pos,f),Z&&console.log(i+this.stackID(d)+` (via ${h&65536?`reduce of ${s.getName(h&65535)}`:"shift"} for ${s.getName(Q)} @ ${r}${d==O?"":", split"})`),p)return!0;d.pos>r?t.push(d):a.push(d)}return!1}advanceFully(O,t){let a=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>a)return ee(O,t),!0}}runRecovery(O,t,a){let r=null,s=!1;for(let i=0;i<O.length;i++){let l=O[i],o=t[i<<1],c=t[(i<<1)+1],h=Z?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,a))))continue;let Q=l.split(),f=h;for(let p=0;Q.forceReduce()&&p<10&&(Z&&console.log(f+this.stackID(Q)+" (via force-reduce)"),!this.advanceFully(Q,a));p++)Z&&(f=this.stackID(Q)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,a);this.stream.end>l.pos?(c==l.pos&&(c++,o=0),l.recoverByDelete(o,c),Z&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),ee(l,a)):(!r||r.score<l.score)&&(r=l)}return r}stackToTree(O){return O.close(),tO.build({buffer:lO.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 t=(uO||(uO=new WeakMap)).get(O);return t||uO.set(O,t=String.fromCodePoint(this.nextStackID++)),t+O}}function ee(e,O){for(let t=0;t<O.length;t++){let a=O[t];if(a.pos==e.pos&&a.sameState(e)){O[t].score<e.score&&(O[t]=e);return}}O.push(e)}class ma{constructor(O,t,a){this.source=O,this.flags=t,this.disabled=a}allows(O){return!this.disabled||this.disabled[O]==0}}const dO=e=>e;class Ge{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 q 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 t=O.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;l<O.repeatNodeCount;l++)t.push("");let a=Object.keys(O.topRules).map(l=>O.topRules[l][1]),r=[];for(let l=0;l<t.length;l++)r.push([]);function s(l,o,c){r[l].push([o,o.deserialize(String(c))])}if(O.nodeProps)for(let l of O.nodeProps){let o=l[0];typeof o=="string"&&(o=jO[o]);for(let c=1;c<l.length;){let h=l[c++];if(h>=0)s(h,o,l[c++]);else{let Q=l[c+-h];for(let f=-h;f>0;f--)s(l[c++],o,Q);c++}}}this.nodeSet=new Et(t.map((l,o)=>At.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:a.indexOf(o)>-1,error:o==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(o)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=Mt;let i=M(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(te),this.states=M(O.states,Uint32Array),this.data=M(O.stateData),this.goto=M(O.goto),this.maxTerm=O.maxTerm,this.tokenizers=O.tokenizers.map(l=>typeof l=="number"?new W(i,l):l),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,t,a){let r=new Sa(this,O,t,a);for(let s of this.wrappers)r=s(r,O,t,a);return r}getGoto(O,t,a=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&a)return o;for(let c=s+(i>>1);s<c;s++)if(r[s]==O)return o;if(l)return-1}}hasAction(O,t){let a=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(O,r?2:1),i;;s+=3){if((i=a[s])==65535)if(a[s+1]==1)i=a[s=T(a,s+2)];else{if(a[s+1]==2)return T(a,s+2);break}if(i==t||i==0)return T(a,s+1)}return 0}stateSlot(O,t){return this.states[O*6+t]}stateFlag(O,t){return(this.stateSlot(O,0)&t)>0}validAction(O,t){return!!this.allActions(O,a=>a==t?!0:null)}allActions(O,t){let a=this.stateSlot(O,4),r=a?t(a):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=T(this.data,s+2);else break;r=t(T(this.data,s+1))}return r}nextStates(O){let t=[];for(let a=this.stateSlot(O,1);;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=T(this.data,a+2);else break;if(!(this.data[a+2]&1)){let r=this.data[a+1];t.some((s,i)=>i&1&&s==r)||t.push(this.data[a],r)}}return t}configure(O){let t=Object.assign(Object.create(q.prototype),this);if(O.props&&(t.nodeSet=this.nodeSet.extend(...O.props)),O.top){let a=this.topRules[O.top];if(!a)throw new RangeError(`Invalid top rule name ${O.top}`);t.top=a}return O.tokenizers&&(t.tokenizers=this.tokenizers.map(a=>{let r=O.tokenizers.find(s=>s.from==a);return r?r.to:a})),O.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((a,r)=>{let s=O.specializers.find(l=>l.from==a.external);if(!s)return a;let i=Object.assign(Object.assign({},a),{external:s.to});return t.specializers[r]=te(i),i})),O.contextTracker&&(t.context=O.contextTracker),O.dialect&&(t.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(t.strict=O.strict),O.wrap&&(t.wrappers=t.wrappers.concat(O.wrap)),O.bufferLength!=null&&(t.bufferLength=O.bufferLength),t}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 t=this.dynamicPrecedences;return t==null?0:t[O]||0}parseDialect(O){let t=Object.keys(this.dialects),a=t.map(()=>!1);if(O)for(let s of O.split(" ")){let i=t.indexOf(s);i>=0&&(a[i]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!a[s])for(let i=this.dialects[t[s]],l;(l=this.data[i++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new ma(O,a,r)}static deserialize(O){return new q(O)}}function T(e,O){return e[O]|e[O+1]<<16}function ga(e){let O=null;for(let t of e){let a=t.p.stoppedAt;(t.pos==t.p.stream.end||a!=null&&t.pos>a)&&t.p.parser.stateFlag(t.state,2)&&(!O||O.score<t.score)&&(O=t)}return O}function te(e){if(e.external){let O=e.extend?1:0;return(t,a)=>e.external(t,a)<<1|O}return e.get}const Za=54,ba=1,xa=55,ka=2,Xa=56,ya=3,ae=4,wa=5,oO=6,ze=7,Ce=8,Ee=9,Ae=10,Ta=11,va=12,qa=13,fO=57,Ra=14,re=58,Me=20,_a=22,Le=23,ja=24,XO=26,Be=27,Ya=28,Va=31,Wa=34,Ua=36,Ga=37,za=0,Ca=1,Ea={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},Aa={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 Ma(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Ne(e){return e==9||e==10||e==13||e==32}let se=null,le=null,ne=0;function yO(e,O){let t=e.pos+O;if(ne==t&&le==e)return se;let a=e.peek(O);for(;Ne(a);)a=e.peek(++O);let r="";for(;Ma(a);)r+=String.fromCharCode(a),a=e.peek(++O);return le=e,ne=t,se=r?r.toLowerCase():a==La||a==Ba?void 0:null}const Ie=60,QO=62,WO=47,La=63,Ba=33,Na=45;function oe(e,O){this.name=e,this.parent=O}const Ia=[oO,Ae,ze,Ce,Ee],Da=new Ge({start:null,shift(e,O,t,a){return Ia.indexOf(O)>-1?new oe(yO(a,1)||"",e):e},reduce(e,O){return O==Me&&e?e.parent:e},reuse(e,O,t,a){let r=O.type.id;return r==oO||r==Ua?new oe(yO(a,1)||"",e):e},strict:!1}),Ja=new x((e,O)=>{if(e.next!=Ie){e.next<0&&O.context&&e.acceptToken(fO);return}e.advance();let t=e.next==WO;t&&e.advance();let a=yO(e,0);if(a===void 0)return;if(!a)return e.acceptToken(t?Ra:oO);let r=O.context?O.context.name:null;if(t){if(a==r)return e.acceptToken(Ta);if(r&&Aa[r])return e.acceptToken(fO,-2);if(O.dialectEnabled(za))return e.acceptToken(va);for(let s=O.context;s;s=s.parent)if(s.name==a)return;e.acceptToken(qa)}else{if(a=="script")return e.acceptToken(ze);if(a=="style")return e.acceptToken(Ce);if(a=="textarea")return e.acceptToken(Ee);if(Ea.hasOwnProperty(a))return e.acceptToken(Ae);r&&ie[r]&&ie[r][a]?e.acceptToken(fO,-1):e.acceptToken(oO)}},{contextual:!0}),Ka=new x(e=>{for(let O=0,t=0;;t++){if(e.next<0){t&&e.acceptToken(re);break}if(e.next==Na)O++;else if(e.next==QO&&O>=2){t>=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 x((e,O)=>{if(e.next==WO&&e.peek(1)==QO){let t=O.dialectEnabled(Ca)||Fa(O.context);e.acceptToken(t?wa:ae,2)}else e.next==QO&&e.acceptToken(ae,1)});function UO(e,O,t){let a=2+e.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==Ie||s==1&&r.next==WO||s>=2&&s<a&&r.next==e.charCodeAt(s-2))s++,i++;else if((s==2||s==a)&&Ne(r.next))i++;else if(s==a&&r.next==QO){l>i?r.acceptToken(O,-i):r.acceptToken(t,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const Or=UO("script",Za,ba),er=UO("style",xa,ka),tr=UO("textarea",Xa,ya),ar=I({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),rr=q.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Da,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&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebhSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXhSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vchS`P!a`!cpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WihSkWc!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QchSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Or,er,tr,Ha,Ja,Ka,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:509},tokenPrec:511});function De(e,O){let t=Object.create(null);for(let a of e.getChildren(Le)){let r=a.getChild(ja),s=a.getChild(XO)||a.getChild(Be);r&&(t[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 t}function Qe(e,O){let t=e.getChild(_a);return t?O.read(t.from,t.to):" "}function $O(e,O,t){let a;for(let r of t)if(!r.attrs||r.attrs(a||(a=De(e.node.parent.firstChild,O))))return{parser:r.parser};return null}function Je(e=[],O=[]){let t=[],a=[],r=[],s=[];for(let l of e)(l.tag=="script"?t:l.tag=="style"?a:l.tag=="textarea"?r:s).push(l);let i=O.length?Object.create(null):null;for(let l of O)(i[l.name]||(i[l.name]=[])).push(l);return Lt((l,o)=>{let c=l.type.id;if(c==Ya)return $O(l,o,t);if(c==Va)return $O(l,o,a);if(c==Wa)return $O(l,o,r);if(c==Me&&s.length){let h=l.node,Q=h.firstChild,f=Q&&Qe(Q,o),p;if(f){for(let d of s)if(d.tag==f&&(!d.attrs||d.attrs(p||(p=De(Q,o))))){let P=h.lastChild,S=P.type.id==Ga?P.from:h.to;if(S>Q.to)return{parser:d.parser,overlay:[{from:Q.to,to:S}]}}}}if(i&&c==Le){let h=l.node,Q;if(Q=h.firstChild){let f=i[o.read(Q.from,Q.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=Qe(h.parent,o))continue;let d=h.lastChild;if(d.type.id==XO){let P=d.from+1,S=d.lastChild,k=d.to-(S&&S.isError?0:1);if(k>P)return{parser:p.parser,overlay:[{from:P,to:k}]}}else if(d.type.id==Be)return{parser:p.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}const ir=99,ce=1,sr=100,lr=101,pe=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],nr=58,or=40,Fe=95,Qr=91,rO=45,cr=46,pr=35,hr=37,ur=38,dr=92,fr=10;function L(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function He(e){return e>=48&&e<=57}const $r=new x((e,O)=>{for(let t=!1,a=0,r=0;;r++){let{next:s}=e;if(L(s)||s==rO||s==Fe||t&&He(s))!t&&(s!=rO||r>0)&&(t=!0),a===r&&s==rO&&a++,e.advance();else if(s==dr&&e.peek(1)!=fr)e.advance(),e.next>-1&&e.advance(),t=!0;else{t&&e.acceptToken(s==or?sr:a==2&&O.canShift(pe)?pe:lr);break}}}),Pr=new x(e=>{if(Ke.includes(e.peek(-1))){let{next:O}=e;(L(O)||O==Fe||O==pr||O==cr||O==Qr||O==nr&&L(e.peek(1))||O==rO||O==ur)&&e.acceptToken(ir)}}),Sr=new x(e=>{if(!Ke.includes(e.peek(-1))){let{next:O}=e;if(O==hr&&(e.advance(),e.acceptToken(ce)),L(O)){do e.advance();while(L(e.next)||He(e.next));e.acceptToken(ce)}}}),mr=I({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),gr={__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},xr=q.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<<HdO9sQWO,5;^OOQP1G/Y1G/YOOQS-E8V-E8VO${QdO'#EZO9{QWO,5;ZOOQT1G.u1G.uOOQP<<Hd<<HdOOQS7+$k7+$kO:TQdO7+%]OOQO7+%d7+%dOOQO,5:k,5:kO3{QdO'#EaO7rQWO,5:zOOQS,5:z,5:zOOQS-E8^-E8^OOQS1G0U1G0UO:[QtO,5:wOOQS-E8Z-E8ZOOQO<<Ho<<HoOOQPAN>OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<<Hw<<HwOOQO,5:{,5:{OOQO-E8_-E8_OOQS1G0f1G0f",stateData:";o~O#ZOS#[QQ~OUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XRO#bTO~OQfOUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XeO#bTO~O#U#gP~P!ZO#[jO~O#XlO~O]qO^qOqsOtoOxrO!OtO!RvO#VuO#bnO~O!TwO~P#pO`}O#WzO#XyO~O#X!OO~O#X!QO~OQ![Ob!TOf![Oh![On!YOq!ZO#W!WO#X!SO#e!UO~Ob!^O!d!`O!g!aO#X!]O!T#hP~Oh!fOn!YO#X!eO~Oh!hO#X!hO~Ob!^O!d!`O!g!aO#X!]O~O!Y#hP~P%jO]WX]!WX^WXqWXtWXxWX!OWX!RWX!TWX#VWX#bWX~O]!mO~O!Y!nO#U#gX!S#gX~O#U#gX!S#gX~P!ZO#]!qO#^!qO#_!sO~OUYOXYO]VO^VOqXOxWO#XRO#bTO~OtoO!TwO~O`!zO#WzO#XyO~O!S#gP~P!ZOb#RO~Ob#SO~Op#TO|#UO~OP#WObgXjgX!YgX!dgX!ggX#XgXagXQgXfgXhgXngXqgXtgX!XgX#UgX#WgX#egXpgX!SgX~Ob!^Oj#XO!d!`O!g!aO#X!]O!Y#hP~Ob#[O~Op#`O#X#]O~Ob!^O!d!`O!g!aO#X#aO~Ot#eO!b#dO!T#hX!Y#hX~Ob#hO~Oj#XO!Y#jO~O!Y#kO~Oh#lOn!YO~O!T#mO~O!TwO!b#dO~O!TwO!Y#pO~O!X#rO!Y!Va#U!Va!S!Va~P${O!Y#QX#U#QX!S#QX~P!ZO!Y!nO#U#ga!S#ga~O#]!qO#^!qO#_#xO~O]qO^qOqsOxrO!OtO!RvO#VuO#bnO~Ot#Oa!T#Oaa#Oa~P.pOp#zO|#{O~O]qO^qOqsOxrO#bnO~Ot}i!O}i!R}i!T}i#V}ia}i~P/qOt!Pi!O!Pi!R!Pi!T!Pi#V!Pia!Pi~P/qOt!Qi!O!Qi!R!Qi!T!Qi#V!Qia!Qi~P/qO!S#|O~Oa#fP~P(aOa#cP~P${Oa$TOj#XO~O!Y$VO~Oa$WOh$XOo$XO~Op$ZO#X#]O~O]!`Xa!^X!b!^X~O]$[O~Oa$]O!b#dO~Ot#eO!T#ha!Y#ha~O!b#dOt!ca!T!ca!Y!caa!ca~O!Y$bO~O!S$iO#X$dO#e$cO~Oj#XOt$kO!X$mO!Y!Vi#U!Vi!S!Vi~P${O!Y#Qa#U#Qa!S#Qa~P!ZO!Y!nO#U#gi!S#gi~Oa#fX~P#pOa$qO~Oj#XOQ!{Xa!{Xb!{Xf!{Xh!{Xn!{Xq!{Xt!{X#W!{X#X!{X#e!{X~Ot$sOa#cX~P${Oa$uO~Oj#XOp$vO~Oa$wO~O!b#dOt#Ra!T#Ra!Y#Ra~Oa$yO~P.pOP#WOtgX!TgX~O#e$cOt!sX!T!sX~Ot${O!TwO~O!S%PO#X$dO#e$cO~Oj#XOQ#PXb#PXf#PXh#PXn#PXq#PXt#PX!X#PX!Y#PX#U#PX#W#PX#X#PX#e#PX!S#PX~Ot$kO!X%SO!Y!Vq#U!Vq!S!Vq~P${Oj#XOp%TO~OtoOa#fa~Ot$sOa#ca~Oa%WO~P${Oj#XOQ#Pab#Paf#Pah#Pan#Paq#Pat#Pa!X#Pa!Y#Pa#U#Pa#W#Pa#X#Pa#e#Pa!S#Pa~Oa!}at!}a~P${O#Zo#[#ej!R#e~",goto:"-g#jPPP#kP#nP#w$WP#w$g#wPP$mPPP$s$|$|P%`P$|P$|%z&^PPPP$|&vP&z'Q#wP'W#w'^P#wP#w#wPPP'd'y(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:[mr],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%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!X[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYxQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QS|So`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!RQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l<cYo`Oy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=WUo`Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=qUo`#e[Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l>[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[Pr,Sr,$r,1,2,3,4,new nO("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>gr[e]||-1},{term:58,get:e=>Zr[e]||-1},{term:101,get:e=>br[e]||-1}],tokenPrec:1219});let PO=null;function SO(){if(!PO&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)a!="cssText"&&a!="cssFloat"&&typeof e[a]=="string"&&(/[A-Z]/.test(a)&&(a=a.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(a)||(O.push(a),t.add(a)));PO=O.sort().map(a=>({type:"property",label:a,apply:a+": "}))}return PO||[]}const he=["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})),ue=["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}))),kr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(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 t;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;return(a==null?void 0:a.name)!="Callee"?!1:O.sliceString(a.from,a.to)=="var"}const de=new _e,Tr=["Declaration"];function vr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function Ot(e,O,t){if(O.to-O.from>4096){let a=de.get(O);if(a)return a;let r=[],s=new Set,i=O.cursor(YO.IncludeAnonymous);if(i.firstChild())do for(let l of Ot(e,i.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return de.set(O,r),r}else{let a=[],r=new Set;return O.cursor().iterate(s=>{var i;if(t(s)&&s.matchContext(Tr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=e.sliceString(s.from,s.to);r.has(l)||(r.add(l),a.push({label:l,type:"variable"}))}}),a}}const qr=e=>O=>{let{state:t,pos:a}=O,r=z(t).resolveInner(a,-1),s=r.type.isError&&r.from==r.to-1&&t.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:SO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:ue,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:he,validFor:w};if(e(r)||(O.explicit||s)&&wr(r,t.doc))return{from:e(r)||s?r.from:a,options:Ot(t.doc,vr(r),e),validFor:yr};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:SO(),validFor:w};return{from:r.from,options:kr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:Xr,validFor:w};if(!O.explicit)return null;let i=r.resolve(a),l=i.childBefore(a);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:a,options:he,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:a,options:ue,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:a,options:SO(),validFor:w}:null},Rr=qr(e=>e.name=="VariableName"),cO=D.define({name:"css",parser:xr.configure({props:[J.add({Declaration:Y()}),K.add({"Block KeyframeList":VO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _r(){return new F(cO,cO.data.of({autocomplete:Rr}))}const jr=314,Yr=315,fe=1,Vr=2,Wr=3,Ur=4,Gr=316,zr=318,Cr=319,Er=5,Ar=6,Mr=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,Lr=59,TO=47,Br=42,Nr=43,Ir=45,Dr=60,Jr=44,Kr=63,Fr=46,Hr=91,Oi=new Ge({start:!1,shift(e,O){return O==Er||O==Ar||O==zr?e:O==Cr},strict:!1}),ei=new x((e,O)=>{let{next:t}=e;(t==et||t==-1||O.context)&&e.acceptToken(Gr)},{contextual:!0,fallback:!0}),ti=new x((e,O)=>{let{next:t}=e,a;wO.indexOf(t)>-1||t==TO&&((a=e.peek(1))==TO||a==Br)||t!=et&&t!=Lr&&t!=-1&&!O.context&&e.acceptToken(jr)},{contextual:!0}),ai=new x((e,O)=>{e.next==Hr&&!O.context&&e.acceptToken(Yr)},{contextual:!0}),ri=new x((e,O)=>{let{next:t}=e;if(t==Nr||t==Ir){if(e.advance(),t==e.next){e.advance();let a=!O.context&&O.canShift(fe);e.acceptToken(a?fe:Vr)}}else t==Kr&&e.peek(1)==Fr&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Wr))},{contextual:!0});function mO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const ii=new x((e,O)=>{if(e.next!=Dr||!O.dialectEnabled(Mr)||(e.advance(),e.next==TO))return;let t=0;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(mO(e.next,!0)){for(e.advance(),t++;mO(e.next,!1);)e.advance(),t++;for(;wO.indexOf(e.next)>-1;)e.advance(),t++;if(e.next==Jr)return;for(let a=0;;a++){if(a==7){if(!mO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(a))break;e.advance(),t++}}e.acceptToken(Ur,-t)}),si=I({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),"NewExpression/VariableName":n.className,PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer asserts":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),li={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,const:52,extends:56,this:60,true:68,false:68,null:80,void:84,typeof:88,super:104,new:138,delete:150,yield:159,await:163,class:168,public:231,private:231,protected:231,readonly:233,instanceof:252,satisfies:255,in:256,import:290,keyof:347,unique:351,infer:357,asserts:393,is:395,abstract:415,implements:417,type:419,let:422,var:424,using:427,interface:433,enum:437,namespace:443,module:445,declare:449,global:453,for:472,of:481,while:484,with:488,do:492,if:496,else:498,switch:502,case:508,try:514,catch:518,finally:522,return:526,throw:530,break:534,continue:538,debugger:542},ni={__proto__:null,async:125,get:127,set:129,declare:191,public:193,private:193,protected:193,static:195,abstract:197,override:199,readonly:205,accessor:207,new:399},oi={__proto__:null,"<":189},Qi=q.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#D_O.QQlO'#DeO.bQlO'#DpO%[QlO'#DxO0fQlO'#EQOOQ!0Lf'#EY'#EYO1PQ`O'#EVOOQO'#En'#EnOOQO'#Ij'#IjO1XQ`O'#GrO1dQ`O'#EmO1iQ`O'#EmO3hQ!0MxO'#JpO6[Q!0MxO'#JqO6uQ`O'#F[O6zQ,UO'#FsOOQ!0Lf'#Fe'#FeO7VO7dO'#FeO7eQMhO'#F{O9UQ`O'#FzOOQ!0Lf'#Jq'#JqOOQ!0Lb'#Jp'#JpO9ZQ`O'#GvOOQ['#K]'#K]O9fQ`O'#IWO9kQ!0LrO'#IXOOQ['#J^'#J^OOQ['#I]'#I]Q`QlOOQ`QlOOO9sQ!L^O'#DtO9zQlO'#D|O:RQlO'#EOO9aQ`O'#GrO:YQMhO'#CoO:hQ`O'#ElO:sQ`O'#EwO:xQMhO'#FdO;gQ`O'#GrOOQO'#K^'#K^O;lQ`O'#K^O;zQ`O'#GzO;zQ`O'#G{O;zQ`O'#G}O9aQ`O'#HQO<qQ`O'#HTO>YQ`O'#CeO>jQ`O'#HaO>rQ`O'#HgO>rQ`O'#HiO`QlO'#HkO>rQ`O'#HmO>rQ`O'#HpO>wQ`O'#HvO>|Q!0LsO'#H|O%[QlO'#IOO?XQ!0LsO'#IQO?dQ!0LsO'#ISO9kQ!0LrO'#IUO?oQ!0MxO'#CiO@qQpO'#DjQOQ`OOO%[QlO'#EOOAXQ`O'#ERO:YQMhO'#ElOAdQ`O'#ElOAoQ!bO'#FdOOQ['#Cg'#CgOOQ!0Lb'#Do'#DoOOQ!0Lb'#Jt'#JtO%[QlO'#JtOOQO'#Jw'#JwOOQO'#If'#IfOBoQpO'#EeOOQ!0Lb'#Ed'#EdOOQ!0Lb'#J{'#J{OCkQ!0MSO'#EeOCuQpO'#EUOOQO'#Jv'#JvODZQpO'#JwOEhQpO'#EUOCuQpO'#EePEuO&2DjO'#CbPOOO)CD{)CD{OOOO'#I^'#I^OFQO#tO,59UOOQ!0Lh,59U,59UOOOO'#I_'#I_OF`O&jO,59UOFnQ!L^O'#DaOOOO'#Ia'#IaOFuO#@ItO,59yOOQ!0Lf,59y,59yOGTQlO'#IbOGhQ`O'#JrOIgQ!fO'#JrO+}QlO'#JrOInQ`O,5:POJUQ`O'#EnOJcQ`O'#KROJnQ`O'#KQOJnQ`O'#KQOJvQ`O,5;[OJ{Q`O'#KPOOQ!0Ln,5:[,5:[OKSQlO,5:[OMQQ!0MxO,5:dOMqQ`O,5:lON[Q!0LrO'#KOONcQ`O'#J}O9ZQ`O'#J}ONwQ`O'#J}O! PQ`O,5;ZO! UQ`O'#J}O!#ZQ!fO'#JqOOQ!0Lh'#Ci'#CiO%[QlO'#EQO!#yQ!fO,5:qOOQS'#Jx'#JxOOQO-E<h-E<hO9aQ`O,5=^O!$aQ`O,5=^O!$fQlO,5;XO!&iQMhO'#EiO!(SQ`O,5;XO!(XQlO'#DwO!(cQpO,5;bO!(kQpO,5;bO%[QlO,5;bOOQ['#FS'#FSOOQ['#FU'#FUO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cO%[QlO,5;cOOQ['#FY'#FYO!(yQlO,5;sOOQ!0Lf,5;x,5;xOOQ!0Lf,5;y,5;yOOQ!0Lf,5;{,5;{O%[QlO'#InO!*|Q!0LrO,5<hO%[QlO,5;cO!&iQMhO,5;cO!+kQMhO,5;cO!-]QMhO'#E[O%[QlO,5;vOOQ!0Lf,5;z,5;zO!-dQ,UO'#FiO!.aQ,UO'#KVO!-{Q,UO'#KVO!.hQ,UO'#KVOOQO'#KV'#KVO!.|Q,UO,5<ROOOW,5<_,5<_O!/_QlO'#FuOOOW'#Im'#ImO7VO7dO,5<PO!/fQ,UO'#FwOOQ!0Lf,5<P,5<PO!0VQ$IUO'#CwOOQ!0Lh'#C{'#C{O!0jO#@ItO'#DPO!1WQMjO,5<dO!1_Q`O,5<gO!2zQ(CWO'#GWO!3XQ`O'#GXO!3^Q`O'#GXO!4|Q(CWO'#G]O!6RQpO'#GaOOQO'#Gm'#GmO!+rQMhO'#GlOOQO'#Go'#GoO!+rQMhO'#GnO!6tQ$IUO'#JjOOQ!0Lh'#Jj'#JjO!7OQ`O'#JiO!7^Q`O'#JhO!7fQ`O'#CuOOQ!0Lh'#Cy'#CyO!7qQ`O'#C{OOQ!0Lh'#DT'#DTOOQ!0Lh'#DV'#DVO1SQ`O'#DXO!+rQMhO'#GOO!+rQMhO'#GQO!7vQ`O'#GSO!7{Q`O'#GTO!3^Q`O'#GZO!+rQMhO'#G`O;zQ`O'#JiO!8QQ`O'#EoO!8oQ`O,5<fOOQ!0Lb'#Cr'#CrO!8wQ`O'#EpO!9qQpO'#EqOOQ!0Lb'#KP'#KPO!9xQ!0LrO'#K_O9kQ!0LrO,5=bO`QlO,5>rOOQ['#Jf'#JfOOQ[,5>s,5>sOOQ[-E<Z-E<ZO!;wQ!0MxO,5:`O!9lQpO,5:^O!>bQ!0MxO,5:hO%[QlO,5:hO!@xQ!0MxO,5:jOOQO,5@x,5@xO!AiQMhO,5=^O!AwQ!0LrO'#JgO9UQ`O'#JgO!BYQ!0LrO,59ZO!BeQpO,59ZO!BmQMhO,59ZO:YQMhO,59ZO!BxQ`O,5;XO!CQQ`O'#H`O!CfQ`O'#KbO%[QlO,5;|O!9lQpO,5<OO!CnQ`O,5=yO!CsQ`O,5=yO!CxQ`O,5=yO9kQ!0LrO,5=yO;zQ`O,5=iOOQO'#Cw'#CwO!DWQpO,5=fO!D`QMhO,5=gO!DkQ`O,5=iO!DpQ!bO,5=lO!DxQ`O'#K^O>wQ`O'#HVO9aQ`O'#HXO!D}Q`O'#HXO:YQMhO'#HZO!ESQ`O'#HZOOQ[,5=o,5=oO!EXQ`O'#H[O!EjQ`O'#CoO!EoQ`O,59PO!EyQ`O,59PO!HOQlO,59POOQ[,59P,59PO!H`Q!0LrO,59PO%[QlO,59PO!JkQlO'#HcOOQ['#Hd'#HdOOQ['#He'#HeO`QlO,5={O!KRQ`O,5={O`QlO,5>RO`QlO,5>TO!KWQ`O,5>VO`QlO,5>XO!K]Q`O,5>[O!KbQlO,5>bOOQ[,5>h,5>hO%[QlO,5>hO9kQ!0LrO,5>jOOQ[,5>l,5>lO# lQ`O,5>lOOQ[,5>n,5>nO# lQ`O,5>nOOQ[,5>p,5>pO#!YQpO'#D]O%[QlO'#JtO#!{QpO'#JtO##VQpO'#DkO##hQpO'#DkO#%yQlO'#DkO#&QQ`O'#JsO#&YQ`O,5:UO#&_Q`O'#ErO#&mQ`O'#KSO#&uQ`O,5;]O#&zQpO'#DkO#'XQpO'#ETOOQ!0Lf,5:m,5:mO%[QlO,5:mO#'`Q`O,5:mO>wQ`O,5;WO!BeQpO,5;WO!BmQMhO,5;WO:YQMhO,5;WO#'hQ`O,5@`O#'mQ07dO,5:qOOQO-E<d-E<dO#(sQ!0MSO,5;POCuQpO,5:pO#(}QpO,5:pOCuQpO,5;PO!BYQ!0LrO,5:pOOQ!0Lb'#Eh'#EhOOQO,5;P,5;PO%[QlO,5;PO#)[Q!0LrO,5;PO#)gQ!0LrO,5;PO!BeQpO,5:pOOQO,5;V,5;VO#)uQ!0LrO,5;PPOOO'#I['#I[P#*ZO&2DjO,58|POOO,58|,58|OOOO-E<[-E<[OOQ!0Lh1G.p1G.pOOOO-E<]-E<]OOOO,59{,59{O#*fQ!bO,59{OOOO-E<_-E<_OOQ!0Lf1G/e1G/eO#*kQ!fO,5>|O+}QlO,5>|OOQO,5?S,5?SO#*uQlO'#IbOOQO-E<`-E<`O#+SQ`O,5@^O#+[Q!fO,5@^O#+cQ`O,5@lOOQ!0Lf1G/k1G/kO%[QlO,5@mO#+kQ`O'#IhOOQO-E<f-E<fO#+cQ`O,5@lOOQ!0Lb1G0v1G0vOOQ!0Ln1G/v1G/vOOQ!0Ln1G0W1G0WO%[QlO,5@jO#,PQ!0LrO,5@jO#,bQ!0LrO,5@jO#,iQ`O,5@iO9ZQ`O,5@iO#,qQ`O,5@iO#-PQ`O'#IkO#,iQ`O,5@iOOQ!0Lb1G0u1G0uO!(cQpO,5:sO!(nQpO,5:sOOQS,5:u,5:uO#-qQdO,5:uO#-yQMhO1G2xO9aQ`O1G2xOOQ!0Lf1G0s1G0sO#.XQ!0MxO1G0sO#/^Q!0MvO,5;TOOQ!0Lh'#GV'#GVO#/zQ!0MzO'#JjO!$fQlO1G0sO#2VQ!fO'#JuO%[QlO'#JuO#2aQ`O,5:cOOQ!0Lh'#D]'#D]OOQ!0Lf1G0|1G0|O%[QlO1G0|OOQ!0Lf1G1e1G1eO#2fQ`O1G0|O#4zQ!0MxO1G0}O#5RQ!0MxO1G0}O#7iQ!0MxO1G0}O#7pQ!0MxO1G0}O#:WQ!0MxO1G0}O#<nQ!0MxO1G0}O#<uQ!0MxO1G0}O#<|Q!0MxO1G0}O#?dQ!0MxO1G0}O#?kQ!0MxO1G0}O#AxQ?MtO'#CiO#CsQ?MtO1G1_O#CzQ?MtO'#JqO#D_Q!0MxO,5?YOOQ!0Lb-E<l-E<lO#FlQ!0MxO1G0}O#GiQ!0MzO1G0}OOQ!0Lf1G0}1G0}O#HlQMjO'#JzO#HvQ`O,5:vO#H{Q!0MxO1G1bO#IoQ,UO,5<VO#IwQ,UO,5<WO#JPQ,UO'#FnO#JhQ`O'#FmOOQO'#KW'#KWOOQO'#Il'#IlO#JmQ,UO1G1mOOQ!0Lf1G1m1G1mOOOW1G1x1G1xO#KOQ?MtO'#JpO#KYQ`O,5<aO!(yQlO,5<aOOOW-E<k-E<kOOQ!0Lf1G1k1G1kO#K_QpO'#KVOOQ!0Lf,5<c,5<cO#KgQpO,5<cO#KlQMhO'#DROOOO'#I`'#I`O#KsO#@ItO,59kOOQ!0Lh,59k,59kO%[QlO1G2OO!7{Q`O'#IpO#LOQ`O,5<yOOQ!0Lh,5<v,5<vO!+rQMhO'#IsO#LlQMjO,5=WO!+rQMhO'#IuO#M_QMjO,5=YO!&iQMhO,5=[OOQO1G2R1G2RO#MiQ!dO'#CrO#M|Q(CWO'#EpO$ RQpO'#GaO$ iQ!dO,5<rO$ pQ`O'#KYO9ZQ`O'#KYO$!OQ`O,5<tO!+rQMhO,5<sO$!TQ`O'#GYO$!fQ`O,5<sO$!kQ!dO'#GVO$!xQ!dO'#KZO$#SQ`O'#KZO!&iQMhO'#KZO$#XQ`O,5<wO$#^QlO'#JtO$#hQpO'#GbO##hQpO'#GbO$#yQ`O'#GfO!3^Q`O'#GjO$$OQ!0LrO'#IrO$$ZQpO,5<{OOQ!0Lp,5<{,5<{O$$bQpO'#GbO$$oQpO'#GcO$%QQpO'#GcO$%VQMjO,5=WO$%gQMjO,5=YOOQ!0Lh,5=],5=]O!+rQMhO,5@TO!+rQMhO,5@TO$%wQ`O'#IwO$&VQ`O,5@SO$&_Q`O,59aOOQ!0Lh,59g,59gO$'UQ$IYO,59sOOQ!0Lh'#Jn'#JnO$'wQMjO,5<jO$(jQMjO,5<lO@iQ`O,5<nOOQ!0Lh,5<o,5<oO$(tQ`O,5<uO$(yQMjO,5<zO$)ZQ`O,5@TO$)iQ`O'#J}O!$fQlO1G2QO$)nQ`O1G2QO9ZQ`O'#KQO9ZQ`O'#ErO%[QlO'#ErO9ZQ`O'#IyO$)sQ!0LrO,5@yOOQ[1G2|1G2|OOQ[1G4^1G4^OOQ!0Lf1G/z1G/zOOQ!0Lf1G/x1G/xO$+uQ!0MxO1G0SOOQ[1G2x1G2xO!&iQMhO1G2xO%[QlO1G2xO#-|Q`O1G2xO$-yQMhO'#EiOOQ!0Lb,5@R,5@RO$.WQ!0LrO,5@ROOQ[1G.u1G.uO!BYQ!0LrO1G.uO!BeQpO1G.uO!BmQMhO1G.uO$.iQ`O1G0sO$.nQ`O'#CiO$.yQ`O'#KcO$/RQ`O,5=zO$/WQ`O'#KcO$/]Q`O'#KcO$/kQ`O'#JPO$/yQ`O,5@|O$0RQ!fO1G1hOOQ!0Lf1G1j1G1jO9aQ`O1G3eO@iQ`O1G3eO$0YQ`O1G3eO$0_Q`O1G3eOOQ[1G3e1G3eO!DkQ`O1G3TO!&iQMhO1G3QO$0dQ`O1G3QOOQ[1G3R1G3RO!&iQMhO1G3RO$0iQ`O1G3RO$0qQpO'#HPOOQ[1G3T1G3TO!5|QpO'#I{O!DpQ!bO1G3WOOQ[1G3W1G3WOOQ[,5=q,5=qO$0yQMhO,5=sO9aQ`O,5=sO$#yQ`O,5=uO9UQ`O,5=uO!BeQpO,5=uO!BmQMhO,5=uO:YQMhO,5=uO$1XQ`O'#KaO$1dQ`O,5=vOOQ[1G.k1G.kO$1iQ!0LrO1G.kO@iQ`O1G.kO$1tQ`O1G.kO9kQ!0LrO1G.kO$3|Q!fO,5AOO$4ZQ`O,5AOO9ZQ`O,5AOO$4fQlO,5=}O$4mQ`O,5=}OOQ[1G3g1G3gO`QlO1G3gOOQ[1G3m1G3mOOQ[1G3o1G3oO>rQ`O1G3qO$4rQlO1G3sO$8vQlO'#HrOOQ[1G3v1G3vO$9TQ`O'#HxO>wQ`O'#HzOOQ[1G3|1G3|O$9]QlO1G3|O9kQ!0LrO1G4SOOQ[1G4U1G4UOOQ!0Lb'#G^'#G^O9kQ!0LrO1G4WO9kQ!0LrO1G4YO$=dQ`O,5@`O!(yQlO,5;^O9ZQ`O,5;^O>wQ`O,5:VO!(yQlO,5:VO!BeQpO,5:VO$=iQ?MtO,5:VOOQO,5;^,5;^O$=sQpO'#IcO$>ZQ`O,5@_OOQ!0Lf1G/p1G/pO$>cQpO'#IiO$>mQ`O,5@nOOQ!0Lb1G0w1G0wO##hQpO,5:VOOQO'#Ie'#IeO$>uQpO,5:oOOQ!0Ln,5:o,5:oO#'cQ`O1G0XOOQ!0Lf1G0X1G0XO%[QlO1G0XOOQ!0Lf1G0r1G0rO>wQ`O1G0rO!BeQpO1G0rO!BmQMhO1G0rOOQ!0Lb1G5z1G5zO!BYQ!0LrO1G0[OOQO1G0k1G0kO%[QlO1G0kO$>|Q!0LrO1G0kO$?XQ!0LrO1G0kO!BeQpO1G0[OCuQpO1G0[O$?gQ!0LrO1G0kOOQO1G0[1G0[O$?{Q!0MxO1G0kPOOO-E<Y-E<YPOOO1G.h1G.hOOOO1G/g1G/gO$@VQ!bO,5<hO$@_Q!fO1G4hOOQO1G4n1G4nO%[QlO,5>|O$@iQ`O1G5xO$@qQ`O1G6WO$@yQ!fO1G6XO9ZQ`O,5?SO$ATQ!0MxO1G6UO%[QlO1G6UO$AeQ!0LrO1G6UO$AvQ`O1G6TO$AvQ`O1G6TO9ZQ`O1G6TO$BOQ`O,5?VO9ZQ`O,5?VOOQO,5?V,5?VO$BdQ`O,5?VO$)iQ`O,5?VOOQO-E<i-E<iOOQS1G0_1G0_OOQS1G0a1G0aO#-tQ`O1G0aOOQ[7+(d7+(dO!&iQMhO7+(dO%[QlO7+(dO$BrQ`O7+(dO$B}QMhO7+(dO$C]Q!0MzO,5=WO$EhQ!0MzO,5=YO$GsQ!0MzO,5=WO$JUQ!0MzO,5=YO$LgQ!0MzO,59sO$NlQ!0MzO,5<jO%!wQ!0MzO,5<lO%%SQ!0MzO,5<zOOQ!0Lf7+&_7+&_O%'eQ!0MxO7+&_O%(XQlO'#IdO%(fQ`O,5@aO%(nQ!fO,5@aOOQ!0Lf1G/}1G/}O%(xQ`O7+&hOOQ!0Lf7+&h7+&hO%(}Q?MtO,5:dO%[QlO7+&yO%)XQ?MtO,5:`O%)fQ?MtO,5:hO%)pQ?MtO,5:jO%)zQMhO'#IgO%*UQ`O,5@fOOQ!0Lh1G0b1G0bOOQO1G1q1G1qOOQO1G1r1G1rO%*^Q!jO,5<YO!(yQlO,5<XOOQO-E<j-E<jOOQ!0Lf7+'X7+'XOOOW7+'d7+'dOOOW1G1{1G1{O%*iQ`O1G1{OOQ!0Lf1G1}1G1}OOOO,59m,59mO%*nQ!dO,59mOOOO-E<^-E<^OOQ!0Lh1G/V1G/VO%*uQ!0MxO7+'jOOQ!0Lh,5?[,5?[O%+iQMhO1G2eP%+pQ`O'#IpPOQ!0Lh-E<n-E<nO%,^QMjO,5?_OOQ!0Lh-E<q-E<qO%-PQMjO,5?aOOQ!0Lh-E<s-E<sO%-ZQ!dO1G2vO%-bQ!dO'#CrO%-xQMhO'#KQO$#^QlO'#JtOOQ!0Lh1G2^1G2^O%.PQ`O'#IoO%.eQ`O,5@tO%.eQ`O,5@tO%.mQ`O,5@tO%.xQ`O,5@tOOQO1G2`1G2`O%/WQMjO1G2_O!+rQMhO1G2_O%/hQ(CWO'#IqO%/uQ`O,5@uO!&iQMhO,5@uO%/}Q!dO,5@uOOQ!0Lh1G2c1G2cO%2_Q!fO'#CiO%2iQ`O,5=OOOQ!0Lb,5<|,5<|O%2qQpO,5<|OOQ!0Lb,5<},5<}OCfQ`O,5<|O%2|QpO,5<|OOQ!0Lb,5=Q,5=QO$)iQ`O,5=UOOQO,5?^,5?^OOQO-E<p-E<pOOQ!0Lp1G2g1G2gO##hQpO,5<|O$#^QlO,5=OO%3[Q`O,5<}O%3gQpO,5<}O!+rQMhO'#IsO%4aQMjO1G2rO!+rQMhO'#IuO%5SQMjO1G2tO%5^QMjO1G5oO%5hQMjO1G5oOOQO,5?c,5?cOOQO-E<u-E<uOOQO1G.{1G.{O!9lQpO,59uO%[QlO,59uOOQ!0Lh,5<i,5<iO%5uQ`O1G2YO!+rQMhO1G2aO!+rQMhO1G5oO!+rQMhO1G5oO%5zQ!0MxO7+'lOOQ!0Lf7+'l7+'lO!$fQlO7+'lO%6nQ`O,5;^OOQ!0Lb,5?e,5?eOOQ!0Lb-E<w-E<wO%6sQ!dO'#K[O#'cQ`O7+(dO4UQ!fO7+(dO$BuQ`O7+(dO%6}Q!0MvO'#CiO%7nQ!0LrO,5=RO%8PQ!0MvO,5=RO%8dQ`O,5=ROOQ!0Lb1G5m1G5mOOQ[7+$a7+$aO!BYQ!0LrO7+$aO!BeQpO7+$aO!$fQlO7+&_O%8lQ`O'#JOO%9TQ`O,5@}OOQO1G3f1G3fO9aQ`O,5@}O%9TQ`O,5@}O%9]Q`O,5@}OOQO,5?k,5?kOOQO-E<}-E<}OOQ!0Lf7+'S7+'SO%9bQ`O7+)PO9kQ!0LrO7+)PO9aQ`O7+)PO@iQ`O7+)POOQ[7+(o7+(oO%9gQ!0MvO7+(lO!&iQMhO7+(lO!DfQ`O7+(mOOQ[7+(m7+(mO!&iQMhO7+(mO%9qQ`O'#K`O%9|Q`O,5=kOOQO,5?g,5?gOOQO-E<y-E<yOOQ[7+(r7+(rO%;`QpO'#HYOOQ[1G3_1G3_O!&iQMhO1G3_O%[QlO1G3_O%;gQ`O1G3_O%;rQMhO1G3_O9kQ!0LrO1G3aO$#yQ`O1G3aO9UQ`O1G3aO!BeQpO1G3aO!BmQMhO1G3aO%<QQ`O'#I}O%<fQ`O,5@{O%<nQpO,5@{OOQ!0Lb1G3b1G3bOOQ[7+$V7+$VO@iQ`O7+$VO9kQ!0LrO7+$VO%<yQ`O7+$VO%[QlO1G6jO%[QlO1G6kO%=OQ!0LrO1G6jO%=YQlO1G3iO%=aQ`O1G3iO%=fQlO1G3iOOQ[7+)R7+)RO9kQ!0LrO7+)]O`QlO7+)_OOQ['#Kf'#KfOOQ['#JQ'#JQO%=mQlO,5>^OOQ[,5>^,5>^O%[QlO'#HsO%=zQ`O'#HuOOQ[,5>d,5>dO9ZQ`O,5>dOOQ[,5>f,5>fOOQ[7+)h7+)hOOQ[7+)n7+)nOOQ[7+)r7+)rOOQ[7+)t7+)tO%>PQpO1G5zO%>kQ?MtO1G0xO%>uQ`O1G0xOOQO1G/q1G/qO%?QQ?MtO1G/qO>wQ`O1G/qO!(yQlO'#DkOOQO,5>},5>}OOQO-E<a-E<aOOQO,5?T,5?TOOQO-E<g-E<gO!BeQpO1G/qOOQO-E<c-E<cOOQ!0Ln1G0Z1G0ZOOQ!0Lf7+%s7+%sO#'cQ`O7+%sOOQ!0Lf7+&^7+&^O>wQ`O7+&^O!BeQpO7+&^OOQO7+%v7+%vO$?{Q!0MxO7+&VOOQO7+&V7+&VO%[QlO7+&VO%?[Q!0LrO7+&VO!BYQ!0LrO7+%vO!BeQpO7+%vO%?gQ!0LrO7+&VO%?uQ!0MxO7++pO%[QlO7++pO%@VQ`O7++oO%@VQ`O7++oOOQO1G4q1G4qO9ZQ`O1G4qO%@_Q`O1G4qOOQS7+%{7+%{O#'cQ`O<<LOO4UQ!fO<<LOO%@mQ`O<<LOOOQ[<<LO<<LOO!&iQMhO<<LOO%[QlO<<LOO%@uQ`O<<LOO%AQQ!0MzO,5?_O%C]Q!0MzO,5?aO%EhQ!0MzO1G2_O%GyQ!0MzO1G2rO%JUQ!0MzO1G2tO%LaQ!fO,5?OO%[QlO,5?OOOQO-E<b-E<bO%LkQ`O1G5{OOQ!0Lf<<JS<<JSO%LsQ?MtO1G0sO%NzQ?MtO1G0}O& RQ?MtO1G0}O&#SQ?MtO1G0}O&#ZQ?MtO1G0}O&%[Q?MtO1G0}O&']Q?MtO1G0}O&'dQ?MtO1G0}O&'kQ?MtO1G0}O&)lQ?MtO1G0}O&)sQ?MtO1G0}O&)zQ!0MxO<<JeO&+rQ?MtO1G0}O&,oQ?MvO1G0}O&-rQ?MvO'#JjO&/xQ?MtO1G1bO&0VQ?MtO1G0SO&0aQMjO,5?ROOQO-E<e-E<eO!(yQlO'#FpOOQO'#KX'#KXOOQO1G1t1G1tO&0kQ`O1G1sO&0pQ?MtO,5?YOOOW7+'g7+'gOOOO1G/X1G/XO&0zQ!dO1G4vOOQ!0Lh7+(P7+(PP!&iQMhO,5?[O!+rQMhO7+(bO&1RQ`O,5?ZO9ZQ`O,5?ZOOQO-E<m-E<mO&1aQ`O1G6`O&1aQ`O1G6`O&1iQ`O1G6`O&1tQMjO7+'yO&2UQ!dO,5?]O&2`Q`O,5?]O!&iQMhO,5?]OOQO-E<o-E<oO&2eQ!dO1G6aO&2oQ`O1G6aO&2wQ`O1G2jO!&iQMhO1G2jOOQ!0Lb1G2h1G2hOOQ!0Lb1G2i1G2iO%2qQpO1G2hO!BeQpO1G2hOCfQ`O1G2hOOQ!0Lb1G2p1G2pO&2|QpO1G2hO&3[Q`O1G2jO$)iQ`O1G2iOCfQ`O1G2iO$#^QlO1G2jO&3dQ`O1G2iO&4WQMjO,5?_OOQ!0Lh-E<r-E<rO&4yQMjO,5?aOOQ!0Lh-E<t-E<tO!+rQMhO7++ZOOQ!0Lh1G/a1G/aO&5TQ`O1G/aOOQ!0Lh7+'t7+'tO&5YQMjO7+'{O&5jQMjO7++ZO&5tQMjO7++ZO&6RQ!0MxO<<KWOOQ!0Lf<<KW<<KWO&6uQ`O1G0xO!&iQMhO'#IxO&6zQ`O,5@vO&8|Q!fO<<LOO!&iQMhO1G2mO&9TQ!0LrO1G2mOOQ[<<G{<<G{O!BYQ!0LrO<<G{O&9fQ!0MxO<<IyOOQ!0Lf<<Iy<<IyOOQO,5?j,5?jO&:YQ`O,5?jO&:_Q`O,5?jOOQO-E<|-E<|O&:mQ`O1G6iO&:mQ`O1G6iO9aQ`O1G6iO@iQ`O<<LkOOQ[<<Lk<<LkO&:uQ`O<<LkO9kQ!0LrO<<LkOOQ[<<LW<<LWO%9gQ!0MvO<<LWOOQ[<<LX<<LXO!DfQ`O<<LXO&:zQpO'#IzO&;VQ`O,5@zO!(yQlO,5@zOOQ[1G3V1G3VOOQO'#I|'#I|O9kQ!0LrO'#I|O&;_QpO,5=tOOQ[,5=t,5=tO&;fQpO'#EeO&;mQpO'#GdO&;rQ`O7+(yO&;wQ`O7+(yOOQ[7+(y7+(yO!&iQMhO7+(yO%[QlO7+(yO&<PQ`O7+(yOOQ[7+({7+({O9kQ!0LrO7+({O$#yQ`O7+({O9UQ`O7+({O!BeQpO7+({O&<[Q`O,5?iOOQO-E<{-E<{OOQO'#H]'#H]O&<gQ`O1G6gO9kQ!0LrO<<GqOOQ[<<Gq<<GqO@iQ`O<<GqO&<oQ`O7+,UO&<tQ`O7+,VO%[QlO7+,UO%[QlO7+,VOOQ[7+)T7+)TO&<yQ`O7+)TO&=OQlO7+)TO&=VQ`O7+)TOOQ[<<Lw<<LwOOQ[<<Ly<<LyOOQ[-E=O-E=OOOQ[1G3x1G3xO&=[Q`O,5>_OOQ[,5>a,5>aO&=aQ`O1G4OO9ZQ`O7+&dO!(yQlO7+&dOOQO7+%]7+%]O&=fQ?MtO1G6XO>wQ`O7+%]OOQ!0Lf<<I_<<I_OOQ!0Lf<<Ix<<IxO>wQ`O<<IxOOQO<<Iq<<IqO$?{Q!0MxO<<IqO%[QlO<<IqOOQO<<Ib<<IbO!BYQ!0LrO<<IbO&=pQ!0LrO<<IqO&={Q!0MxO<= [O&>]Q`O<= ZOOQO7+*]7+*]O9ZQ`O7+*]OOQ[ANAjANAjO&>eQ!fOANAjO!&iQMhOANAjO#'cQ`OANAjO4UQ!fOANAjO&>lQ`OANAjO%[QlOANAjO&>tQ!0MzO7+'yO&AVQ!0MzO,5?_O&CbQ!0MzO,5?aO&EmQ!0MzO7+'{O&HOQ!fO1G4jO&HYQ?MtO7+&_O&J^Q?MvO,5=WO&LeQ?MvO,5=YO&LuQ?MvO,5=WO&MVQ?MvO,5=YO&MgQ?MvO,59sO' mQ?MvO,5<jO'#pQ?MvO,5<lO'&UQ?MvO,5<zO''zQ?MtO7+'jO'(XQ?MtO7+'lO'(fQ`O,5<[OOQO7+'_7+'_OOQ!0Lh7+*b7+*bO'(kQMjO<<K|OOQO1G4u1G4uO'(rQ`O1G4uO'(}Q`O1G4uO')]Q`O7++zO')]Q`O7++zO!&iQMhO1G4wO')eQ!dO1G4wO')oQ`O7++{O')wQ`O7+(UO'*SQ!dO7+(UOOQ!0Lb7+(S7+(SOOQ!0Lb7+(T7+(TO!BeQpO7+(SOCfQ`O7+(SO'*^Q`O7+(UO!&iQMhO7+(UO$)iQ`O7+(TO'*cQ`O7+(UOCfQ`O7+(TO'*kQMjO<<NuOOQ!0Lh7+${7+${O!+rQMhO<<NuO'*uQ!dO,5?dOOQO-E<v-E<vO'+PQ!0MvO7+(XO!&iQMhO7+(XOOQ[AN=gAN=gO9aQ`O1G5UOOQO1G5U1G5UO'+aQ`O1G5UO'+fQ`O7+,TO'+fQ`O7+,TO9kQ!0LrOANBVO@iQ`OANBVOOQ[ANBVANBVOOQ[ANArANArOOQ[ANAsANAsO'+nQ`O,5?fOOQO-E<x-E<xO'+yQ?MtO1G6fOOQO,5?h,5?hOOQO-E<z-E<zOOQ[1G3`1G3`O',TQ`O,5=OOOQ[<<Le<<LeO!&iQMhO<<LeO&;rQ`O<<LeO',YQ`O<<LeO%[QlO<<LeOOQ[<<Lg<<LgO9kQ!0LrO<<LgO$#yQ`O<<LgO9UQ`O<<LgO',bQpO1G5TO',mQ`O7+,ROOQ[AN=]AN=]O9kQ!0LrOAN=]OOQ[<= p<= pOOQ[<= q<= qO',uQ`O<= pO',zQ`O<= qOOQ[<<Lo<<LoO'-PQ`O<<LoO'-UQlO<<LoOOQ[1G3y1G3yO>wQ`O7+)jO'-]Q`O<<JOO'-hQ?MtO<<JOOOQO<<Hw<<HwOOQ!0LfAN?dAN?dOOQOAN?]AN?]O$?{Q!0MxOAN?]OOQOAN>|AN>|O%[QlOAN?]OOQO<<Mw<<MwOOQ[G27UG27UO!&iQMhOG27UO#'cQ`OG27UO'-rQ!fOG27UO4UQ!fOG27UO'-yQ`OG27UO'.RQ?MtO<<JeO'.`Q?MvO1G2_O'0UQ?MvO,5?_O'2XQ?MvO,5?aO'4[Q?MvO1G2rO'6_Q?MvO1G2tO'8bQ?MtO<<KWO'8oQ?MtO<<IyOOQO1G1v1G1vO!+rQMhOANAhOOQO7+*a7+*aO'8|Q`O7+*aO'9XQ`O<= fO'9aQ!dO7+*cOOQ!0Lb<<Kp<<KpO$)iQ`O<<KpOCfQ`O<<KpO'9kQ`O<<KpO!&iQMhO<<KpOOQ!0Lb<<Kn<<KnO!BeQpO<<KnO'9vQ!dO<<KpOOQ!0Lb<<Ko<<KoO':QQ`O<<KpO!&iQMhO<<KpO$)iQ`O<<KoO':VQMjOANDaO':aQ!0MvO<<KsOOQO7+*p7+*pO9aQ`O7+*pO':qQ`O<= oOOQ[G27qG27qO9kQ!0LrOG27qO!(yQlO1G5QO':yQ`O7+,QO';RQ`O1G2jO&;rQ`OANBPOOQ[ANBPANBPO!&iQMhOANBPO';WQ`OANBPOOQ[ANBRANBRO9kQ!0LrOANBRO$#yQ`OANBROOQO'#H^'#H^OOQO7+*o7+*oOOQ[G22wG22wOOQ[ANE[ANE[OOQ[ANE]ANE]OOQ[ANBZANBZO';`Q`OANBZOOQ[<<MU<<MUO!(yQlOAN?jOOQOG24wG24wO$?{Q!0MxOG24wO#'cQ`OLD,pOOQ[LD,pLD,pO!&iQMhOLD,pO';eQ!fOLD,pO';lQ?MvO7+'yO'=bQ?MvO,5?_O'?eQ?MvO,5?aO'AhQ?MvO7+'{O'C^QMjOG27SOOQO<<M{<<M{OOQ!0LbANA[ANA[O$)iQ`OANA[OCfQ`OANA[O'CnQ!dOANA[OOQ!0LbANAYANAYO'CuQ`OANA[O!&iQMhOANA[O'DQQ!dOANA[OOQ!0LbANAZANAZOOQO<<N[<<N[OOQ[LD-]LD-]O'D[Q?MtO7+*lOOQO'#Ge'#GeOOQ[G27kG27kO&;rQ`OG27kO!&iQMhOG27kOOQ[G27mG27mO9kQ!0LrOG27mOOQ[G27uG27uO'DfQ?MtOG25UOOQOLD*cLD*cOOQ[!$(![!$(![O#'cQ`O!$(![O!&iQMhO!$(![O'DpQ!0MzOG27SOOQ!0LbG26vG26vO$)iQ`OG26vO'GRQ`OG26vOCfQ`OG26vO'G^Q!dOG26vO!&iQMhOG26vOOQ[LD-VLD-VO&;rQ`OLD-VOOQ[LD-XLD-XOOQ[!)9Ev!)9EvO#'cQ`O!)9EvOOQ!0LbLD,bLD,bO$)iQ`OLD,bOCfQ`OLD,bO'GeQ`OLD,bO'GpQ!dOLD,bOOQ[!$(!q!$(!qOOQ[!.K;b!.K;bO'GwQ?MvOG27SOOQ!0Lb!$( |!$( |O$)iQ`O!$( |OCfQ`O!$( |O'ImQ`O!$( |OOQ!0Lb!)9Eh!)9EhO$)iQ`O!)9EhOCfQ`O!)9EhOOQ!0Lb!.K;S!.K;SO$)iQ`O!.K;SOOQ!0Lb!4/0n!4/0nO!(yQlO'#DxO1PQ`O'#EVO'IxQ!fO'#JpO'JPQ!L^O'#DtO'JWQlO'#D|O'J_Q!fO'#CiO'LuQ!fO'#CiO!(yQlO'#EOO'MVQlO,5;XO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO,5;cO!(yQlO'#InO( YQ`O,5<hO!(yQlO,5;cO( bQMhO,5;cO(!{QMhO,5;cO!(yQlO,5;vO!&iQMhO'#GlO( bQMhO'#GlO!&iQMhO'#GnO( bQMhO'#GnO1SQ`O'#DXO1SQ`O'#DXO!&iQMhO'#GOO( bQMhO'#GOO!&iQMhO'#GQO( bQMhO'#GQO!&iQMhO'#G`O( bQMhO'#G`O!(yQlO,5:hO(#SQpO'#D]O(#^QpO'#JtO!(yQlO,5@mO'MVQlO1G0sO(#hQ?MtO'#CiO!(yQlO1G2OO!&iQMhO'#IsO( bQMhO'#IsO!&iQMhO'#IuO( bQMhO'#IuO(#rQ!dO'#CrO!&iQMhO,5<sO( bQMhO,5<sO'MVQlO1G2QO!(yQlO7+&yO!&iQMhO1G2_O( bQMhO1G2_O!&iQMhO'#IsO( bQMhO'#IsO!&iQMhO'#IuO( bQMhO'#IuO!&iQMhO1G2aO( bQMhO1G2aO'MVQlO7+'lO'MVQlO7+&_O!&iQMhOANAhO( bQMhOANAhO($VQ`O'#EmO($[Q`O'#EmO($dQ`O'#F[O($iQ`O'#EwO($nQ`O'#KRO($yQ`O'#KPO(%UQ`O,5;XO(%ZQMjO,5<dO(%bQ`O'#GXO(%gQ`O'#GXO(%lQ`O,5<fO(%tQ`O,5;XO(%|Q?MtO1G1_O(&TQ`O,5<sO(&YQ`O,5<sO(&_Q`O,5<uO(&dQ`O,5<uO(&iQ`O1G2QO(&nQ`O1G0sO(&sQMjO<<K|O(&zQMjO<<K|O7eQMhO'#F{O9UQ`O'#FzOAdQ`O'#ElO!(yQlO,5;sO!3^Q`O'#GXO!3^Q`O'#GXO!3^Q`O'#GZO!3^Q`O'#GZO!+rQMhO7+(bO!+rQMhO7+(bO%-ZQ!dO1G2vO%-ZQ!dO1G2vO!&iQMhO,5=[O!&iQMhO,5=[",stateData:"((P~O'zOS'{OSTOS'|RQ~OPYOQYOSfOY!VOaqOdzOeyOj!POnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]XO!guO!jZO!mYO!nYO!oYO!qvO!swO!vxO!z]O$V|O$miO%g}O%i!QO%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO%x!UO&U!WO&[!XO&^!YO&`!ZO&b![O&e!]O&k!^O&q!_O&s!`O&u!aO&w!bO&y!cO(RSO(TTO(WUO(_VO(m[O~OWtO~P`OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oa!wOq!nO!Q!oO!`!yO!a!vO!b!vO!z;wO#R!pO#S!pO#T!xO#U!pO#V!pO#Y!zO#Z!zO(S!lO(TTO(WUO(c!mO(m!sO~O'|!{O~OP]XR]X[]Xa]Xp]X!O]X!Q]X!Z]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X'x]X(_]X(p]X(w]X(x]X~O!e%QX~P(qO_!}O(T#PO(U!}O(V#PO~O_#QO(V#PO(W#PO(X#QO~Ov#SO!S#TO(`#TO(a#VO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R;{O(TTO(WUO(_VO(m[O~O!Y#ZO!Z#WO!W(fP!W(tP~P+}O![#cO~P`OPYOQYOSfOd!jOe!iOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(TTO(WUO(_VO(m[O~On#mO!Y#iO!z]O#g#lO#h#iO(R;|O!i(qP~P.iO!j#oO(R#nO~O!v#sO!z]O%g#tO~O#i#uO~O!e#vO#i#uO~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!Z$_O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~Oa(dX'x(dX'u(dX!i(dX!W(dX!](dX%h(dX!e(dX~P1qO#Q$dO#^$eO$P$eOP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#t(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX!](eX%h(eX~Oa(eX'x(eX'u(eX!W(eX!i(eXt(eX!e(eX~P4UO#^$eO~O$[$hO$^$gO$e$mO~OSfO!]$nO$h$oO$j$qO~Oh%VOj%cOn%WOp%XOq$tOr$tOx%YOz%ZO|%[O!Q${O!]$|O!g%aO!j$xO#h%bO$V%_O$s%]O$u%^O$x%`O(R$sO(TTO(WUO(_$uO(w$}O(x%POg([P~O!j%dO~O!Q%gO!]%hO(R%fO~O!e%lO~Oa%mO'x%mO~O!O%qO~P%[O(S!lO~P%[O%m%uO~P%[Oh%VO!j%dO(R%fO(S!lO~Oe%|O!j%dO(R%fO~O#t$RO~O!O&RO!]&OO!j&QO%i&UO(R%fO(S!lO(TTO(WUO`)UP~O!v#sO~O%r&WO!Q)QX!])QX(R)QX~O(R&XO~Oj!PO!s&^O%i!QO%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO~Od&cOe&bO!v&`O%g&aO%z&_O~P<POd&fOeyOj!PO!]&eO!s&^O!vxO!z]O%g}O%k!OO%l!OO%m!OO%p!RO%r!SO%u!TO%v!TO%x!UO~Ob&iO#^&lO%i&gO(S!lO~P=UO!j&mO!s&qO~O!j#oO~O!]XO~Oa%mO'v&yO'x%mO~Oa%mO'v&|O'x%mO~Oa%mO'v'OO'x%mO~O'u]X!W]Xt]X!i]X&Y]X!]]X%h]X!e]X~P(qO!`']O!a'UO!b'UO(S!lO(TTO(WUO~Oq'SO!Q'RO!Y'VO(c'QO![(gP![(vP~P@]Ol'`O!]'^O(R%fO~Oe'eO!j%dO(R%fO~O!O&RO!j&QO~Oq!nO!Q!oO!z;wO#R!pO#S!pO#U!pO#V!pO(S!lO(TTO(WUO(c!mO(m!sO~O!`'kO!a'jO!b'jO#T!pO#Y'lO#Z'lO~PAwOa%mOh%VO!e#vO!j%dO'x%mO(p'nO~O!n'rO#^'pO~PCVOq!nO!Q!oO(TTO(WUO(c!mO(m!sO~O!]XOq(kX!Q(kX!`(kX!a(kX!b(kX!z(kX#R(kX#S(kX#T(kX#U(kX#V(kX#Y(kX#Z(kX(S(kX(T(kX(W(kX(c(kX(m(kX~O!a'jO!b'jO(S!lO~PCuO'}'vO(O'vO(P'xO~O_!}O(T'zO(U!}O(V'zO~O_#QO(V'zO(W'zO(X#QO~Ot'|O~P%[Ov#SO!S#TO(`#TO(a(PO~O!Y(RO!W'UX!W'[X!Z'UX!Z'[X~P+}O!Z(TO!W(fX~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!Z(TO!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~O!W(fX~PGpO!W(YO~O!W(sX!Z(sX!e(sX!i(sX(p(sX~O#^(sX#i#bX![(sX~PIsO#^(ZO!W(uX!Z(uX~O!Z([O!W(tX~O!W(_O~O#^$eO~PIsO![(`O~P`OR#zO!O#yO!Q#{O!j#xO(_VOP!la[!lap!la!Z!la!n!la#P!la#l!la#m!la#n!la#o!la#p!la#q!la#r!la#s!la#t!la#u!la#w!la#y!la#z!la(p!la(w!la(x!la~Oa!la'x!la'u!la!W!la!i!lat!la!]!la%h!la!e!la~PKZO!i(aO~O!e#vO#^(bO(p'nO!Z(rXa(rX'x(rX~O!i(rX~PMvO!Q%gO!]%hO!z]O#g(gO#h(fO(R%fO~O!Z(hO!i(qX~O!i(jO~O!Q%gO!]%hO#h(fO(R%fO~OP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#t(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX~O!e#vO!i(eX~P! dOR(lO!O(kO!j#xO#Q$dO!z!ya!Q!ya~O!v!ya%g!ya!]!ya#g!ya#h!ya(R!ya~P!#eO!v(pO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]XO!guO!jZO!mYO!nYO!oYO!qvO!s!gO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~O#i(vO~O!Y(xO!i(iP~P%[O(c(zO(m[O~O!Q(|O!j#xO(c(zO(m[O~OP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]!eO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(R)ZO(TTO(WUO(_VO(m[O~O!Z$_Oa$pa'x$pa'u$pa!i$pa!W$pa!]$pa%h$pa!e$pa~Oj)bO~P!&iOh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|%[O!Q${O!]$|O!g%aO!j$xO#h%bO$V%_O$s%]O$u%^O$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~Og(nP~P!+rO!O)gO!e)fO!]$]X$Y$]X$[$]X$^$]X$e$]X~O!e)fO!](yX$Y(yX$[(yX$^(yX$e(yX~O!O)gO~P!-{O!O)gO!](yX$Y(yX$[(yX$^(yX$e(yX~O!])iO$Y)mO$[)hO$^)hO$e)nO~O!Y)qO~P!(yO$[$hO$^$gO$e)uO~Ol$yX!O$yX#Q$yX'w$yX(w$yX(x$yX~OgkXg$yXlkX!ZkX#^kX~P!/qOv)wO(`)xO(a)zO~Ol*TO!O)|O'w)}O(w$}O(x%PO~Og){O~P!0uOg*UO~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q*WO!]*XO!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(TTO(WUO(_$uO(w$}O(x%PO~O!Y*[O(R*VO!i(|P~P!1dO#i*^O~O!j*_O~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(R*aO(TTO(WUO(_$uO(w$}O(x%PO~O!Y*dO!W(}P~P!3cOp*pOq!nO!Q*fO!`*nO!a*hO!b*hO!j*_O#Y*oO%_*jO(S!lO(TTO(WUO(c!mO~O![*mO~P!5WO#Q$dOl(^X!O(^X'w(^X(w(^X(x(^X!Z(^X#^(^X~Og(^X#}(^X~P!6YOl*uO#^*tOg(]X!Z(]X~O!Z*vOg([X~Oj%cO(R&XOg([P~Oq*yO~O!j+OO~O(R(tO~On+TO!Q%gO!Y#iO!]%hO!z]O#g#lO#h#iO(R%fO!i(qP~O!e#vO#i+UO~O!Q%gO!Y+WO!Z([O!]%hO(R%fO!W(tP~Oq'YO!Q+YO!Y+XO(TTO(WUO(c(zO~O![(vP~P!9]O!Z+ZOa)RX'x)RX~OP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO#y$WO#z$XO(_VO(p$YO(w#|O(x#}O~Oa!ha!Z!ha'x!ha'u!ha!W!ha!i!hat!ha!]!ha%h!ha!e!ha~P!:TOR#zO!O#yO!Q#{O!j#xO(_VOP!pa[!pap!pa!Z!pa!n!pa#P!pa#l!pa#m!pa#n!pa#o!pa#p!pa#q!pa#r!pa#s!pa#t!pa#u!pa#w!pa#y!pa#z!pa(p!pa(w!pa(x!pa~Oa!pa'x!pa'u!pa!W!pa!i!pat!pa!]!pa%h!pa!e!pa~P!<kOR#zO!O#yO!Q#{O!j#xO(_VOP!ra[!rap!ra!Z!ra!n!ra#P!ra#l!ra#m!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#w!ra#y!ra#z!ra(p!ra(w!ra(x!ra~Oa!ra'x!ra'u!ra!W!ra!i!rat!ra!]!ra%h!ra!e!ra~P!?ROh%VOl+dO!]'^O%h+cO~O!e+fOa(ZX!](ZX'x(ZX!Z(ZX~Oa%mO!]XO'x%mO~Oh%VO!j%dO~Oh%VO!j%dO(R%fO~O!e#vO#i(vO~Ob+qO%i+rO(R+nO(TTO(WUO![)VP~O!Z+sO`)UX~O[+wO~O`+xO~O!]&OO(R%fO(S!lO`)UP~Oh%VO#^+}O~Oh%VOl,QO!]$|O~O!],SO~O!O,UO!]XO~O%m%uO~O!v,ZO~Oe,`O~Ob,aO(R#nO(TTO(WUO![)TP~Oe%|O~O%i!QO(R&XO~P=UO[,fO`,eO~OPYOQYOSfOdzOeyOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!guO!jZO!mYO!nYO!oYO!qvO!vxO!z]O$miO%g}O(TTO(WUO(_VO(m[O~O!]!eO!s!gO$V!kO(R!dO~P!FRO`,eOa%mO'x%mO~OPYOQYOSfOd!jOe!iOnkOpYOqkOrkOxkOzYO|YO!QWO!UkO!VkO!]!eO!guO!jZO!mYO!nYO!oYO!qvO!v!hO$V!kO$miO(R!dO(TTO(WUO(_VO(m[O~Oa,kOj!OO!swO%k!OO%l!OO%m!OO~P!HkO!j&mO~O&[,qO~O!],sO~O&m,uO&o,vOP&jaQ&jaS&jaY&jaa&jad&jae&jaj&jan&jap&jaq&jar&jax&jaz&ja|&ja!Q&ja!U&ja!V&ja!]&ja!g&ja!j&ja!m&ja!n&ja!o&ja!q&ja!s&ja!v&ja!z&ja$V&ja$m&ja%g&ja%i&ja%k&ja%l&ja%m&ja%p&ja%r&ja%u&ja%v&ja%x&ja&U&ja&[&ja&^&ja&`&ja&b&ja&e&ja&k&ja&q&ja&s&ja&u&ja&w&ja&y&ja'u&ja(R&ja(T&ja(W&ja(_&ja(m&ja![&ja&c&jab&ja&h&ja~O(R,{O~Oh!cX!Z!PX![!PX!e!PX!e!cX!j!cX#^!PX~O!Z!cX![!cX~P# qO!e-QO#^-POh(hX!Z#fX![#fX!e(hX!j(hX~O!Z(hX![(hX~P#!dOh%VO!e-SO!j%dO!Z!_X![!_X~Oq!nO!Q!oO(TTO(WUO(c!mO~OP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]!eO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(TTO(WUO(_VO(m[O~O(R<rO~P##yO!Z-WO![(gX~O![-YO~O!e-QO#^-PO!Z#fX![#fX~O!Z-ZO![(vX~O![-]O~O!a-^O!b-^O(S!lO~P##hO![-aO~P'_Ol-dO!]'^O~O!W-iO~Oq!ya!`!ya!a!ya!b!ya#R!ya#S!ya#T!ya#U!ya#V!ya#Y!ya#Z!ya(S!ya(T!ya(W!ya(c!ya(m!ya~P!#eO!n-nO#^-lO~PCVO!a-pO!b-pO(S!lO~PCuOa%mO#^-lO'x%mO~Oa%mO!e#vO#^-lO'x%mO~Oa%mO!e#vO!n-nO#^-lO'x%mO(p'nO~O'}'vO(O'vO(P-uO~Ot-vO~O!W'Ua!Z'Ua~P!:TO!Y-zO!W'UX!Z'UX~P%[O!Z(TO!W(fa~O!W(fa~PGpO!Z([O!W(ta~O!Q%gO!Y.OO!]%hO(R%fO!W'[X!Z'[X~O#^.QO!Z(ra!i(raa(ra'x(ra~O!e#vO~P#,PO!Z(hO!i(qa~O!Q%gO!]%hO#h.UO(R%fO~On.ZO!Q%gO!Y.WO!]%hO!z]O#g.YO#h.WO(R%fO!Z'_X!i'_X~OR._O!j#xO~Oh%VOl.bO!]'^O%h.aO~Oa#ai!Z#ai'x#ai'u#ai!W#ai!i#ait#ai!]#ai%h#ai!e#ai~P!:TOl=|O!O)|O'w)}O(w$}O(x%PO~O#i#]aa#]a#^#]a'x#]a!Z#]a!i#]a!]#]a!W#]a~P#.{O#i(^XP(^XR(^X[(^Xa(^Xp(^X!Q(^X!j(^X!n(^X#P(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#s(^X#t(^X#u(^X#w(^X#y(^X#z(^X'x(^X(_(^X(p(^X!i(^X!W(^X'u(^Xt(^X!](^X%h(^X!e(^X~P!6YO!Z.oO!i(iX~P!:TO!i.rO~O!W.tO~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O(_VO[#kia#kip#ki!Z#ki#P#ki#m#ki#n#ki#o#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#l#ki~P#2kO#l$OO~P#2kOP$[OR#zOp$aO!O#yO!Q#{O!j#xO!n$[O#l$OO#m$PO#n$PO#o$PO(_VO[#kia#ki!Z#ki#P#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#p#ki~P#5YO#p$QO~P#5YOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO(_VOa#ki!Z#ki#w#ki#y#ki#z#ki'x#ki(p#ki(w#ki(x#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#u#ki~P#7wOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO(_VO(x#}Oa#ki!Z#ki#y#ki#z#ki'x#ki(p#ki(w#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#w$UO~P#:_O#w#ki~P#:_O#u$SO~P#7wOP$[OR#zO[$cOp$aO!O#yO!Q#{O!j#xO!n$[O#P$RO#l$OO#m$PO#n$PO#o$PO#p$QO#q$RO#r$RO#s$bO#t$RO#u$SO#w$UO(_VO(w#|O(x#}Oa#ki!Z#ki#z#ki'x#ki(p#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~O#y#ki~P#=TO#y$WO~P#=TOP]XR]X[]Xp]X!O]X!Q]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X!Z]X![]X~O#}]X~P#?rOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO#w<VO#y<XO#z<YO(_VO(p$YO(w#|O(x#}O~O#}.vO~P#BPO#Q$dO#^<`O$P<`O#}(eX![(eX~P! dOa'ba!Z'ba'x'ba'u'ba!i'ba!W'bat'ba!]'ba%h'ba!e'ba~P!:TO[#kia#kip#ki!Z#ki#P#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki'x#ki(p#ki'u#ki!W#ki!i#kit#ki!]#ki%h#ki!e#ki~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O#l$OO#m$PO#n$PO#o$PO(_VO(w#ki(x#ki~P#EROl=|O!O)|O'w)}O(w$}O(x%POP#kiR#ki!Q#ki!j#ki!n#ki#l#ki#m#ki#n#ki#o#ki(_#ki~P#ERO!Z.zOg(nX~P!0uOg.|O~Oa$Oi!Z$Oi'x$Oi'u$Oi!W$Oi!i$Oit$Oi!]$Oi%h$Oi!e$Oi~P!:TO$[.}O$^.}O~O$[/OO$^/OO~O!e)fO#^/PO!]$bX$Y$bX$[$bX$^$bX$e$bX~O!Y/QO~O!])iO$Y/SO$[)hO$^)hO$e/TO~O!Z<ZO![(dX~P#BPO![/UO~O!e)fO$e(yX~O$e/WO~Ot/XO~P!&iOv)wO(`)xO(a/[O~O!Q/_O~O(w$}Ol%`a!O%`a'w%`a(x%`a!Z%`a#^%`a~Og%`a#}%`a~P#LTO(x%POl%ba!O%ba'w%ba(w%ba!Z%ba#^%ba~Og%ba#}%ba~P#LvO!ZfX!efX!ifX!i$yX(pfX~P!/qO!Y/hO!Z([O(R/gO!W(tP!W(}P~P!1dOp*pO!`*nO!a*hO!b*hO!j*_O#Y*oO%_*jO(S!lO(TTO(WUO~Oq<oO!Q/iO!Y+XO![*mO(c<nO![(vP~P#NaO!i/jO~P#.{O!Z/kO!e#vO(p'nO!i(|X~O!i/pO~O!Q%gO!Y*[O!]%hO(R%fO!i(|P~O#i/rO~O!W$yX!Z$yX!e%QX~P!/qO!Z/sO!W(}X~P#.{O!e/uO~O!W/wO~OnkO(R/xO~P.iOh%VOp/}O!e#vO!j%dO(p'nO~O!e+fO~Oa%mO!Z0RO'x%mO~O![0TO~P!5WO!a0UO!b0UO(S!lO~P##hOq!nO!Q0VO(TTO(WUO(c!mO~O#Y0XO~Og%`a!Z%`a#^%`a#}%`a~P!0uOg%ba!Z%ba#^%ba#}%ba~P!0uOj%cO(R&XOg'kX!Z'kX~O!Z*vOg([a~Og0bO~OR0cO!O0cO!Q0dO#Q$dOl{a'w{a(w{a(x{a!Z{a#^{a~Og{a#}{a~P$&dO!O)|O'w)}Ol$ra(w$ra(x$ra!Z$ra#^$ra~Og$ra#}$ra~P$'`O!O)|O'w)}Ol$ta(w$ta(x$ta!Z$ta#^$ta~Og$ta#}$ta~P$(RO#i0gO~Og%Sa!Z%Sa#^%Sa#}%Sa~P!0uOl0iO#^0hOg(]a!Z(]a~O!e#vO~O#i0lO~O!Z+ZOa)Ra'x)Ra~OR#zO!O#yO!Q#{O!j#xO(_VOP!pi[!pip!pi!Z!pi!n!pi#P!pi#l!pi#m!pi#n!pi#o!pi#p!pi#q!pi#r!pi#s!pi#t!pi#u!pi#w!pi#y!pi#z!pi(p!pi(w!pi(x!pi~Oa!pi'x!pi'u!pi!W!pi!i!pit!pi!]!pi%h!pi!e!pi~P$*OOh%VOp%XOq$tOr$tOx%YOz%ZO|<eO!Q${O!]$|O!g=vO!j$xO#h<kO$V%_O$s<gO$u<iO$x%`O(TTO(WUO(_$uO(w$}O(x%PO~On0vO%[0wO(R0tO~P$,fO!e+fOa(Za!](Za'x(Za!Z(Za~O#i0|O~O[]X!ZfX![fX~O!Z0}O![)VX~O![1PO~O[1QO~Ob1SO(R+nO(TTO(WUO~O!]&OO(R%fO`'sX!Z'sX~O!Z+sO`)Ua~O!i1VO~P!:TO[1YO~O`1ZO~O#^1^O~Ol1aO!]$|O~O(c(zO![)SP~Oh%VOl1jO!]1gO%h1iO~O[1tO!Z1rO![)TX~O![1uO~O`1wOa%mO'x%mO~O(R#nO(TTO(WUO~O#Q$dO#^$eO$P$eOP(eXR(eX[(eXp(eX!O(eX!Q(eX!Z(eX!j(eX!n(eX#P(eX#l(eX#m(eX#n(eX#o(eX#p(eX#q(eX#r(eX#s(eX#u(eX#w(eX#y(eX#z(eX(_(eX(p(eX(w(eX(x(eX~O#t1zO&Y1{Oa(eX~P$2PO#^$eO#t1zO&Y1{O~Oa1}O~P%[Oa2PO~O&c2SOP&aiQ&aiS&aiY&aia&aid&aie&aij&ain&aip&aiq&air&aix&aiz&ai|&ai!Q&ai!U&ai!V&ai!]&ai!g&ai!j&ai!m&ai!n&ai!o&ai!q&ai!s&ai!v&ai!z&ai$V&ai$m&ai%g&ai%i&ai%k&ai%l&ai%m&ai%p&ai%r&ai%u&ai%v&ai%x&ai&U&ai&[&ai&^&ai&`&ai&b&ai&e&ai&k&ai&q&ai&s&ai&u&ai&w&ai&y&ai'u&ai(R&ai(T&ai(W&ai(_&ai(m&ai![&aib&ai&h&ai~Ob2YO![2WO&h2XO~P`O!]XO!j2[O~O&o,vOP&jiQ&jiS&jiY&jia&jid&jie&jij&jin&jip&jiq&jir&jix&jiz&ji|&ji!Q&ji!U&ji!V&ji!]&ji!g&ji!j&ji!m&ji!n&ji!o&ji!q&ji!s&ji!v&ji!z&ji$V&ji$m&ji%g&ji%i&ji%k&ji%l&ji%m&ji%p&ji%r&ji%u&ji%v&ji%x&ji&U&ji&[&ji&^&ji&`&ji&b&ji&e&ji&k&ji&q&ji&s&ji&u&ji&w&ji&y&ji'u&ji(R&ji(T&ji(W&ji(_&ji(m&ji![&ji&c&jib&ji&h&ji~O!W2bO~O!Z!_a![!_a~P#BPOq!nO!Q!oO!Y2hO(c!mO!Z'VX!['VX~P@]O!Z-WO![(ga~O!Z']X![']X~P!9]O!Z-ZO![(va~O![2oO~P'_Oa%mO#^2xO'x%mO~Oa%mO!e#vO#^2xO'x%mO~Oa%mO!e#vO!n2|O#^2xO'x%mO(p'nO~Oa%mO'x%mO~P!:TO!Z$_Ot$pa~O!W'Ui!Z'Ui~P!:TO!Z(TO!W(fi~O!Z([O!W(ti~O!W(ui!Z(ui~P!:TO!Z(ri!i(ria(ri'x(ri~P!:TO#^3OO!Z(ri!i(ria(ri'x(ri~O!Z(hO!i(qi~O!Q%gO!]%hO!z]O#g3TO#h3SO(R%fO~O!Q%gO!]%hO#h3SO(R%fO~Ol3[O!]'^O%h3ZO~Oh%VOl3[O!]'^O%h3ZO~O#i%`aP%`aR%`a[%`aa%`ap%`a!Q%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a'x%`a(_%`a(p%`a!i%`a!W%`a'u%`at%`a!]%`a%h%`a!e%`a~P#LTO#i%baP%baR%ba[%baa%bap%ba!Q%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba'x%ba(_%ba(p%ba!i%ba!W%ba'u%bat%ba!]%ba%h%ba!e%ba~P#LvO#i%`aP%`aR%`a[%`aa%`ap%`a!Q%`a!Z%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a'x%`a(_%`a(p%`a!i%`a!W%`a'u%`a#^%`at%`a!]%`a%h%`a!e%`a~P#.{O#i%baP%baR%ba[%baa%bap%ba!Q%ba!Z%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba'x%ba(_%ba(p%ba!i%ba!W%ba'u%ba#^%bat%ba!]%ba%h%ba!e%ba~P#.{O#i{aP{a[{aa{ap{a!j{a!n{a#P{a#l{a#m{a#n{a#o{a#p{a#q{a#r{a#s{a#t{a#u{a#w{a#y{a#z{a'x{a(_{a(p{a!i{a!W{a'u{at{a!]{a%h{a!e{a~P$&dO#i$raP$raR$ra[$raa$rap$ra!Q$ra!j$ra!n$ra#P$ra#l$ra#m$ra#n$ra#o$ra#p$ra#q$ra#r$ra#s$ra#t$ra#u$ra#w$ra#y$ra#z$ra'x$ra(_$ra(p$ra!i$ra!W$ra'u$rat$ra!]$ra%h$ra!e$ra~P$'`O#i$taP$taR$ta[$taa$tap$ta!Q$ta!j$ta!n$ta#P$ta#l$ta#m$ta#n$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#w$ta#y$ta#z$ta'x$ta(_$ta(p$ta!i$ta!W$ta'u$tat$ta!]$ta%h$ta!e$ta~P$(RO#i%SaP%SaR%Sa[%Saa%Sap%Sa!Q%Sa!Z%Sa!j%Sa!n%Sa#P%Sa#l%Sa#m%Sa#n%Sa#o%Sa#p%Sa#q%Sa#r%Sa#s%Sa#t%Sa#u%Sa#w%Sa#y%Sa#z%Sa'x%Sa(_%Sa(p%Sa!i%Sa!W%Sa'u%Sa#^%Sat%Sa!]%Sa%h%Sa!e%Sa~P#.{Oa#aq!Z#aq'x#aq'u#aq!W#aq!i#aqt#aq!]#aq%h#aq!e#aq~P!:TO!Y3dO!Z'WX!i'WX~P%[O!Z.oO!i(ia~O!Z.oO!i(ia~P!:TO!W3gO~O#}!la![!la~PKZO#}!ha!Z!ha![!ha~P#BPO#}!pa![!pa~P!<kO#}!ra![!ra~P!?ROg'ZX!Z'ZX~P!+rO!Z.zOg(na~OSfO!]3{O$c3|O~O![4QO~Ot4RO~P#.{Oa$lq!Z$lq'x$lq'u$lq!W$lq!i$lqt$lq!]$lq%h$lq!e$lq~P!:TO!W4TO~P!&iO!Q4UO~O!O)|O'w)}O(x%POl'ga(w'ga!Z'ga#^'ga~Og'ga#}'ga~P%+uO!O)|O'w)}Ol'ia(w'ia(x'ia!Z'ia#^'ia~Og'ia#}'ia~P%,hO(p$YO~P#.{O!WfX!W$yX!ZfX!Z$yX!e%QX#^fX~P!/qO(R<xO~P!1dO!Q%gO!Y4XO!]%hO(R%fO!Z'cX!i'cX~O!Z/kO!i(|a~O!Z/kO!e#vO!i(|a~O!Z/kO!e#vO(p'nO!i(|a~Og${i!Z${i#^${i#}${i~P!0uO!Y4aO!W'eX!Z'eX~P!3cO!Z/sO!W(}a~O!Z/sO!W(}a~P#.{OP]XR]X[]Xp]X!O]X!Q]X!W]X!Z]X!j]X!n]X#P]X#Q]X#^]X#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X~O!e%XX#t%XX~P%0XO!e#vO#t4fO~Oh%VO!e#vO!j%dO~Oh%VOp4kO!j%dO(p'nO~Op4pO!e#vO(p'nO~Oq!nO!Q4qO(TTO(WUO(c!mO~O(w$}Ol%`i!O%`i'w%`i(x%`i!Z%`i#^%`i~Og%`i#}%`i~P%3xO(x%POl%bi!O%bi'w%bi(w%bi!Z%bi#^%bi~Og%bi#}%bi~P%4kOg(]i!Z(]i~P!0uO#^4wOg(]i!Z(]i~P!0uO!i4zO~Oa$nq!Z$nq'x$nq'u$nq!W$nq!i$nqt$nq!]$nq%h$nq!e$nq~P!:TO!W5QO~O!Z5RO!])OX~P#.{Oa]Xa$yX!]]X!]$yX%]]X'x]X'x$yX!Z]X!Z$yX~P!/qO%]5UOa%Za!]%Za'x%Za!Z%Za~OlmX!OmX'wmX(wmX(xmX~P%7nOn5VO(R#nO~Ob5]O%i5^O(R+nO(TTO(WUO!Z'rX!['rX~O!Z0}O![)Va~O[5bO~O`5cO~Oa%mO'x%mO~P#.{O!Z5kO#^5mO![)SX~O![5nO~Op5tOq!nO!Q*fO!`!yO!a!vO!b!vO!z;wO#R!pO#S!pO#T!pO#U!pO#V!pO#Y5sO#Z!zO(S!lO(TTO(WUO(c!mO(m!sO~O![5rO~P%:ROl5yO!]1gO%h5xO~Oh%VOl5yO!]1gO%h5xO~Ob6QO(R#nO(TTO(WUO!Z'qX!['qX~O!Z1rO![)Ta~O(TTO(WUO(c6SO~O`6WO~O#t6ZO&Y6[O~PMvO!i6]O~P%[Oa6_O~Oa6_O~P%[Ob2YO![6dO&h2XO~P`O!e6fO~O!e6hOh(hi!Z(hi![(hi!e(hi!j(hip(hi(p(hi~O!Z#fi![#fi~P#BPO#^6iO!Z#fi![#fi~O!Z!_i![!_i~P#BPOa%mO#^6rO'x%mO~Oa%mO!e#vO#^6rO'x%mO~O!Z(rq!i(rqa(rq'x(rq~P!:TO!Z(hO!i(qq~O!Q%gO!]%hO#h6yO(R%fO~O!]'^O%h6|O~Ol7QO!]'^O%h6|O~O#i'gaP'gaR'ga['gaa'gap'ga!Q'ga!j'ga!n'ga#P'ga#l'ga#m'ga#n'ga#o'ga#p'ga#q'ga#r'ga#s'ga#t'ga#u'ga#w'ga#y'ga#z'ga'x'ga(_'ga(p'ga!i'ga!W'ga'u'gat'ga!]'ga%h'ga!e'ga~P%+uO#i'iaP'iaR'ia['iaa'iap'ia!Q'ia!j'ia!n'ia#P'ia#l'ia#m'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#w'ia#y'ia#z'ia'x'ia(_'ia(p'ia!i'ia!W'ia'u'iat'ia!]'ia%h'ia!e'ia~P%,hO#i${iP${iR${i[${ia${ip${i!Q${i!Z${i!j${i!n${i#P${i#l${i#m${i#n${i#o${i#p${i#q${i#r${i#s${i#t${i#u${i#w${i#y${i#z${i'x${i(_${i(p${i!i${i!W${i'u${i#^${it${i!]${i%h${i!e${i~P#.{O#i%`iP%`iR%`i[%`ia%`ip%`i!Q%`i!j%`i!n%`i#P%`i#l%`i#m%`i#n%`i#o%`i#p%`i#q%`i#r%`i#s%`i#t%`i#u%`i#w%`i#y%`i#z%`i'x%`i(_%`i(p%`i!i%`i!W%`i'u%`it%`i!]%`i%h%`i!e%`i~P%3xO#i%biP%biR%bi[%bia%bip%bi!Q%bi!j%bi!n%bi#P%bi#l%bi#m%bi#n%bi#o%bi#p%bi#q%bi#r%bi#s%bi#t%bi#u%bi#w%bi#y%bi#z%bi'x%bi(_%bi(p%bi!i%bi!W%bi'u%bit%bi!]%bi%h%bi!e%bi~P%4kO!Z'Wa!i'Wa~P!:TO!Z.oO!i(ii~O#}#ai!Z#ai![#ai~P#BPOP$[OR#zO!O#yO!Q#{O!j#xO!n$[O(_VO[#kip#ki#P#ki#m#ki#n#ki#o#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#l#ki~P%MQO#l<PO~P%MQOP$[OR#zOp<]O!O#yO!Q#{O!j#xO!n$[O#l<PO#m<QO#n<QO#o<QO(_VO[#ki#P#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#p#ki~P& YO#p<RO~P& YOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO(_VO#w#ki#y#ki#z#ki#}#ki(p#ki(w#ki(x#ki!Z#ki![#ki~O#u#ki~P&#bOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO(_VO(x#}O#y#ki#z#ki#}#ki(p#ki(w#ki!Z#ki![#ki~O#w<VO~P&%cO#w#ki~P&%cO#u<TO~P&#bOP$[OR#zO[<_Op<]O!O#yO!Q#{O!j#xO!n$[O#P<SO#l<PO#m<QO#n<QO#o<QO#p<RO#q<SO#r<SO#s<^O#t<SO#u<TO#w<VO(_VO(w#|O(x#}O#z#ki#}#ki(p#ki!Z#ki![#ki~O#y#ki~P&'rO#y<XO~P&'rOa#{y!Z#{y'x#{y'u#{y!W#{y!i#{yt#{y!]#{y%h#{y!e#{y~P!:TO[#kip#ki#P#ki#p#ki#q#ki#r#ki#s#ki#t#ki#u#ki#w#ki#y#ki#z#ki#}#ki(p#ki!Z#ki![#ki~OP$[OR#zO!O#yO!Q#{O!j#xO!n$[O#l<PO#m<QO#n<QO#o<QO(_VO(w#ki(x#ki~P&*nOl=}O!O)|O'w)}O(w$}O(x%POP#kiR#ki!Q#ki!j#ki!n#ki#l#ki#m#ki#n#ki#o#ki(_#ki~P&*nO#Q$dOP(^XR(^X[(^Xl(^Xp(^X!O(^X!Q(^X!j(^X!n(^X#P(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#s(^X#t(^X#u(^X#w(^X#y(^X#z(^X#}(^X'w(^X(_(^X(p(^X(w(^X(x(^X!Z(^X![(^X~O#}$Oi!Z$Oi![$Oi~P#BPO#}!pi![!pi~P$*OOg'Za!Z'Za~P!0uO![7dO~O!Z'ba!['ba~P#BPO!W7eO~P#.{O!e#vO(p'nO!Z'ca!i'ca~O!Z/kO!i(|i~O!Z/kO!e#vO!i(|i~Og${q!Z${q#^${q#}${q~P!0uO!W'ea!Z'ea~P#.{O!e7lO~O!Z/sO!W(}i~P#.{O!Z/sO!W(}i~O!W7oO~Oh%VOp7tO!j%dO(p'nO~O!e#vO#t7vO~Op7yO!e#vO(p'nO~O!O)|O'w)}O(x%POl'ha(w'ha!Z'ha#^'ha~Og'ha#}'ha~P&3oO!O)|O'w)}Ol'ja(w'ja(x'ja!Z'ja#^'ja~Og'ja#}'ja~P&4bO!W7{O~Og$}q!Z$}q#^$}q#}$}q~P!0uOg(]q!Z(]q~P!0uO#^7|Og(]q!Z(]q~P!0uOa$ny!Z$ny'x$ny'u$ny!W$ny!i$nyt$ny!]$ny%h$ny!e$ny~P!:TO!e6hO~O!Z5RO!])Oa~O!]'^OP$SaR$Sa[$Sap$Sa!O$Sa!Q$Sa!Z$Sa!j$Sa!n$Sa#P$Sa#l$Sa#m$Sa#n$Sa#o$Sa#p$Sa#q$Sa#r$Sa#s$Sa#t$Sa#u$Sa#w$Sa#y$Sa#z$Sa(_$Sa(p$Sa(w$Sa(x$Sa~O%h6|O~P&7SO%]8QOa%Zi!]%Zi'x%Zi!Z%Zi~Oa#ay!Z#ay'x#ay'u#ay!W#ay!i#ayt#ay!]#ay%h#ay!e#ay~P!:TO[8SO~Ob8UO(R+nO(TTO(WUO~O!Z0}O![)Vi~O`8YO~O(c(zO!Z'nX!['nX~O!Z5kO![)Sa~O![8cO~P%:RO(m!sO~P$$oO#Y8dO~O!]1gO~O!]1gO%h8fO~Ol8iO!]1gO%h8fO~O[8nO!Z'qa!['qa~O!Z1rO![)Ti~O!i8rO~O!i8sO~O!i8vO~O!i8vO~P%[Oa8xO~O!e8yO~O!i8zO~O!Z(ui![(ui~P#BPOa%mO#^9SO'x%mO~O!Z(ry!i(rya(ry'x(ry~P!:TO!Z(hO!i(qy~O%h9VO~P&7SO!]'^O%h9VO~O#i${qP${qR${q[${qa${qp${q!Q${q!Z${q!j${q!n${q#P${q#l${q#m${q#n${q#o${q#p${q#q${q#r${q#s${q#t${q#u${q#w${q#y${q#z${q'x${q(_${q(p${q!i${q!W${q'u${q#^${qt${q!]${q%h${q!e${q~P#.{O#i'haP'haR'ha['haa'hap'ha!Q'ha!j'ha!n'ha#P'ha#l'ha#m'ha#n'ha#o'ha#p'ha#q'ha#r'ha#s'ha#t'ha#u'ha#w'ha#y'ha#z'ha'x'ha(_'ha(p'ha!i'ha!W'ha'u'hat'ha!]'ha%h'ha!e'ha~P&3oO#i'jaP'jaR'ja['jaa'jap'ja!Q'ja!j'ja!n'ja#P'ja#l'ja#m'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#w'ja#y'ja#z'ja'x'ja(_'ja(p'ja!i'ja!W'ja'u'jat'ja!]'ja%h'ja!e'ja~P&4bO#i$}qP$}qR$}q[$}qa$}qp$}q!Q$}q!Z$}q!j$}q!n$}q#P$}q#l$}q#m$}q#n$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#w$}q#y$}q#z$}q'x$}q(_$}q(p$}q!i$}q!W$}q'u$}q#^$}qt$}q!]$}q%h$}q!e$}q~P#.{O!Z'Wi!i'Wi~P!:TO#}#aq!Z#aq![#aq~P#BPO(w$}OP%`aR%`a[%`ap%`a!Q%`a!j%`a!n%`a#P%`a#l%`a#m%`a#n%`a#o%`a#p%`a#q%`a#r%`a#s%`a#t%`a#u%`a#w%`a#y%`a#z%`a#}%`a(_%`a(p%`a!Z%`a![%`a~Ol%`a!O%`a'w%`a(x%`a~P&HgO(x%POP%baR%ba[%bap%ba!Q%ba!j%ba!n%ba#P%ba#l%ba#m%ba#n%ba#o%ba#p%ba#q%ba#r%ba#s%ba#t%ba#u%ba#w%ba#y%ba#z%ba#}%ba(_%ba(p%ba!Z%ba![%ba~Ol%ba!O%ba'w%ba(w%ba~P&JnOl=}O!O)|O'w)}O(x%PO~P&HgOl=}O!O)|O'w)}O(w$}O~P&JnOR0cO!O0cO!Q0dO#Q$dOP{a[{al{ap{a!j{a!n{a#P{a#l{a#m{a#n{a#o{a#p{a#q{a#r{a#s{a#t{a#u{a#w{a#y{a#z{a#}{a'w{a(_{a(p{a(w{a(x{a!Z{a![{a~O!O)|O'w)}OP$raR$ra[$ral$rap$ra!Q$ra!j$ra!n$ra#P$ra#l$ra#m$ra#n$ra#o$ra#p$ra#q$ra#r$ra#s$ra#t$ra#u$ra#w$ra#y$ra#z$ra#}$ra(_$ra(p$ra(w$ra(x$ra!Z$ra![$ra~O!O)|O'w)}OP$taR$ta[$tal$tap$ta!Q$ta!j$ta!n$ta#P$ta#l$ta#m$ta#n$ta#o$ta#p$ta#q$ta#r$ta#s$ta#t$ta#u$ta#w$ta#y$ta#z$ta#}$ta(_$ta(p$ta(w$ta(x$ta!Z$ta![$ta~Ol=}O!O)|O'w)}O(w$}O(x%PO~OP%SaR%Sa[%Sap%Sa!Q%Sa!j%Sa!n%Sa#P%Sa#l%Sa#m%Sa#n%Sa#o%Sa#p%Sa#q%Sa#r%Sa#s%Sa#t%Sa#u%Sa#w%Sa#y%Sa#z%Sa#}%Sa(_%Sa(p%Sa!Z%Sa![%Sa~P'%sO#}$lq!Z$lq![$lq~P#BPO#}$nq!Z$nq![$nq~P#BPO![9dO~O#}9eO~P!0uO!e#vO!Z'ci!i'ci~O!e#vO(p'nO!Z'ci!i'ci~O!Z/kO!i(|q~O!W'ei!Z'ei~P#.{O!Z/sO!W(}q~Op9lO!e#vO(p'nO~O[9nO!W9mO~P#.{O!W9mO~O!e#vO#t9tO~Og(]y!Z(]y~P!0uO!Z'la!]'la~P#.{Oa%Zq!]%Zq'x%Zq!Z%Zq~P#.{O[9yO~O!Z0}O![)Vq~O#^9}O!Z'na!['na~O!Z5kO![)Si~P#BPO!Q:PO~O!]1gO%h:SO~O(TTO(WUO(c:XO~O!Z1rO![)Tq~O!i:[O~O!i:]O~O!i:^O~O!i:^O~P%[O#^:aO!Z#fy![#fy~O!Z#fy![#fy~P#BPO%h:fO~P&7SO!]'^O%h:fO~O#}#{y!Z#{y![#{y~P#BPOP${iR${i[${ip${i!Q${i!j${i!n${i#P${i#l${i#m${i#n${i#o${i#p${i#q${i#r${i#s${i#t${i#u${i#w${i#y${i#z${i#}${i(_${i(p${i!Z${i![${i~P'%sO!O)|O'w)}O(x%POP'gaR'ga['gal'gap'ga!Q'ga!j'ga!n'ga#P'ga#l'ga#m'ga#n'ga#o'ga#p'ga#q'ga#r'ga#s'ga#t'ga#u'ga#w'ga#y'ga#z'ga#}'ga(_'ga(p'ga(w'ga!Z'ga!['ga~O!O)|O'w)}OP'iaR'ia['ial'iap'ia!Q'ia!j'ia!n'ia#P'ia#l'ia#m'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#w'ia#y'ia#z'ia#}'ia(_'ia(p'ia(w'ia(x'ia!Z'ia!['ia~O(w$}OP%`iR%`i[%`il%`ip%`i!O%`i!Q%`i!j%`i!n%`i#P%`i#l%`i#m%`i#n%`i#o%`i#p%`i#q%`i#r%`i#s%`i#t%`i#u%`i#w%`i#y%`i#z%`i#}%`i'w%`i(_%`i(p%`i(x%`i!Z%`i![%`i~O(x%POP%biR%bi[%bil%bip%bi!O%bi!Q%bi!j%bi!n%bi#P%bi#l%bi#m%bi#n%bi#o%bi#p%bi#q%bi#r%bi#s%bi#t%bi#u%bi#w%bi#y%bi#z%bi#}%bi'w%bi(_%bi(p%bi(w%bi!Z%bi![%bi~O#}$ny!Z$ny![$ny~P#BPO#}#ay!Z#ay![#ay~P#BPO!e#vO!Z'cq!i'cq~O!Z/kO!i(|y~O!W'eq!Z'eq~P#.{Op:pO!e#vO(p'nO~O[:tO!W:sO~P#.{O!W:sO~Og(]!R!Z(]!R~P!0uOa%Zy!]%Zy'x%Zy!Z%Zy~P#.{O!Z0}O![)Vy~O!Z5kO![)Sq~O(R:zO~O!]1gO%h:}O~O!i;QO~O%h;VO~P&7SOP${qR${q[${qp${q!Q${q!j${q!n${q#P${q#l${q#m${q#n${q#o${q#p${q#q${q#r${q#s${q#t${q#u${q#w${q#y${q#z${q#}${q(_${q(p${q!Z${q![${q~P'%sO!O)|O'w)}O(x%POP'haR'ha['hal'hap'ha!Q'ha!j'ha!n'ha#P'ha#l'ha#m'ha#n'ha#o'ha#p'ha#q'ha#r'ha#s'ha#t'ha#u'ha#w'ha#y'ha#z'ha#}'ha(_'ha(p'ha(w'ha!Z'ha!['ha~O!O)|O'w)}OP'jaR'ja['jal'jap'ja!Q'ja!j'ja!n'ja#P'ja#l'ja#m'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#w'ja#y'ja#z'ja#}'ja(_'ja(p'ja(w'ja(x'ja!Z'ja!['ja~OP$}qR$}q[$}qp$}q!Q$}q!j$}q!n$}q#P$}q#l$}q#m$}q#n$}q#o$}q#p$}q#q$}q#r$}q#s$}q#t$}q#u$}q#w$}q#y$}q#z$}q#}$}q(_$}q(p$}q!Z$}q![$}q~P'%sOg%d!Z!Z%d!Z#^%d!Z#}%d!Z~P!0uO!W;ZO~P#.{Op;[O!e#vO(p'nO~O[;^O!W;ZO~P#.{O!Z'nq!['nq~P#BPO!Z#f!Z![#f!Z~P#BPO#i%d!ZP%d!ZR%d!Z[%d!Za%d!Zp%d!Z!Q%d!Z!Z%d!Z!j%d!Z!n%d!Z#P%d!Z#l%d!Z#m%d!Z#n%d!Z#o%d!Z#p%d!Z#q%d!Z#r%d!Z#s%d!Z#t%d!Z#u%d!Z#w%d!Z#y%d!Z#z%d!Z'x%d!Z(_%d!Z(p%d!Z!i%d!Z!W%d!Z'u%d!Z#^%d!Zt%d!Z!]%d!Z%h%d!Z!e%d!Z~P#.{Op;fO!e#vO(p'nO~O!W;gO~P#.{Op;nO!e#vO(p'nO~O!W;oO~P#.{OP%d!ZR%d!Z[%d!Zp%d!Z!Q%d!Z!j%d!Z!n%d!Z#P%d!Z#l%d!Z#m%d!Z#n%d!Z#o%d!Z#p%d!Z#q%d!Z#r%d!Z#s%d!Z#t%d!Z#u%d!Z#w%d!Z#y%d!Z#z%d!Z#}%d!Z(_%d!Z(p%d!Z!Z%d!Z![%d!Z~P'%sOp;rO!e#vO(p'nO~Ot(dX~P1qO!O%qO~P!(yO(S!lO~P!(yO!WfX!ZfX#^fX~P%0XOP]XR]X[]Xp]X!O]X!Q]X!Z]X!ZfX!j]X!n]X#P]X#Q]X#^]X#^fX#ifX#l]X#m]X#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#w]X#y]X#z]X$P]X(_]X(p]X(w]X(x]X~O!efX!i]X!ifX(pfX~P'JlOP;vOQ;vOSfOd=rOe!iOnkOp;vOqkOrkOxkOz;vO|;vO!QWO!UkO!VkO!]XO!g;yO!jZO!m;vO!n;vO!o;vO!q;zO!s;}O!v!hO$V!kO$m=pO(R)ZO(TTO(WUO(_VO(m[O~O!Z<ZO![$pa~Oh%VOn%WOp%XOq$tOr$tOx%YOz%ZO|<fO!Q${O!]$|O!g=wO!j$xO#h<lO$V%_O$s<hO$u<jO$x%`O(R(tO(TTO(WUO(_$uO(w$}O(x%PO~Oj)bO~P( bOp!cX(p!cX~P# qOp(hX(p(hX~P#!dO![]X![fX~P'JlO!WfX!W$yX!ZfX!Z$yX#^fX~P!/qO#i<OO~O!e#vO#i<OO~O#^<`O~O#t<SO~O#^<pO!Z(uX![(uX~O#^<`O!Z(sX![(sX~O#i<qO~Og<sO~P!0uO#i<yO~O#i<zO~O!e#vO#i<{O~O!e#vO#i<qO~O#}<|O~P#BPO#i<}O~O#i=OO~O#i=TO~O#i=UO~O#i=VO~O#i=WO~O#}=XO~P!0uO#}=YO~P!0uO#Q#R#S#U#V#Y#g#h#s$m$s$u$x%[%]%g%h%i%p%r%u%v%x%z~'|T#m!V'z(S#nq#l#op!O'{$['{(R$^(c~",goto:"$8f)ZPPPPPP)[PP)_P)pP+Q/VPPPP6aPP6wPP<oP@cP@yP@yPPP@yPCRP@yP@yP@yPCVPC[PCyPHsPPPHwPPPPHwKzPPPLQLrPHwPHwPP! QHwPPPHwPHwP!#XHwP!&o!'t!'}P!(q!(u!(q!,SPPPPPPP!,s!'tPP!-T!.uP!2RHwHw!2W!5d!:Q!:Q!>PPPP!>XHwPPPPPPPPPP!AhP!BuPPHw!DWPHwPHwHwHwHwHwPHw!EjP!HtP!KzP!LO!LY!L^!L^P!HqP!Lb!LbP# hP# lHwPHw# r#$wCV@yP@yP@y@yP#&U@y@y#(h@y#+`@y#-l@y@y#.[#0p#0p#0u#1O#0p#1ZPP#0pP@y#1s@y#5r@y@y6aPPP#9wPPP#:b#:bP#:bP#:x#:bPP#;OP#:uP#:u#;c#:u#;}#<T#<W)_#<Z)_P#<b#<b#<bP)_P)_P)_P)_PP)_P#<h#<kP#<k)_P#<oP#<rP)_P)_P)_P)_P)_P)_)_PP#<x#=O#=Z#=a#=g#=m#=s#>R#>X#>c#>i#>s#>y#?Z#?a#@R#@e#@k#@q#AP#Af#CZ#Ci#Cp#E[#Ej#G[#Gj#Gp#Gv#G|#HW#H^#Hd#Hn#IQ#IWPPPPPPPPPPP#I^PPPPPPP#JR#MY#Nr#Ny$ RPPP$&mP$&v$)o$0Y$0]$0`$1_$1b$1i$1qP$1w$1zP$2h$2l$3d$4r$4w$5_PP$5d$5j$5n$5q$5u$5y$6u$7^$7u$7y$7|$8P$8V$8Y$8^$8bR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R<m;z%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y,k,n,s-d-l-z.Q.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3d4q5y6Z6[6_6r8i8x9SS#q];w!r)]$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sU*{%[<e<fQ+q&OQ,a&eQ,h&mQ0r+dQ0u+fQ1S+rQ1y,fQ3W.bQ5V0wQ5]0}Q6Q1rQ7O3[Q8U5^R9Y7Q'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s!S!nQ!r!v!y!z$|'U']'^'j'k'l*h*l*n*o-W-^-`-p0U0X1g5q5s%[$ti#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}Q&V|Q'S!eS'Y%h-ZQ+q&OQ,a&eQ0f+OQ1S+rQ1X+xQ1x,eQ1y,fQ5]0}Q5f1ZQ6Q1rQ6T1tQ6U1wQ8U5^Q8X5cQ8q6WQ9|8YQ:Y8nR<o*XrnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VR,c&i&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=r=s[#]WZ#W#Z'V(R!b%im#h#i#l$x%d%g([(f(g(h*W*[*_+W+X+Z,j-Q.O.U.V.W.Y/h/k2[3S3T4X6h6yQ%vxQ%zyS&P|&UQ&]!TQ'a!hQ'c!iQ(o#sS+k%{%|Q+o&OQ,Y&`Q,^&bS-g'd'eQ.d(pQ0{+lQ1R+rQ1T+sQ1W+wQ1l,ZS1p,_,`Q2t-hQ5[0}Q5`1QQ5e1YQ6P1qQ8T5^Q8W5bQ9x8SR:w9y!U$zi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y!^%xy!i!u%z%{%|'T'c'd'e'i's*g+k+l-T-g-h-o/{0O0{2m2t2{4i4j4m7s9pQ+e%vQ,O&YQ,R&ZQ,]&bQ.c(oQ1k,YU1o,^,_,`Q3].dQ5z1lS6O1p1qQ8m6P#f=t#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}o=u<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YW%Ti%V*v=pS&Y!Q&gQ&Z!RQ&[!SQ+S%cR+|&W%]%Si#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}T)x$u)yV*{%[<e<fW'Y!e%h*X-ZS({#y#zQ+`%qQ+v&RS.](k(lQ1b,SQ4x0cR8^5k'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s$i$^c#Y#e%p%r%t(Q(W(r(w)P)Q)R)S)T)U)V)W)X)Y)[)^)`)e)o+a+u-U-s-x-}.P.n.q.u.w.x.y/]0j2c2f2v2}3c3h3i3j3k3l3m3n3o3p3q3r3s3t3w3x4P5O5Y6k6q6v7V7W7a7b8`8|9Q9[9b9c:c:y;R;x=gT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ'W!eR2i-W!W!nQ!e!r!v!y!z$|'U']'^'j'k'l*X*h*l*n*o-W-^-`-p0U0X1g5q5sR1d,UnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&w!^Q't!xS(q#u<OQ+i%yQ,W&]Q,X&_Q-e'bQ-r'mS.m(v<qS0k+U<{Q0y+jQ1f,VQ2Z,uQ2],vQ2e-RQ2r-fQ2u-jS5P0l=VQ5W0zS5Z0|=WQ6j2gQ6n2sQ6s2zQ8R5XQ8}6lQ9O6oQ9R6tR:`8z$d$]c#Y#e%r%t(Q(W(r(w)P)Q)R)S)T)U)V)W)X)Y)[)^)`)e)o+a+u-U-s-x-}.P.n.q.u.x.y/]0j2c2f2v2}3c3h3i3j3k3l3m3n3o3p3q3r3s3t3w3x4P5O5Y6k6q6v7V7W7a7b8`8|9Q9[9b9c:c:y;R;x=gS(m#p'gQ(}#zS+_%p.wS.^(l(nR3U._'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sS#q];wQ&r!XQ&s!YQ&u![Q&v!]R2R,qQ'_!hQ+b%vQ-c'aS.`(o+eQ2p-bW3Y.c.d0q0sQ6m2qW6z3V3X3]5TU9U6{6}7PU:e9W9X9ZS;T:d:gQ;b;UR;j;cU!wQ'^-`T5o1g5q!Q_OXZ`st!V!Z#d#h%d%l&g&i&p&r&s&u(h,n,s.V2S2V]!pQ!r'^-`1g5qT#q];w%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SS({#y#zS.](k(l!s=^$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sU$fd)],hS(n#p'gU*s%R(u3vU0e*z.i7]Q5T0rQ6{3WQ9X7OR:g9Ym!tQ!r!v!y!z'^'j'k'l-`-p1g5q5sQ'r!uS(d#g1|S-n'i'uQ/n*ZQ/{*gQ2|-qQ4]/oQ4i/}Q4j0OQ4o0WQ7h4WS7s4k4mS7w4p4rQ9g7iQ9k7oQ9p7tQ9u7yS:o9l9mS;Y:p:sS;e;Z;[S;m;f;gS;q;n;oR;t;rQ#wbQ'q!uS(c#g1|S(e#m+TQ+V%eQ+g%wQ+m%}U-m'i'r'uQ.R(dQ/m*ZQ/|*gQ0P*iQ0x+hQ1m,[S2y-n-qQ3R.ZS4[/n/oQ4e/yS4h/{0WQ4l0QQ5|1nQ6u2|Q7g4WQ7k4]U7r4i4o4rQ7u4nQ8k5}S9f7h7iQ9j7oQ9r7wQ9s7xQ:V8lQ:m9gS:n9k9mQ:v9uQ;P:WS;X:o:sS;d;Y;ZS;l;e;gS;p;m;oQ;s;qQ;u;tQ=a=[Q=l=eR=m=fV!wQ'^-`%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SS#wz!j!r=Z$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sR=a=r%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SQ%ej!^%wy!i!u%z%{%|'T'c'd'e'i's*g+k+l-T-g-h-o/{0O0{2m2t2{4i4j4m7s9pS%}z!jQ+h%xQ,[&bW1n,],^,_,`U5}1o1p1qS8l6O6PQ:W8m!r=[$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ=e=qR=f=r%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9SY#bWZ#W#Z(R!b%im#h#i#l$x%d%g([(f(g(h*W*[*_+W+X+Z,j-Q.O.U.V.W.Y/h/k2[3S3T4X6h6yQ,i&m!p=]$Z$n)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sR=`'VU'Z!e%h*XR2k-Z%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y,k,n,s-d-l-z.Q.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3d4q5y6Z6[6_6r8i8x9S!r)]$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sQ,h&mQ0r+dQ3W.bQ7O3[R9Y7Q!b$Tc#Y%p(Q(W(r(w)X)Y)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;x!P<U)[)o-U.w2c2f3h3q3r3w4P6k7W7a7b8`8|9[9b9c:y;R=g!f$Vc#Y%p(Q(W(r(w)U)V)X)Y)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;x!T<W)[)o-U.w2c2f3h3n3o3q3r3w4P6k7W7a7b8`8|9[9b9c:y;R=g!^$Zc#Y%p(Q(W(r(w)^)e+u-s-x-}.P.n.q/]0j2v2}3c3s5O5Y6q6v7V9Q:c;xQ4V/fz=s)[)o-U.w2c2f3h3w4P6k7W7a7b8`8|9[9b9c:y;R=gQ=x=zR=y={'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sS$oh$pR3|/P'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/P/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sT$kf$qQ$ifS)h$l)lR)t$qT$jf$qT)j$l)l'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%l%s&Q&i&l&m&p&r&s&u&y'R'V'`'p(R(T(Z(b(v(x(|)q){*f+U+Y+d,k,n,s-P-S-d-l-z.Q.b.o.v/P/Q/i0V0d0l0|1j1z1{1}2P2S2V2X2h2x3O3[3d3{4q5m5y6Z6[6_6i6r7Q8i8x9S9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=sT$oh$pQ$rhR)s$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%l%s&Q&i&l&m&p&r&s&u&y'R'`'p(R(T(Z(b(v(x(|){*f+U+Y+d,k,n,s-d-l-z.Q.b.o.v/i0V0d0l0|1j1z1{1}2P2S2V2X2x3O3[3d4q5y6Z6[6_6r7Q8i8x9S!s=q$Z$n'V)q-P-S/Q2h3{5m6i9}:a;v;y;z;}<O<P<Q<R<S<T<U<V<W<X<Y<Z<]<`<m<p<q<s<{<|=V=W=s#glOPXZst!Z!`!o#S#d#o#{$n%l&i&l&m&p&r&s&u&y'R'`(|)q*f+Y+d,k,n,s-d.b/Q/i0V0d1j1z1{1}2P2S2V2X3[3{4q5y6Z6[6_7Q8i8x!U%Ri$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y#f(u#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}Q+P%`Q/^)|o3v<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!U$yi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=yQ*`$zU*i$|*X*lQ+Q%aQ0Q*j#f=c#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n=d<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YQ=h=tQ=i=uQ=j=vR=k=w!U%Ri$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y#f(u#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}o3v<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=YnoOXst!Z#d%l&p&r&s&u,n,s2S2VS*c${*WQ,|&|Q,}'OR4`/s%[%Si#v$b$c$d$x${%O%Q%]%^%b)w*P*R*T*W*^*d*t*u+c+f+},Q.a.z/_/h/r/s/u0Y0[0g0h0i1^1a1i3Z4U4V4a4f4w5R5U5x6|7l7v7|8Q8f9V9e9n9t:S:f:t:};V;^<^<_<a<b<c<d<g<h<i<j<k<l<t<u<v<w<y<z<}=O=P=Q=R=S=T=U=X=Y=p=x=y=|=}Q,P&ZQ1`,RQ5i1_R8]5jV*k$|*X*lU*k$|*X*lT5p1g5qS/y*f/iQ4n0VT7x4q:PQ+g%wQ0P*iQ0x+hQ1m,[Q5|1nQ8k5}Q:V8lR;P:W!U%Oi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=yx*P$v)c*Q*r+R/q0^0_3y4^4{4|4}7f7z9v:l=b=n=oS0Y*q0Z#f<a#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n<b<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!d<t(s)a*Y*b.e.h.l/Y/f/v0p1]3`4S4_4c5h7R7U7m7p7}8P9i9q9w:q:u;W;];h=z={`<u3u7X7[7`9]:h:k;kS=P.g3aT=Q7Z9`!U%Qi$d%O%Q%]%^%b*P*R*^*t*u.z/r0Y0[0g0h0i4V4w7|9e=p=x=y|*R$v)c*S*q+R/b/q0^0_3y4^4s4{4|4}7f7z9v:l=b=n=oS0[*r0]#f<c#v$b$c$x${)w*T*W*d+c+f+},Q.a/_/h/s/u1^1a1i3Z4U4a4f5R5U5x6|7l7v8Q8f9V9n9t:S:f:t:};V;^<a<c<g<i<k<t<v<y<}=P=R=T=X=|=}n<d<^<_<b<d<h<j<l<u<w<z=O=Q=S=U=Y!h<v(s)a*Y*b.f.g.l/Y/f/v0p1]3^3`4S4_4c5h7R7S7U7m7p7}8P9i9q9w:q:u;W;];h=z={d<w3u7Y7Z7`9]9^:h:i:k;kS=R.h3bT=S7[9arnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VQ&d!UR,k&mrnOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VR&d!UQ,T&[R1[+|snOXst!V!Z#d%l&g&p&r&s&u,n,s2S2VQ1h,YS5w1k1lU8e5u5v5zS:R8g8hS:{:Q:TQ;_:|R;i;`Q&k!VR,d&gR6T1tR:Y8nS&P|&UR1T+sQ&p!WR,n&qR,t&vT2T,s2VR,x&wQ,w&wR2^,xQ'w!{R-t'wSsOtQ#dXT%os#dQ#OTR'y#OQ#RUR'{#RQ)y$uR/Z)yQ#UVR(O#UQ#XWU(U#X(V-{Q(V#YR-{(WQ-X'WR2j-XQ.p(wS3e.p3fR3f.qQ-`'^R2n-`Y!rQ'^-`1g5qR'h!rQ.{)cR3z.{U#_W%g*WU(]#_(^-|Q(^#`R-|(XQ-['ZR2l-[t`OXst!V!Z#d%l&g&i&p&r&s&u,n,s2S2VS#hZ%dU#r`#h.VR.V(hQ(i#jQ.S(eW.[(i.S3P6wQ3P.TR6w3QQ)l$lR/R)lQ$phR)r$pQ$`cU)_$`-w<[Q-w;xR<[)oQ/l*ZW4Y/l4Z7j9hU4Z/m/n/oS7j4[4]R9h7k$e*O$v(s)a)c*Y*b*q*r*|*}+R.g.h.j.k.l/Y/b/d/f/q/v0^0_0p1]3^3_3`3u3y4S4^4_4c4s4u4{4|4}5h7R7S7T7U7Z7[7^7_7`7f7m7p7z7}8P9]9^9_9i9q9v9w:h:i:j:k:l:q:u;W;];h;k=b=n=o=z={Q/t*bU4b/t4d7nQ4d/vR7n4cS*l$|*XR0S*lx*Q$v)c*q*r+R/q0^0_3y4^4{4|4}7f7z9v:l=b=n=o!d.e(s)a*Y*b.g.h.l/Y/f/v0p1]3`4S4_4c5h7R7U7m7p7}8P9i9q9w:q:u;W;];h=z={U/c*Q.e7Xa7X3u7Z7[7`9]:h:k;kQ0Z*qQ3a.gU4t0Z3a9`R9`7Z|*S$v)c*q*r+R/b/q0^0_3y4^4s4{4|4}7f7z9v:l=b=n=o!h.f(s)a*Y*b.g.h.l/Y/f/v0p1]3^3`4S4_4c5h7R7S7U7m7p7}8P9i9q9w:q:u;W;];h=z={U/e*S.f7Ye7Y3u7Z7[7`9]9^:h:i:k;kQ0]*rQ3b.hU4v0]3b9aR9a7[Q*w%UR0a*wQ5S0pR8O5SQ+[%jR0o+[Q5l1bS8_5l:OR:O8`Q,V&]R1e,VQ5q1gR8b5qQ1s,aS6R1s8oR8o6TQ1O+oW5_1O5a8V9zQ5a1RQ8V5`R9z8WQ+t&PR1U+tQ2V,sR6c2VYrOXst#dQ&t!ZQ+^%lQ,m&pQ,o&rQ,p&sQ,r&uQ2Q,nS2T,s2VR6b2SQ%npQ&x!_Q&{!aQ&}!bQ'P!cQ'o!uQ+]%kQ+i%yQ+{&VQ,c&kQ,z&zW-k'i'q'r'uQ-r'mQ0R*kQ0y+jS1v,d,gQ2_,yQ2`,|Q2a,}Q2u-jW2w-m-n-q-sQ5W0zQ5d1XQ5g1]Q5{1mQ6V1xQ6a2RU6p2v2y2|Q6s2zQ8R5XQ8Z5fQ8[5hQ8a5pQ8j5|Q8p6US9P6q6uQ9R6tQ9{8XQ:U8kQ:Z8qQ:b9QQ:x9|Q;O:VQ;S:cR;a;PQ%yyQ'b!iQ'm!uU+j%z%{%|Q-R'TU-f'c'd'eS-j'i'sQ/z*gS0z+k+lQ2g-TS2s-g-hQ2z-oS4g/{0OQ5X0{Q6l2mQ6o2tQ6t2{U7q4i4j4mQ9o7sR:r9pS$wi=pR*x%VU%Ui%V=pR0`*vQ$viS(s#v+fS)a$b$cQ)c$dQ*Y$xS*b${*WQ*q%OQ*r%QQ*|%]Q*}%^Q+R%bQ.g<aQ.h<cQ.j<gQ.k<iQ.l<kQ/Y)wQ/b*PQ/d*RQ/f*TQ/q*^S/v*d/hQ0^*tQ0_*ul0p+c,Q.a1a1i3Z5x6|8f9V:S:f:};VQ1]+}Q3^<tQ3_<vQ3`<yS3u<^<_Q3y.zS4S/_4UQ4^/rQ4_/sQ4c/uQ4s0YQ4u0[Q4{0gQ4|0hQ4}0iQ5h1^Q7R<}Q7S=PQ7T=RQ7U=TQ7Z<bQ7[<dQ7^<hQ7_<jQ7`<lQ7f4VQ7m4aQ7p4fQ7z4wQ7}5RQ8P5UQ9]<zQ9^<uQ9_<wQ9i7lQ9q7vQ9v7|Q9w8QQ:h=OQ:i=QQ:j=SQ:k=UQ:l9eQ:q9nQ:u9tQ;W=XQ;]:tQ;h;^Q;k=YQ=b=pQ=n=xQ=o=yQ=z=|R={=}Q*z%[Q.i<eR7]<fnpOXst!Z#d%l&p&r&s&u,n,s2S2VQ!fPS#fZ#oQ&z!`W'f!o*f0V4qQ'}#SQ)O#{Q)p$nS,g&i&lQ,l&mQ,y&yS-O'R/iQ-b'`Q.s(|Q/V)qQ0m+YQ0s+dQ2O,kQ2q-dQ3X.bQ4O/QQ4y0dQ5v1jQ6X1zQ6Y1{Q6^1}Q6`2PQ6e2XQ7P3[Q7c3{Q8h5yQ8t6ZQ8u6[Q8w6_Q9Z7QQ:T8iR:_8x#[cOPXZst!Z!`!o#d#o#{%l&i&l&m&p&r&s&u&y'R'`(|*f+Y+d,k,n,s-d.b/i0V0d1j1z1{1}2P2S2V2X3[4q5y6Z6[6_7Q8i8xQ#YWQ#eYQ%puQ%rvS%tw!gS(Q#W(TQ(W#ZQ(r#uQ(w#xQ)P$OQ)Q$PQ)R$QQ)S$RQ)T$SQ)U$TQ)V$UQ)W$VQ)X$WQ)Y$XQ)[$ZQ)^$_Q)`$aQ)e$eW)o$n)q/Q3{Q+a%sQ+u&QS-U'V2hQ-s'pS-x(R-zQ-}(ZQ.P(bQ.n(vQ.q(xQ.u;vQ.w;yQ.x;zQ.y;}Q/]){Q0j+UQ2c-PQ2f-SQ2v-lQ2}.QQ3c.oQ3h<OQ3i<PQ3j<QQ3k<RQ3l<SQ3m<TQ3n<UQ3o<VQ3p<WQ3q<XQ3r<YQ3s.vQ3t<]Q3w<`Q3x<mQ4P<ZQ5O0lQ5Y0|Q6k<pQ6q2xQ6v3OQ7V3dQ7W<qQ7a<sQ7b<{Q8`5mQ8|6iQ9Q6rQ9[<|Q9b=VQ9c=WQ:c9SQ:y9}Q;R:aQ;x#SR=g=sR#[WR'X!el!tQ!r!v!y!z'^'j'k'l-`-p1g5q5sS'T!e-WU*g$|*X*lS-T'U']S0O*h*nQ0W*oQ2m-^Q4m0UR4r0XR(y#xQ!fQT-_'^-`]!qQ!r'^-`1g5qQ#p]R'g;wR)d$dY!uQ'^-`1g5qQ'i!rS's!v!yS'u!z5sS-o'j'kQ-q'lR2{-pT#kZ%dS#jZ%dS%jm,jU(e#h#i#lS.T(f(gQ.X(hQ0n+ZQ3Q.UU3R.V.W.YS6x3S3TR9T6yd#^W#W#Z%g(R([*W+W.O/hr#gZm#h#i#l%d(f(g(h+Z.U.V.W.Y3S3T6yS*Z$x*_Q/o*[Q1|,jQ2d-QQ4W/kQ6g2[Q7i4XQ8{6hT=_'V+XV#aW%g*WU#`W%g*WS(S#W([U(X#Z+W/hS-V'V+XT-y(R.OV'[!e%h*XQ$lfR)v$qT)k$l)lR3}/PT*]$x*_T*e${*WQ0q+cQ1_,QQ3V.aQ5j1aQ5u1iQ6}3ZQ8g5xQ9W6|Q:Q8fQ:d9VQ:|:SQ;U:fQ;`:}R;c;VnqOXst!Z#d%l&p&r&s&u,n,s2S2VQ&j!VR,c&gtmOXst!U!V!Z#d%l&g&p&r&s&u,n,s2S2VR,j&mT%km,jR1c,SR,b&eQ&T|R+z&UR+p&OT&n!W&qT&o!W&qT2U,s2V",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList const 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 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 asserts 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:378,context:Oi,nodeProps:[["isolate",-8,5,6,14,35,37,49,51,53,""],["group",-26,9,17,19,66,206,210,214,215,217,220,223,233,235,241,243,245,247,250,256,262,264,266,268,270,272,273,"Statement",-34,13,14,30,33,34,40,49,52,53,55,60,68,70,74,78,80,82,83,108,109,118,119,135,138,140,141,142,143,144,146,147,166,168,170,"Expression",-23,29,31,35,39,41,43,172,174,176,177,179,180,181,183,184,185,187,188,189,200,202,204,205,"Type",-3,86,101,107,"ClassItem"],["openedBy",23,"<",36,"InterpolationStart",54,"[",58,"{",71,"(",159,"JSXStartCloseTag"],["closedBy",-2,24,167,">",38,"InterpolationEnd",48,"]",59,"}",72,")",164,"JSXEndTag"]],propSources:[si],skippedNodes:[0,5,6,276],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_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Up(X!b'z0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(V#S$h&j'{0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Up(X!b'{0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!n),Q(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(T':f$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(X!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(X!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(X!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(X!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Up(X!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$h&j(Up(X!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$h&j(X!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(X!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(UpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(UpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Up(X!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$h&j(m%1l(Up(X!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$h&j(Up(X!b$[#t(R,2j(c$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+dHRk$h&j(Up(X!b$[#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$h&j(Up(X!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$h&j$P(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,#xLva(x+JY$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$h&j#y(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(W';W$h&j(UpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$h&j(UpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$h&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$c`$h&j(UpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(UpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$c`(UpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!j/.^$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&U!)O_!i!Lf$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z-!n!*[b$h&j(Up(X!b(S%&f#o(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$h&j(Up(X!b#l(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$h&j(Up(X!bp+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!Z+Jf$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!/ec$h&j(Up(X!b!O.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_!Y!L^$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!3eg$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$h&j(Up(X!b#m(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$h&j(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$h&j(X!b!V7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$h&j!V7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$h&j!V7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!V7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!V7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$h&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$h&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$h&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$h&j(X!b!V7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(X!b!V7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(X!b!V7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(X!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(X!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$h&j(Up!V7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$h&j(Up!V7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Up!V7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Up!V7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(UpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$h&j(UpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$h&j(Up(X!b!V7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Up(X!b!V7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Up(X!b!V7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Up(X!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$h&j(Up(X!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$h&j(Up(X!b'|0/l!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$h&j(Up(X!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$h&j(X!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$h&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(X!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$h&j(UpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(UpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Up(X!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$h&j$P(Ch(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Y#t$h&j(Up(X!b!V7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Up(X!bq'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!e$b$h&j#})Lv(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#P-<U(Up(X!b$m7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$j&j(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#p(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$P(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#q(Ch(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#^*!Y$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#i(Cl$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x$%Vag!*r#q(Ch$e#|$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#q(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$'qa#p(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#p(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(p(Ct$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$h&j#z(Ch(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!z$Ip$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f$.X_!Q0,v$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/]Z$h&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$h&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$h&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$h&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$h&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!W#)l$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$6U`#w(Ch$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$h&j(Up(X!b(_+4QOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$8qk$h&j(Up(X!b(R,2j$^#t(c$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$h&j(Up(X!b$^#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!]#Hb(Up(X!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(w+JY$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_![(CdtBr$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!o7`$h&j(Up(X!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$h&j(Up(X!b'z0/l$[#t(R,2j(c$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%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$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(Up(X!b'{0/l$[#t(R,2j(c$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:[ti,ai,ri,ii,2,3,4,5,6,7,8,9,10,11,12,13,14,ei,new nO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOv~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!S~~!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(a~~",141,338),new nO("j~RQYZXz{^~^O(O~~aP!P!Qd~iO(P~~",25,321)],topRules:{Script:[0,7],SingleExpression:[1,274],SingleClassItem:[2,275]},dialects:{jsx:0,ts:15091},dynamicPrecedences:{78:1,80:1,92:1,168:1,198:1},specialized:[{term:325,get:e=>li[e]||-1},{term:341,get:e=>ni[e]||-1},{term:93,get:e=>oi[e]||-1}],tokenPrec:15116}),tt=[g("function ${name}(${params}) {\n	${}\n}",{label:"function",detail:"definition",type:"keyword"}),g("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}",{label:"for",detail:"loop",type:"keyword"}),g("for (let ${name} of ${collection}) {\n	${}\n}",{label:"for",detail:"of loop",type:"keyword"}),g("do {\n	${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),g("while (${}) {\n	${}\n}",{label:"while",detail:"loop",type:"keyword"}),g(`try {
 	\${}
 } catch (\${error}) {
 	\${}
diff --git a/ui/dist/assets/CreateApiDocs-C9nzLaaI.js b/ui/dist/assets/CreateApiDocs-dx3XBFzI.js
similarity index 99%
rename from ui/dist/assets/CreateApiDocs-C9nzLaaI.js
rename to ui/dist/assets/CreateApiDocs-dx3XBFzI.js
index bea7ca4d..b79e51ef 100644
--- a/ui/dist/assets/CreateApiDocs-C9nzLaaI.js
+++ b/ui/dist/assets/CreateApiDocs-dx3XBFzI.js
@@ -1,4 +1,4 @@
-import{S as $t,i as qt,s as St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-Bw7x2V1B.js";import{F as Rt}from"./FieldsQueryParam-DvIo4uvz.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,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(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(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.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.",P=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>',Y=p(),U=s("tr"),U.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(),G=s("tr"),G.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 St,V as Tt,J as ee,X as ue,W as Ct,h as s,z as _,j as p,c as $e,k as w,n as r,o as i,m as qe,H as oe,Y as Ve,Z as pt,E as Ot,_ as Mt,G as Lt,t as ye,a as ve,v as d,d as Se,p as Pt,l as Te,q as Ft,I as we,L as Ht}from"./index-DCriA6MP.js";import{F as Rt}from"./FieldsQueryParam-JXZpoc_D.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,A,T,O,R,M,I,J,S,Q,L,q,k,P,te,Y,U,re,G,K,X;function fe(y,C){var V,W,H;return C&1&&(f=null),f==null&&(f=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Kt))!=null&&H.required)),f?At:jt}let le=fe(a,-1),E=le(a);function Z(y,C){var V,W,H;return C&1&&(I=null),I==null&&(I=!!((H=(W=(V=y[0])==null?void 0:V.fields)==null?void 0:W.find(Gt))!=null&&H.required)),I?Vt:Bt}let x=Z(a,-1),F=x(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(),A=s("td"),A.textContent="Auth record email address.",T=p(),O=s("tr"),R=s("td"),M=s("div"),F.c(),J=p(),S=s("span"),S.textContent="emailVisibility",Q=p(),L=s("td"),L.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.",P=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>',Y=p(),U=s("tr"),U.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(),G=s("tr"),G.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>`,K=p(),X=s("tr"),X.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,A),r(y,T,C),r(y,O,C),i(O,R),i(R,M),F.m(M,null),i(M,J),i(M,S),i(O,Q),i(O,L),i(O,q),i(O,k),r(y,P,C),r(y,te,C),r(y,Y,C),r(y,U,C),r(y,re,C),r(y,G,C),r(y,K,C),r(y,X,C)},p(y,C){le!==(le=fe(y,C))&&(E.d(1),E=le(y),E&&(E.c(),E.m(c,b))),x!==(x=Z(y,C))&&(F.d(1),F=x(y),F&&(F.c(),F.m(M,J)))},d(y){y&&(d(e),d(t),d(l),d(T),d(O),d(P),d(te),d(Y),d(U),d(re),d(G),d(K),d(X)),E.d(),F.d()}}}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 At(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 Bt(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-CJmwjOMw.js b/ui/dist/assets/DeleteApiDocs-Dwxzpd42.js
similarity index 98%
rename from ui/dist/assets/DeleteApiDocs-CJmwjOMw.js
rename to ui/dist/assets/DeleteApiDocs-Dwxzpd42.js
index 416226eb..f7637511 100644
--- a/ui/dist/assets/DeleteApiDocs-CJmwjOMw.js
+++ b/ui/dist/assets/DeleteApiDocs-Dwxzpd42.js
@@ -1,4 +1,4 @@
-import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-Bw7x2V1B.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=He(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 Le({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 Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,b=[],de=new Map,R;C=new Te({props:{js:`
+import{S as Re,i as Ee,s as Pe,V as Te,X as U,h as c,z as y,j as k,c as De,k as m,n as p,o as i,m as Ce,H as ee,Y as he,Z as Be,E as Oe,_ as Ie,G as qe,t as te,a as le,v as f,d as we,J as Ae,p as Me,l as z,q as He,W as Le}from"./index-DCriA6MP.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=He(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 Le({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 Se(a){var fe,me;let l,s,o=a[0].name+"",h,r,n,d,$,D,F,M=a[0].name+"",G,se,J,C,K,P,N,g,H,ae,L,E,oe,V,S=a[0].name+"",W,ne,X,ie,Y,T,Z,B,Q,O,x,w,I,v=[],ce=new Map,re,q,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-5FSlIcs-.js b/ui/dist/assets/EmailChangeDocs-M95lizJx.js
similarity index 99%
rename from ui/dist/assets/EmailChangeDocs-5FSlIcs-.js
rename to ui/dist/assets/EmailChangeDocs-M95lizJx.js
index 69c8d7cd..074a50bb 100644
--- a/ui/dist/assets/EmailChangeDocs-5FSlIcs-.js
+++ b/ui/dist/assets/EmailChangeDocs-M95lizJx.js
@@ -1,4 +1,4 @@
-import{S as se,i as oe,s as ie,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-Bw7x2V1B.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=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(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=C(),b(t,"class","tab-item"),K(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)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(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,q[c]=ke(s,f))}let _=I(n[2]);const Z=c=>c[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),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=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;c<q.length;c+=1)q[c].c();P=C(),j=p("div");for(let c=0;c<T.length;c+=1)T[c].c();b(t,"class","label label-primary"),b(d,"class","content"),b(e,"class","alert alert-success"),b(W,"class","section-title"),b(L,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(H,"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,A),g(c,Y,f),g(c,W,f),g(c,J,f),g(c,L,f),g(c,z,f),g(c,B,f),g(c,D,f),g(c,S,f),u(S,H);for(let s=0;s<q.length;s+=1)q[s]&&q[s].m(H,null);u(S,P),u(S,j);for(let s=0;s<T.length;s+=1)T[s]&&T[s].m(j,null);w=!0},p(c,[f]){(!w||f&1)&&m!==(m=c[0].name+"")&&F(k,m),f&6&&(E=I(c[2]),q=le(q,f,M,1,c,E,O,H,Re,ke,null,ve)),f&6&&(_=I(c[2]),ne(),T=le(T,f,Z,1,c,_,N,j,Se,$e,null,ge),ae())},i(c){if(!w){for(let f=0;f<_.length;f+=1)V(T[f]);w=!0}},o(c){for(let f=0;f<T.length;f+=1)X(T[f]);w=!1},d(c){c&&(v(e),v(Y),v(W),v(J),v(L),v(z),v(B),v(D),v(S));for(let f=0;f<q.length;f+=1)q[f].d();for(let f=0;f<T.length;f+=1)T[f].d()}}}function Ne(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,X as I,h as p,j as C,z as U,k as b,n as g,o as u,H as F,Y as le,Z as Re,E as ne,_ as Se,G as ae,t as V,a as X,v,l as K,q as ce,W as Oe,c as x,m as ee,d as te,V as Me,$ as _e,J as Be,p as De,a0 as be}from"./index-DCriA6MP.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=C(),b(t,"class","tab-item"),K(t,"active",e[1]===e[4].code),this.first=t},m(k,A){g(k,t,A),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,A){e=k,A&4&&l!==(l=e[4].code+"")&&F(d,l),A&6&&K(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=C(),b(t,"class","tab-item"),K(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)&&K(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&v(t),te(l)}}}function He(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,A,Y,W,J,L,z,B,D,S,H,q=[],O=new Map,P,j,T=[],N=new Map,w,E=I(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,q[c]=ke(s,f))}let _=I(n[2]);const Z=c=>c[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);N.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=C(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),A=U("/confirm-email-change"),Y=C(),W=p("div"),W.textContent="Body Parameters",J=C(),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=C(),B=p("div"),B.textContent="Responses",D=C(),S=p("div"),H=p("div");for(let c=0;c<q.length;c+=1)q[c].c();P=C(),j=p("div");for(let c=0;c<T.length;c+=1)T[c].c();b(t,"class","label label-primary"),b(d,"class","content"),b(e,"class","alert alert-success"),b(W,"class","section-title"),b(L,"class","table-compact table-border m-b-base"),b(B,"class","section-title"),b(H,"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,A),g(c,Y,f),g(c,W,f),g(c,J,f),g(c,L,f),g(c,z,f),g(c,B,f),g(c,D,f),g(c,S,f),u(S,H);for(let s=0;s<q.length;s+=1)q[s]&&q[s].m(H,null);u(S,P),u(S,j);for(let s=0;s<T.length;s+=1)T[s]&&T[s].m(j,null);w=!0},p(c,[f]){(!w||f&1)&&m!==(m=c[0].name+"")&&F(k,m),f&6&&(E=I(c[2]),q=le(q,f,M,1,c,E,O,H,Re,ke,null,ve)),f&6&&(_=I(c[2]),ne(),T=le(T,f,Z,1,c,_,N,j,Se,$e,null,ge),ae())},i(c){if(!w){for(let f=0;f<_.length;f+=1)V(T[f]);w=!0}},o(c){for(let f=0;f<T.length;f+=1)X(T[f]);w=!1},d(c){c&&(v(e),v(Y),v(W),v(J),v(L),v(z),v(B),v(D),v(S));for(let f=0;f<q.length;f+=1)q[f].d();for(let f=0;f<T.length;f+=1)T[f].d()}}}function Ne(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": "An error occurred while validating the submitted data.",
diff --git a/ui/dist/assets/FieldsQueryParam-DvIo4uvz.js b/ui/dist/assets/FieldsQueryParam-JXZpoc_D.js
similarity index 96%
rename from ui/dist/assets/FieldsQueryParam-DvIo4uvz.js
rename to ui/dist/assets/FieldsQueryParam-JXZpoc_D.js
index 5e6d1c99..45549613 100644
--- a/ui/dist/assets/FieldsQueryParam-DvIo4uvz.js
+++ b/ui/dist/assets/FieldsQueryParam-JXZpoc_D.js
@@ -1,4 +1,4 @@
-import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-Bw7x2V1B.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({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"),y=i(`Comma separated string of the fields to return in the JSON response
+import{S as I,i as J,s as N,W as O,h as t,j as c,z as i,c as P,k as Q,n as R,o as e,m as W,H as A,t as D,a as G,v as K,d as U}from"./index-DCriA6MP.js";function V(f){let n,o,u,d,v,s,p,y,g,F,r,S,_,w,b,E,C,a,$,H,L,q,M,T,m,j,k,z,x;return r=new O({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"),y=i(`Comma separated string of the fields to return in the JSON response
             `),g=t("em"),g.textContent="(by default returns all fields)",F=i(`. Ex.:
             `),P(r.$$.fragment),S=c(),_=t("p"),_.innerHTML="<code>*</code> targets all keys from the specific depth level.",w=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?)",H=c(),L=t("br"),q=i(`
                 Returns a short plain text version of the field string value.
diff --git a/ui/dist/assets/FilterAutocompleteInput-DbGqmGAP.js b/ui/dist/assets/FilterAutocompleteInput-CXrfVJaY.js
similarity index 98%
rename from ui/dist/assets/FilterAutocompleteInput-DbGqmGAP.js
rename to ui/dist/assets/FilterAutocompleteInput-CXrfVJaY.js
index d9c3149e..731798c5 100644
--- a/ui/dist/assets/FilterAutocompleteInput-DbGqmGAP.js
+++ b/ui/dist/assets/FilterAutocompleteInput-CXrfVJaY.js
@@ -1 +1 @@
-import{S as $,i as ee,s as te,h as ne,k as re,n as ie,I as _,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-Bw7x2V1B.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 Ke,n as Ce,o as Re,p as Le,q as G,C as R,S as qe,t as ve,u as De,v as Oe}from"./index-CH-gyH77.js";function We(e){return new Worker(""+new URL("autocomplete.worker-DDUJflPE.js",import.meta.url).href,{name:e==null?void 0:e.name})}function _e(e){Q(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 Ae(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:Me(r),indent:Te(r,t),languageData:t}}function Q(e,r){if(!e.hasOwnProperty(r))throw new Error("Undefined state "+r+" in simple mode")}function Je(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 Ie(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 Ae(e,r){(e.next||e.push)&&Q(r,e.next||e.push),this.regex=Je(e.regex),this.token=Ie(e.token),this.data=e}function Me(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 Te(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 Be(e){let r;return{c(){r=ne("div"),re(r,"class","code-editor")},m(t,g){ie(t,r,g),e[15](r)},p:_,i:_,o:_,d(t){t&&ae(r),e[15](null)}}}function He(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.fields])}function Ue(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,J=new R,I=new R,A=new R,M=new R,v=new We,T=[],B=[],H=[],K="",D="";function O(){d==null||d.focus()}let W=null;v.onmessage=n=>{H=n.data.baseKeys||[],T=n.data.requestKeys||[],B=n.data.collectionJoinKeys||[]};function V(){clearTimeout(W),W=setTimeout(()=>{v.postMessage({baseCollection:s,collections:j(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function j(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",O)}function P(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",O)}function z(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(T||[])),c&&(l=l.concat(B||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=Oe(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 C=z(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)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(_e({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)}};P();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(De,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),M.of(G(o)),I.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),J.of(N()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.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()),U())})]})})),()=>{clearTimeout(W),F(),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,K=He(s)),e.$$.dirty[0]&25352&&!i&&(D!=K||b!==-1||m!==-1)&&(t(14,D=K),V()),e.$$.dirty[0]&4&&f&&P(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[J.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[I.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),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:[M.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,O,d,q,K,D,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Ue,Be,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,h as ne,k as re,n as ie,I as _,v as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-DCriA6MP.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 Ke,n as Ce,o as Re,p as Le,q as G,C as R,S as qe,t as ve,u as De,v as Oe}from"./index-CEH5UG_e.js";function We(e){return new Worker(""+new URL("autocomplete.worker-DDUJflPE.js",import.meta.url).href,{name:e==null?void 0:e.name})}function _e(e){Q(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 Ae(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:Me(r),indent:Te(r,t),languageData:t}}function Q(e,r){if(!e.hasOwnProperty(r))throw new Error("Undefined state "+r+" in simple mode")}function Je(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 Ie(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 Ae(e,r){(e.next||e.push)&&Q(r,e.next||e.push),this.regex=Je(e.regex),this.token=Ie(e.token),this.data=e}function Me(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 Te(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 Be(e){let r;return{c(){r=ne("div"),re(r,"class","code-editor")},m(t,g){ie(t,r,g),e[15](r)},p:_,i:_,o:_,d(t){t&&ae(r),e[15](null)}}}function He(e){return JSON.stringify([e==null?void 0:e.name,e==null?void 0:e.type,e==null?void 0:e.fields])}function Ue(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,J=new R,I=new R,A=new R,M=new R,v=new We,T=[],B=[],H=[],K="",D="";function O(){d==null||d.focus()}let W=null;v.onmessage=n=>{H=n.data.baseKeys||[],T=n.data.requestKeys||[],B=n.data.collectionJoinKeys||[]};function V(){clearTimeout(W),W=setTimeout(()=>{v.postMessage({baseCollection:s,collections:j(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function j(n){let c=n.slice();return s&&u.pushOrReplaceByKey(c,s,"id"),c}function U(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:a},bubbles:!0}))}function F(){if(!f)return;const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.removeEventListener("click",O)}function P(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",O)}function z(n=!0,c=!0){let l=[].concat(L);return l=l.concat(H||[]),n&&(l=l.concat(T||[])),c&&(l=l.concat(B||[])),l}function X(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=Oe(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 C=z(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of C)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(_e({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)}};P();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(De,{fallback:!0}),Ee(),Se(),Ke(),Ce(),Re.of(c),E.lineWrapping,Le({override:[X],icons:!1}),M.of(G(o)),I.of(E.editable.of(!i)),A.of(S.readOnly.of(i)),J.of(N()),S.transactionFilter.of(l=>{var x,C,w;if(y&&l.newDoc.lines>1){if(!((w=(C=(x=l.changes)==null?void 0:x.inserted)==null?void 0:C.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()),U())})]})})),()=>{clearTimeout(W),F(),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,K=He(s)),e.$$.dirty[0]&25352&&!i&&(D!=K||b!==-1||m!==-1)&&(t(14,D=K),V()),e.$$.dirty[0]&4&&f&&P(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[J.reconfigure(N())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[I.reconfigure(E.editable.of(!i)),A.reconfigure(S.readOnly.of(i))]}),t(12,q=i),U()),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:[M.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,O,d,q,K,D,Y]}class Ne extends ${constructor(r){super(),ee(this,r,Ue,Be,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-D4zfzAhd.js b/ui/dist/assets/ListApiDocs-GWn-CPMs.js
similarity index 99%
rename from ui/dist/assets/ListApiDocs-D4zfzAhd.js
rename to ui/dist/assets/ListApiDocs-GWn-CPMs.js
index 9a6b1fbc..5db63e12 100644
--- a/ui/dist/assets/ListApiDocs-D4zfzAhd.js
+++ b/ui/dist/assets/ListApiDocs-GWn-CPMs.js
@@ -1,4 +1,4 @@
-import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-Bw7x2V1B.js";import{F as ul}from"./FieldsQueryParam-DvIo4uvz.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format
+import{S as el,i as ll,s as sl,h as e,j as s,L as ol,k as a,n as m,q as nl,I as Ue,v as h,z as g,o as t,V as al,W as Le,X as ae,c as Kt,m as Qt,H as ve,Y as Je,Z as il,E as rl,_ as cl,G as dl,t as Ct,a as kt,d as Vt,$ as pl,J as Te,p as fl,l as Ae}from"./index-DCriA6MP.js";import{F as ul}from"./FieldsQueryParam-JXZpoc_D.js";function ml(r){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function hl(r){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,b){m(f,n,b),m(f,o,b),m(f,i,b)},d(f){f&&(h(n),h(o),h(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,S,Xt,H,it,P,Z,ie,j,z,re,rt,vt,tt,Ft,ce,ct,dt,et,q,Yt,Lt,k,lt,At,Zt,Tt,U,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,D,Et,nt,St,F,ut,fe,J,qt,ee,Nt,le,Ht,ue,L,mt,me,ht,he,M,be,T,Dt,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,zt,Ce,G,ke,wt,se,R,xt,V,W,O,Ut,ne,X;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`,b=s(),p=e("li"),u=e("code"),u.textContent="OPERATOR",C=g(` - is one of:
             `),_=e("br"),x=s(),d=e("ul"),Y=e("li"),yt=e("code"),yt.textContent="=",Wt=s(),S=e("span"),S.textContent="Equal",Xt=s(),H=e("li"),it=e("code"),it.textContent="!=",P=s(),Z=e("span"),Z.textContent="NOT equal",ie=s(),j=e("li"),z=e("code"),z.textContent=">",re=s(),rt=e("span"),rt.textContent="Greater than",vt=s(),tt=e("li"),Ft=e("code"),Ft.textContent=">=",ce=s(),ct=e("span"),ct.textContent="Greater than or equal",dt=s(),et=e("li"),q=e("code"),q.textContent="<",Yt=s(),Lt=e("span"),Lt.textContent="Less than",k=s(),lt=e("li"),At=e("code"),At.textContent="<=",Zt=s(),Tt=e("span"),Tt.textContent="Less than or equal",U=s(),st=e("li"),Pt=e("code"),Pt.textContent="~",te=s(),Rt=e("span"),Rt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
diff --git a/ui/dist/assets/PageInstaller-FV_9CRnx.js b/ui/dist/assets/PageInstaller-CPCvh_Gv.js
similarity index 98%
rename from ui/dist/assets/PageInstaller-FV_9CRnx.js
rename to ui/dist/assets/PageInstaller-CPCvh_Gv.js
index fe0d59b2..b619d2c5 100644
--- a/ui/dist/assets/PageInstaller-FV_9CRnx.js
+++ b/ui/dist/assets/PageInstaller-CPCvh_Gv.js
@@ -1,3 +1,3 @@
-import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-Bw7x2V1B.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="<h4>Create your first superuser account in order to continue</h4>",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='<span class="txt">Create superuser and login</span> <i class="ri-arrow-right-line"></i>',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML='<i class="ri-upload-cloud-line"></i> <span class="txt">Or initialize from backup</span>',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the file source.
+import{S as W,i as G,s as J,F as Q,c as S,m as E,t as O,a as j,d as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as k,j as q,k as r,l as z,n as m,o as T,q as I,u as Z,v as h,w as x,x as ee,y as U,z as N,A,B as te}from"./index-DCriA6MP.js";function ne(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Email"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","email"),r(e,"autocomplete","off"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),s[11](e),A(e,s[2]),_||(d=I(e,"input",s[12]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&4&&e.value!==a[2]&&A(e,a[2])},d(a){a&&(h(t),h(n),h(e)),s[11](null),_=!1,d()}}}function le(s){let t,o,u,n,e,p,_,d,a,i;return{c(){t=k("label"),o=N("Password"),n=q(),e=k("input"),_=q(),d=k("div"),d.textContent="Recommended at least 10 characters.",r(t,"for",u=s[20]),r(e,"type","password"),r(e,"autocomplete","new-password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0,r(d,"class","help-block")},m(c,g){m(c,t,g),T(t,o),m(c,n,g),m(c,e,g),A(e,s[3]),m(c,_,g),m(c,d,g),a||(i=I(e,"input",s[13]),a=!0)},p(c,g){g&1048576&&u!==(u=c[20])&&r(t,"for",u),g&1048576&&p!==(p=c[20])&&r(e,"id",p),g&128&&(e.disabled=c[7]),g&8&&e.value!==c[3]&&A(e,c[3])},d(c){c&&(h(t),h(n),h(e),h(_),h(d)),a=!1,i()}}}function se(s){let t,o,u,n,e,p,_,d;return{c(){t=k("label"),o=N("Password confirm"),n=q(),e=k("input"),r(t,"for",u=s[20]),r(e,"type","password"),r(e,"minlength","10"),r(e,"id",p=s[20]),e.disabled=s[7],e.required=!0},m(a,i){m(a,t,i),T(t,o),m(a,n,i),m(a,e,i),A(e,s[4]),_||(d=I(e,"input",s[14]),_=!0)},p(a,i){i&1048576&&u!==(u=a[20])&&r(t,"for",u),i&1048576&&p!==(p=a[20])&&r(e,"id",p),i&128&&(e.disabled=a[7]),i&16&&e.value!==a[4]&&A(e,a[4])},d(a){a&&(h(t),h(n),h(e)),_=!1,d()}}}function ie(s){let t,o,u,n,e,p,_,d,a,i,c,g,B,w,F,$,v,y,L;return n=new K({props:{class:"form-field required",name:"email",$$slots:{default:[ne,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),p=new K({props:{class:"form-field required",name:"password",$$slots:{default:[le,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),d=new K({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[se,({uniqueId:l})=>({20:l}),({uniqueId:l})=>l?1048576:0]},$$scope:{ctx:s}}}),{c(){t=k("form"),o=k("div"),o.innerHTML="<h4>Create your first superuser account in order to continue</h4>",u=q(),S(n.$$.fragment),e=q(),S(p.$$.fragment),_=q(),S(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='<span class="txt">Create superuser and login</span> <i class="ri-arrow-right-line"></i>',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML='<i class="ri-upload-cloud-line"></i> <span class="txt">Or initialize from backup</span>',F=q(),$=k("input"),r(o,"class","content txt-center m-b-base"),r(i,"type","submit"),r(i,"class","btn btn-lg btn-block btn-next"),z(i,"btn-disabled",s[7]),z(i,"btn-loading",s[0]),r(t,"class","block"),r(t,"autocomplete","off"),r(w,"for","backupFileInput"),r(w,"class","btn btn-lg btn-hint btn-transparent btn-block"),z(w,"btn-disabled",s[7]),z(w,"btn-loading",s[1]),r($,"id","backupFileInput"),r($,"type","file"),r($,"class","hidden"),r($,"accept",".zip")},m(l,b){m(l,t,b),T(t,o),T(t,u),E(n,t,null),T(t,e),E(p,t,null),T(t,_),E(d,t,null),T(t,a),T(t,i),m(l,c,b),m(l,g,b),m(l,B,b),m(l,w,b),m(l,F,b),m(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",Z(s[8])),I($,"change",s[16])],y=!0)},p(l,b){const H={};b&3145892&&(H.$$scope={dirty:b,ctx:l}),n.$set(H);const f={};b&3145864&&(f.$$scope={dirty:b,ctx:l}),p.$set(f);const P={};b&3145872&&(P.$$scope={dirty:b,ctx:l}),d.$set(P),(!v||b&128)&&z(i,"btn-disabled",l[7]),(!v||b&1)&&z(i,"btn-loading",l[0]),(!v||b&128)&&z(w,"btn-disabled",l[7]),(!v||b&2)&&z(w,"btn-loading",l[1])},i(l){v||(O(n.$$.fragment,l),O(p.$$.fragment,l),O(d.$$.fragment,l),v=!0)},o(l){j(n.$$.fragment,l),j(p.$$.fragment,l),j(d.$$.fragment,l),v=!1},d(l){l&&(h(t),h(c),h(g),h(B),h(w),h(F),h($)),D(n),D(p),D(d),s[15](null),y=!1,x(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){S(t.$$.fragment)},m(u,n){E(t,u,n),o=!0},p(u,[n]){const e={};n&2097407&&(e.$$scope={dirty:n,ctx:u}),t.$set(e)},i(u){o||(O(t.$$.fragment,u),o=!0)},o(u){j(t.$$.fragment,u),o=!1},d(u){D(t,u)}}}function oe(s,t,o){let u,{params:n}=t,e="",p="",_="",d=!1,a=!1,i,c;g();async function g(){if(!(n!=null&&n.token))return M("/");o(0,d=!0);try{const f=V(n==null?void 0:n.token);await C.collection("_superusers").getOne(f.id,{requestKey:"installer_token_check",headers:{Authorization:n==null?void 0:n.token}})}catch(f){f!=null&&f.isAbort||(X("The installer token is invalid or has expired."),M("/"))}o(0,d=!1),await Y(),i==null||i.focus()}async function B(){if(!u){o(0,d=!0);try{await C.collection("_superusers").create({email:e,password:p,passwordConfirm:_},{headers:{Authorization:n==null?void 0:n.token}}),await C.collection("_superusers").authWithPassword(e,p),M("/")}catch(f){C.error(f)}o(0,d=!1)}}function w(){c&&o(6,c.value="",c)}function F(f){f&&ee(`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 "${f.name}"?`,()=>{$(f)},()=>{w()})}async function $(f){if(!(!f||u)){o(1,a=!0);try{await C.backups.upload({file:f},{headers:{Authorization:n==null?void 0:n.token}}),await C.backups.restore(f.name,{headers:{Authorization:n==null?void 0:n.token}}),te("Please wait while extracting the uploaded archive!"),await new Promise(P=>setTimeout(P,2e3)),M("/")}catch(P){C.error(P)}w(),o(1,a=!1)}}function v(f){U[f?"unshift":"push"](()=>{i=f,o(5,i)})}function y(){e=this.value,o(2,e)}function L(){p=this.value,o(3,p)}function l(){_=this.value,o(4,_)}function b(f){U[f?"unshift":"push"](()=>{c=f,o(6,c)})}const H=f=>{var P,R;F((R=(P=f.target)==null?void 0:P.files)==null?void 0:R[0])};return s.$$set=f=>{"params"in f&&o(10,n=f.params)},s.$$.update=()=>{s.$$.dirty&3&&o(7,u=d||a)},[d,a,e,p,_,i,c,u,B,F,n,v,y,L,l,b,H]}class re extends W{constructor(t){super(),G(this,t,oe,ae,J,{params:10})}}export{re as default};
diff --git a/ui/dist/assets/PageOAuth2RedirectFailure-U4FK74Ke.js b/ui/dist/assets/PageOAuth2RedirectFailure-DNk27lv-.js
similarity index 88%
rename from ui/dist/assets/PageOAuth2RedirectFailure-U4FK74Ke.js
rename to ui/dist/assets/PageOAuth2RedirectFailure-DNk27lv-.js
index f7a15870..1a6be487 100644
--- a/ui/dist/assets/PageOAuth2RedirectFailure-U4FK74Ke.js
+++ b/ui/dist/assets/PageOAuth2RedirectFailure-DNk27lv-.js
@@ -1 +1 @@
-import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-Bw7x2V1B.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>',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(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 x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default};
+import{S as r,i as c,s as l,h as u,k as h,n as p,I as n,v as d,O as f,P as m,Q as g,R as o}from"./index-DCriA6MP.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>',h(t,"class","content txt-hint txt-center p-base")},m(e,a){p(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 x extends r{constructor(t){super(),c(this,t,b,_,l,{})}}export{x as default};
diff --git a/ui/dist/assets/PageOAuth2RedirectSuccess-DxO2GykN.js b/ui/dist/assets/PageOAuth2RedirectSuccess-8Lc5-IG-.js
similarity index 88%
rename from ui/dist/assets/PageOAuth2RedirectSuccess-DxO2GykN.js
rename to ui/dist/assets/PageOAuth2RedirectSuccess-8Lc5-IG-.js
index 1c9465cf..ba2e3278 100644
--- a/ui/dist/assets/PageOAuth2RedirectSuccess-DxO2GykN.js
+++ b/ui/dist/assets/PageOAuth2RedirectSuccess-8Lc5-IG-.js
@@ -1 +1 @@
-import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-Bw7x2V1B.js";function b(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 g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default};
+import{S as i,i as r,s as u,h as l,k as p,n as h,I as n,v as d,O as m,P as f,Q as _,R as o}from"./index-DCriA6MP.js";function b(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 g(a,t,e){let s;return m(a,o,c=>e(0,s=c)),f(o,s="OAuth2 auth completed",s),_(()=>{window.close()}),[]}class x extends i{constructor(t){super(),r(this,t,g,b,u,{})}}export{x as default};
diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-DsgNrJ_Y.js b/ui/dist/assets/PageRecordConfirmEmailChange-CjqCY8Sq.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmEmailChange-DsgNrJ_Y.js
rename to ui/dist/assets/PageRecordConfirmEmailChange-CjqCY8Sq.js
index c46fcd41..a145261a 100644
--- a/ui/dist/assets/PageRecordConfirmEmailChange-DsgNrJ_Y.js
+++ b/ui/dist/assets/PageRecordConfirmEmailChange-CjqCY8Sq.js
@@ -1,2 +1,2 @@
-import{S as J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-Bw7x2V1B.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 J,i as M,s as j,F as z,c as L,m as S,t as h,a as v,d as I,J as A,L as G,n as _,E as N,G as R,v as b,M as W,g as Y,p as B,f as D,h as m,z as y,j as C,k as p,l as T,o as g,q as P,u as K,I as E,H as O,A as F}from"./index-DCriA6MP.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(),L(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),S(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(),I(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=G()},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):(N(),v(o[u],1,1,()=>{o[u]=null}),R(),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 z({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){L(e.$$.fragment)},m(n,l){S(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){I(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 W("../");try{const $=Y(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=A.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends J{constructor(e){super(),M(this,e,x,Z,j,{params:5})}}export{te as default};
diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-CKnBpNvm.js b/ui/dist/assets/PageRecordConfirmPasswordReset-B5ksiewx.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmPasswordReset-CKnBpNvm.js
rename to ui/dist/assets/PageRecordConfirmPasswordReset-B5ksiewx.js
index 576e5e8b..6c89fdc7 100644
--- a/ui/dist/assets/PageRecordConfirmPasswordReset-CKnBpNvm.js
+++ b/ui/dist/assets/PageRecordConfirmPasswordReset-B5ksiewx.js
@@ -1,2 +1,2 @@
-import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-Bw7x2V1B.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({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=y(`Reset your user password
+import{S as z,i as A,s as E,F as G,c as H,m as L,t as P,a as q,d as N,J as W,L as Y,n as _,E as B,G as D,v as m,M as K,g as O,p as Q,f as J,h as b,z as y,j as C,k as p,l as M,o as w,q as S,u as U,I as F,H as V,A as R}from"./index-DCriA6MP.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&j(a);return o=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new J({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=y(`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],M(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),L(o,e,null),w(e,c),L(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=j(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const I={};$&3074&&(I.$$scope={dirty:$,ctx:f}),r.$set(I),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&M(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),N(o),N(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 j(a){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(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=y("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=y("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=Y()},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(),q(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){q(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new G({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){L(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){q(e.$$.fragment,s),l=!1},d(s){N(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=W.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends z{constructor(e){super(),A(this,e,le,se,E,{params:6})}}export{oe as default};
diff --git a/ui/dist/assets/PageRecordConfirmVerification-C6uR9qGl.js b/ui/dist/assets/PageRecordConfirmVerification-JwH6c-NG.js
similarity index 98%
rename from ui/dist/assets/PageRecordConfirmVerification-C6uR9qGl.js
rename to ui/dist/assets/PageRecordConfirmVerification-JwH6c-NG.js
index 54fc78e4..177697d3 100644
--- a/ui/dist/assets/PageRecordConfirmVerification-C6uR9qGl.js
+++ b/ui/dist/assets/PageRecordConfirmVerification-JwH6c-NG.js
@@ -1 +1 @@
-import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-Bw7x2V1B.js";function A(o){let e,l,n;function t(i,f){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(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(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 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>Please check your email for the new verification link.</p></div>',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(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 D(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",d(e,"class","alert alert-success"),d(n,"type","button"),d(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 G(o){let e;return{c(){e=u("div"),e.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',d(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",d(e,"type","button"),d(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",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(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]?G:s[0]?D:s[2]?B:A}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 H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(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,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.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 p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default};
+import{S as M,i as P,s as R,F as H,c as q,m as N,t as S,a as V,d as F,M as w,g as y,N as j,L as g,n as r,v as a,p as E,h as u,j as v,k as d,q as k,I as m,l as C,o as z}from"./index-DCriA6MP.js";function A(o){let e,l,n;function t(i,f){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(),d(e,"class","alert alert-danger")},m(i,f){r(i,e,f),r(i,l,f),c.m(i,f),r(i,n,f)},p(i,f){s===(s=t(i))&&c?c.p(i,f):(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 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>Please check your email for the new verification link.</p></div>',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(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 D(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",d(e,"class","alert alert-success"),d(n,"type","button"),d(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 G(o){let e;return{c(){e=u("div"),e.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',d(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",d(e,"type","button"),d(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",d(l,"class","txt"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block"),e.disabled=o[3],C(e,"btn-loading",o[3])},m(s,c){r(s,e,c),z(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]?G:s[0]?D:s[2]?B:A}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 H({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){q(e.$$.fragment)},m(n,t){N(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(S(e.$$.fragment,n),l=!0)},o(n){V(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,f=!1;x();async function x(){if(c)return;l(1,c=!0);const p=new w("../");try{const b=y(t==null?void 0:t.token);await p.collection(b.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 p=y(t==null?void 0:t.token);if(f||!p.collectionId||!p.email)return;l(3,f=!0);const b=new w("../");try{const _=y(t==null?void 0:t.token);await b.collection(_.collectionId).requestVerification(_.email),l(2,i=!0)}catch(_){E.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),I=()=>window.close(),L=()=>window.close();return o.$$set=p=>{"params"in p&&l(6,t=p.params)},o.$$.update=()=>{o.$$.dirty&64&&l(4,n=(t==null?void 0:t.token)&&j(t.token))},[s,c,i,f,n,T,t,h,I,L]}class X extends M{constructor(e){super(),P(this,e,U,Q,R,{params:6})}}export{X as default};
diff --git a/ui/dist/assets/PageSuperuserConfirmPasswordReset-y4vpPRrL.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-C-QLe07z.js
similarity index 98%
rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-y4vpPRrL.js
rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-C-QLe07z.js
index dbef0108..bd2cb5d3 100644
--- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-y4vpPRrL.js
+++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-C-QLe07z.js
@@ -1,2 +1,2 @@
-import{S as y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-Bw7x2V1B.js";function W(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=h(),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=j(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=h(),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=j(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,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({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 y,i as E,s as G,F as I,c as R,m as H,t as J,a as N,d as T,J as M,f as D,h as _,z as P,j as h,k as f,l as K,n as b,o as c,q as j,u as O,C as Q,D as U,v as w,w as V,p as L,K as X,r as Y,H as Z,A as q}from"./index-DCriA6MP.js";function W(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=h(),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=j(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=h(),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=j(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,k,F,z,m=r[3]&&W(r);return i=new D({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new D({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=h(),R(i.$$.fragment),p=h(),R(d.$$.fragment),u=h(),a=_("button"),g=_("span"),g.textContent="Set new password",S=h(),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],K(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),H(i,e,null),c(e,p),H(d,e,null),c(e,u),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),k=!0,F||(z=[j(e,"submit",O(r[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=W(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const A={};$&769&&(A.$$scope={dirty:$,ctx:o}),i.$set(A);const B={};$&770&&(B.$$scope={dirty:$,ctx:o}),d.$set(B),(!k||$&4)&&(a.disabled=o[2]),(!k||$&4)&&K(a,"btn-loading",o[2])},i(o){k||(J(i.$$.fragment,o),J(d.$$.fragment,o),k=!0)},o(o){N(i.$$.fragment,o),N(d.$$.fragment,o),k=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(i),T(d),F=!1,V(z)}}}function se(r){let e,n;return e=new I({props:{$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){R(e.$$.fragment)},m(s,l){H(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(J(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(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 L.collection("_superusers").confirmPasswordReset(l==null?void 0:l.token,t,i),X("Successfully set a new superuser password."),Y("/")}catch(g){L.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 y{constructor(e){super(),E(this,e,le,se,G,{params:5})}}export{ae as default};
diff --git a/ui/dist/assets/PageSuperuserRequestPasswordReset-C2RIJeZg.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-DL6nXs9m.js
similarity index 98%
rename from ui/dist/assets/PageSuperuserRequestPasswordReset-C2RIJeZg.js
rename to ui/dist/assets/PageSuperuserRequestPasswordReset-DL6nXs9m.js
index 61438a4f..7a83df83 100644
--- a/ui/dist/assets/PageSuperuserRequestPasswordReset-C2RIJeZg.js
+++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-DL6nXs9m.js
@@ -1 +1 @@
-import{S as M,i as T,s as j,F as z,c as E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-Bw7x2V1B.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({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(),E(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),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(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),L(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||(_=R(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||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),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(){E(e.$$.fragment)},m(n,l){H(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){L(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 E,m as H,t as w,a as y,d as L,j as v,h as m,k as p,n as g,o as d,C as A,D as B,E as D,G,v as k,p as C,f as I,l as F,q as R,u as N,z as h,H as J,I as P,A as S}from"./index-DCriA6MP.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new I({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(),E(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),H(l,e,null),d(e,t),d(e,r),d(r,c),d(r,_),d(r,i),a=!0,b||(f=R(e,"submit",N(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),L(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||(_=R(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||(_=A(B.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(D(),y(a[$],1,1,()=>{a[$]=null}),G(),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(){E(e.$$.fragment)},m(n,l){H(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){L(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-D6vfkA3g.js b/ui/dist/assets/PasswordResetDocs-C2FJxDCy.js
similarity index 99%
rename from ui/dist/assets/PasswordResetDocs-D6vfkA3g.js
rename to ui/dist/assets/PasswordResetDocs-C2FJxDCy.js
index 3ca1e740..afba27db 100644
--- a/ui/dist/assets/PasswordResetDocs-D6vfkA3g.js
+++ b/ui/dist/assets/PasswordResetDocs-C2FJxDCy.js
@@ -1,4 +1,4 @@
-import{S as se,i as ne,s as oe,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-Bw7x2V1B.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"),j(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+"")&&X(d,n),y&6&&j(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"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(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)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(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,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(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=K(o[2]);const V=l=>l[4].code;for(let l=0;l<m.length;l+=1){let s=me(o,m,l),_=V(s);H.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"),F=S(),C=p("div"),C.textContent="Body Parameters",z=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>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"),q=p("div");for(let l=0;l<R.length;l+=1)R[l].c();U=S(),N=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(C,"class","section-title"),k(A,"class","table-compact table-border m-b-base"),k(O,"class","section-title"),k(q,"class","tabs-header compact combined left"),k(N,"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,F,s),b(l,C,s),b(l,z,s),b(l,A,s),b(l,L,s),b(l,O,s),b(l,W,s),b(l,T,s),u(T,q);for(let _=0;_<R.length;_+=1)R[_]&&R[_].m(q,null);u(T,U),u(T,N);for(let _=0;_<h.length;_+=1)h[_]&&h[_].m(N,null);E=!0},p(l,[s]){(!E||s&1)&&f!==(f=l[0].name+"")&&X(g,f),s&6&&(P=K(l[2]),R=ee(R,s,B,1,l,P,M,q,ye,he,null,_e)),s&6&&(m=K(l[2]),te(),h=ee(h,s,V,1,l,m,H,N,Te,be,null,me),le())},i(l){if(!E){for(let s=0;s<m.length;s+=1)G(h[s]);E=!0}},o(l){for(let s=0;s<h.length;s+=1)J(h[s]);E=!1},d(l){l&&(v(t),v(F),v(C),v(z),v(A),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 Ae(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,X as K,h as p,j as S,z as D,k,n as b,o as u,H as X,Y as ee,Z as ye,E as te,_ as Te,G as le,t as G,a as J,v,l as j,q as ae,W as Ee,c as Z,m as Q,d as x,V as qe,$ as fe,J as Ce,p as Oe,a0 as pe}from"./index-DCriA6MP.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"),j(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+"")&&X(d,n),y&6&&j(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"),Z(n.$$.fragment),d=S(),k(e,"class","tab-item"),j(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Q(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)&&j(e,"active",t[1]===t[4].code)},i(r){c||(G(n.$$.fragment,r),c=!0)},o(r){J(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,F,C,z,A,L,O,W,T,q,R=[],M=new Map,U,N,h=[],H=new Map,E,P=K(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=K(o[2]);const V=l=>l[4].code;for(let l=0;l<m.length;l+=1){let s=me(o,m,l),_=V(s);H.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"),F=S(),C=p("div"),C.textContent="Body Parameters",z=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>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"),q=p("div");for(let l=0;l<R.length;l+=1)R[l].c();U=S(),N=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(C,"class","section-title"),k(A,"class","table-compact table-border m-b-base"),k(O,"class","section-title"),k(q,"class","tabs-header compact combined left"),k(N,"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,F,s),b(l,C,s),b(l,z,s),b(l,A,s),b(l,L,s),b(l,O,s),b(l,W,s),b(l,T,s),u(T,q);for(let _=0;_<R.length;_+=1)R[_]&&R[_].m(q,null);u(T,U),u(T,N);for(let _=0;_<h.length;_+=1)h[_]&&h[_].m(N,null);E=!0},p(l,[s]){(!E||s&1)&&f!==(f=l[0].name+"")&&X(g,f),s&6&&(P=K(l[2]),R=ee(R,s,B,1,l,P,M,q,ye,he,null,_e)),s&6&&(m=K(l[2]),te(),h=ee(h,s,V,1,l,m,H,N,Te,be,null,me),le())},i(l){if(!E){for(let s=0;s<m.length;s+=1)G(h[s]);E=!0}},o(l){for(let s=0;s<h.length;s+=1)J(h[s]);E=!1},d(l){l&&(v(t),v(F),v(C),v(z),v(A),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 Ae(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": "An error occurred while validating the submitted data.",
diff --git a/ui/dist/assets/RealtimeApiDocs-2osG30JV.js b/ui/dist/assets/RealtimeApiDocs-BZWtgnO2.js
similarity index 99%
rename from ui/dist/assets/RealtimeApiDocs-2osG30JV.js
rename to ui/dist/assets/RealtimeApiDocs-BZWtgnO2.js
index c56a1165..7cea1936 100644
--- a/ui/dist/assets/RealtimeApiDocs-2osG30JV.js
+++ b/ui/dist/assets/RealtimeApiDocs-BZWtgnO2.js
@@ -1,4 +1,4 @@
-import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-Bw7x2V1B.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,r,R;return l=new pe({props:{js:`
+import{S as re,i as ae,s as be,V as pe,W as ue,J as P,h as p,z as y,j as a,c as se,k as u,n as s,o as I,m as ne,H as me,t as ie,a as ce,v as n,d as le,p as de}from"./index-DCriA6MP.js";function he(o){var B,U,W,H,L,A,T,j,q,J,M,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,C,g,E,v,w,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-C65dej9I.js b/ui/dist/assets/UpdateApiDocs-XHS3RD1Q.js
similarity index 99%
rename from ui/dist/assets/UpdateApiDocs-C65dej9I.js
rename to ui/dist/assets/UpdateApiDocs-XHS3RD1Q.js
index 331e3e94..03fde04b 100644
--- a/ui/dist/assets/UpdateApiDocs-C65dej9I.js
+++ b/ui/dist/assets/UpdateApiDocs-XHS3RD1Q.js
@@ -1,4 +1,4 @@
-import{S as Ot,i as St,s as Mt,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-Bw7x2V1B.js";import{F as Pt}from"./FieldsQueryParam-DvIo4uvz.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,V as $t,J as x,X as ie,W as Tt,h as i,z as h,j as f,c as ve,k,n as o,o as n,m as we,H as te,Y as Je,Z as bt,E as qt,_ as Rt,G as Ht,t as he,a as ye,v as r,d as Ce,p as Dt,l as Te,q as Lt,I as de}from"./index-DCriA6MP.js";import{F as Pt}from"./FieldsQueryParam-JXZpoc_D.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,H,S,E,q,D,J,I,$,R,L,g,v,w;function z(_,C){var le,W,ne;return C&1&&(b=null),b==null&&(b=!!((ne=(W=(le=_[0])==null?void 0:le.fields)==null?void 0:W.find(Qt))!=null&&ne.required)),b?jt:Ft}let Q=z(d,-1),F=Q(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-Whu5MtMJ.js b/ui/dist/assets/VerificationDocs-Cnw3YmXh.js
similarity index 99%
rename from ui/dist/assets/VerificationDocs-Whu5MtMJ.js
rename to ui/dist/assets/VerificationDocs-Cnw3YmXh.js
index c4873601..5572e811 100644
--- a/ui/dist/assets/VerificationDocs-Whu5MtMJ.js
+++ b/ui/dist/assets/VerificationDocs-Cnw3YmXh.js
@@ -1,4 +1,4 @@
-import{S as le,i as ne,s as ie,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-Bw7x2V1B.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(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 Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;l<O.length;l+=1){let i=ue(s,O,l),n=G(i);T.set(n,p[l]=_e(n,i))}return{c(){t=m("div"),e=m("strong"),e.textContent="POST",o=y(),f=m("div"),c=m("p"),r=M("/api/collections/"),a=m("strong"),g=M(u),q=M("/confirm-verification"),D=y(),P=m("div"),P.textContent="Body Parameters",j=y(),R=m("table"),R.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=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=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(P,"class","section-title"),v(R,"class","table-compact table-border m-b-base"),v(E,"class","section-title"),v(V,"class","tabs-header compact combined left"),v(I,"class","tabs-content"),v(C,"class","tabs")},m(l,i){b(l,t,i),d(t,e),d(t,o),d(t,f),d(f,c),d(c,r),d(c,a),d(a,g),d(c,q),b(l,D,i),b(l,P,i),b(l,j,i),b(l,R,i),b(l,B,i),b(l,E,i),b(l,N,i),b(l,C,i),d(C,V);for(let n=0;n<$.length;n+=1)$[n]&&$[n].m(V,null);d(C,K),d(C,I);for(let n=0;n<p.length;n+=1)p[n]&&p[n].m(I,null);A=!0},p(l,[i]){(!A||i&1)&&u!==(u=l[0].name+"")&&W(g,u),i&6&&(_=F(l[2]),$=x($,i,J,1,l,_,z,V,Te,pe,null,me)),i&6&&(O=F(l[2]),ee(),p=x(p,i,G,1,l,O,T,I,qe,_e,null,ue),te())},i(l){if(!A){for(let i=0;i<O.length;i+=1)L(p[i]);A=!0}},o(l){for(let i=0;i<p.length;i+=1)U(p[i]);A=!1},d(l){l&&(h(t),h(D),h(P),h(j),h(R),h(B),h(E),h(N),h(C));for(let i=0;i<$.length;i+=1)$[i].d();for(let i=0;i<p.length;i+=1)p[i].d()}}}function Re(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,X as F,h as m,j as y,z as M,k as v,n as b,o as d,H as W,Y as x,Z as Te,E as ee,_ as qe,G as te,t as L,a as U,v as h,l as H,q as oe,W as Ce,c as Y,m as Z,d as Q,V as Ve,$ as fe,J as Ae,p as Ie,a0 as de}from"./index-DCriA6MP.js";function ue(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function u(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(g,q){b(g,e,q),d(e,f),d(e,c),r||(a=oe(e,"click",u),r=!0)},p(g,q){t=g,q&4&&o!==(o=t[4].code+"")&&W(f,o),q&6&&H(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 Ce({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Y(o.$$.fragment),f=y(),v(e,"class","tab-item"),H(e,"active",t[1]===t[4].code),this.first=e},m(r,a){b(r,e,a),Z(o,e,null),d(e,f),c=!0},p(r,a){t=r;const u={};a&4&&(u.content=t[4].body),o.$set(u),(!c||a&6)&&H(e,"active",t[1]===t[4].code)},i(r){c||(L(o.$$.fragment,r),c=!0)},o(r){U(o.$$.fragment,r),c=!1},d(r){r&&h(e),Q(o)}}}function Pe(s){let t,e,o,f,c,r,a,u=s[0].name+"",g,q,D,P,j,R,B,E,N,C,V,$=[],z=new Map,K,I,p=[],T=new Map,A,_=F(s[2]);const J=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=J(i);z.set(n,$[l]=pe(n,i))}let O=F(s[2]);const G=l=>l[4].code;for(let l=0;l<O.length;l+=1){let i=ue(s,O,l),n=G(i);T.set(n,p[l]=_e(n,i))}return{c(){t=m("div"),e=m("strong"),e.textContent="POST",o=y(),f=m("div"),c=m("p"),r=M("/api/collections/"),a=m("strong"),g=M(u),q=M("/confirm-verification"),D=y(),P=m("div"),P.textContent="Body Parameters",j=y(),R=m("table"),R.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=y(),E=m("div"),E.textContent="Responses",N=y(),C=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();K=y(),I=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(P,"class","section-title"),v(R,"class","table-compact table-border m-b-base"),v(E,"class","section-title"),v(V,"class","tabs-header compact combined left"),v(I,"class","tabs-content"),v(C,"class","tabs")},m(l,i){b(l,t,i),d(t,e),d(t,o),d(t,f),d(f,c),d(c,r),d(c,a),d(a,g),d(c,q),b(l,D,i),b(l,P,i),b(l,j,i),b(l,R,i),b(l,B,i),b(l,E,i),b(l,N,i),b(l,C,i),d(C,V);for(let n=0;n<$.length;n+=1)$[n]&&$[n].m(V,null);d(C,K),d(C,I);for(let n=0;n<p.length;n+=1)p[n]&&p[n].m(I,null);A=!0},p(l,[i]){(!A||i&1)&&u!==(u=l[0].name+"")&&W(g,u),i&6&&(_=F(l[2]),$=x($,i,J,1,l,_,z,V,Te,pe,null,me)),i&6&&(O=F(l[2]),ee(),p=x(p,i,G,1,l,O,T,I,qe,_e,null,ue),te())},i(l){if(!A){for(let i=0;i<O.length;i+=1)L(p[i]);A=!0}},o(l){for(let i=0;i<p.length;i+=1)U(p[i]);A=!1},d(l){l&&(h(t),h(D),h(P),h(j),h(R),h(B),h(E),h(N),h(C));for(let i=0;i<$.length;i+=1)$[i].d();for(let i=0;i<p.length;i+=1)p[i].d()}}}function Re(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": "An error occurred while validating the submitted data.",
diff --git a/ui/dist/assets/ViewApiDocs-DsJmXTBN.js b/ui/dist/assets/ViewApiDocs-CWljd9ob.js
similarity index 98%
rename from ui/dist/assets/ViewApiDocs-DsJmXTBN.js
rename to ui/dist/assets/ViewApiDocs-CWljd9ob.js
index 5a1b102e..e41aa1e4 100644
--- a/ui/dist/assets/ViewApiDocs-DsJmXTBN.js
+++ b/ui/dist/assets/ViewApiDocs-CWljd9ob.js
@@ -1,4 +1,4 @@
-import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-Bw7x2V1B.js";import{F as ut}from"./FieldsQueryParam-DvIo4uvz.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||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:`
+import{S as lt,i as st,s as nt,V as ot,W as tt,X as K,h as o,z as _,j as b,c as W,k as m,n as r,o as l,m as X,H as ve,Y as Qe,Z as at,E as it,_ as rt,G as dt,t as U,a as V,v as d,d as Y,J as Ke,p as ct,l as Z,q as pt}from"./index-DCriA6MP.js";import{F as ut}from"./FieldsQueryParam-JXZpoc_D.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||(U(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&d(n),Y(i)}}}function ft(a){var ze,Ge;let s,n,i=a[0].name+"",v,p,c,f,w,C,ee,z=a[0].name+"",te,$e,le,F,se,S,ne,$,G,ye,J,T,we,oe,N=a[0].name+"",ae,Ce,ie,Fe,re,q,de,x,ce,A,pe,R,ue,Re,H,O,fe,Oe,be,De,h,Pe,E,Te,Ee,Be,me,Se,_e,qe,xe,Ae,he,He,Ie,B,ke,I,ge,D,M,y=[],Me=new Map,Le,L,k=[],je=new Map,P;F=new ot({props:{js:`
         import PocketBase from 'pocketbase';
 
         const pb = new PocketBase('${a[3]}');
diff --git a/ui/dist/assets/index-CH-gyH77.js b/ui/dist/assets/index-CEH5UG_e.js
similarity index 78%
rename from ui/dist/assets/index-CH-gyH77.js
rename to ui/dist/assets/index-CEH5UG_e.js
index d893efcb..63a3d81d 100644
--- a/ui/dist/assets/index-CH-gyH77.js
+++ b/ui/dist/assets/index-CEH5UG_e.js
@@ -1,14 +1,14 @@
 let ys=[],Nl=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,e=0;t<n.length;t++)(t%2?Nl:ys).push(e=e+n[t])})();function Oc(n){if(n<768)return!1;for(let t=0,e=ys.length;;){let i=t+e>>1;if(n<ys[i])e=i;else if(n>=Nl[i])t=i+1;else return!0;if(t==e)return!1}}function Yr(n){return n>=127462&&n<=127487}const Xr=8205;function Tc(n,t,e=!0,i=!0){return(e?Fl:Bc)(n,t,i)}function Fl(n,t,e){if(t==n.length)return t;t&&Vl(n.charCodeAt(t))&&Hl(n.charCodeAt(t-1))&&t--;let i=Xn(n,t);for(t+=_r(i);t<n.length;){let s=Xn(n,t);if(i==Xr||s==Xr||e&&Oc(s))t+=_r(s),i=s;else if(Yr(s)){let r=0,o=t-2;for(;o>=0&&Yr(Xn(n,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function Bc(n,t,e){for(;t>0;){let i=Fl(n,t-2,e);if(i<t)return i;t--}return 0}function Xn(n,t){let e=n.charCodeAt(t);if(!Hl(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Vl(i)?(e-55296<<10)+(i-56320)+65536:e}function Vl(n){return n>=56320&&n<57344}function Hl(n){return n>=55296&&n<56320}function _r(n){return n<65536?1:2}class F{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Ue(this,t,e);let s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),Ut.from(s,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Ue(this,t,e);let i=[];return this.decompose(t,e,i,0),Ut.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new mi(this),r=new mi(t);for(let o=e,l=e;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(t=1){return new mi(this,t)}iterRange(t,e=this.length){return new Wl(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let s=this.line(t).from;i=this.iterRange(s,Math.max(s,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new zl(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?F.empty:t.length<=32?new _(t):Ut.from(_.split(t,[]))}}class _ extends F{constructor(t,e=Pc(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((e?i:l)>=t)return new Rc(s,l,i,o);s=l+1,i++}}decompose(t,e,i,s){let r=t<=0&&e>=this.length?this:new _(Qr(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(s&1){let o=i.pop(),l=an(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new _(l,o.length+r.length));else{let a=l.length>>1;i.push(new _(l.slice(0,a)),new _(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof _))return super.replace(t,e,i);[t,e]=Ue(this,t,e);let s=an(this.text,an(i.text,Qr(this.text,0,t)),e),r=this.length+i.length-(e-t);return s.length<=32?new _(s,r):Ut.from(_.split(s,[]),r)}sliceString(t,e=this.length,i=`
 `){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;r<=e&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>t&&o&&(s+=i),t<a&&e>r&&(s+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return s}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],s=-1;for(let r of t)i.push(r),s+=r.length+1,i.length==32&&(e.push(new _(i,s)),i=[],s=-1);return s>-1&&e.push(new _(i,s)),e}}class Ut extends F{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,s);s=l+1,i=a+1}}decompose(t,e,i,s){for(let r=0,o=0;o<=e&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(t<=a&&e>=o){let c=s&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!c?i.push(l):l.decompose(t-o,e-o,i,c)}o=a+1}}replace(t,e,i){if([t,e]=Ue(this,t,e),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(t>=r&&e<=l){let a=o.replace(t-r,e-r,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let h=this.children.slice();return h[s]=a,new Ut(h,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=`
 `){[t,e]=Ue(this,t,e);let s="";for(let r=0,o=0;r<this.children.length&&o<=e;r++){let l=this.children[r],a=o+l.length;o>t&&r&&(s+=i),t<a&&e>o&&(s+=l.sliceString(t-o,e-o,i)),o=a+1}return s}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Ut))return 0;let i=0,[s,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;s+=e,r+=e){if(s==o||r==l)return i;let a=this.children[s],c=t.children[r];if(a!=c)return i+a.scanIdentical(c,e);i+=a.length+1}}static from(t,e=t.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new _(d,e)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,c=-1,h=[];function f(d){let p;if(d.lines>r&&d instanceof Ut)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,c+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,c+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Ut.from(h,c)),c=-1,a=h.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Ut(l,e)}}F.empty=new _([""],0);function Pc(n){let t=-1;for(let e of n)t+=e.length+1;return t}function an(n,t,e=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=e&&(a>i&&(l=l.slice(0,i-s)),s<e&&(l=l.slice(e-s)),o?(t[t.length-1]+=l,o=!1):t.push(l)),s=a+1}return t}function Qr(n,t,e){return an(n,[""],t,e)}class mi{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof _?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof _?s.text.length:s.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=`
-`,this;t--}else if(s instanceof _){let a=s.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=s.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Wl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new mi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zl{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Wl.prototype[Symbol.iterator]=zl.prototype[Symbol.iterator]=function(){return this});class Rc{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ue(n,t,e){return t=Math.max(0,Math.min(n.length,t)),[t,Math.max(t,Math.min(n.length,e))]}function rt(n,t,e=!0,i=!0){return Tc(n,t,e,i)}function Lc(n){return n>=56320&&n<57344}function Ec(n){return n>=55296&&n<56320}function yt(n,t){let e=n.charCodeAt(t);if(!Ec(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Lc(i)?(e-55296<<10)+(i-56320)+65536:e}function ur(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Gt(n){return n<65536?1:2}const bs=/\r\n?|\n/;var at=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(at||(at={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,s=0;e<this.sections.length;){let r=this.sections[e++],o=this.sections[e++];o<0?(t(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(t,e=!1){xs(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];s<0?t.push(i,s):t.push(s,i)}return new Qt(t)}composeDesc(t){return this.empty?t:t.empty?this:ql(this,t)}mapDesc(t,e=!1){return t.empty?this:ws(this,t,e)}mapPos(t,e=-1,i=at.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=s+l;if(a<0){if(c>t)return r+(t-s);r+=l}else{if(i!=at.Simple&&c>=t&&(i==at.TrackDel&&s<t&&c>t||i==at.TrackBefore&&s<t||i==at.TrackAfter&&c>t))return null;if(c>t||c==t&&e<0&&!l)return t==s||e<0?r:r+a;r+=a}s=c}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return r}touchesRange(t,e=t){for(let i=0,s=0;i<this.sections.length&&s<=e;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=e&&l>=t)return s<t&&l>e?"cover":!0;s=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];t+=(t?" ":"")+i+(s>=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class tt extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return xs(this,(e,i,s,r,o)=>t=t.replace(s,s+(i-e),o),!1),t}mapDesc(t,e=!1){return ws(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,r=0;s<e.length;s+=2){let o=e[s],l=e[s+1];if(l>=0){e[s]=l,e[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(F.empty);i.push(o?t.slice(r,r+o):F.empty)}r+=o}return new tt(e,i)}compose(t){return this.empty?t:t.empty?this:ql(this,t,!0)}map(t,e=!1){return t.empty?this:ws(this,t,e,!0)}iterChanges(t,e=!1){xs(this,t,e)}get desc(){return Qt.create(this.sections)}filter(t){let e=[],i=[],s=[],r=new wi(this);t:for(let o=0,l=0;;){let a=o==t.length?1e9:t[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break t;let h=Math.min(r.len,a-l);lt(s,h,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;lt(e,h,f),f>0&&ce(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l<c;){if(r.done)break t;let h=Math.min(r.len,c-l);lt(e,h,-1),lt(s,h,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(h),l+=h}}return{changes:new tt(e,i),filtered:Qt.create(s)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],s=this.sections[e+1];s<0?t.push(i):s==0?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;o<e&&lt(s,e-o,-1);let f=new tt(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function c(h){if(Array.isArray(h))for(let f of h)c(f);else if(h instanceof tt){if(h.length!=e)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${e})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:f,to:u=f,insert:d}=h;if(f>u||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?F.of(d.split(i||bs)):d:F.empty,g=p.length;if(f==u&&g==0)return;f<o&&a(),f>o&&lt(s,f-o,-1),lt(s,u-f,g),ce(r,s,p),o=u}}return c(t),a(!l),l}static empty(t){return new tt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;s<t.length;s++){let r=t[s];if(typeof r=="number")e.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length<s;)i.push(F.empty);i[s]=F.of(r.slice(1)),e.push(r[0],i[s].length)}}}return new tt(e,i)}static createSet(t,e){return new tt(t,e)}}function lt(n,t,e,i=!1){if(t==0&&e<=0)return;let s=n.length-2;s>=0&&e<=0&&e==n[s+1]?n[s]+=t:s>=0&&t==0&&n[s]==0?n[s+1]+=e:i?(n[s]+=t,n[s+1]+=e):n.push(t,e)}function ce(n,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(e);else{for(;n.length<i;)n.push(F.empty);n.push(e)}}function xs(n,t,e){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let c=s,h=r,f=F.empty;for(;c+=l,h+=a,a&&i&&(f=f.append(i[o-2>>1])),!(e||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];t(s,c,r,h,f),s=c,r=h}}}function ws(n,t,e,i=!1){let s=[],r=i?[]:null,o=new wi(n),l=new wi(t);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);lt(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!e))){let c=l.len;for(lt(s,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(lt(s,0,o.ins),r&&ce(r,s,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;lt(s,c,a<o.i?o.ins:0),r&&a<o.i&&ce(r,s,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return r?tt.createSet(s,r):Qt.create(s);throw new Error("Mismatched change set lengths")}}}function ql(n,t,e=!1){let i=[],s=e?[]:null,r=new wi(n),o=new wi(t);for(let l=!1;;){if(r.done&&o.done)return s?tt.createSet(i,s):Qt.create(i);if(r.ins==0)lt(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)lt(i,0,o.ins,l),s&&ce(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),c=i.length;if(r.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;lt(i,a,h,l),s&&h&&ce(s,i,o.text)}else o.ins==-1?(lt(i,r.off?0:r.len,a,l),s&&ce(s,i,r.textBit(a))):(lt(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&ce(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class wi{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?F.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?F.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ke{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ke(i,s,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ke(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new b([this.main],0)}addRange(t,e=!0){return b.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,b.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ke.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<t.length;s++){let r=t[s];if(r.empty?r.from<=i:r.from<i)return b.normalized(t.slice(),e);i=r.to}return new b(t,e)}static cursor(t,e=0,i,s){return ke.create(t,t,(e==0?0:e<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(t,e,i,s){let r=(i??16777215)<<6|(s==null?7:Math.min(6,s));return e<t?ke.create(e,t,48|r):ke.create(t,e,(e>t?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((s,r)=>s.from-r.from),e=t.indexOf(i);for(let s=1;s<t.length;s++){let r=t[s],o=t[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=e&&e--,t.splice(--s,2,r.anchor>r.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Kl(n,t){for(let e of n.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let dr=0;class T{constructor(t,e,i,s,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=dr++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:pr),!!t.static,t.enables)}of(t){return new hn([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function pr(n,t){return n==t||n.length==t.length&&n.every((e,i)=>e===t[i])}class hn{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=dr++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||Ss(f,h)){let d=i(f);if(l?!Zr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=bn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof mt?u.field(m,!1)==f.field(m,!1):!0)||(l?Zr(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Zr(n,t,e){if(n.length!=t.length)return!1;for(let i=0;i<n.length;i++)if(!e(n[i],t[i]))return!1;return!0}function Ss(n,t){let e=!1;for(let i of t)yi(n,i)&1&&(e=!0);return e}function Ic(n,t,e){let i=e.map(a=>n[a.id]),s=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[t.id]>>1;function l(a){let c=[];for(let h=0;h<i.length;h++){let f=bn(a,i[h]);if(s[h]==2)for(let u of f)c.push(u);else c.push(f)}return t.combine(c)}return{create(a){for(let c of i)yi(a,c);return a.values[o]=l(a),1},update(a,c){if(!Ss(a,r))return 0;let h=l(a);return t.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=Ss(a,i),f=c.config.facets[t.id],u=c.facet(t);if(f&&!h&&pr(e,f))return a.values[o]=u,0;let d=l(a);return t.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const to=T.define({static:!0});class mt{constructor(t,e,i,s,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(t){let e=new mt(dr++,t.create,t.update,t.compare||((i,s)=>i===s),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(to).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,s)=>{let r=i.values[e],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[e]=s.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,to.of({field:this,create:t})]}get extension(){return this}}const Se={lowest:4,low:3,default:2,high:1,highest:0};function ri(n){return t=>new $l(t,n)}const ye={highest:ri(Se.highest),high:ri(Se.high),default:ri(Se.default),low:ri(Se.low),lowest:ri(Se.lowest)};class $l{constructor(t,e){this.inner=t,this.prec=e}}class Hn{of(t){return new ks(this,t)}reconfigure(t){return Hn.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class ks{constructor(t,e){this.compartment=t,this.inner=e}}class yn{constructor(t,e,i,s,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let s=[],r=Object.create(null),o=new Map;for(let u of Nc(t,e,o))u instanceof mt?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of s)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,pr(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>Ic(m,p,d))}}let f=c.map(u=>u(l));return new yn(t,o,f,l,a,r)}}function Nc(n,t,e){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof ks&&e.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof ks){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof $l)r(o.inner,o.prec);else if(o instanceof mt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof hn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Se.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(n,Se.default),i.reduce((o,l)=>o.concat(l))}function yi(n,t){if(t&1)return 2;let e=t>>1,i=n.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[e]=4;let s=n.computeSlot(n,n.config.dynamicSlots[e]);return n.status[e]=2|s}function bn(n,t){return t&1?n.config.staticValues[t>>1]:n.values[t>>1]}const jl=T.define(),vs=T.define({combine:n=>n.some(t=>t),static:!0}),Ul=T.define({combine:n=>n.length?n[0]:void 0,static:!0}),Gl=T.define(),Jl=T.define(),Yl=T.define(),Xl=T.define({combine:n=>n.length?n[0]:!1});class oe{constructor(t,e){this.type=t,this.value=e}static define(){return new Fc}}class Fc{of(t){return new oe(this,t)}}class Vc{constructor(t){this.map=t}of(t){return new N(this,t)}}class N{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new N(this.type,e)}is(t){return this.type==t}static define(t={}){return new Vc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let r=s.map(e);r&&i.push(r)}return i}}N.reconfigure=N.define();N.appendConfig=N.define();class Z{constructor(t,e,i,s,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Kl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,s,r,o){return new Z(t,e,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=oe.define();Z.userEvent=oe.define();Z.addToHistory=oe.define();Z.remote=oe.define();function Hc(n,t){let e=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==t.length||t[s]>=n[i]))r=n[i++],o=n[i++];else if(s<t.length)r=t[s++],o=t[s++];else return e;!e.length||e[e.length-1]<r?e.push(r,o):e[e.length-1]<o&&(e[e.length-1]=o)}}function _l(n,t,e){var i;let s,r,o;return e?(s=t.changes,r=tt.empty(t.changes.length),o=n.changes.compose(t.changes)):(s=t.changes.map(n.changes),r=n.changes.mapDesc(t.changes,!0),o=n.changes.compose(s)),{changes:o,selection:t.selection?t.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:N.mapEffects(n.effects,s).concat(N.mapEffects(t.effects,r)),annotations:n.annotations.length?n.annotations.concat(t.annotations):t.annotations,scrollIntoView:n.scrollIntoView||t.scrollIntoView}}function Cs(n,t,e){let i=t.selection,s=ze(t.annotations);return t.userEvent&&(s=s.concat(Z.userEvent.of(t.userEvent))),{changes:t.changes instanceof tt?t.changes:tt.of(t.changes||[],e,n.facet(Ul)),selection:i&&(i instanceof b?i:b.single(i.anchor,i.head)),effects:ze(t.effects),annotations:s,scrollIntoView:!!t.scrollIntoView}}function Ql(n,t,e){let i=Cs(n,t.length?t[0]:{},n.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let r=1;r<t.length;r++){t[r].filter===!1&&(e=!1);let o=!!t[r].sequential;i=_l(i,Cs(n,t[r],o?i.changes.newLength:n.doc.length),o)}let s=Z.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return zc(e?Wc(s):s)}function Wc(n){let t=n.startState,e=!0;for(let s of t.facet(Gl)){let r=s(n);if(r===!1){e=!1;break}Array.isArray(r)&&(e=e===!0?r:Hc(e,r))}if(e!==!0){let s,r;if(e===!1)r=n.changes.invertedDesc,s=tt.empty(t.doc.length);else{let o=n.changes.filter(e);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=Z.create(t,s,n.selection&&n.selection.map(r),N.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=t.facet(Jl);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=Ql(t,ze(r),!1)}return n}function zc(n){let t=n.startState,e=t.facet(Yl),i=n;for(let s=e.length-1;s>=0;s--){let r=e[s](n);r&&Object.keys(r).length&&(i=_l(i,Cs(t,r,n.changes.newLength),!0))}return i==n?n:Z.create(t,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const qc=[];function ze(n){return n==null?qc:Array.isArray(n)?n:[n]}var J=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(J||(J={}));const Kc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let As;try{As=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $c(n){if(As)return As.test(n);for(let t=0;t<n.length;t++){let e=n[t];if(/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Kc.test(e)))return!0}return!1}function jc(n){return t=>{if(!/\S/.test(t))return J.Space;if($c(t))return J.Word;for(let e=0;e<n.length;e++)if(t.indexOf(n[e])>-1)return J.Word;return J.Other}}class H{constructor(t,e,i,s,r,o){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)yi(this,l<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(i==null){if(e)throw new RangeError("Field is not present in this state");return}return yi(this,i),bn(this,i)}update(...t){return Ql(this,t,!0)}applyTransaction(t){let e=this.config,{base:i,compartments:s}=e;for(let l of t.effects)l.is(Hn.reconfigure)?(e&&(s=new Map,e.compartments.forEach((a,c)=>s.set(c,a)),e=null),s.set(l.value.compartment,l.value.extension)):l.is(N.reconfigure)?(e=null,i=l.value):l.is(N.appendConfig)&&(e=null,i=ze(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=yn.resolve(i,s,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(vs)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ze(i.effects);for(let l=1;l<e.ranges.length;l++){let a=t(e.ranges[l]),c=this.changes(a.changes),h=c.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(h);let f=s.mapDesc(c,!0);r.push(a.range.map(f)),s=s.compose(h),o=N.mapEffects(o,h).concat(N.mapEffects(ze(a.effects),f))}return{changes:s,selection:b.create(r,e.mainIndex),effects:o}}changes(t=[]){return t instanceof tt?t:tt.of(t,this.doc.length,this.facet(H.lineSeparator))}toText(t){return F.of(t.split(this.facet(H.lineSeparator)||bs))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(yi(this,e),bn(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let s=t[i];s instanceof mt&&this.config.address[s.id]!=null&&(e[i]=s.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(t,r)){let o=i[r],l=t[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=yn.resolve(t.extensions||[],new Map),i=t.doc instanceof F?t.doc:F.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||bs)),s=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Kl(s,i.length),e.staticFacet(vs)||(s=s.asSingle()),new H(e,i,s,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||`
-`}get readOnly(){return this.facet(Xl)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let r of this.facet(jl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&s.push(o[t]);return s}charCategorizer(t){return jc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=rt(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;l<s;){let a=rt(e,l);if(r(e.slice(l,a))!=J.Word)break;l=a}return o==l?null:b.range(o+i,l+i)}}H.allowMultipleSelections=vs;H.tabSize=T.define({combine:n=>n.length?n[0]:4});H.lineSeparator=Ul;H.readOnly=Xl;H.phrases=T.define({compare(n,t){let e=Object.keys(n),i=Object.keys(t);return e.length==i.length&&e.every(s=>n[s]==t[s])}});H.languageData=jl;H.changeFilter=Gl;H.transactionFilter=Jl;H.transactionExtender=Yl;Hn.reconfigure=N.define();function Ee(n,t,e={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in t)i[s]===void 0&&(i[s]=t[s]);return i}class De{eq(t){return this==t}range(t,e=t){return Ms.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=at.TrackDel;let Ms=class Zl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Zl(t,e,i)}};function Ds(n,t){return n.from-t.from||n.value.startSide-t.value.startSide}class gr{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,s){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+t,this.to[r]+t,this.value[r])===!1)return!1}map(t,e){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+t,f=this.to[a]+t,u,d;if(h==f){let p=e.mapPos(h,c.startSide,c.mapMode);if(p==null||(u=d=p,c.startSide!=c.endSide&&(d=e.mapPos(h,c.endSide),d<u)))continue}else if(u=e.mapPos(h,c.startSide),d=e.mapPos(f,c.endSide),u>d||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),s.push(u-o),r.push(d-o))}return{mapped:i.length?new gr(s,r,i,l):null,pos:o}}}class K{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new K(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(Ds)),this.isEmpty)return e.length?K.of(e):this;let l=new ta(this,null,-1).goto(0),a=0,c=[],h=new Oe;for(;l.value||a<e.length;)if(a<e.length&&(l.from-e[a].from||l.startSide-e[a].value.startSide)>=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(l.chunkIndex)<e[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(Ms.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?K.empty:this.nextLayer.update({add:c,filter:o,filterFrom:s,filterTo:r}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=t.touchesRange(l,l+a.length);if(c===!1)s=Math.max(s,a.maxPoint),e.push(a),i.push(t.mapPos(l));else if(c===!0){let{mapped:h,pos:f}=a.map(l,t);h&&(s=Math.max(s,h.maxPoint),e.push(h),i.push(f))}}let r=this.nextLayer.map(t);return e.length==0?r:new K(i,e,r||K.empty,s)}between(t,e,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(e>=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return Si.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Si.from(t).goto(e)}static compare(t,e,i,s,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=eo(o,l,i),c=new oi(o,a,r),h=new oi(l,a,r);i.iterGaps((f,u,d)=>io(c,f,h,u,d,s)),i.empty&&i.length==0&&io(c,0,h,0,0,s)}static eq(t,e,i=0,s){s==null&&(s=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=eo(r,o),a=new oi(r,l,0).goto(i),c=new oi(o,l,0).goto(i);for(;;){if(a.to!=c.to||!Os(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(t,e,i,s,r=-1){let o=new oi(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFrom<e?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);s.point(l,c,o.point,h,f,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(s.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Oe;for(let s of t instanceof Ms?[t]:e?Uc(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=K.empty;s=s.nextLayer)e=new K(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Uc(n){if(n.length>1)for(let t=n[0],e=1;e<n.length;e++){let i=n[e];if(Ds(t,i)>0)return n.slice().sort(Ds);t=i}return n}K.empty.nextLayer=K.empty;class Oe{finishChunk(t){this.chunks.push(new gr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Oe)).add(t,e,i)}addInner(t,e,i){let s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function eo(n,t,e){let i=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of t)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(e?e.mapPos(l):l)==r.chunkPos[o]&&!(e!=null&&e.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class ta{constructor(t,e,i,s=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<t||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Si{constructor(t){this.heap=t}static from(t,e=null,i=-1){let s=[];for(let r=0;r<t.length;r++)for(let o=t[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&s.push(new ta(o,e,i,r));return s.length==1?s[0]:new Si(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),_n(this.heap,0)}}}function _n(n,t){for(let e=n[t];;){let i=(t<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1<n.length&&s.compare(n[i+1])>=0&&(s=n[i+1],i++),e.compare(s)<0)break;n[i]=e,n[t]=s,t=i}}class oi{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Si.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){zi(this.active,t),zi(this.activeTo,t),zi(this.activeRank,t),this.minActive=no(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:r}=this.cursor;for(;e<this.activeRank.length&&(r-this.activeRank[e]||s-this.activeTo[e])>0;)e++;qi(this.active,e,i),qi(this.activeTo,e,s),qi(this.activeRank,e,r),t&&qi(t,e,this.cursor.from),this.minActive=no(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&zi(i,s)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<t;s--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function io(n,t,e,i,s,r){n.goto(t),e.goto(i);let o=i+s,l=i,a=i-t;for(;;){let c=n.to+a-e.to,h=c||n.endSide-e.endSide,f=h<0?n.to+a:e.to,u=Math.min(f,o);if(n.point||e.point?n.point&&e.point&&(n.point==e.point||n.point.eq(e.point))&&Os(n.activeForPoint(n.to),e.activeForPoint(e.to))||r.comparePoint(l,u,n.point,e.point):u>l&&!Os(n.active,e.active)&&r.compareRange(l,u,n.active,e.active),f>o)break;(c||n.openEnd!=e.openEnd)&&r.boundChange&&r.boundChange(f),l=f,h<=0&&n.next(),h>=0&&e.next()}}function Os(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!=t[e]&&!n[e].eq(t[e]))return!1;return!0}function zi(n,t){for(let e=t,i=n.length-1;e<i;e++)n[e]=n[e+1];n.pop()}function qi(n,t,e){for(let i=n.length-1;i>=t;i--)n[i+1]=n[i];n[t]=e}function no(n,t){let e=-1,i=1e9;for(let s=0;s<t.length;s++)(t[s]-i||n[s].endSide-n[e].endSide)<0&&(e=s,i=t[s]);return e}function ei(n,t,e=n.length){let i=0;for(let s=0;s<e;)n.charCodeAt(s)==9?(i+=t-i%t,s++):(i++,s=rt(n,s));return i}function Ts(n,t,e,i){for(let s=0,r=0;;){if(r>=t)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?e-r%e:1,s=rt(n,s)}return i===!0?-1:n.length}const Bs="ͼ",so=typeof Symbol>"u"?"__"+Bs:Symbol.for(Bs),Ps=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(s(o),t[o],this.rules)}getRules(){return this.rules.join(`
+`,this;t--}else if(s instanceof _){let a=s.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=s.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Wl{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new mi(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:s}=this.cursor.next(t);return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zl{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:s}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Wl.prototype[Symbol.iterator]=zl.prototype[Symbol.iterator]=function(){return this});class Rc{constructor(t,e,i,s){this.from=t,this.to=e,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ue(n,t,e){return t=Math.max(0,Math.min(n.length,t)),[t,Math.max(t,Math.min(n.length,e))]}function rt(n,t,e=!0,i=!0){return Tc(n,t,e,i)}function Lc(n){return n>=56320&&n<57344}function Ec(n){return n>=55296&&n<56320}function yt(n,t){let e=n.charCodeAt(t);if(!Ec(e)||t+1==n.length)return e;let i=n.charCodeAt(t+1);return Lc(i)?(e-55296<<10)+(i-56320)+65536:e}function ur(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Gt(n){return n<65536?1:2}const bs=/\r\n?|\n/;var at=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(at||(at={}));class Qt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,s=0;e<this.sections.length;){let r=this.sections[e++],o=this.sections[e++];o<0?(t(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(t,e=!1){xs(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];s<0?t.push(i,s):t.push(s,i)}return new Qt(t)}composeDesc(t){return this.empty?t:t.empty?this:ql(this,t)}mapDesc(t,e=!1){return t.empty?this:ws(this,t,e)}mapPos(t,e=-1,i=at.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=s+l;if(a<0){if(c>t)return r+(t-s);r+=l}else{if(i!=at.Simple&&c>=t&&(i==at.TrackDel&&s<t&&c>t||i==at.TrackBefore&&s<t||i==at.TrackAfter&&c>t))return null;if(c>t||c==t&&e<0&&!l)return t==s||e<0?r:r+a;r+=a}s=c}if(t>s)throw new RangeError(`Position ${t} is out of range for changeset of length ${s}`);return r}touchesRange(t,e=t){for(let i=0,s=0;i<this.sections.length&&s<=e;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=e&&l>=t)return s<t&&l>e?"cover":!0;s=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],s=this.sections[e++];t+=(t?" ":"")+i+(s>=0?":"+s:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(t)}static create(t){return new Qt(t)}}class tt extends Qt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return xs(this,(e,i,s,r,o)=>t=t.replace(s,s+(i-e),o),!1),t}mapDesc(t,e=!1){return ws(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let s=0,r=0;s<e.length;s+=2){let o=e[s],l=e[s+1];if(l>=0){e[s]=l,e[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(F.empty);i.push(o?t.slice(r,r+o):F.empty)}r+=o}return new tt(e,i)}compose(t){return this.empty?t:t.empty?this:ql(this,t,!0)}map(t,e=!1){return t.empty?this:ws(this,t,e,!0)}iterChanges(t,e=!1){xs(this,t,e)}get desc(){return Qt.create(this.sections)}filter(t){let e=[],i=[],s=[],r=new wi(this);t:for(let o=0,l=0;;){let a=o==t.length?1e9:t[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break t;let h=Math.min(r.len,a-l);lt(s,h,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;lt(e,h,f),f>0&&ce(i,e,r.text),r.forward(h),l+=h}let c=t[o++];for(;l<c;){if(r.done)break t;let h=Math.min(r.len,c-l);lt(e,h,-1),lt(s,h,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(h),l+=h}}return{changes:new tt(e,i),filtered:Qt.create(s)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],s=this.sections[e+1];s<0?t.push(i):s==0?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;o<e&&lt(s,e-o,-1);let f=new tt(s,r);l=l?l.compose(f.map(l)):f,s=[],r=[],o=0}function c(h){if(Array.isArray(h))for(let f of h)c(f);else if(h instanceof tt){if(h.length!=e)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${e})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:f,to:u=f,insert:d}=h;if(f>u||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?F.of(d.split(i||bs)):d:F.empty,g=p.length;if(f==u&&g==0)return;f<o&&a(),f>o&&lt(s,f-o,-1),lt(s,u-f,g),ce(r,s,p),o=u}}return c(t),a(!l),l}static empty(t){return new tt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let s=0;s<t.length;s++){let r=t[s];if(typeof r=="number")e.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length<s;)i.push(F.empty);i[s]=F.of(r.slice(1)),e.push(r[0],i[s].length)}}}return new tt(e,i)}static createSet(t,e){return new tt(t,e)}}function lt(n,t,e,i=!1){if(t==0&&e<=0)return;let s=n.length-2;s>=0&&e<=0&&e==n[s+1]?n[s]+=t:s>=0&&t==0&&n[s]==0?n[s+1]+=e:i?(n[s]+=t,n[s+1]+=e):n.push(t,e)}function ce(n,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(e);else{for(;n.length<i;)n.push(F.empty);n.push(e)}}function xs(n,t,e){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let c=s,h=r,f=F.empty;for(;c+=l,h+=a,a&&i&&(f=f.append(i[o-2>>1])),!(e||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];t(s,c,r,h,f),s=c,r=h}}}function ws(n,t,e,i=!1){let s=[],r=i?[]:null,o=new wi(n),l=new wi(t);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);lt(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!e))){let c=l.len;for(lt(s,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(lt(s,0,o.ins),r&&ce(r,s,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let f=Math.min(h,l.len);c+=f,h-=f,l.forward(f)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;lt(s,c,a<o.i?o.ins:0),r&&a<o.i&&ce(r,s,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return r?tt.createSet(s,r):Qt.create(s);throw new Error("Mismatched change set lengths")}}}function ql(n,t,e=!1){let i=[],s=e?[]:null,r=new wi(n),o=new wi(t);for(let l=!1;;){if(r.done&&o.done)return s?tt.createSet(i,s):Qt.create(i);if(r.ins==0)lt(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)lt(i,0,o.ins,l),s&&ce(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),c=i.length;if(r.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;lt(i,a,h,l),s&&h&&ce(s,i,o.text)}else o.ins==-1?(lt(i,r.off?0:r.len,a,l),s&&ce(s,i,r.textBit(a))):(lt(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&ce(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class wi{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?F.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?F.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class ve{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new ve(i,s,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return b.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return b.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(t.anchor,t.head)}static create(t,e,i){return new ve(t,e,i)}}class b{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:b.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new b([this.main],0)}addRange(t,e=!0){return b.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,b.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(t.ranges.map(e=>ve.fromJSON(e)),t.main)}static single(t,e=t){return new b([b.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<t.length;s++){let r=t[s];if(r.empty?r.from<=i:r.from<i)return b.normalized(t.slice(),e);i=r.to}return new b(t,e)}static cursor(t,e=0,i,s){return ve.create(t,t,(e==0?0:e<0?8:16)|(i==null?7:Math.min(6,i))|(s??16777215)<<6)}static range(t,e,i,s){let r=(i??16777215)<<6|(s==null?7:Math.min(6,s));return e<t?ve.create(e,t,48|r):ve.create(t,e,(e>t?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((s,r)=>s.from-r.from),e=t.indexOf(i);for(let s=1;s<t.length;s++){let r=t[s],o=t[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=e&&e--,t.splice(--s,2,r.anchor>r.head?b.range(a,l):b.range(l,a))}}return new b(t,e)}}function Kl(n,t){for(let e of n.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let dr=0;class T{constructor(t,e,i,s,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=dr++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new T(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:pr),!!t.static,t.enables)}of(t){return new hn([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new hn(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function pr(n,t){return n==t||n.length==t.length&&n.every((e,i)=>e===t[i])}class hn{constructor(t,e,i,s){this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=dr++}dynamicSlot(t){var e;let i=this.value,s=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||h.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||c&&(u.docChanged||u.selection)||Ss(f,h)){let d=i(f);if(l?!Zr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=bn(u,p);if(this.dependencies.every(m=>m instanceof T?u.facet(m)===f.facet(m):m instanceof mt?u.field(m,!1)==f.field(m,!1):!0)||(l?Zr(d=i(f),g,s):s(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Zr(n,t,e){if(n.length!=t.length)return!1;for(let i=0;i<n.length;i++)if(!e(n[i],t[i]))return!1;return!0}function Ss(n,t){let e=!1;for(let i of t)yi(n,i)&1&&(e=!0);return e}function Ic(n,t,e){let i=e.map(a=>n[a.id]),s=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[t.id]>>1;function l(a){let c=[];for(let h=0;h<i.length;h++){let f=bn(a,i[h]);if(s[h]==2)for(let u of f)c.push(u);else c.push(f)}return t.combine(c)}return{create(a){for(let c of i)yi(a,c);return a.values[o]=l(a),1},update(a,c){if(!Ss(a,r))return 0;let h=l(a);return t.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=Ss(a,i),f=c.config.facets[t.id],u=c.facet(t);if(f&&!h&&pr(e,f))return a.values[o]=u,0;let d=l(a);return t.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const to=T.define({static:!0});class mt{constructor(t,e,i,s,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(t){let e=new mt(dr++,t.create,t.update,t.compare||((i,s)=>i===s),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(to).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,s)=>{let r=i.values[e],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[e]=s.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,to.of({field:this,create:t})]}get extension(){return this}}const Se={lowest:4,low:3,default:2,high:1,highest:0};function ri(n){return t=>new $l(t,n)}const ye={highest:ri(Se.highest),high:ri(Se.high),default:ri(Se.default),low:ri(Se.low),lowest:ri(Se.lowest)};class $l{constructor(t,e){this.inner=t,this.prec=e}}class Hn{of(t){return new vs(this,t)}reconfigure(t){return Hn.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class vs{constructor(t,e){this.compartment=t,this.inner=e}}class yn{constructor(t,e,i,s,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let s=[],r=Object.create(null),o=new Map;for(let u of Nc(t,e,o))u instanceof mt?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],c=[];for(let u of s)l[u.id]=c.length<<1,c.push(d=>u.slot(d));let h=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=h&&h[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,pr(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(y=>y.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=c.length<<1,c.push(y=>m.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(m=>Ic(m,p,d))}}let f=c.map(u=>u(l));return new yn(t,o,f,l,a,r)}}function Nc(n,t,e){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof vs&&e.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof vs){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(o.compartment)||o.inner;e.set(o.compartment,c),r(c,l)}else if(o instanceof $l)r(o.inner,o.prec);else if(o instanceof mt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof hn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,Se.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(n,Se.default),i.reduce((o,l)=>o.concat(l))}function yi(n,t){if(t&1)return 2;let e=t>>1,i=n.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[e]=4;let s=n.computeSlot(n,n.config.dynamicSlots[e]);return n.status[e]=2|s}function bn(n,t){return t&1?n.config.staticValues[t>>1]:n.values[t>>1]}const jl=T.define(),ks=T.define({combine:n=>n.some(t=>t),static:!0}),Ul=T.define({combine:n=>n.length?n[0]:void 0,static:!0}),Gl=T.define(),Jl=T.define(),Yl=T.define(),Xl=T.define({combine:n=>n.length?n[0]:!1});class oe{constructor(t,e){this.type=t,this.value=e}static define(){return new Fc}}class Fc{of(t){return new oe(this,t)}}class Vc{constructor(t){this.map=t}of(t){return new N(this,t)}}class N{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new N(this.type,e)}is(t){return this.type==t}static define(t={}){return new Vc(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let s of t){let r=s.map(e);r&&i.push(r)}return i}}N.reconfigure=N.define();N.appendConfig=N.define();class Z{constructor(t,e,i,s,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&Kl(i,e.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(t,e,i,s,r,o){return new Z(t,e,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Z.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}Z.time=oe.define();Z.userEvent=oe.define();Z.addToHistory=oe.define();Z.remote=oe.define();function Hc(n,t){let e=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==t.length||t[s]>=n[i]))r=n[i++],o=n[i++];else if(s<t.length)r=t[s++],o=t[s++];else return e;!e.length||e[e.length-1]<r?e.push(r,o):e[e.length-1]<o&&(e[e.length-1]=o)}}function _l(n,t,e){var i;let s,r,o;return e?(s=t.changes,r=tt.empty(t.changes.length),o=n.changes.compose(t.changes)):(s=t.changes.map(n.changes),r=n.changes.mapDesc(t.changes,!0),o=n.changes.compose(s)),{changes:o,selection:t.selection?t.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:N.mapEffects(n.effects,s).concat(N.mapEffects(t.effects,r)),annotations:n.annotations.length?n.annotations.concat(t.annotations):t.annotations,scrollIntoView:n.scrollIntoView||t.scrollIntoView}}function Cs(n,t,e){let i=t.selection,s=ze(t.annotations);return t.userEvent&&(s=s.concat(Z.userEvent.of(t.userEvent))),{changes:t.changes instanceof tt?t.changes:tt.of(t.changes||[],e,n.facet(Ul)),selection:i&&(i instanceof b?i:b.single(i.anchor,i.head)),effects:ze(t.effects),annotations:s,scrollIntoView:!!t.scrollIntoView}}function Ql(n,t,e){let i=Cs(n,t.length?t[0]:{},n.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let r=1;r<t.length;r++){t[r].filter===!1&&(e=!1);let o=!!t[r].sequential;i=_l(i,Cs(n,t[r],o?i.changes.newLength:n.doc.length),o)}let s=Z.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return zc(e?Wc(s):s)}function Wc(n){let t=n.startState,e=!0;for(let s of t.facet(Gl)){let r=s(n);if(r===!1){e=!1;break}Array.isArray(r)&&(e=e===!0?r:Hc(e,r))}if(e!==!0){let s,r;if(e===!1)r=n.changes.invertedDesc,s=tt.empty(t.doc.length);else{let o=n.changes.filter(e);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=Z.create(t,s,n.selection&&n.selection.map(r),N.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=t.facet(Jl);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=Ql(t,ze(r),!1)}return n}function zc(n){let t=n.startState,e=t.facet(Yl),i=n;for(let s=e.length-1;s>=0;s--){let r=e[s](n);r&&Object.keys(r).length&&(i=_l(i,Cs(t,r,n.changes.newLength),!0))}return i==n?n:Z.create(t,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const qc=[];function ze(n){return n==null?qc:Array.isArray(n)?n:[n]}var J=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(J||(J={}));const Kc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let As;try{As=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function $c(n){if(As)return As.test(n);for(let t=0;t<n.length;t++){let e=n[t];if(/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Kc.test(e)))return!0}return!1}function jc(n){return t=>{if(!/\S/.test(t))return J.Space;if($c(t))return J.Word;for(let e=0;e<n.length;e++)if(t.indexOf(n[e])>-1)return J.Word;return J.Other}}class H{constructor(t,e,i,s,r,o){this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)yi(this,l<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(i==null){if(e)throw new RangeError("Field is not present in this state");return}return yi(this,i),bn(this,i)}update(...t){return Ql(this,t,!0)}applyTransaction(t){let e=this.config,{base:i,compartments:s}=e;for(let l of t.effects)l.is(Hn.reconfigure)?(e&&(s=new Map,e.compartments.forEach((a,c)=>s.set(c,a)),e=null),s.set(l.value.compartment,l.value.extension)):l.is(N.reconfigure)?(e=null,i=l.value):l.is(N.appendConfig)&&(e=null,i=ze(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=yn.resolve(i,s,this),r=new H(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=t.startState.facet(ks)?t.newSelection:t.newSelection.asSingle();new H(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:b.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],o=ze(i.effects);for(let l=1;l<e.ranges.length;l++){let a=t(e.ranges[l]),c=this.changes(a.changes),h=c.map(s);for(let u=0;u<l;u++)r[u]=r[u].map(h);let f=s.mapDesc(c,!0);r.push(a.range.map(f)),s=s.compose(h),o=N.mapEffects(o,h).concat(N.mapEffects(ze(a.effects),f))}return{changes:s,selection:b.create(r,e.mainIndex),effects:o}}changes(t=[]){return t instanceof tt?t:tt.of(t,this.doc.length,this.facet(H.lineSeparator))}toText(t){return F.of(t.split(this.facet(H.lineSeparator)||bs))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(yi(this,e),bn(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let s=t[i];s instanceof mt&&this.config.address[s.id]!=null&&(e[i]=s.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(t,r)){let o=i[r],l=t[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return H.create({doc:t.doc,selection:b.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s})}static create(t={}){let e=yn.resolve(t.extensions||[],new Map),i=t.doc instanceof F?t.doc:F.of((t.doc||"").split(e.staticFacet(H.lineSeparator)||bs)),s=t.selection?t.selection instanceof b?t.selection:b.single(t.selection.anchor,t.selection.head):b.single(0);return Kl(s,i.length),e.staticFacet(ks)||(s=s.asSingle()),new H(e,i,s,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||`
+`}get readOnly(){return this.facet(Xl)}phrase(t,...e){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let s=[];for(let r of this.facet(jl))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&s.push(o[t]);return s}charCategorizer(t){return jc(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:s}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=rt(e,o,!1);if(r(e.slice(a,o))!=J.Word)break;o=a}for(;l<s;){let a=rt(e,l);if(r(e.slice(l,a))!=J.Word)break;l=a}return o==l?null:b.range(o+i,l+i)}}H.allowMultipleSelections=ks;H.tabSize=T.define({combine:n=>n.length?n[0]:4});H.lineSeparator=Ul;H.readOnly=Xl;H.phrases=T.define({compare(n,t){let e=Object.keys(n),i=Object.keys(t);return e.length==i.length&&e.every(s=>n[s]==t[s])}});H.languageData=jl;H.changeFilter=Gl;H.transactionFilter=Jl;H.transactionExtender=Yl;Hn.reconfigure=N.define();function Ee(n,t,e={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in t)i[s]===void 0&&(i[s]=t[s]);return i}class De{eq(t){return this==t}range(t,e=t){return Ms.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=at.TrackDel;let Ms=class Zl{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Zl(t,e,i)}};function Ds(n,t){return n.from-t.from||n.value.startSide-t.value.startSide}class gr{constructor(t,e,i,s){this.from=t,this.to=e,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(t,e,i,s){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+t,this.to[r]+t,this.value[r])===!1)return!1}map(t,e){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+t,f=this.to[a]+t,u,d;if(h==f){let p=e.mapPos(h,c.startSide,c.mapMode);if(p==null||(u=d=p,c.startSide!=c.endSide&&(d=e.mapPos(h,c.endSide),d<u)))continue}else if(u=e.mapPos(h,c.startSide),d=e.mapPos(f,c.endSide),u>d||u==d&&c.startSide>0&&c.endSide<=0)continue;(d-u||c.endSide-c.startSide)<0||(o<0&&(o=u),c.point&&(l=Math.max(l,d-u)),i.push(c),s.push(u-o),r.push(d-o))}return{mapped:i.length?new gr(s,r,i,l):null,pos:o}}}class K{constructor(t,e,i,s){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s}static create(t,e,i,s){return new K(t,e,i,s)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(Ds)),this.isEmpty)return e.length?K.of(e):this;let l=new ta(this,null,-1).goto(0),a=0,c=[],h=new Oe;for(;l.value||a<e.length;)if(a<e.length&&(l.from-e[a].from||l.startSide-e[a].value.startSide)>=0){let f=e[a++];h.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(l.chunkIndex)<e[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(Ms.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?K.empty:this.nextLayer.update({add:c,filter:o,filterFrom:s,filterTo:r}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=t.touchesRange(l,l+a.length);if(c===!1)s=Math.max(s,a.maxPoint),e.push(a),i.push(t.mapPos(l));else if(c===!0){let{mapped:h,pos:f}=a.map(l,t);h&&(s=Math.max(s,h.maxPoint),e.push(h),i.push(f))}}let r=this.nextLayer.map(t);return e.length==0?r:new K(i,e,r||K.empty,s)}between(t,e,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(e>=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return Si.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Si.from(t).goto(e)}static compare(t,e,i,s,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=eo(o,l,i),c=new oi(o,a,r),h=new oi(l,a,r);i.iterGaps((f,u,d)=>io(c,f,h,u,d,s)),i.empty&&i.length==0&&io(c,0,h,0,0,s)}static eq(t,e,i=0,s){s==null&&(s=999999999);let r=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0),o=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=eo(r,o),a=new oi(r,l,0).goto(i),c=new oi(o,l,0).goto(i);for(;;){if(a.to!=c.to||!Os(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(t,e,i,s,r=-1){let o=new oi(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let h=o.activeForPoint(o.to),f=o.pointFrom<e?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);s.point(l,c,o.point,h,f,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(s.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new Oe;for(let s of t instanceof Ms?[t]:e?Uc(t):t)i.add(s.from,s.to,s.value);return i.finish()}static join(t){if(!t.length)return K.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let s=t[i];s!=K.empty;s=s.nextLayer)e=new K(s.chunkPos,s.chunk,e,Math.max(s.maxPoint,e.maxPoint));return e}}K.empty=new K([],[],null,-1);function Uc(n){if(n.length>1)for(let t=n[0],e=1;e<n.length;e++){let i=n[e];if(Ds(t,i)>0)return n.slice().sort(Ds);t=i}return n}K.empty.nextLayer=K.empty;class Oe{finishChunk(t){this.chunks.push(new gr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Oe)).add(t,e,i)}addInner(t,e,i){let s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(K.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=K.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function eo(n,t,e){let i=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of t)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(e?e.mapPos(l):l)==r.chunkPos[o]&&!(e!=null&&e.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class ta{constructor(t,e,i,s=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<t||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Si{constructor(t){this.heap=t}static from(t,e=null,i=-1){let s=[];for(let r=0;r<t.length;r++)for(let o=t[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&s.push(new ta(o,e,i,r));return s.length==1?s[0]:new Si(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)_n(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),_n(this.heap,0)}}}function _n(n,t){for(let e=n[t];;){let i=(t<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1<n.length&&s.compare(n[i+1])>=0&&(s=n[i+1],i++),e.compare(s)<0)break;n[i]=e,n[t]=s,t=i}}class oi{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Si.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){zi(this.active,t),zi(this.activeTo,t),zi(this.activeRank,t),this.minActive=no(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:s,rank:r}=this.cursor;for(;e<this.activeRank.length&&(r-this.activeRank[e]||s-this.activeTo[e])>0;)e++;qi(this.active,e,i),qi(this.activeTo,e,s),qi(this.activeRank,e,r),t&&qi(t,e,this.cursor.from),this.minActive=no(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>t){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&zi(i,s)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let s=i.length-1;s>=0&&i[s]<t;s--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function io(n,t,e,i,s,r){n.goto(t),e.goto(i);let o=i+s,l=i,a=i-t;for(;;){let c=n.to+a-e.to,h=c||n.endSide-e.endSide,f=h<0?n.to+a:e.to,u=Math.min(f,o);if(n.point||e.point?n.point&&e.point&&(n.point==e.point||n.point.eq(e.point))&&Os(n.activeForPoint(n.to),e.activeForPoint(e.to))||r.comparePoint(l,u,n.point,e.point):u>l&&!Os(n.active,e.active)&&r.compareRange(l,u,n.active,e.active),f>o)break;(c||n.openEnd!=e.openEnd)&&r.boundChange&&r.boundChange(f),l=f,h<=0&&n.next(),h>=0&&e.next()}}function Os(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!=t[e]&&!n[e].eq(t[e]))return!1;return!0}function zi(n,t){for(let e=t,i=n.length-1;e<i;e++)n[e]=n[e+1];n.pop()}function qi(n,t,e){for(let i=n.length-1;i>=t;i--)n[i+1]=n[i];n[t]=e}function no(n,t){let e=-1,i=1e9;for(let s=0;s<t.length;s++)(t[s]-i||n[s].endSide-n[e].endSide)<0&&(e=s,i=t[s]);return e}function ei(n,t,e=n.length){let i=0;for(let s=0;s<e;)n.charCodeAt(s)==9?(i+=t-i%t,s++):(i++,s=rt(n,s));return i}function Ts(n,t,e,i){for(let s=0,r=0;;){if(r>=t)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?e-r%e:1,s=rt(n,s)}return i===!0?-1:n.length}const Bs="ͼ",so=typeof Symbol>"u"?"__"+Bs:Symbol.for(Bs),Ps=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class de{constructor(t,e){this.rules=[];let{finish:i}=e||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let h=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,h,u)}else p!=null&&h.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(h.length||u)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in t)r(s(o),t[o],this.rules)}getRules(){return this.rules.join(`
 `)}static newName(){let t=ro[so]||1;return ro[so]=t+1,Bs+t.toString(36)}static mount(t,e,i){let s=t[Ps],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Gc(t,r),s.mount(Array.isArray(e)?e:[e],t)}}let oo=new Map;class Gc{constructor(t,e){let i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){let r=oo.get(i);if(r)return t[Ps]=r;this.sheet=new s.CSSStyleSheet,oo.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ps]=this}mount(t,e){let i=this.sheet,s=0,r=0;for(let o=0;o<t.length;o++){let l=t[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
-`;this.styleTag.textContent=o;let l=e.head||e;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var pe={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ki={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jc=typeof navigator<"u"&&/Mac/.test(navigator.platform),Yc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)pe[48+st]=pe[96+st]=String(st);for(var st=1;st<=24;st++)pe[st+111]="F"+st;for(var st=65;st<=90;st++)pe[st]=String.fromCharCode(st+32),ki[st]=String.fromCharCode(st);for(var Qn in pe)ki.hasOwnProperty(Qn)||(ki[Qn]=pe[Qn]);function Xc(n){var t=Jc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Yc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?ki:pe)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function vi(n){let t;return n.nodeType==11?t=n.getSelection?n:n.ownerDocument:t=n,t.getSelection()}function Rs(n,t){return t?n==t||n.contains(t.nodeType!=1?t.parentNode:t):!1}function cn(n,t){if(!t.anchorNode)return!1;try{return Rs(n,t.anchorNode)}catch{return!1}}function Ge(n){return n.nodeType==3?Be(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bi(n,t,e,i){return e?lo(n,t,e,i,-1)||lo(n,t,e,i,1):!1}function Te(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t}function xn(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function lo(n,t,e,i,s){for(;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Zt(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[t+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;t=s<0?Zt(n):0}else return!1}}function Zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Li(n,t){let e=t?n.left:n.right;return{left:e,right:e,top:n.top,bottom:n.bottom}}function _c(n){let t=n.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ea(n,t){let e=t.width/n.offsetWidth,i=t.height/n.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-n.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-n.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Qc(n,t,e,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=_c(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=ea(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(s=="nearest")t.top<u.top?(y=-(u.top-t.top+o),e>0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y<u.top&&(y=-(u.top+y-t.top+o)));else{let x=t.bottom-t.top,S=u.bottom-u.top;y=(s=="center"&&x<=S?t.top+x/2-S/2:s=="start"||s=="center"&&e<0?t.top-o:t.bottom-S+o)-u.top}if(i=="nearest"?t.left<u.left?(m=-(u.left-t.left+r),e>0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.left<u.left+m&&(m=-(u.left+m-t.left+r))):m=(i=="center"?t.left+(t.right-t.left)/2-(u.right-u.left)/2:i=="start"==l?t.left-r:t.right-(u.right-u.left)+r)-u.left,m||y)if(d)c.scrollBy(m,y);else{let x=0,S=0;if(y){let k=h.scrollTop;h.scrollTop+=y/g,S=(h.scrollTop-k)*g}if(m){let k=h.scrollLeft;h.scrollLeft+=m/p,x=(h.scrollLeft-k)*p}t={left:t.left-x,top:t.top-S,right:t.right-x,bottom:t.bottom-S},x&&Math.abs(x-m)<1&&(i="nearest"),S&&Math.abs(S-y)<1&&(s="nearest")}if(d)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Zc(n){let t=n.ownerDocument,e,i;for(let s=n.parentNode;s&&!(s==t.body||e&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!e&&s.scrollWidth>s.clientWidth&&(e=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:e,y:i}}class tf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Zt(e):0),i,Math.min(t.focusOffset,i?Zt(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Fe=null;function ia(n){if(n.setActive)return n.setActive();if(Fe)return n.focus(Fe);let t=[];for(let e=n;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(n.focus(Fe==null?{get preventScroll(){return Fe={preventScroll:!0},!0}}:void 0),!Fe){Fe=!1;for(let e=0;e<t.length;){let i=t[e++],s=t[e++],r=t[e++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let ao;function Be(n,t,e=t){let i=ao||(ao=document.createRange());return i.setEnd(n,e),i.setStart(n,t),i}function qe(n,t,e,i){let s={key:t,code:t,keyCode:e,which:e,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function ef(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function na(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function nf(n,t){let e=t.focusNode,i=t.focusOffset;if(!e||t.anchorNode!=e||t.anchorOffset!=i)return!1;for(i=Math.min(i,Zt(e));;)if(i){if(e.nodeType!=1)return!1;let s=e.childNodes[i-1];s.contentEditable=="false"?i--:(e=s,i=Zt(e))}else{if(e==n)return!0;i=Te(e),e=e.parentNode}}function sa(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function ra(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=Zt(e)}else if(e.parentNode&&!xn(e))i=Te(e),e=e.parentNode;else return null}}function oa(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&i<e.nodeValue.length)return{node:e,offset:i};if(e.nodeType==1&&i<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[i],i=0}else if(e.parentNode&&!xn(e))i=Te(e)+1,e=e.parentNode;else return null}}class ht{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new ht(t.parentNode,Te(t),e)}static after(t,e){return new ht(t.parentNode,Te(t)+1,e)}}const mr=[];class ${constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=$.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(t,e),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&r!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=ho(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&e&&e.node==i&&(e.written=!0);r;)r=ho(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let s=Zt(t)==0?0:e==0?-1:1;for(;;){let r=t.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(t==r.firstChild?s=-1:s=1),t=r}s<0?i=t:i=t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!$.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(t,e,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let f=this.children[a],u=c+f.length;if(c<t&&u>e)return f.domBoundsAround(t,e,c);if(u>=t&&s==-1&&(s=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=mr){this.markDirty();for(let s=t;s<e;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}i.length<250?this.children.splice(t,e-t,...i):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(let s=0;s<i.length;s++)i[s].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new la(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,s,r,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!((this.flags|t.flags)&8)}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}$.prototype.breakAfter=0;function ho(n){let t=n.nextSibling;return n.parentNode.removeChild(n),t}class la{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function aa(n,t,e,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,s,r.length?f:null,e==0,l,a))){if(i<c.length){let d=c[i];d&&(s<d.length||d.breakAfter&&(f!=null&&f.breakAfter))?(t==i&&(d=d.split(s),s=0),!u&&f&&d.merge(0,s,f,!0,0,a)?r[r.length-1]=d:((s||d.children.length&&!d.children[0].length)&&d.merge(0,s,null,!1,0,a),r.push(d))):d!=null&&d.breakAfter&&(f?f.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,e>0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(e,h.length,null,!1,l,0),t++));t<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[t].become(r[0]))t++,r.shift(),l=r.length?0:a;else break;!r.length&&t&&i<c.length&&!c[t-1].breakAfter&&c[i].merge(0,0,c[t-1],!1,l,a)&&t--,(t<i||r.length)&&n.replaceChildren(t,i,r)}}function ha(n,t,e,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(e,1),{i:c,off:h}=o.findPos(t,-1),f=t-e;for(let u of i)f+=u.length;n.length+=f,aa(n,c,h,l,a,i,0,s,r)}let bt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ls=typeof document<"u"?document:{documentElement:{style:{}}};const Es=/Edge\/(\d+)/.exec(bt.userAgent),ca=/MSIE \d/.test(bt.userAgent),Is=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bt.userAgent),Wn=!!(ca||Is||Es),co=!Wn&&/gecko\/(\d+)/i.test(bt.userAgent),Zn=!Wn&&/Chrome\/(\d+)/.exec(bt.userAgent),fo="webkitFontSmoothing"in Ls.documentElement.style,fa=!Wn&&/Apple Computer/.test(bt.vendor),uo=fa&&(/Mobile\/\w+/.test(bt.userAgent)||bt.maxTouchPoints>2);var D={mac:uo||/Mac/.test(bt.platform),windows:/Win/.test(bt.platform),linux:/Linux|X11/.test(bt.platform),ie:Wn,ie_version:ca?Ls.documentMode||6:Is?+Is[1]:Es?+Es[1]:0,gecko:co,gecko_version:co?+(/Firefox\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,chrome:!!Zn,chrome_version:Zn?+Zn[1]:0,ios:uo,android:/Android\b/.test(bt.userAgent),webkit:fo,safari:fa,webkit_version:fo?+(/\bAppleWebKit\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,tabSize:Ls.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sf=256;class Ft extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Ft)||this.length-(e-t)+i.length>sf||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Ft(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ht(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return rf(this.dom,t,e)}}class re extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let s of e)s.setParent(this)}setAttrs(t){if(na(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,s,r,o){return i&&(!(i instanceof re&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&o<=0)?!1:(ha(this,t,e,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(t){let e=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>t&&e.push(i<t?l.split(t-i):l),s<0&&i>=t&&(s=r),i=a,r++}let o=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new re(this.mark,e,o)}domAtPos(t){return ua(this,t)}coordsAt(t,e){return pa(this,t,e)}}function rf(n,t,e){let i=n.nodeValue.length;t>i&&(t=i);let s=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(s--,o=1):r<i&&(r++,o=-1)):e<0?s--:r<i&&r++;let l=Be(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:e>=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Li(a,o<0):a||null}class ve extends ${static create(t,e,i){return new ve(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=ve.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,s,r,o){return i&&(!(i instanceof ve)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof ve&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(this.length==0)return F.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):F.empty}domAtPos(t){return(this.length?t==0:this.side>0)?ht.before(this.dom):ht.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?s.length-1:0;r=s[l],!(t>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return Li(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Je extends ${constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof Je&&t.side==this.side}split(){return new Je(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?ht.before(this.dom):ht.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Ft.prototype.children=ve.prototype.children=Je.prototype.children=mr;function ua(n,t){let e=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(t>r&&t<l&&o.dom.parentNode==e)return o.domAtPos(t-r);if(t<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==e)return o.domAtPos(0)}return new ht(e,0)}function da(n,t,e){let i,{children:s}=n;e>0&&t instanceof re&&s.length&&(i=s[s.length-1])instanceof re&&i.mark.eq(t.mark)?da(i,t.children[0],e-1):(s.push(t),t.setParent(n)),n.length+=t.length}function pa(n,t,e){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f<c.children.length&&u<=h;f++){let d=c.children[f],p=u+d.length;p>=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u<h||u==p&&d.getSide()<0&&!d.isHidden)&&(i=d,s=h-u)),u=p}}l(n,t);let a=(e<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),e):of(n)}function of(n){let t=n.dom.lastChild;if(!t)return n.dom.getBoundingClientRect();let e=Ge(t);return e[e.length-1]||null}function Ns(n,t){for(let e in n)e=="class"&&t.class?t.class+=" "+n.class:e=="style"&&t.style?t.style+=";"+n.style:t[e]=n[e];return t}const po=Object.create(null);function wn(n,t,e){if(n==t)return!0;n||(n=po),t||(t=po);let i=Object.keys(n),s=Object.keys(t);if(i.length-(e&&i.indexOf(e)>-1?1:0)!=s.length-(e&&s.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(s.indexOf(r)==-1||n[r]!==t[r]))return!1;return!0}function Fs(n,t,e){let i=!1;if(t)for(let s in t)e&&s in e||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(e)for(let s in e)t&&t[s]==e[s]||(i=!0,s=="style"?n.style.cssText=e[s]:n.setAttribute(s,e[s]));return i}function lf(n){let t=Object.create(null);for(let e=0;e<n.attributes.length;e++){let i=n.attributes[e];t[i.name]=i.value}return t}class Ie{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Mt=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Mt||(Mt={}));class P extends De{constructor(t,e,i,s){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(t){return new Ei(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new ge(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=ga(t,e);i=(r?e?-3e8:-1:5e8)-1,s=(o?e?2e8:1:-6e8)+1}return new ge(t,i,s,e,t.widget||null,!0)}static line(t){return new Ii(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=K.empty;class Ei extends P{constructor(t){let{start:e,end:i}=ga(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ei&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&wn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ei.prototype.point=!1;class Ii extends P{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Ii&&this.spec.class==t.spec.class&&wn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Ii.prototype.mapMode=at.TrackBefore;Ii.prototype.point=!0;class ge extends P{constructor(t,e,i,s,r,o){super(e,i,r,t),this.block=s,this.isReplace=o,this.mapMode=s?e<=0?at.TrackBefore:at.TrackAfter:at.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ge&&af(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ge.prototype.point=!0;function ga(n,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=n;return e==null&&(e=n.inclusive),i==null&&(i=n.inclusive),{start:e??t,end:i??t}}function af(n,t){return n==t||!!(n&&t&&n.compare(t))}function fn(n,t,e,i=0){let s=e.length-1;s>=0&&e[s]+i>=n?e[s]=Math.max(e[s],t):e.push(n,t)}class Q extends ${constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,s,r,o){if(i){if(!(i instanceof Q))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),ha(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Q;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:s}=this.childPos(t);s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)e.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){wn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){da(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Ns(e,this.attrs||{})),i&&(this.attrs=Ns({class:i},this.attrs||{}))}domAtPos(t){return ua(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(na(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Fs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let s=this.dom.lastChild;for(;s&&$.get(s)instanceof re;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=$.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Ft))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Ft)||/[^ -~]/.test(i.text))return null;let s=Ge(i.dom);if(s.length!=1)return null;t+=s[0].width,e=s[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=pa(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(t){return t instanceof Q&&this.children.length==0&&t.children.length==0&&wn(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let i=0,s=0;i<t.children.length;i++){let r=t.children[i],o=s+r.length;if(o>=e){if(r instanceof Q)return r;if(o>e)break}s=o+r.breakAfter}return null}}class ne extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,s,r,o){return i&&(!(i instanceof ne)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return t==0?ht.before(this.dom):ht.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new ne(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return mr}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):F.empty}domBoundsAround(){return null}become(t){return t instanceof ne&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof Vs?null:Li(this.dom.getBoundingClientRect(),this.length?t==0:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e==i?!1:t<0?e<0:i>0}}class Vs extends Ie{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class xi{constructor(t,e,i,s){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof ne&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ki(new Je(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof ne)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(Ki(new Ft(this.text.slice(this.textOff,this.textOff+s)),e),i),this.atCursorPos=!0,this.textOff+=s,t-=s,i=0}}span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s)}point(t,e,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ge){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ge)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ne(i.widget||Ye.block,l,i));else{let a=ve.create(i.widget||Ye.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(t<e||i.startSide>0),h=!a.isEditable&&(t<e||r>s.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(f.append(Ki(new Je(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ki(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?t<e||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,s,r){let o=new xi(t,e,i,r);return o.openEnd=K.spans(s,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ki(n,t){for(let e of t)n=new re(e,[n],n.length);return n}class Ye extends Ie{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ye.inline=new Ye("span");Ye.block=new Ye("div");var X=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(X||(X={}));const Pe=X.LTR,yr=X.RTL;function ma(n){let t=[];for(let e=0;e<n.length;e++)t.push(1<<+n[e]);return t}const hf=ma("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),cf=ma("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Hs=Object.create(null),qt=[];for(let n of["()","[]","{}"]){let t=n.charCodeAt(0),e=n.charCodeAt(1);Hs[t]=e,Hs[e]=-t}function ya(n){return n<=247?hf[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?cf[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const ff=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class fe{get dir(){return this.level%2?yr:Pe}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,s){let r=-1;for(let o=0;o<t.length;o++){let l=t[o];if(l.from<=e&&l.to>=e){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<e:l.to>e:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ba(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++){let i=n[e],s=t[e];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!ba(i.inner,s.inner))return!1}return!0}const q=[];function uf(n,t,e,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:t,l=r<i.length?i[r].from:e,a=r?256:s;for(let c=o,h=a,f=a;c<l;c++){let u=ya(n.charCodeAt(c));u==512?u=h:u==8&&f==4&&(u=16),q[c]=u==4?2:u,u&7&&(f=u),h=u}for(let c=o,h=a,f=a;c<l;c++){let u=q[c];if(u==128)c<l-1&&h==q[c+1]&&h&24?u=q[c]=h:q[c]=256;else if(u==64){let d=c+1;for(;d<l&&q[d]==64;)d++;let p=c&&h==8||d<e&&q[d]==8?f==1?1:8:256;for(let g=c;g<d;g++)q[g]=p;c=d-1}else u==8&&f==1&&(q[c]=1);h=u,u&7&&(f=u)}}}function df(n,t,e,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:t,h=o<i.length?i[o].from:e;for(let f=c,u,d,p;f<h;f++)if(d=Hs[u=n.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(qt[g+1]==-d){let m=qt[g+2],y=m&2?s:m&4?m&1?r:s:0;y&&(q[f]=q[qt[g]]=y),l=g;break}}else{if(qt.length==189)break;qt[l++]=f,qt[l++]=u,qt[l++]=a}else if((p=q[f])==2||p==1){let g=p==s;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=qt[m+2];if(y&2)break;if(g)qt[m+2]|=2;else{if(y&4)break;qt[m+2]|=4}}}}}function pf(n,t,e,i){for(let s=0,r=i;s<=e.length;s++){let o=s?e[s-1].to:n,l=s<e.length?e[s].from:t;for(let a=o;a<l;){let c=q[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==e.length)break;h=e[s++].to,l=s<e.length?e[s].from:t}else if(q[h]==256)h++;else break;let f=r==1,u=(h<t?q[h]:i)==1,d=f==u?f?1:2:i;for(let p=h,g=s,m=g?e[g-1].to:n;p>a;)p==m&&(p=e[--g].from,m=g?e[g-1].to:n),q[--p]=d;a=h}else r=c,a++}}}function Ws(n,t,e,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=t,c=0;a<e;){let h=!0,f=!1;if(c==r.length||a<r[c].from){let g=q[a];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c<r.length&&p==r[c].from){if(f)break t;let g=r[c];if(!h)for(let m=g.to,y=c+1;;){if(m==e)break t;if(y<r.length&&r[y].from==m)m=r[y++].to;else{if(q[m]==l)break t;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new fe(a,g.from,d));let m=g.direction==Pe!=!(d%2);zs(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Ws(n,a,p,i+1,s,u,o):a<p&&o.push(new fe(a,p,d)),a=p}else for(let a=e,c=r.length;a>t;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.to<a&&o.push(new fe(g.to,a,d));let m=g.direction==Pe!=!(d%2);zs(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==t||(h?q[p-1]!=l:q[p-1]==l))break;p--}u?Ws(n,p,a,i+1,s,u,o):p<a&&o.push(new fe(p,a,d)),a=p}}function zs(n,t,e,i,s,r,o){let l=t%2?2:1;uf(n,s,r,i,l),df(n,s,r,i,l),pf(s,r,i,l),Ws(n,s,r,t,e,i,o)}function gf(n,t,e){if(!n)return[new fe(0,0,t==yr?1:0)];if(t==Pe&&!e.length&&!ff.test(n))return xa(n.length);if(e.length)for(;n.length>q.length;)q[q.length]=256;let i=[],s=t==Pe?0:1;return zs(n,s,s,e,0,n.length,i),i}function xa(n){return[new fe(0,n,0)]}let wa="";function mf(n,t,e,i,s){var r;let o=i.head-n.from,l=fe.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(s,e);if(o==c){let u=l+=s?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!s,e),c=a.side(s,e)}let h=rt(n.text,o,a.forward(s,e));(h<a.from||h>a.to)&&(h=c),wa=n.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(s?t.length-1:0)?null:t[l+(s?1:-1)];return f&&h==c&&f.level+(s?0:1)<a.level?b.cursor(f.side(!s,e)+n.from,f.forward(s,e)?1:-1,f.level):b.cursor(h+n.from,a.forward(s,e)?-1:1,a.level)}function yf(n,t,e){for(let i=t;i<e;i++){let s=ya(n.charCodeAt(i));if(s==1)return Pe;if(s==2||s==4)return yr}return Pe}const Sa=T.define(),ka=T.define(),va=T.define(),Ca=T.define(),qs=T.define(),Aa=T.define(),Ma=T.define(),br=T.define(),xr=T.define(),Da=T.define({combine:n=>n.some(t=>t)}),Oa=T.define({combine:n=>n.some(t=>t)}),Ta=T.define();class Ke{constructor(t,e="nearest",i="nearest",s=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Ke(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Ke(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $i=N.define({map:(n,t)=>n.map(t)}),Ba=N.define();function At(n,t,e){let i=n.facet(Ca);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ie=T.define({combine:n=>n.length?n[0]:!0});let bf=0;const fi=T.define();class ft{constructor(t,e,i,s,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=e||{};return new ft(bf++,t,i,s,l=>{let a=[fi.of(l)];return o&&a.push(Ci.of(c=>{let h=c.plugin(l);return h?o(h):P.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ft.define(i=>new t(i),e)}}class ts{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(At(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){At(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){At(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Pa=T.define(),wr=T.define(),Ci=T.define(),Ra=T.define(),Sr=T.define(),La=T.define();function go(n,t){let e=n.state.facet(La);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=yf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),s}const Ea=T.define();function kr(n){let t=0,e=0,i=0,s=0;for(let r of n.state.facet(Ea)){let o=r(n);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:t,right:e,top:i,bottom:s}}const ui=T.define();class Et{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new Et(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(e.length==0)return t;let i=[];for(let s=0,r=0,o=0,l=0;;s++){let a=s==t.length?null:t[s],c=o-l,h=a?a.fromB:1e9;for(;r<e.length&&e[r]<h;){let f=e[r],u=e[r+1],d=Math.max(l,f),p=Math.min(h,u);if(d<=p&&new Et(d+c,p+c,d,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new Et(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Sn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=tt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Et(r,o,l,a))),this.changedRanges=s}static create(t,e,i){return new Sn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class mo extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=P.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Et(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?s=this.domChanged.newSel.head:!Af(t.changes,this.hasComposition)&&!t.selectionSet&&(s=t.state.selection.main.head));let r=s>-1?wf(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Et(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=vf(o,l,t.changes);return i=Et.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ne&&o.widget instanceof Vs&&r.push(o.dom);s.updateGaps(r)}updateChildren(t,e,i){let s=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromB<f&&i.range.toB>h){let k=xi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=xi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let v=this.compositionView(i);w.breakAtStart?v.breakAfter=1:w.content.length&&v.merge(v.length,v.length,w.content[0],!1,w.openStart,0)&&(v.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&v.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat(v).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=xi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:S}=r.findPos(a,-1);aa(this,x,S,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(Ba)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Ft(t.text.nodeValue);e.flags|=8;for(let{deco:s}of t.marks)e=new re(s,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(let r=t.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],e(r>=0?t.marks[r].node:t.text,s)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(ie)||this.dom.tabIndex>-1)&&cn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&xf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ht(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!bi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!bi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&Cf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=vi(this.view.root);if(f)if(l.empty){if(D.gecko){let u=Sf(a.node,a.offset);if(u&&u!=3){let d=(u==1?ra:oa)(a.node,a.offset);d&&(a=new ht(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ht(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ht(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&bi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=vi(t.root),{anchorNode:s,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let s=t.offset;!i&&s<e.childNodes.length;s++){let r=$.get(e.childNodes[s]);r instanceof Q&&(i=r.domAtPos(0))}for(let s=t.offset-1;!i&&s>=0;s--){let r=$.get(e.childNodes[s]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ht(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let s=this.children[e];if(i<s.length||s instanceof Q)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<t)break;if(c<=t&&(c<t||l.covers(-1))&&(a>t||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,s=c;else if(i&&c==t&&a==t&&l instanceof ne&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-s,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),s=this.children[e];if(!(s instanceof Q))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ft))return null;let r=rt(s.text,i);if(r==i)return null;let o=Be(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:s}=t,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;h<this.children.length;h++){let f=this.children[h],u=c+f.length;if(u>s)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Ge(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Ge(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:s}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new la(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let r=s==e.viewports.length?null:e.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(P.replace({widget:new Vs(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Ci).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(Ra).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let c=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=c.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let c of this.view.state.facet(Ta))try{if(c(this.view,t.range,t))return!0}catch(h){At(this.view.state,h,"scroll handler")}let{range:e}=t,i=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=kr(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Qc(this.view.scrollDOM,o,e.head<e.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==X.LTR)}}function xf(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function Ia(n,t){let e=n.observer.selectionRange;if(!e.focusNode)return null;let i=ra(e.focusNode,e.focusOffset),s=oa(e.focusNode,e.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=$.get(s.node);if(!l||l instanceof Ft&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=$.get(i.node);!a||a instanceof Ft&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=t-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function wf(n,t,e){let i=Ia(n,e);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc,c=new Et(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let f=s.parentNode;;f=f.parentNode){let u=$.get(f);if(u instanceof re)h.push({node:f,deco:u.mark});else{if(u instanceof Q||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:f};if(f!=n.contentDOM)h.push({node:f,deco:new Ei({inclusive:!0,attributes:lf(f),tagName:f.tagName.toLowerCase()})});else return null}}}function Sf(n,t){return n.nodeType!=1?0:(t&&n.childNodes[t-1].contentEditable=="false"?1:0)|(t<n.childNodes.length&&n.childNodes[t].contentEditable=="false"?2:0)}let kf=class{constructor(){this.changes=[]}compareRange(t,e){fn(t,e,this.changes)}comparePoint(t,e){fn(t,e,this.changes)}boundChange(t){fn(t,t,this.changes)}};function vf(n,t,e){let i=new kf;return K.compare(n,t,e,i),i.changes}function Cf(n,t){for(let e=n;e&&e!=t;e=e.assignedSlot||e.parentNode)if(e.nodeType==1&&e.contentEditable=="false")return!0;return!1}function Af(n,t){let e=!1;return t&&n.iterChangedRanges((i,s)=>{i<t.to&&s>t.from&&(e=!0)}),e}function Mf(n,t,e=1){let i=n.charCategorizer(t),s=n.doc.lineAt(t),r=t-s.from;if(s.length==0)return b.cursor(t);r==0?e=1:r==s.length&&(e=-1);let o=r,l=r;e<0?o=rt(s.text,r,!1):l=rt(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=rt(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=rt(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return b.range(o+s.from,l+s.from)}function Df(n,t){return t.left>n?t.left-n:Math.max(0,n-t.right)}function Of(n,t){return t.top>n?t.top-n:Math.max(0,n-t.bottom)}function es(n,t){return n.top<t.bottom-1&&n.bottom>t.top+1}function yo(n,t){return t<n.top?{top:t,left:n.left,right:n.right,bottom:n.bottom}:n}function bo(n,t){return t>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:t}:n}function Ks(n,t,e){let i,s,r,o,l=!1,a,c,h,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ge(p);for(let m=0;m<g.length;m++){let y=g[m];s&&es(s,y)&&(y=yo(bo(y,s.bottom),s.top));let x=Df(t,y),S=Of(e,y);if(x==0&&S==0)return p.nodeType==3?xo(p,t,e):Ks(p,t,e);if(!i||o>S||o==S&&r>x){i=p,s=y,r=x,o=S;let k=S?e<y.top?-1:1:x?t<y.left?-1:1:0;l=!k||(k>0?m<g.length-1:m>0)}x==0?e>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):e<y.top&&(!f||f.top>y.top)&&(c=p,f=y):h&&es(h,y)?h=bo(h,y.bottom):f&&es(f,y)&&(f=yo(f,y.top))}}if(h&&h.bottom>=e?(i=a,s=h):f&&f.top<=e&&(i=c,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,t));if(i.nodeType==3)return xo(i,u,e);if(l&&i.contentEditable!="false")return Ks(i,u,e);let d=Array.prototype.indexOf.call(n.childNodes,i)+(t>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function xo(n,t,e){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Be(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=t-h.left);let f=(h.top>e?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f<r){let u=t>=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Be(n,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Na(n,t,e,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let k=n.viewState.heightOracle.textHeight/2,w=!1;a=n.elementAtHeight(u),a.type!=Mt.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(d<n.viewport.from)return n.viewport.from==0?0:e?null:wo(n,o,a,h,f);if(d>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:e?null:wo(n,o,a,h,f);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(h,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(h,f);k&&({offsetNode:y,offset:x}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(h,f);k&&({startContainer:y,startOffset:x}=k,(!n.contentDOM.contains(y)||D.safari&&Tf(y,x,h)||D.chrome&&Bf(y,x,h))&&(y=void 0))}y&&(x=Math.min(Zt(y),x))}if(!y||!n.docView.dom.contains(y)){let k=Q.find(n.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=Ks(k.dom,h,f))}let S=n.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=S.dom.getBoundingClientRect();return t.y<k.top||t.y<=k.bottom&&t.x<=(k.left+k.right)/2?S.posAtStart:S.posAtEnd}else return S.localPosFromDOM(y,x)+S.posAtStart}function wo(n,t,e,i,s){let r=Math.round((i-t.left)*n.defaultCharacterWidth);if(n.lineWrapping&&e.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-e.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(e.from,e.to);return e.from+Ts(o,r,n.state.tabSize)}function Tf(n,t,e){let i;if(n.nodeType!=3||t!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Be(n,i-1,i).getBoundingClientRect().left>e}function Bf(n,t,e){if(t!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Be(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function $s(n,t){let e=n.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Mt.Text))return i}return e}function Pf(n,t,e,i){let s=$s(n,t.head),r=!i||s.type!=Mt.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(t.assoc<0&&t.head>s.from?t.head-1:t.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?s.to:s.from,e?-1:1)}function So(n,t,e,i){let s=n.state.doc.lineAt(t.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=t,a=null;;){let c=mf(s,r,o,l,e),h=wa;if(!c){if(s.number==(e?n.state.doc.lines:1))return l;h=`
-`,s=n.state.doc.line(s.number+(e?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function Rf(n,t,e){let i=n.state.charCategorizer(t),s=i(e);return r=>{let o=i(r);return s==J.Space&&(s=o),s==o}}function Lf(n,t,e,i){let s=t.head,r=e?1:-1;if(s==(e?n.state.doc.length:0))return b.cursor(s,t.assoc);let o=t.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,t.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Na(n,{x:f,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let m=n.docView.coordsForChar(g),y=!m||p<m.top?-1:1;return b.cursor(g,y,void 0,o)}}}function un(n,t,e){for(;;){let i=0;for(let s of n)s.between(t-1,t+1,(r,o,l)=>{if(t>r&&t<o){let a=i||e||(t-r<o-t?-1:1);t=a<0?r:o,i=a}});if(!i)return t}}function is(n,t,e){let i=un(n.state.facet(Sr).map(s=>s(n)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,i<e.from?1:-1)}const di="￿";class Ef{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(H.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=di}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==e)break;let l=$.get(s),a=$.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:xn(s))||xn(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(If(t,i.node,i.offset)?e:0))}}function If(n,t,e){for(;;){if(!t||e<Zt(t))return!1;if(t==n)return!0;e=Te(t)+1,t=t.parentNode}}class ko{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class Nf{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Hf(t),a=new Ef(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Wf(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Rs(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Rs(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.to<t.state.doc.length)){let f=Math.min(a,c),u=Math.max(a,c),d=h.from-f,p=h.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==t.state.doc.length)&&(a=0,c=t.state.doc.length)}this.newSel=b.single(c,a)}}}function Fa(n,t){let e,{newSel:i}=t,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=s.from,c=null;(r===8||D.android&&t.text.length<l-o)&&(a=s.to,c="end");let h=Vf(n.state.doc.sliceString(o,l,di),t.text,a-o,c);h&&(D.chrome&&r==13&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==di+di&&h.toB--,e={from:o+h.from,to:o+h.toA,insert:F.of(t.text.slice(h.from,h.toB).split(di))})}else i&&(!n.hasFocus&&n.state.facet(ie)||i.main.eq(s))&&(i=null);if(!e&&!i)return!1;if(!e&&t.typeOver&&!s.empty&&i&&i.main.empty?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:e&&e.from>=s.from&&e.to<=s.to&&(e.from!=s.from||e.to!=s.to)&&s.to-s.from-(e.to-e.from)<=4?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,e.from).append(e.insert).append(n.state.doc.slice(e.to,s.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==s.head-1&&/^\. ?$/.test(e.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==s.head&&e.insert.toString()==`
- `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}),e)return vr(n,e,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vr(n,t,e,i=-1){if(D.ios&&n.inputState.flushIOSKey(t))return!0;let s=n.state.selection.main;if(D.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&n.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&qe(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.length<t.to-t.from&&t.to>s.head)&&qe(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&qe(n.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Ff(n,t,e));return n.state.facet(Aa).some(a=>a(n,t.from,t.to,r,l))||n.dispatch(l()),!0}function Ff(n,t,e){let i,s=n.state,r=s.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let l=r.from<t.from?s.sliceDoc(r.from,t.from):"",a=r.to>t.to?s.sliceDoc(t.to,r.to):"";i=s.replaceSelection(n.state.toText(l+t.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=n.state.sliceDoc(t.from,t.to),h,f=e&&Ia(n,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vf(n,t,e,i){let s=Math.min(n.length,t.length),r=0;for(;r<s&&n.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==s&&n.length==t.length)return null;let o=n.length,l=t.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o<r&&n.length<t.length){let a=e<=r&&e>=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=e<=r&&e>=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Hf(n){let t=[];if(n.root.activeElement!=n.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return e&&(t.push(new ko(e,i)),(s!=e||r!=i)&&t.push(new ko(s,r))),t}function Wf(n,t){if(n.length==0)return null;let e=n[0].pos,i=n.length==2?n[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class zf{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&nu(t.contentDOM.ownerDocument)}handleEvent(t){!Yf(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let s of i.observers)s(this.view,e);for(let s of i.handlers){if(e.defaultPrevented)break;if(s(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=qf(t),i=this.handlers,s=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Ha.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Va.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||Kf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,qe(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0))}ignoreDuringComposition(t){return/^key/.test(t.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function vo(n,t){return(e,i)=>{try{return t.call(n,i,e)}catch(s){At(e.state,s)}}}function qf(n){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&e(r).handlers.push(vo(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&e(r).observers.push(vo(i.value,o))}}for(let i in Vt)e(i).handlers.push(Vt[i]);for(let i in It)e(i).observers.push(It[i]);return t}const Va=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Kf="dthko",Ha=[16,17,18,20,91,92,224,225],ji=6;function Ui(n){return Math.max(0,n)*.7+8}function $f(n,t){return Math.max(Math.abs(n.clientX-t.clientX),Math.abs(n.clientY-t.clientY))}class jf{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Zc(t.contentDOM),this.atoms=t.state.facet(Sr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Uf(t,e),this.dragging=Jf(t,e)&&qa(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&$f(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=kr(this.view);t.clientX-a.left<=s+ji?e=-Ui(s-t.clientX):t.clientX+a.right>=o-ji&&(e=Ui(t.clientX-o)),t.clientY-a.top<=r+ji?i=-Ui(r-t.clientY):t.clientY+a.bottom>=l-ji&&(i=Ui(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;i<t.ranges.length;i++){let s=t.ranges[i],r=null;if(s.empty){let o=un(this.atoms,s.from,0);o!=s.from&&(r=b.cursor(o,-1))}else{let o=un(this.atoms,s.from,-1),l=un(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=b.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(e||(e=t.ranges.slice()),e[i]=r)}return e?b.create(e,t.mainIndex):t}select(t){let{view:e}=this,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(e.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Uf(n,t){let e=n.state.facet(Sa);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Gf(n,t){let e=n.state.facet(ka);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function Jf(n,t){let{main:e}=n.state.selection;if(e.empty)return!1;let i=vi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=t.clientX&&o.right>=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function Yf(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=n.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Vt=Object.create(null),It=Object.create(null),Wa=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Xf(n){let t=n.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{n.focus(),e.remove(),za(n,e.value)},50)}function zn(n,t,e){for(let i of n.facet(t))e=i(e,n);return e}function za(n,t){t=zn(n.state,br,t);let{state:e}=n,i,s=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(js!=null&&e.selection.ranges.every(a=>a.empty)&&js==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(s++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}It.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Vt.keydown=(n,t)=>(n.inputState.setSelectionOrigin("select"),t.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);It.touchstart=(n,t)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};It.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Vt.mousedown=(n,t)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of n.state.facet(va))if(e=i(n,t),e)break;if(!e&&t.button==0&&(e=Zf(n,t)),e){let i=!n.hasFocus;n.inputState.startMouseSelection(new jf(n,t,e,i)),i&&n.observer.ignore(()=>{ia(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(t),s.dragging===!1}return!1};function Co(n,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return Mf(n.state,t,e);{let s=Q.find(n.docView,t),r=n.state.doc.lineAt(s?s.posAtEnd:t),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,b.range(o,l)}}let Ao=(n,t,e)=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right;function _f(n,t,e,i){let s=Q.find(n.docView,t);if(!s)return 1;let r=t-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Ao(e,i,o))return-1;let l=s.coordsAt(r,1);return l&&Ao(e,i,l)?1:o&&o.bottom>=i?-1:1}function Mo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:_f(n,e,t.clientX,t.clientY)}}const Qf=D.ie&&D.ie_version<=11;let Do=null,Oo=0,To=0;function qa(n){if(!Qf)return n.detail;let t=Do,e=To;return Do=n,To=Date.now(),Oo=!t||e>Date.now()-400&&Math.abs(t.clientX-n.clientX)<2&&Math.abs(t.clientY-n.clientY)<2?(Oo+1)%3:1}function Zf(n,t){let e=Mo(n,t),i=qa(t),s=n.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),s=s.map(r.changes))},get(r,o,l){let a=Mo(n,r),c,h=Co(n,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=Co(n,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u<h.from?b.range(u,d):b.range(d,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=tu(s,a.pos))?c:l?s.addRange(h):b.create([h])}}}function tu(n,t){for(let e=0;e<n.ranges.length;e++){let{from:i,to:s}=n.ranges[e];if(i<=t&&s>=t)return b.create(n.ranges.slice(0,e).concat(n.ranges.slice(e+1)),n.mainIndex==e?0:n.mainIndex-(n.mainIndex>e?1:0))}return null}Vt.dragstart=(n,t)=>{let{selection:{main:e}}=n.state;if(t.target.draggable){let s=n.docView.nearest(t.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",zn(n.state,xr,n.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Vt.dragend=n=>(n.inputState.draggedContent=null,!1);function Bo(n,t,e,i){if(e=zn(n.state,br,e),!e)return;let s=n.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&Gf(n,t)?{from:r.from,to:r.to}:null,l={from:s,insert:e},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Vt.drop=(n,t)=>{if(!t.dataTransfer)return!1;if(n.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),s=0,r=()=>{++s==e.length&&Bo(n,t,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<e.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Bo(n,t,i,!0),!0}return!1};Vt.paste=(n,t)=>{if(n.state.readOnly)return!0;n.observer.flush();let e=Wa?null:t.clipboardData;return e?(za(n,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Xf(n),!1)};function eu(n,t){let e=n.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function iu(n){let t=[],e=[],i=!1;for(let s of n.selection.ranges)s.empty||(t.push(n.sliceDoc(s.from,s.to)),e.push(s));if(!t.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(t.push(o.text),e.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:zn(n,xr,t.join(n.lineBreak)),ranges:e,linewise:i}}let js=null;Vt.copy=Vt.cut=(n,t)=>{let{text:e,ranges:i,linewise:s}=iu(n.state);if(!e&&!s)return!1;js=s?e:null,t.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Wa?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(eu(n,e),!1)};const Ka=oe.define();function $a(n,t){let e=[];for(let i of n.facet(Ma)){let s=i(n,t);s&&e.push(s)}return e?n.update({effects:e,annotations:Ka.of(!0)}):null}function ja(n){setTimeout(()=>{let t=n.hasFocus;if(t!=n.inputState.notifiedFocused){let e=$a(n.state,t);e?n.dispatch(e):n.update([])}},10)}It.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ja(n)};It.blur=n=>{n.observer.clearSelectionRange(),ja(n)};It.compositionstart=It.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};It.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,D.chrome&&D.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};It.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Vt.beforeinput=(n,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&n.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),c=n.posAtDOM(l.endContainer,l.endOffset);return vr(n,{from:a,to:c,insert:n.state.toText(r)},null),!0}}let s;if(D.chrome&&D.android&&(s=Va.find(r=>r.inputType==t.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&n.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>It.compositionend(n,t),20),!1};const Po=new Set;function nu(n){Po.has(n)||(Po.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ro=["pre-wrap","normal","pre-line","break-spaces"];let Xe=!1;function Lo(){Xe=!1}class su{constructor(t){this.lineWrapping=t,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Ro.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let s=t[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(e=!0,this.heightSamples[Math.floor(s*10)]=!0)}return e}refresh(t,e,i,s,r,o){let l=Ro.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class ru{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class Jt{constructor(t,e,i,s,r){this.from=t,this.length=e,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Mt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ge?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Jt(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var G=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(G||(G={}));const dn=.001;class pt{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>dn&&(Xe=!0),this.height=t)}replace(t,e,i){return pt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=s[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,G.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,G.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=Cr.build(i.setDoc(o),t,h,f);r=kn(r,r.replace(a,c,p))}return r.updateHeight(i,0)}static empty(){return new Ct(0,0)}static of(t){if(t.length==1)return t[0];let e=0,i=t.length,s=0,r=0;for(;;)if(e==i)if(s>r*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=t[e++];l&&(s+=l.size)}else{let l=t[--i];l&&(r+=l.size)}let o=0;return t[e-1]==null?(o=1,e--):t[e]==null&&(o=1,i++),new ou(pt.of(t.slice(0,e)),o,pt.of(t.slice(i)))}}function kn(n,t){return n==t?n:(n.constructor!=t.constructor&&(Xe=!0),t)}pt.prototype.size=1;class Ua extends pt{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,s){return new Jt(s,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(t,e,i,s,r,o){t<=r+this.length&&e>=r&&o(this.blockAt(0,i,s,r))}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends Ua{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,s){return new Jt(s,this.length,i,this.height,this.breaks)}replace(t,e,i){let s=i[0];return i.length==1&&(s instanceof Ct||s instanceof nt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof nt?s=new Ct(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pt.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends pt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,r=s-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(t,e,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,s);if(e.lineWrapping){let c=s+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),h=e.doc.lineAt(c),f=l+h.length*a,u=Math.max(i,t-f/2);return new Jt(h.from,h.length,u,f,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((t-i)/l))),{from:h,length:f}=e.doc.line(r+c);return new Jt(h,f,i+l*c,l,0)}}lineAt(t,e,i,s,r){if(e==G.ByHeight)return this.blockAt(t,i,s,r);if(e==G.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(t);return new Jt(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(t),h=l+c.length*a,f=c.number-o,u=s+l*f+a*(c.from-r-f);return new Jt(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(t,e,i,s,r,o){t=Math.max(t,r),e=Math.min(e,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=t,f=s;h<=e;){let u=i.doc.lineAt(h);if(h==t){let p=u.number-l;f+=a*p+c*(t-r-p)}let d=a+c*u.length;o(new Jt(u.from,u.length,f,d,0)),f+=d,h=u.to+1}}replace(t,e,i){let s=this.length-e;if(s>0){let r=i[i.length-1];r instanceof nt?i[i.length-1]=new nt(r.length+s):i.push(null,new nt(s-1))}if(t>0){let r=i[0];r instanceof nt?i[0]=new nt(t+r.length):i.unshift(new nt(t-1),null)}return pt.of(i)}decomposeLeft(t,e){e.push(new nt(t-1),null)}decomposeRight(t,e){e.push(null,new nt(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let r=e+this.length;if(s&&s.from<=e+this.length&&s.more){let o=[],l=Math.max(e,s.from),a=-1;for(s.from>e&&o.push(new nt(s.from-e-1).updateHeight(t,e));l<=r&&s.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=dn&&(a=-2);let u=new Ct(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new nt(r-l).updateHeight(t,l));let c=pt.of(o);return(a<0||Math.abs(c.height-this.height)>=dn||Math.abs(a-this.heightMetrics(t,e).perLine)>=dn)&&(Xe=!0),kn(this,c)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ou extends pt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,s){let r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,s):this.right.blockAt(t,e,r,s+this.left.length+this.break)}lineAt(t,e,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=e==G.ByHeight?t<o:t<l,c=a?this.left.lineAt(t,e,i,s,r):this.right.lineAt(t,e,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=e==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(t,e,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,s,r,o),e>=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,G.ByPos,i,s,r);t<c.from&&this.left.forEachLine(t,c.from-1,i,s,r,o),c.to>=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let s=this.left.length+this.break;if(e<s)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&Eo(r,o-1),e<this.length){let l=r.length;this.decomposeRight(e,r),Eo(r,l)}return pt.of(r)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<s&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?pt.of(this.break?[t,null,e]:[t,e]):(this.left=kn(this.left,t),this.right=kn(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return s&&s.from<=e+r.length&&s.more?a=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(t,l,i,s):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Eo(n,t){let e,i;n[t]==null&&(e=n[t-1])instanceof nt&&(i=n[t+1])instanceof nt&&n.splice(t-1,3,new nt(e.length+1+i.length))}const lu=5;class Cr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ct?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ct(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=e-t;i.block?this.addBlock(new Ua(o,s,i)):(o||r||s>=lu)&&this.addLineDeco(s,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Ct(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new nt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ct)return t;let e=new Ct(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenTo<this.pos||e==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=t;for(let s of this.nodes)s instanceof Ct&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(t,e,i,s){let r=new Cr(i,t);return K.spans(e,i,s,r,0),r.finish(i)}}function au(n,t,e){let i=new hu;return K.compare(n,t,e,i,0),i.changes}class hu{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,s){(t<e||i&&i.heightRelevant||s&&s.heightRelevant)&&fn(t,e,this.changes,5)}}function cu(n,t){let e=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,e.left),o=Math.min(s.innerWidth,e.right),l=Math.max(0,e.top),a=Math.min(s.innerHeight,e.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,f=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==n.parentNode?s.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function fu(n,t){let e=n.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class ns{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let s=t[i],r=e[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(t,e){return P.replace({widget:new uu(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class uu extends Ie{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class Io{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=No,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=X.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(wr).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new su(e),this.stateDeco=t.facet(Ci).filter(i=>typeof i!="function"),this.heightMap=pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(t.doc),[new Et(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);t.push(new Gi(r,o))}}return this.viewports=t.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?No:new Ar(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(pi(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ci).filter(h=>typeof h!="function");let s=t.changedRanges,r=Et.extendWithRanges(s,au(i,this.stateDeco,t?t.changes:tt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Lo(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||Xe)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Oa)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=ea(e,l);(k>.005&&Math.abs(this.scaleX-k)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=k,this.scaleY=w,c|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=sa(t.scrollDOM);let p=(this.printing?fu:cu)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(k)&&(o=!0),o||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:v,textHeight:A}=t.docView.measureTextSize();o=w>0&&s.refresh(r,w,v,A,x/v,k),o&&(t.docView.minWidth=0,c|=8)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),Lo();for(let w of this.viewports){let v=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new Et(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new ru(w.from,v))}Xe&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Gi(s.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(c,G.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c<a.from?u=f.top:u=f.bottom-h,a=new Gi(s.lineAt(u-1e3/2,G.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,G.ByHeight,r,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),s=e.mapPos(t.to,1);return new Gi(this.heightMap.lineAt(i,G.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,G.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(t==0||s<=o-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+2*1e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let s of t)e.touchesRange(s.from,s.to)||i.push(new ns(e.mapPos(s.from),e.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<f){a(h,y-10,u,d),a(y+10,f,u,d);return}let m=pu(t,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-f)<r&&!g.some(x=>y.from<x&&y.to>x));if(!m){if(f<u.to&&e&&i&&e.visibleRanges.some(S=>S.from<=f&&S.to>=f)){let S=e.moveToLineBoundary(b.cursor(f),!1,!0).head;S>h&&(f=S)}let y=this.gapSize(u,h,f,d),x=i||y<2e6?y:2e6;m=new ns(h,f,y,x)}l.push(m)},c=h=>{if(h.length<o||h.type!=Mt.Text)return;let f=du(h.from,h.to,this.stateDeco);if(f.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,y;if(u!=null){let x=Yi(f,u),S=((this.visibleBottom-this.visibleTop)/2+g)/h.height;m=x-S,y=x+S}else m=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;d=Ji(f,m),p=Ji(f,y)}else{let g=f.total*this.heightOracle.charWidth,m=s*this.heightOracle.charWidth,y=0;if(g>2e6)for(let v of t)v.from>=h.from&&v.from<h.to&&v.size!=v.displaySize&&v.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=v.size-v.displaySize);let x=this.pixelViewport.left+y,S=this.pixelViewport.right+y,k,w;if(u!=null){let v=Yi(f,u),A=((S-x)/2+m)/g;k=v-A,w=v+A}else k=(x-m)/g,w=(S+m)/g;d=Ji(f,k),p=Ji(f,w)}d>h.from&&a(h.from,d,h,f),p<h.to&&a(p,h.to,h,f)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(t,e,i,s){let r=Yi(s,i)-Yi(s,e);return this.heightOracle.lineWrapping?t.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(t){ns.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=P.set(t.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];K.spans(t,this.viewport.from,this.viewport.to,{span(s,r){e.push({from:s,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=e[r].from||s.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||pi(this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||pi(this.heightMap.lineAt(this.scaler.fromDOM(t),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return pi(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Gi{constructor(t,e){this.from=t,this.to=e}}function du(n,t,e){let i=[],s=n,r=0;return K.spans(e,n,t,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<t&&(i.push({from:s,to:t}),r+=t-s),{total:r,ranges:i}}function Ji({total:n,ranges:t},e){if(e<=0)return t[0].from;if(e>=1)return t[t.length-1].to;let i=Math.floor(n*e);for(let s=0;;s++){let{from:r,to:o}=t[s],l=o-r;if(i<=l)return r+i;i-=l}}function Yi(n,t){let e=0;for(let{from:i,to:s}of n.ranges){if(t<=s){e+=t-i;break}e+=s-i}return e/n.total}function pu(n,t){for(let e of n)if(t(e))return e}const No={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Ar{constructor(t,e,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,G.ByPos,t,0,0).top,h=e.lineAt(a,G.ByPos,t,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.top)return s+(t-i)*this.scale;if(t<=r.bottom)return r.domTop+(t-r.top);i=r.bottom,s=r.domBottom}}fromDOM(t){for(let e=0,i=0,s=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.domTop)return i+(t-s)/this.scale;if(t<=r.domBottom)return r.top+(t-r.domTop);i=r.bottom,s=r.domBottom}}eq(t){return t instanceof Ar?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,i)=>e.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function pi(n,t){if(t.scale==1)return n;let e=t.toDOM(n.top),i=t.toDOM(n.bottom);return new Jt(n.from,n.length,e,i-e,Array.isArray(n._content)?n._content.map(s=>pi(s,t)):n._content)}const Xi=T.define({combine:n=>n.join(" ")}),Us=T.define({combine:n=>n.indexOf(!0)>-1}),Gs=de.newName(),Ga=de.newName(),Ja=de.newName(),Ya={"&light":"."+Ga,"&dark":"."+Ja};function Js(n,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!e||!e[s])throw new RangeError(`Unsupported selector: ${s}`);return e[s]}):n+" "+i}})}const gu=Js("."+Gs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ya),mu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ss=D.ie&&D.ie_version<=11;class yu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new tf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new xu(t),t.state.facet(ie)&&(t.contentDOM.editContext=this.editContext.editContext)),ss&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(ie)?i.root.activeElement!=this.dom:!cn(this.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&s.focusNode&&bi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=vi(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&bu(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=cn(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&nf(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(i.nodeType==1)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=e)i.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,mu),ss&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ss&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let s=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&qe(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&cn(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Nf(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=Fa(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Fo(e,t.previousSibling||t.target.previousSibling,-1),s=Fo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ie)!=t.state.facet(ie)&&(t.view.contentDOM.editContext=t.state.facet(ie)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Fo(n,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==n)return i;let s=t.parentNode;t=s!=n.dom?s:e>0?t.nextSibling:t.previousSibling}return null}function Vo(n,t){let e=t.startContainer,i=t.startOffset,s=t.endContainer,r=t.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return bi(o.node,o.offset,s,r)&&([e,i,s,r]=[s,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}}function bu(n,t){if(t.getComposedRanges){let s=t.getComposedRanges(n.root)[0];if(s)return Vo(n,s)}let e=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),e?Vo(n,e):null}class xu{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:s}=t.state.selection.main,r=this.toEditorPos(i.updateRangeStart),o=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:o,insert:F.of(i.text.split(`
-`))};if(l.from==this.from&&s<this.from?l.from=s:l.to==this.to&&s>this.to&&(l.to=s),!(l.from==l.to&&!l.insert.length)){if(this.pendingContextChange=l,!t.state.readOnly){let a=this.to-this.from+(l.to-l.from+l.insert.length);vr(t,l,b.single(this.toEditorPos(i.selectionStart,a),this.toEditorPos(i.selectionEnd,a)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=t.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}e.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);if(a<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(P.mark({attributes:{style:h}}).range(a,c))}}}t.dispatch({effects:Ba.of(P.set(s))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=vi(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,e+=h,this.to+=h;return}else s=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=t.root||ef(t.parent)||document,this.viewState=new Io(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is($i)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(fi).map(s=>new ts(s));for(let s of this.plugins)s.update(this);this.observer=new yu(this),this.inputState=new zf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Ka))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$a(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);s=Sn.create(this,r,t),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ke(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($i)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=vn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(ui)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Xi)!=s.state.facet(Xi)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(qs))try{u(s)}catch(d){At(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Fa(this,h)&&c.force&&qe(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Io(t),this.plugins=t.facet(fi).map(i=>new ts(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new mo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(fi),i=t.state.facet(fi);if(e!=i){let s=[];for(let r of i){let o=e.indexOf(r);if(o<0)s.push(new ts(r));else{let l=this.plugins[o];l.mustUpdate=t,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=t;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(i){At(this.state,i,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(sa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return At(this.state,p),Ho}}),f=Sn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(h[d]!=Ho)try{let p=c[d];p.write&&p.write(h[d],this)}catch(p){At(this.state,p)}if(u&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(qs))l(e)}get themeClasses(){return Gs+" "+(this.state.facet(Us)?Ja:Ga)+" "+this.state.facet(Xi)}updateAttrs(){let t=Wo(this,Pa,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ie)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Wo(this,wr,e);let i=this.observer.ignore(()=>{let s=Fs(this.contentDOM,this.contentAttrs,e),r=Fs(this.dom,this.editorAttrs,t);return s||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)if(s.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ui);let t=this.state.facet(O.cspNonce);de.mount(this.root,this.styleModules.concat(gu).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key){this.measureRequests[e]=t;return}}this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(e===void 0||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(i=>i.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return is(this,t,So(this,t,e,i))}moveByGroup(t,e){return is(this,t,So(this,t,e,i=>Rf(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return Pf(this,t,e,i)}moveVertically(t,e,i){return is(this,t,Lf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Na(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),r=this.bidiSpans(s),o=r[fe.find(r,t-s.from,-1,e)];return Li(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Da)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>wu)return xa(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||ba(r.isolates,i=go(this,t))))return r.order;i||(i=go(this,t));let s=gf(t.text,e,i);return this.bidiCache.push(new vn(t.from,t.to,e,i,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ia(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return $i.of(new Ke(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return $i.of(new Ke(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ft.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ft.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),s=[Xi.of(i),ui.of(Js(`.${i}`,t))];return e&&e.dark&&s.push(Us.of(!0)),s}static baseTheme(t){return ye.lowest(ui.of(Js("."+Gs,t,Ya)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&$.get(i)||$.get(t);return((e=s==null?void 0:s.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=ui;O.inputHandler=Aa;O.clipboardInputFilter=br;O.clipboardOutputFilter=xr;O.scrollHandler=Ta;O.focusChangeEffect=Ma;O.perLineTextDirection=Da;O.exceptionSink=Ca;O.updateListener=qs;O.editable=ie;O.mouseSelectionStyle=va;O.dragMovesSelection=ka;O.clickAddsSelectionRange=Sa;O.decorations=Ci;O.outerDecorations=Ra;O.atomicRanges=Sr;O.bidiIsolatedRanges=La;O.scrollMargins=Ea;O.darkTheme=Us;O.cspNonce=T.define({combine:n=>n.length?n[0]:""});O.contentAttributes=wr;O.editorAttributes=Pa;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=N.define();const wu=4096,Ho={};class vn{constructor(t,e,i,s,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r<t.length;r++){let o=t[r];o.dir==s&&!e.touchesRange(o.from,o.to)&&i.push(new vn(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function Wo(n,t,e){for(let i=n.state.facet(t),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Ns(o,e)}return e}const Su=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function ku(n,t){const e=n.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<e.length-1;++a){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))t=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function _i(n,t,e){return t.altKey&&(n="Alt-"+n),t.ctrlKey&&(n="Ctrl-"+n),t.metaKey&&(n="Meta-"+n),e!==!1&&t.shiftKey&&(n="Shift-"+n),n}const vu=ye.default(O.domEventHandlers({keydown(n,t){return _a(Xa(t.state),n,t,"editor")}})),Mr=T.define({enables:vu}),zo=new WeakMap;function Xa(n){let t=n.facet(Mr),e=zo.get(t);return e||zo.set(t,e=Mu(t.reduce((i,s)=>i.concat(s),[]))),e}function Cu(n,t,e){return _a(Xa(n.state),t,n,e)}let he=null;const Au=4e3;function Mu(n,t=Su){let e=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>ku(y,t));for(let y=1;y<p.length;y++){let x=p.slice(0,y).join(" ");s(x,!0),d[x]||(d[x]={preventDefault:!0,stopPropagation:!1,run:[S=>{let k=he={view:S,prefix:x,scope:o};return setTimeout(()=>{he==k&&(he=null)},Au),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Ys))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Ys=null;function _a(n,t,e,i){Ys=t;let s=Xc(t),r=yt(s,0),o=Gt(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;he&&he.view==e&&he.scope==i&&(l=he.prefix+" ",Ha.indexOf(t.keyCode)<0&&(c=!0,he=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=n[i],p,g;return d&&(u(d[l+_i(s,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=pe[t.keyCode])&&p!=s?(u(d[l+_i(p,t,!0)])||t.shiftKey&&(g=ki[t.keyCode])!=s&&g!=p&&u(d[l+_i(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+_i(s,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Ys=null,a}class Ni{constructor(t,e,i,s,r){this.className=t,this.left=e,this.top=i,this.width=s,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Qa(t);return[new Ni(e,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Du(t,e,i)}}function Qa(n){let t=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==X.LTR?t.left:t.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:t.top-n.scrollDOM.scrollTop*n.scaleY}}function qo(n,t,e,i){let s=n.coordsAtPos(t,e*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Du(n,t,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let i=Math.max(e.from,n.viewport.from),s=Math.min(e.to,n.viewport.to),r=n.textDirection==X.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Qa(n),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=$s(n,i),p=$s(n,s),g=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(g&&(n.lineWrapping||d.widgetLineBreaks)&&(g=qo(n,i,1,g)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=qo(n,s,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(S(e.from,e.to,g));{let w=g?S(e.from,null,g):k(d,!1),v=m?S(null,e.to,m):k(p,!0),A=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2<v.top?A.push(y(f,w.bottom,u,v.top)):w.bottom<v.top&&n.elementAtHeight((w.bottom+v.top)/2).type==Mt.Text&&(w.bottom=v.top=(w.bottom+v.top)/2),x(w).concat(A).concat(x(v))}function y(w,v,A,R){return new Ni(t,w-a.left,v-a.top-.01,A-w,R-v+.01)}function x({top:w,bottom:v,horizontal:A}){let R=[];for(let I=0;I<A.length;I+=2)R.push(y(A[I],w,A[I+1],v));return R}function S(w,v,A){let R=1e9,I=-1e9,z=[];function E(V,j,dt,kt,Wt){let it=n.coordsAtPos(V,V==A.to?-2:2),Dt=n.coordsAtPos(dt,dt==A.from?2:-2);!it||!Dt||(R=Math.min(it.top,Dt.top,R),I=Math.max(it.bottom,Dt.bottom,I),Wt==X.LTR?z.push(r&&j?f:it.left,r&&kt?u:Dt.right):z.push(!r&&kt?f:Dt.left,!r&&j?u:it.right))}let B=w??A.from,W=v??A.to;for(let V of n.visibleRanges)if(V.to>B&&V.from<W)for(let j=Math.max(V.from,B),dt=Math.min(V.to,W);;){let kt=n.state.doc.lineAt(j);for(let Wt of n.bidiSpans(kt)){let it=Wt.from+kt.from,Dt=Wt.to+kt.from;if(it>=dt)break;Dt>j&&E(Math.max(it,j),w==null&&it<=B,Math.min(Dt,dt),v==null&&Dt>=W,Wt.dir)}if(j=kt.to+1,j>=dt)break}return z.length==0&&E(B,w==null,W,v==null,n.textDirection),{top:R,bottom:I,horizontal:z}}function k(w,v){let A=l.top+(v?w.top:w.bottom);return{top:A,bottom:A,horizontal:[]}}}function Ou(n,t){return n.constructor==t.constructor&&n.eq(t)}class Tu{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(pn)!=t.state.facet(pn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(pn);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;(t!=this.scaleX||e!=this.scaleY)&&(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((e,i)=>!Ou(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let s of t)s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(s.draw(),e);for(;e;){let s=e.nextSibling;e.remove(),e=s}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pn=T.define();function Za(n){return[ft.define(t=>new Tu(t,n)),pn.of(n)]}const th=!(D.ios&&D.webkit&&D.webkit_version<534),Ai=T.define({combine(n){return Ee(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function Mm(n={}){return[Ai.of(n),Bu,Pu,Ru,Oa.of(!0)]}function eh(n){return n.startState.facet(Ai)!=n.state.facet(Ai)}const Bu=Za({above:!0,markers(n){let{state:t}=n,e=t.facet(Ai),i=[];for(let s of t.selection.ranges){let r=s==t.selection.main;if(s.empty?!r||th:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Ni.forRange(n,o,l))i.push(a)}}return i},update(n,t){n.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=eh(n);return e&&Ko(n.state,t),n.docChanged||n.selectionSet||e},mount(n,t){Ko(t.state,n)},class:"cm-cursorLayer"});function Ko(n,t){t.style.animationDuration=n.facet(Ai).cursorBlinkRate+"ms"}const Pu=Za({above:!1,markers(n){return n.state.selection.ranges.map(t=>t.empty?[]:Ni.forRange(n,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(n,t){return n.docChanged||n.selectionSet||n.viewportChanged||eh(n)},class:"cm-selectionLayer"}),Xs={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};th&&(Xs[".cm-line"].caretColor=Xs[".cm-content"].caretColor="transparent !important");const Ru=ye.highest(O.theme(Xs)),ih=N.define({map(n,t){return n==null?null:t.mapPos(n)}}),gi=mt.define({create(){return null},update(n,t){return n!=null&&(n=t.changes.mapPos(n)),t.effects.reduce((e,i)=>i.is(ih)?i.value:e,n)}}),Lu=ft.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var t;let e=n.state.field(gi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(gi)!=e||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,t=n.state.field(gi),e=t!=null&&n.coordsAtPos(t);if(!e)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:e.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:e.bottom-e.top}}drawCursor(n){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;n?(this.cursor.style.left=n.left/t+"px",this.cursor.style.top=n.top/e+"px",this.cursor.style.height=n.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(gi)!=n&&this.view.dispatch({effects:ih.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Dm(){return[gi,Lu]}function $o(n,t,e,i,s){t.lastIndex=0;for(let r=n.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)s(o+l.index,l)}function Eu(n,t){let e=n.visibleRanges;if(e.length==1&&e[0].from==n.viewport.from&&e[0].to==n.viewport.to)return e;let i=[];for(let{from:s,to:r}of e)s=Math.max(n.state.doc.lineAt(s).from,s-t),r=Math.min(n.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Iu{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(l,a,c,h)=>s(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new Oe,i=e.add.bind(e);for(let{from:s,to:r}of Eu(t,this.maxLength))$o(t.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l<t.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),t.viewportChanged||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=t.state.doc.lineAt(o),c=a.to<l?t.state.doc.lineAt(l):a,h=Math.max(r.from,a.from),f=Math.min(r.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){f=l;break}}let u=[],d,p=(g,m,y)=>u.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,t,d.index+a.from,p);else $o(t.state.doc,this.regexp,h,f,(g,m)=>this.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>g<h||m>f,add:u})}}return e}}const _s=/x/.unicode!=null?"gu":"g",Nu=new RegExp(`[\0-\b
---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,_s),Fu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let rs=null;function Vu(){var n;if(rs==null&&typeof document<"u"&&document.body){let t=document.body.style;rs=((n=t.tabSize)!==null&&n!==void 0?n:t.MozTabSize)!=null}return rs||!1}const gn=T.define({combine(n){let t=Ee(n,{render:null,specialChars:Nu,addSpecialChars:null});return(t.replaceTabs=!Vu())&&(t.specialChars=new RegExp("	|"+t.specialChars.source,_s)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,_s)),t}});function Om(n={}){return[gn.of(n),Hu()]}let jo=null;function Hu(){return jo||(jo=ft.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Iu({regexp:n.specialChars,decoration:(t,e,i)=>{let{doc:s}=e.state,r=yt(t[0],0);if(r==9){let o=s.lineAt(i),l=e.state.tabSize,a=ei(o.text,l,i-o.from);return P.replace({widget:new Ku((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new qu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let t=n.state.facet(gn);n.startState.facet(gn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Wu="•";function zu(n){return n>=32?Wu:n==10?"␤":String.fromCharCode(9216+n)}class qu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=zu(this.code),i=t.state.phrase("Control character")+" "+(Fu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ku extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="	",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class $u extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Ge(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),s=Li(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Tm(n){return ft.fromClass(class{constructor(t){this.view=t,this.placeholder=n?P.set([P.widget({widget:new $u(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:t=>t.decorations})}const Qs=2e3;function ju(n,t,e){let i=Math.min(t.line,e.line),s=Math.max(t.line,e.line),r=[];if(t.off>Qs||e.off>Qs||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=s;a++){let c=n.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=s;a++){let c=n.doc.line(a),h=Ts(c.text,o,n.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=Ts(c.text,l,n.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Uu(n,t){let e=n.coordsAtPos(n.viewport.from);return e?Math.round(Math.abs((e.left-t)/n.defaultCharacterWidth)):-1}function Uo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1),i=n.state.doc.lineAt(e),s=e-i.from,r=s>Qs?-1:s==i.length?Uu(n,t.clientX):ei(i.text,n.state.tabSize,e-i.from);return{line:i.number,col:r,off:s}}function Gu(n,t){let e=Uo(n,t),i=n.state.selection;return e?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(e.line).from),o=s.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Uo(n,s);if(!l)return i;let a=ju(n.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Bm(n){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Gu(e,i):null)}const li="-10000px";class Ju{constructor(t,e,i,s){this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let s=t.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;a<r.length;a++){let c=r[a],h=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let u=this.tooltips[f];u&&u.create==c.create&&(h=f)}if(h<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[h];l&&(l[a]=e[h]),f.update&&f.update(t)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return e&&(l.forEach((a,c)=>e[c]=a),e.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function Yu(n){let{win:t}=n;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const os=T.define({combine:n=>{var t,e,i;return{position:D.ios?"absolute":((t=n.find(s=>s.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=n.find(s=>s.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Yu}}}),Go=new WeakMap,nh=ft.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=n.state.facet(os);this.position=t.position,this.parent=t.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ju(n,sh,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(n,this.above);t&&this.observeIntersection();let e=t||n.geometryChanged,i=n.state.facet(os);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(n,t){let e=n.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",e.dom.appendChild(s)}return e.dom.style.position=this.position,e.dom.style.top=li,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var n,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,t=1,e=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(D.gecko)e=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==li&&r.style.left=="0px"){let o=r.getBoundingClientRect();e=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(e||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=kr(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(os).tooltipSpace(this.view),scaleX:n,scaleY:t,makeAbsolute:e}}writeMeasure(n){var t;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:e,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:h}=c,f=n.pos[l],u=n.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(e.top,i.top)||f.top>=Math.min(e.bottom,i.bottom)||f.right<Math.max(e.left,i.left)-.1||f.left>Math.min(e.right,i.right)+.1)){h.style.top=li;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=Go.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||_u,x=this.view.textDirection==X.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-y.x),i.right-g),k=this.above[l];!a.strictSide&&(k?f.top-m-p-y.y<i.top:f.bottom+m+p+y.y>i.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let w=(k?f.top-i.top:i.bottom-f.bottom)-p;if(w<m&&c.resize!==!1){if(w<this.view.defaultLineHeight){h.style.top=li;continue}Go.set(c,m),h.style.height=(m=w)/r+"px"}else h.style.height&&(h.style.height="");let v=k?f.top-m-p-y.y:f.bottom+p+y.y,A=S+g;if(c.overlap!==!0)for(let R of o)R.left<A&&R.right>S&&R.top<v+m&&R.bottom>v&&(v=k?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(h.style.top=(v-n.parent.top)/r+"px",Jo(h,(S-n.parent.left)/s)):(h.style.top=v/r+"px",Jo(h,S/s)),d){let R=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=R/s+"px"}c.overlap!==!0&&o.push({left:S,top:v,right:A,bottom:v+m}),h.classList.toggle("cm-tooltip-above",k),h.classList.toggle("cm-tooltip-below",!k),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=li}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Jo(n,t){let e=parseInt(n.style.left,10);(isNaN(e)||Math.abs(t-e)>1)&&(n.style.left=t+"px")}const Xu=O.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),_u={x:0,y:0},sh=T.define({enables:[nh,Xu]});function rh(n,t){let e=n.plugin(nh);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const Yo=T.define({combine(n){let t,e;for(let i of n)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Cn(n,t){let e=n.plugin(oh),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const oh=ft.fromClass(class{constructor(n){this.input=n.state.facet(An),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(n));let t=n.state.facet(Yo);this.top=new Qi(n,!0,t.topContainer),this.bottom=new Qi(n,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(n){let t=n.state.facet(Yo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Qi(n.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Qi(n.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=n.state.facet(An);if(e!=this.input){let i=e.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),l.push(h)):(h=this.panels[c],h.update&&h.update(n)),s.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(t=>{let e=t.plugin(n);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Qi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Xo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Xo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Xo(n){let t=n.nextSibling;return n.remove(),t}const An=T.define({enables:oh});class Re extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Re.prototype.elementClass="";Re.prototype.toDOM=void 0;Re.prototype.mapMode=at.TrackBefore;Re.prototype.startSide=Re.prototype.endSide=-1;Re.prototype.point=!0;const Qu=T.define(),Zu=new class extends Re{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},td=Qu.compute(["selection"],n=>{let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>e&&(e=s,t.push(Zu.range(s)))}return K.of(t)});function Pm(){return td}const ed=1024;let id=0;class Bt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=id++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=gt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Mi{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const nd=Object.create(null);class gt{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):nd,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),s=new gt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return s}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=e[r<0?i.name:s[r]];if(o)return o}}}}gt.none=new gt("",Object.create(null),0,8);class Dr{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let s=null;for(let r of t){let o=r(i);o&&(s||(s=Object.assign({},i.props)),s[o[0].id]=o[1])}e.push(s?new gt(i.name,s,i.id,i.flags):i)}return new Dr(e)}}const Zi=new WeakMap,_o=new WeakMap;var Y;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(Y||(Y={}));class U{constructor(t,e,i,s,r){if(this.type=t,this.children=e,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=Mi.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let s=i.toString();s&&(e&&(e+=","),e+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Mn(this.topNode,t)}cursorAt(t,e=0,i=0){let s=Zi.get(this)||this.topNode,r=new Mn(s);return r.moveTo(t,e),Zi.set(this,r._tree),r}get topNode(){return new ct(this,0,0,null)}resolve(t,e=0){let i=Di(Zi.get(this)||this.topNode,t,e,!1);return Zi.set(this,i),i}resolveInner(t,e=0){let i=Di(_o.get(this)||this.topNode,t,e,!0);return _o.set(this,i),i}resolveStack(t,e=0){return od(this,t,e)}iterate(t){let{enter:e,leave:i,from:s=0,to:r=this.length}=t,o=t.mode||0,l=(o&Y.IncludeAnonymous)>0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Br(gt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,s)=>new U(this.type,e,i,s,this.propValues),t.makeTree||((e,i,s)=>new U(gt.none,e,i,s)))}static build(t){return ld(t)}}U.empty=new U(gt.none,[],[],0);class Or{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Or(this.buffer,this.index)}}class me{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return gt.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],s=this.set.types[e],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,s,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(lh(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let s=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=s[l++],r[a++]=s[l++]-i;let c=r[a++]=s[l++]-i;r[a++]=s[l++]-t,o=Math.max(o,c)}return new me(r,o,this.set)}}function lh(n,t,e,i){switch(n){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Di(n,t,e,i){for(var s;n.from==n.to||(e<1?n.from>=t:n.from>t)||(e>-1?n.to<=t:n.to<t);){let o=!i&&n instanceof ct&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:Y.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof ct&&o.index<0&&((s=l.enter(t,e,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(t,e,r);if(!o)return n;n=o}}class ah{cursor(t=0){return new Mn(this,t)}getChild(t,e=null,i=null){let s=Qo(this,t,e,i);return s.length?s[0]:null}getChildren(t,e=null,i=null){return Qo(this,t,e,i)}resolve(t,e=0){return Di(this,t,e,!1)}resolveInner(t,e=0){return Di(this,t,e,!0)}matchContext(t){return Zs(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let s=e.lastChild;if(!s||s.to!=e.to)break;s.type.isError&&s.from==s.to?(i=e,e=s.prevSibling):e=s}return i}get node(){return this}get next(){return this.parent}}class ct extends ah{constructor(t,e,i,s){super(),this._tree=t,this.from=e,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,s,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=e>0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(lh(s,i,f,f+h.length)){if(h instanceof me){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,s);if(u>-1)return new Yt(new sd(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||Tr(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Mi.get(h))&&!u.overlay)return new ct(u.tree,f,t,o);let d=new ct(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,s)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let s;if(!(i&Y.IgnoreOverlays)&&(s=Mi.get(this._tree))&&s.overlay){let r=t-this.from;for(let{from:o,to:l}of s.overlay)if((e>0?o<=r:o<r)&&(e<0?l>=r:l>r))return new ct(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Qo(n,t,e,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=s.type.is(e),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(t)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Zs(n,t,e=t.length-1){for(let i=n;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class sd{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class Yt extends ah{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];t.push(i.slice(s,r,o)),e.push(0)}return new U(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hh(n){if(!n.length)return null;let t=0,e=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof ct&&e.index<0?null:e.parent,s=n.slice();return i?s[t]=i:s.splice(t,1),new rd(s,e)}class rd{constructor(t,e){this.heads=t,this.node=e}get next(){return hh(this.heads)}}function od(n,t,e){let i=n.resolveInner(t,e),s=null;for(let r=i instanceof ct?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[i])).push(o.resolve(t,e)),r=o}else{let o=Mi.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new ct(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Di(l,t,e,!1))}}return s?hh(s):i}class Mn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ct)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:s}=this.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0}yield(t){return t?t instanceof ct?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(e.findChild(s,this.index,-1,0,4))}else{let s=e.buffer[this.index+3];if(s<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:s}=this;if(s){if(t>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=s)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof me||!l.type.isAnonymous||Tr(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==s){if(s==this.index)return o;e=o,i=r+1;break t}s=this.stack[--r]}for(let s=i;s<this.stack.length;s++)e=new Yt(this.buffer,e,this.stack[s]);return this.bufferNode=new Yt(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let s=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&e&&e(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(t){if(!this.buffer)return Zs(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let s=t.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return Zs(this._tree,t,s);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[s]&&t[s]!=o.name)return!1;s--}}return!0}}function Tr(n){return n.children.some(t=>t instanceof me||!t.type.isAnonymous||Tr(t))}function ld(n){var t;let{buffer:e,nodeSet:i,maxBufferLength:s=ed,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(e)?new Or(e,e.length):e,a=i.types,c=0,h=0;function f(w,v,A,R,I,z){let{id:E,start:B,end:W,size:V}=l,j=h,dt=c;for(;V<0;)if(l.next(),V==-1){let ee=r[E];A.push(ee),R.push(B-w);return}else if(V==-3){c=E;return}else if(V==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${V}`);let kt=a[E],Wt,it,Dt=B-w;if(W-B<=s&&(it=m(l.pos-v,I))){let ee=new Uint16Array(it.size-it.skip),Ot=l.pos-it.size,zt=ee.length;for(;l.pos>Ot;)zt=y(it.start,ee,zt);Wt=new me(ee,W-it.start,i),Dt=it.start-w}else{let ee=l.pos-V;l.next();let Ot=[],zt=[],xe=E>=o?E:-1,Ne=0,Wi=W;for(;l.pos>ee;)xe>=0&&l.id==xe&&l.size>=0?(l.end<=Wi-s&&(p(Ot,zt,B,Ne,l.end,Wi,xe,j,dt),Ne=Ot.length,Wi=l.end),l.next()):z>2500?u(B,ee,Ot,zt):f(B,ee,Ot,zt,xe,z+1);if(xe>=0&&Ne>0&&Ne<Ot.length&&p(Ot,zt,B,Ne,B,Wi,xe,j,dt),Ot.reverse(),zt.reverse(),xe>-1&&Ne>0){let Jr=d(kt,dt);Wt=Br(kt,Ot,zt,0,Ot.length,0,W-B,Jr,Jr)}else Wt=g(kt,Ot,zt,W-B,j-W,dt)}A.push(Wt),R.push(Dt)}function u(w,v,A,R){let I=[],z=0,E=-1;for(;l.pos>v;){let{id:B,start:W,end:V,size:j}=l;if(j>4)l.next();else{if(E>-1&&W<E)break;E<0&&(E=V-s),I.push(B,W,V),z++,l.next()}}if(z){let B=new Uint16Array(z*4),W=I[I.length-2];for(let V=I.length-3,j=0;V>=0;V-=3)B[j++]=I[V],B[j++]=I[V+1]-W,B[j++]=I[V+2]-W,B[j++]=j;A.push(new me(B,I[2]-W,i)),R.push(W-w)}}function d(w,v){return(A,R,I)=>{let z=0,E=A.length-1,B,W;if(E>=0&&(B=A[E])instanceof U){if(!E&&B.type==w&&B.length==I)return B;(W=B.prop(L.lookAhead))&&(z=R[E]+B.length+W)}return g(w,A,R,I,z,v)}}function p(w,v,A,R,I,z,E,B,W){let V=[],j=[];for(;w.length>R;)V.push(w.pop()),j.push(v.pop()+A-I);w.push(g(i.types[E],V,j,z-I,B-z,W)),v.push(I-A)}function g(w,v,A,R,I,z,E){if(z){let B=[L.contextHash,z];E=E?[B].concat(E):[B]}if(I>25){let B=[L.lookAhead,I];E=E?[B].concat(E):[B]}return new U(w,v,A,R,E)}function m(w,v){let A=l.fork(),R=0,I=0,z=0,E=A.end-s,B={size:0,start:0,skip:0};t:for(let W=A.pos-w;A.pos>W;){let V=A.size;if(A.id==v&&V>=0){B.size=R,B.start=I,B.skip=z,z+=4,R+=4,A.next();continue}let j=A.pos-V;if(V<0||j<W||A.start<E)break;let dt=A.id>=o?4:0,kt=A.start;for(A.next();A.pos>j;){if(A.size<0)if(A.size==-3)dt+=4;else break t;else A.id>=o&&(dt+=4);A.next()}I=kt,R+=V,z+=dt}return(v<0||R==w)&&(B.size=R,B.start=I,B.skip=z),B.size>4?B:void 0}function y(w,v,A){let{id:R,start:I,end:z,size:E}=l;if(l.next(),E>=0&&R<o){let B=A;if(E>4){let W=l.pos-(E-4);for(;l.pos>W;)A=y(w,v,A)}v[--A]=B,v[--A]=z-w,v[--A]=I-w,v[--A]=R}else E==-3?c=R:E==-4&&(h=R);return A}let x=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,x,S,-1,0);let k=(t=n.length)!==null&&t!==void 0?t:x.length?S[0]+x[0].length:0;return new U(a[n.topID],x.reverse(),S.reverse(),k)}const Zo=new WeakMap;function mn(n,t){if(!n.isAnonymous||t instanceof me||t.type!=n)return 1;let e=Zo.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=n||!(i instanceof U)){e=1;break}e+=mn(n,i)}Zo.set(t,e)}return e}function Br(n,t,e,i,s,r,o,l,a){let c=0;for(let p=i;p<s;p++)c+=mn(n,t[p]);let h=Math.ceil(c*1.5/8),f=[],u=[];function d(p,g,m,y,x){for(let S=m;S<y;){let k=S,w=g[S],v=mn(n,p[S]);for(S++;S<y;S++){let A=mn(n,p[S]);if(v+A>=h)break;v+=A}if(S==k+1){if(v>h){let A=p[k];d(A.children,A.positions,0,A.children.length,g[k]+x);continue}f.push(p[k])}else{let A=g[S-1]+p[S-1].length-w;f.push(Br(n,p,g,k,S,w,A,null,a))}u.push(w+x-r)}}return d(t,e,i,s,0),(l||a)(f,u,o)}class Rm{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let s=this.map.get(t);s||this.map.set(t,s=new Map),s.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ct&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ct?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class se{constructor(t,e,i,s,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let s=[new se(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&s.push(r);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l<e.length?e[l]:null,f=h?h.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new se(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&s.push(u),o.to>f)break;o=r<t.length?t[r++]:null}if(!h)break;a=h.toA,c=h.toA-h.toB}return s}}class ch{startParse(t,e,i){return typeof t=="string"&&(t=new ad(t)),i=i?i.length?i.map(s=>new Bt(s.from,s.to)):[new Bt(0,0)]:[new Bt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let r=s.advance();if(r)return r}}}class ad{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Lm(n){return(t,e,i,s)=>new cd(t,n,e,i,s)}class tl{constructor(t,e,i,s,r){this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r}}function el(n){if(!n.length||n.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class hd{constructor(t,e,i,s,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const tr=new L({perNode:!0});class cd{constructor(t,e,i,s,r){this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[tr,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Mi(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new dd(this.fragments),e=null,i=null,s=new Mn(new ct(this.baseTree,this.ranges[0].from,0,null),Y.IncludeAnonymous|Y.IgnoreMounts);t:for(let r,o;;){let l=!0,a;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)l=!1;else if(t.hasNode(s)){if(e){let c=e.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=s.from&&u<=s.to&&!e.ranges.some(d=>d.from<u&&d.to>f)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=fd(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.from<s.to||!r.overlay)){s.tree||ud(s);let c=t.findMounts(s.from,r.parser);if(typeof r.overlay=="function")e=new hd(r.parser,r.overlay,c,this.inner.length,s.from,s.tree,e);else{let h=sl(this.ranges,r.overlay||(s.from<s.to?[new Bt(s.from,s.to)]:[]));h.length&&el(h),(h.length||!r.overlay)&&this.inner.push(new tl(r.parser,h.length?r.parser.startParse(this.input,rl(c,h),h):r.parser.startParse(""),r.overlay?r.overlay.map(f=>new Bt(f.from-s.from,f.to-s.from)):null,s.tree,h.length?h[0].from:s.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(s))&&(a===!0&&(a=new Bt(s.from,s.to)),a.from<a.to)){let c=e.ranges.length-1;c>=0&&e.ranges[c].to==a.from?e.ranges[c]={from:e.ranges[c].from,to:a.to}:e.ranges.push(a)}if(l&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&!--e.depth){let c=sl(this.ranges,e.ranges);c.length&&(el(c),this.inner.splice(e.index,0,new tl(e.parser,e.parser.startParse(this.input,rl(e.mounts,c),c),e.ranges.map(h=>new Bt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function fd(n,t,e){for(let i of n){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function il(n,t,e,i,s,r){if(t<e){let o=n.buffer[t+1];i.push(n.slice(t,e,o)),s.push(o-r)}}function ud(n){let{node:t}=n,e=[],i=t.context.buffer;do e.push(n.index),n.parent();while(!n.tree);let s=n.tree,r=s.children.indexOf(i),o=s.children[r],l=o.buffer,a=[r];function c(h,f,u,d,p,g){let m=e[g],y=[],x=[];il(o,h,m,y,x,d);let S=l[m+1],k=l[m+2];a.push(y.length);let w=g?c(m+4,l[m+3],o.set.types[l[m]],S,k-S,g-1):t.toTree();return y.push(w),x.push(S-d),il(o,l[m+3],f,y,x,d),new U(u,y,x,p)}s.children[r]=c(0,l.length,gt.none,0,o.length,e.length-1);for(let h of a){let f=n.tree.children[h],u=n.tree.positions[h];n.yield(new ct(f,u+n.from,h,n._tree))}}class nl{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(Y.IncludeAnonymous|Y.IgnoreMounts)}moveTo(t){let{cursor:e}=this,i=t-this.offset;for(;!this.done&&e.from<i;)e.to>=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof U)e=e.children[0];else break}return!1}}class dd{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(tr))!==null&&e!==void 0?e:i.to,this.inner=new nl(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(tr))!==null&&t!==void 0?t:e.to,this.inner=new nl(e.tree,-e.offset)}}findMounts(t,e){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function sl(n,t){let e=null,i=t;for(let s=1,r=0;s<n.length;s++){let o=n[s-1].to,l=n[s].from;for(;r<i.length;r++){let a=i[r];if(a.from>=l)break;a.to<=o||(e||(i=e=t.slice()),a.from<o?(e[r]=new Bt(a.from,o),a.to>l&&e.splice(r+1,0,new Bt(l,a.to))):a.to>l?e[r--]=new Bt(l,a.to):e.splice(r--,1))}}return i}function pd(n,t,e,i){let s=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=s==n.length?1e9:o?n[s].to:n[s].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);u<d&&c.push(new Bt(u,d))}if(a=Math.min(h,f),a==1e9)break;h==a&&(o?(o=!1,s++):o=!0),f==a&&(l?(l=!1,r++):l=!0)}return c}function rl(n,t){let e=[];for(let{pos:i,mount:s,frag:r}of n){let o=i+(s.overlay?s.overlay[0].from:0),l=o+s.tree.length,a=Math.max(r.from,o),c=Math.min(r.to,l);if(s.overlay){let h=s.overlay.map(u=>new Bt(u.from+i,u.to+i)),f=pd(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new se(d,g,s.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new se(a,c,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let gd=0;class Tt{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=gd++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof Tt&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let s=new Tt(i,[],null,[]);if(s.set.push(s),e)for(let r of e.set)s.set.push(r);return s}static defineModifier(t){let e=new Dn(t);return i=>i.modified.indexOf(e)>-1?i:Dn.get(i.base||i,i.modified.concat(e).sort((s,r)=>s.id-r.id))}}let md=0;class Dn{constructor(t){this.name=t,this.instances=[],this.id=md++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&yd(e,l.modified));if(i)return i;let s=[],r=new Tt(t.name,s,t,e);for(let l of e)l.instances.push(r);let o=bd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)s.push(Dn.get(l,a));return r}}function yd(n,t){return n.length==t.length&&n.every((e,i)=>e==t[i])}function bd(n){let t=[[]];for(let e=0;e<n.length;e++)for(let i=0,s=t.length;i<s;i++)t.push(t[i].concat(n[e]));return t.sort((e,i)=>i.length-e.length)}function xd(n){let t=Object.create(null);for(let e in n){let i=n[e];Array.isArray(i)||(i=[i]);for(let s of e.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let h=new On(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return fh.add(t)}const fh=new L;class On{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}On.empty=new On([],2,null);function uh(n,t){let e=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))e[r.tag.id]=r.class;else for(let o of r.tag)e[o.id]=r.class;let{scope:i,all:s=null}=t||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function wd(n,t){let e=null;for(let i of n){let s=i.style(t);s&&(e=e?e+" "+s:s)}return e}function Sd(n,t,e,i=0,s=n.length){let r=new kd(i,Array.isArray(t)?t:[t],e);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class kd{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,s,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=s,h=vd(t)||On.empty,f=wd(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m<u.overlay.length?u.overlay[m]:null,S=x?x.from+l:a,k=Math.max(e,y),w=Math.min(i,S);if(k<w&&g)for(;t.from<w&&(this.highlightRange(t,k,w,s,r),this.startSpan(Math.min(w,t.to),c),!(t.to>=S||!t.nextSibling())););if(!x||S>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(s="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function vd(n){let t=n.type.prop(fh);for(;t&&t.context&&!n.matchContext(t.context);)t=t.next;return t||null}const C=Tt.define,tn=C(),le=C(),ol=C(le),ll=C(le),ae=C(),en=C(ae),ls=C(ae),jt=C(),we=C(jt),Kt=C(),$t=C(),er=C(),ai=C(er),nn=C(),M={comment:tn,lineComment:C(tn),blockComment:C(tn),docComment:C(tn),name:le,variableName:C(le),typeName:ol,tagName:C(ol),propertyName:ll,attributeName:C(ll),className:C(le),labelName:C(le),namespace:C(le),macroName:C(le),literal:ae,string:en,docString:C(en),character:C(en),attributeValue:C(en),number:ls,integer:C(ls),float:C(ls),bool:C(ae),regexp:C(ae),escape:C(ae),color:C(ae),url:C(ae),keyword:Kt,self:C(Kt),null:C(Kt),atom:C(Kt),unit:C(Kt),modifier:C(Kt),operatorKeyword:C(Kt),controlKeyword:C(Kt),definitionKeyword:C(Kt),moduleKeyword:C(Kt),operator:$t,derefOperator:C($t),arithmeticOperator:C($t),logicOperator:C($t),bitwiseOperator:C($t),compareOperator:C($t),updateOperator:C($t),definitionOperator:C($t),typeOperator:C($t),controlOperator:C($t),punctuation:er,separator:C(er),bracket:ai,angleBracket:C(ai),squareBracket:C(ai),paren:C(ai),brace:C(ai),content:jt,heading:we,heading1:C(we),heading2:C(we),heading3:C(we),heading4:C(we),heading5:C(we),heading6:C(we),contentSeparator:C(jt),list:C(jt),quote:C(jt),emphasis:C(jt),strong:C(jt),link:C(jt),monospace:C(jt),strikethrough:C(jt),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:nn,documentMeta:C(nn),annotation:C(nn),processingInstruction:C(nn),definition:Tt.defineModifier("definition"),constant:Tt.defineModifier("constant"),function:Tt.defineModifier("function"),standard:Tt.defineModifier("standard"),local:Tt.defineModifier("local"),special:Tt.defineModifier("special")};for(let n in M){let t=M[n];t instanceof Tt&&(t.name=n)}uh([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var as;const Ce=new L;function dh(n){return T.define({combine:n?t=>t.concat(n):void 0})}const Cd=new L;class Pt{constructor(t,e,i=[],s=""){this.data=t,this.name=s,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return St(this)}}),this.parser=e,this.extension=[Ze.of(this),H.languageData.of((r,o,l)=>{let a=al(r,o,l),c=a.type.prop(Ce);if(!c)return[];let h=r.facet(c),f=a.type.prop(Cd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return al(t,e,i).type.prop(Ce)==this.data}findRegions(t){let e=t.facet(Ze);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Ce)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ce)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let c=r.children[a];c instanceof U&&s(c,r.positions[a]+o)}};return s(St(t),0),i}get allowsNesting(){return!0}}Pt.setState=N.define();function al(n,t,e){let i=n.facet(Ze),s=St(n).topNode;if(!i||i.allowsNesting)for(let r=s;r;r=r.enter(t,e,Y.ExcludeBuffers))r.type.isTop&&(s=r);return s}class ir extends Pt{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=dh(t.languageData);return new ir(e,t.parser.configure({props:[Ce.add(i=>i.isTop?e:void 0)]}),t.name)}configure(t,e){return new ir(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function St(n){let t=n.field(Pt.state,!1);return t?t.tree:U.empty}class Ad{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let hi=null;class _e{constructor(t,e,i=[],s,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new _e(t,e,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ad(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=U.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let s=Date.now()+t;t=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(se.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(se.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=hi;hi=this;try{return t()}finally{hi=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=hl(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=se.applyChanges(i,a),s=U.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);h<f&&l.push({from:h,to:f})}}}return new _e(this.parser,e,i,s,r,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:r}=this.skipped[i];s<t.to&&r>t.from&&(this.fragments=hl(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends ch{createParse(e,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=hi;if(a){for(let c of s)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new U(gt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return hi}}function hl(n,t,e){return se.applyChanges(n,[{fromA:t,toA:e,fromB:t,toB:e}])}class Qe{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Qe(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=_e.create(t.facet(Ze).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Qe(i)}}Pt.state=mt.define({create:Qe.init,update(n,t){for(let e of t.effects)if(e.is(Pt.setState))return e.value;return t.startState.facet(Ze)!=t.state.facet(Ze)?Qe.init(t.state):n.apply(t)}});let ph=n=>{let t=setTimeout(()=>n(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(ph=n=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(n,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const hs=typeof navigator<"u"&&(!((as=navigator.scheduling)===null||as===void 0)&&as.isInputPending)?()=>navigator.scheduling.isInputPending():null,Md=ft.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Pt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Pt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=ph(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,r=i.field(Pt.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!hs?Math.max(25,t.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>hs&&hs()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Pt.setState.of(new Qe(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>At(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ze=T.define({combine(n){return n.length?n[0]:null},enables:n=>[Pt.state,Md,O.contentAttributes.compute([n],t=>{let e=t.facet(n);return e&&e.name?{"data-language":e.name}:{}})]});class Im{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const Dd=T.define(),qn=T.define({combine:n=>{if(!n.length)return"  ";let t=n[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return t}});function Le(n){let t=n.facet(qn);return t.charCodeAt(0)==9?n.tabSize*t.length:t.length}function Tn(n,t){let e="",i=n.tabSize,s=n.facet(qn)[0];if(s=="	"){for(;t>=i;)e+="	",t-=i;s=" "}for(let r=0;r<t;r++)e+=s;return e}function gh(n,t){n instanceof H&&(n=new Kn(n));for(let i of n.state.facet(Dd)){let s=i(n,t);if(s!==void 0)return s}let e=St(n.state);return e.length>=t?Od(n,e,t):null}class Kn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Le(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(t,e);return i.slice(t-s,Math.min(i.length,t+100-s))}column(t,e=1){let{text:i,from:s}=this.lineAt(t,e),r=this.countColumn(i,t-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ei(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:s}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mh=new L;function Od(n,t,e){let i=t.resolveStack(e),s=i.node.enterUnfinishedNodesBefore(e);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return yh(i,n,e)}function yh(n,t,e){for(let i=n;i;i=i.next){let s=Bd(i.node);if(s)return s(Pr.create(t,e,i))}return 0}function Td(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Bd(n){let t=n.type.prop(mh);if(t)return t;let e=n.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>bh(o,!0,1,void 0,r&&!Td(o)?s.from:void 0)}return n.parent==null?Pd:null}function Pd(){return 0}class Pr extends Kn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Pr(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Rd(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return yh(this.context.next,this.base,this.pos)}}function Rd(n,t){for(let e=t;e;e=e.parent)if(n==e)return!0;return!1}function Ld(n){let t=n.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(e.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+c}}l=a.to}}function Nm({closing:n,align:t=!0,units:e=1}){return i=>bh(i,t,e,n)}function bh(n,t,e,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=t?Ld(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*e)}const Fm=n=>n.baseIndent;function Vm({except:n,units:t=1}={}){return e=>{let i=n&&n.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Hm=new L;function Wm(n){let t=n.firstChild,e=n.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?n.to:e.from}:null}class $n{constructor(t,e){this.specs=t;let i;function s(l){let a=de.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof e.all=="string"?e.all:e.all?s(e.all):void 0,o=e.scope;this.scope=o instanceof Pt?l=>l.prop(Ce)==o.data:o?l=>l==o:void 0,this.style=uh(t.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new de(i):null,this.themeType=e.themeType}static define(t,e){return new $n(t,e||{})}}const nr=T.define(),xh=T.define({combine(n){return n.length?[n[0]]:null}});function cs(n){let t=n.facet(nr);return t.length?t:n.facet(xh)}function zm(n,t){let e=[Id],i;return n instanceof $n&&(n.module&&e.push(O.styleModule.of(n.module)),i=n.themeType),t!=null&&t.fallback?e.push(xh.of(n)):i?e.push(nr.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):e.push(nr.of(n)),e}class Ed{constructor(t){this.markCache=Object.create(null),this.tree=St(t.state),this.decorations=this.buildDeco(t,cs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=St(t.state),i=cs(t.state),s=i!=cs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!s&&e.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return P.none;let i=new Oe;for(let{from:s,to:r}of t.visibleRanges)Sd(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},s,r);return i.finish()}}const Id=ye.high(ft.fromClass(Ed,{decorations:n=>n.decorations})),qm=$n.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),Nd=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),wh=1e4,Sh="()[]{}",kh=T.define({combine(n){return Ee(n,{afterCursor:!0,brackets:Sh,maxScanDistance:wh,renderMatch:Hd})}}),Fd=P.mark({class:"cm-matchingBracket"}),Vd=P.mark({class:"cm-nonmatchingBracket"});function Hd(n){let t=[],e=n.matched?Fd:Vd;return t.push(e.range(n.start.from,n.start.to)),n.end&&t.push(e.range(n.end.from,n.end.to)),t}const Wd=mt.define({create(){return P.none},update(n,t){if(!t.docChanged&&!t.selection)return n;let e=[],i=t.state.facet(kh);for(let s of t.state.selection.ranges){if(!s.empty)continue;let r=Xt(t.state,s.head,-1,i)||s.head>0&&Xt(t.state,s.head-1,1,i)||i.afterCursor&&(Xt(t.state,s.head,1,i)||s.head<t.state.doc.length&&Xt(t.state,s.head+1,-1,i));r&&(e=e.concat(i.renderMatch(r,t.state)))}return P.set(e,!0)},provide:n=>O.decorations.from(n)}),zd=[Wd,Nd];function Km(n={}){return[kh.of(n),zd]}const qd=new L;function sr(n,t,e){let i=n.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=e.indexOf(n.name);if(s>-1&&s%2==(t<0?1:0))return[e[s+t]]}return null}function rr(n){let t=n.type.prop(qd);return t?t(n.node):n}function Xt(n,t,e,i={}){let s=i.maxScanDistance||wh,r=i.brackets||Sh,o=St(n),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=sr(a.type,e,r);if(c&&a.from<a.to){let h=rr(a);if(h&&(e>0?t>=h.from&&t<h.to:t>h.from&&t<=h.to))return Kd(n,t,e,a,h,c,r)}}return $d(n,t,e,o,l.type,s,r)}function Kd(n,t,e,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from<h.to){let f=rr(h);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(sr(h.type,e,o))c++;else if(sr(h.type,-e,o)){if(c==0){let f=rr(h);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(e<0?h.prevSibling():h.nextSibling());return{start:a,matched:!1}}function $d(n,t,e,i,s,r,o){let l=e<0?n.sliceDoc(t-1,t):n.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=n.doc.iterRange(t,e>0?n.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function cl(n,t,e,i=0,s=0){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));let r=s;for(let o=i;o<t;o++)n.charCodeAt(o)==9?r+=e-r%e:r++;return r}class vh{constructor(t,e,i,s){this.string=t,this.tabSize=e,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e=this.string.charAt(this.pos),i;if(typeof t=="string"?i=e==t:i=e&&(t instanceof RegExp?t.test(e):t(e)),i)return++this.pos,e}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=cl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return(t=this.overrideIndent)!==null&&t!==void 0?t:cl(this.string,null,this.tabSize)}match(t,e,i){if(typeof t=="string"){let s=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return s(r)==s(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let s=this.string.slice(this.pos).match(t);return s&&s.index>0?null:(s&&e!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function jd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Ud,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Lr}}function Ud(n){if(typeof n!="object")return n;let t={};for(let e in n){let i=n[e];t[e]=i instanceof Array?i.slice():i}return t}const fl=new WeakMap;class Ch extends Pt{constructor(t){let e=dh(t.languageData),i=jd(t),s,r=new class extends ch{createParse(o,l,a){return new Jd(s,o,l,a)}};super(e,r,[],t.name),this.topNode=_d(e,this),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new Oh(i.tokenTable):Xd}static define(t){return new Ch(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=fl.get(t.state),e!=null&&e<t.pos-1e4&&(e=void 0));let s=Rr(this,t.node.tree,0,t.node.from,e??t.pos),r,o;if(s?(o=s.state,r=s.pos+1):(o=this.streamParser.startState(t.unit),r=0),t.pos-r>1e4)return null;for(;r<t.pos;){let a=t.state.doc.lineAt(r),c=Math.min(t.pos,a.to);if(a.length){let h=i?i(a.from):-1,f=new vh(a.text,t.state.tabSize,t.unit,h<0?void 0:h);for(;f.pos<c-a.from;)Mh(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,t.unit);if(c==t.pos)break;r=a.to+1}let l=t.lineAt(t.pos);return i&&e==null&&fl.set(t.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],t)}get allowsNesting(){return!1}}function Rr(n,t,e,i,s){let r=e>=i&&e+t.length<=s&&t.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof U&&a<s&&Rr(n,l,a,i,s);if(c)return c}return null}function Ah(n,t,e,i,s){if(s&&e<=0&&i>=t.length)return t;!s&&e==0&&t.type==n.topNode&&(s=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(o<i&&l instanceof U){if(!(a=Ah(n,l,e-o,i-o,s)))break;return s?new U(t.type,t.children.slice(0,r).concat(a),t.positions.slice(0,r+1),o+a.length):a}}return null}function Gd(n,t,e,i,s){for(let r of t){let o=r.from+(r.openStart?25:0),l=r.to-(r.openEnd?25:0),a=o<=e&&l>e&&Rr(n,r.tree,0-r.offset,e,l),c;if(a&&a.pos<=i&&(c=Ah(n,r.tree,e+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:c}}return{state:n.streamParser.startState(s?Le(s):4),tree:U.empty}}class Jd{constructor(t,e,i,s){this.lang=t,this.input=e,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=_e.get(),o=s[0].from,{state:l,tree:a}=Gd(t,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);r&&this.parsedPos<r.viewport.from-1e5&&s.some(c=>c.from<=r.viewport.from&&c.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Le(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let t=_e.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+2048);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos<i;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==`
+`;this.styleTag.textContent=o;let l=e.head||e;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var pe={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},vi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Jc=typeof navigator<"u"&&/Mac/.test(navigator.platform),Yc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)pe[48+st]=pe[96+st]=String(st);for(var st=1;st<=24;st++)pe[st+111]="F"+st;for(var st=65;st<=90;st++)pe[st]=String.fromCharCode(st+32),vi[st]=String.fromCharCode(st);for(var Qn in pe)vi.hasOwnProperty(Qn)||(vi[Qn]=pe[Qn]);function Xc(n){var t=Jc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Yc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?vi:pe)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function ki(n){let t;return n.nodeType==11?t=n.getSelection?n:n.ownerDocument:t=n,t.getSelection()}function Rs(n,t){return t?n==t||n.contains(t.nodeType!=1?t.parentNode:t):!1}function cn(n,t){if(!t.anchorNode)return!1;try{return Rs(n,t.anchorNode)}catch{return!1}}function Ge(n){return n.nodeType==3?Be(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bi(n,t,e,i){return e?lo(n,t,e,i,-1)||lo(n,t,e,i,1):!1}function Te(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t}function xn(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function lo(n,t,e,i,s){for(;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Zt(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;t=Te(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[t+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;t=s<0?Zt(n):0}else return!1}}function Zt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Li(n,t){let e=t?n.left:n.right;return{left:e,right:e,top:n.top,bottom:n.bottom}}function _c(n){let t=n.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ea(n,t){let e=t.width/n.offsetWidth,i=t.height/n.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-n.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-n.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function Qc(n,t,e,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,f=!1;h&&!f;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=_c(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(f=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=ea(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(s=="nearest")t.top<u.top?(y=-(u.top-t.top+o),e>0&&t.bottom>u.bottom+y&&(y=t.bottom-u.bottom+y+o)):t.bottom>u.bottom&&(y=t.bottom-u.bottom+o,e<0&&t.top-y<u.top&&(y=-(u.top+y-t.top+o)));else{let x=t.bottom-t.top,S=u.bottom-u.top;y=(s=="center"&&x<=S?t.top+x/2-S/2:s=="start"||s=="center"&&e<0?t.top-o:t.bottom-S+o)-u.top}if(i=="nearest"?t.left<u.left?(m=-(u.left-t.left+r),e>0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.left<u.left+m&&(m=-(u.left+m-t.left+r))):m=(i=="center"?t.left+(t.right-t.left)/2-(u.right-u.left)/2:i=="start"==l?t.left-r:t.right-(u.right-u.left)+r)-u.left,m||y)if(d)c.scrollBy(m,y);else{let x=0,S=0;if(y){let v=h.scrollTop;h.scrollTop+=y/g,S=(h.scrollTop-v)*g}if(m){let v=h.scrollLeft;h.scrollLeft+=m/p,x=(h.scrollLeft-v)*p}t={left:t.left-x,top:t.top-S,right:t.right-x,bottom:t.bottom-S},x&&Math.abs(x-m)<1&&(i="nearest"),S&&Math.abs(S-y)<1&&(s="nearest")}if(d)break;h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Zc(n){let t=n.ownerDocument,e,i;for(let s=n.parentNode;s&&!(s==t.body||e&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),!e&&s.scrollWidth>s.clientWidth&&(e=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:e,y:i}}class tf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Zt(e):0),i,Math.min(t.focusOffset,i?Zt(i):0))}set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s}}let Fe=null;function ia(n){if(n.setActive)return n.setActive();if(Fe)return n.focus(Fe);let t=[];for(let e=n;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(n.focus(Fe==null?{get preventScroll(){return Fe={preventScroll:!0},!0}}:void 0),!Fe){Fe=!1;for(let e=0;e<t.length;){let i=t[e++],s=t[e++],r=t[e++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let ao;function Be(n,t,e=t){let i=ao||(ao=document.createRange());return i.setEnd(n,e),i.setStart(n,t),i}function qe(n,t,e,i){let s={key:t,code:t,keyCode:e,which:e,cancelable:!0};i&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=i);let r=new KeyboardEvent("keydown",s);r.synthetic=!0,n.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,n.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function ef(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function na(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function nf(n,t){let e=t.focusNode,i=t.focusOffset;if(!e||t.anchorNode!=e||t.anchorOffset!=i)return!1;for(i=Math.min(i,Zt(e));;)if(i){if(e.nodeType!=1)return!1;let s=e.childNodes[i-1];s.contentEditable=="false"?i--:(e=s,i=Zt(e))}else{if(e==n)return!0;i=Te(e),e=e.parentNode}}function sa(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function ra(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=Zt(e)}else if(e.parentNode&&!xn(e))i=Te(e),e=e.parentNode;else return null}}function oa(n,t){for(let e=n,i=t;;){if(e.nodeType==3&&i<e.nodeValue.length)return{node:e,offset:i};if(e.nodeType==1&&i<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[i],i=0}else if(e.parentNode&&!xn(e))i=Te(e)+1,e=e.parentNode;else return null}}class ht{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new ht(t.parentNode,Te(t),e)}static after(t,e){return new ht(t.parentNode,Te(t)+1,e)}}const mr=[];class ${constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=$.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(t,e),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&r!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=ho(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&e&&e.node==i&&(e.written=!0);r;)r=ho(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let s=Zt(t)==0?0:e==0?-1:1;for(;;){let r=t.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(t==r.firstChild?s=-1:s=1),t=r}s<0?i=t:i=t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!$.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(t,e,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,h=i;a<this.children.length;a++){let f=this.children[a],u=c+f.length;if(c<t&&u>e)return f.domBoundsAround(t,e,c);if(u>=t&&s==-1&&(s=a,r=c),c>e&&f.dom.parentNode==this.dom){o=a,l=h;break}h=u,c=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=mr){this.markDirty();for(let s=t;s<e;s++){let r=this.children[s];r.parent==this&&i.indexOf(r)<0&&r.destroy()}i.length<250?this.children.splice(t,e-t,...i):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(let s=0;s<i.length;s++)i[s].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new la(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,s,r,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!((this.flags|t.flags)&8)}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}$.prototype.breakAfter=0;function ho(n){let t=n.nextSibling;return n.parentNode.removeChild(n),t}class la{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function aa(n,t,e,i,s,r,o,l,a){let{children:c}=n,h=c.length?c[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&h&&!o&&!u&&r.length<2&&h.merge(e,s,r.length?f:null,e==0,l,a))){if(i<c.length){let d=c[i];d&&(s<d.length||d.breakAfter&&(f!=null&&f.breakAfter))?(t==i&&(d=d.split(s),s=0),!u&&f&&d.merge(0,s,f,!0,0,a)?r[r.length-1]=d:((s||d.children.length&&!d.children[0].length)&&d.merge(0,s,null,!1,0,a),r.push(d))):d!=null&&d.breakAfter&&(f?f.breakAfter=1:o=1),i++}for(h&&(h.breakAfter=o,e>0&&(!o&&r.length&&h.merge(e,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(e<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(e,h.length,null,!1,l,0),t++));t<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[t].become(r[0]))t++,r.shift(),l=r.length?0:a;else break;!r.length&&t&&i<c.length&&!c[t-1].breakAfter&&c[i].merge(0,0,c[t-1],!1,l,a)&&t--,(t<i||r.length)&&n.replaceChildren(t,i,r)}}function ha(n,t,e,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(e,1),{i:c,off:h}=o.findPos(t,-1),f=t-e;for(let u of i)f+=u.length;n.length+=f,aa(n,c,h,l,a,i,0,s,r)}let bt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ls=typeof document<"u"?document:{documentElement:{style:{}}};const Es=/Edge\/(\d+)/.exec(bt.userAgent),ca=/MSIE \d/.test(bt.userAgent),Is=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bt.userAgent),Wn=!!(ca||Is||Es),co=!Wn&&/gecko\/(\d+)/i.test(bt.userAgent),Zn=!Wn&&/Chrome\/(\d+)/.exec(bt.userAgent),fo="webkitFontSmoothing"in Ls.documentElement.style,fa=!Wn&&/Apple Computer/.test(bt.vendor),uo=fa&&(/Mobile\/\w+/.test(bt.userAgent)||bt.maxTouchPoints>2);var D={mac:uo||/Mac/.test(bt.platform),windows:/Win/.test(bt.platform),linux:/Linux|X11/.test(bt.platform),ie:Wn,ie_version:ca?Ls.documentMode||6:Is?+Is[1]:Es?+Es[1]:0,gecko:co,gecko_version:co?+(/Firefox\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,chrome:!!Zn,chrome_version:Zn?+Zn[1]:0,ios:uo,android:/Android\b/.test(bt.userAgent),webkit:fo,safari:fa,webkit_version:fo?+(/\bAppleWebKit\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,tabSize:Ls.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const sf=256;class Ft extends ${constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof Ft)||this.length-(e-t)+i.length>sf||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Ft(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new ht(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return rf(this.dom,t,e)}}class re extends ${constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let s of e)s.setParent(this)}setAttrs(t){if(na(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,s,r,o){return i&&(!(i instanceof re&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&o<=0)?!1:(ha(this,t,e,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(t){let e=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>t&&e.push(i<t?l.split(t-i):l),s<0&&i>=t&&(s=r),i=a,r++}let o=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new re(this.mark,e,o)}domAtPos(t){return ua(this,t)}coordsAt(t,e){return pa(this,t,e)}}function rf(n,t,e){let i=n.nodeValue.length;t>i&&(t=i);let s=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?D.chrome||D.gecko||(t?(s--,o=1):r<i&&(r++,o=-1)):e<0?s--:r<i&&r++;let l=Be(n,s,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:e>=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Li(a,o<0):a||null}class ke extends ${static create(t,e,i){return new ke(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=ke.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,s,r,o){return i&&(!(i instanceof ke)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof ke&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(this.length==0)return F.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):F.empty}domAtPos(t){return(this.length?t==0:this.side>0)?ht.before(this.dom):ht.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?s.length-1:0;r=s[l],!(t>0?l==0:l==s.length-1||r.top<r.bottom);l+=o?-1:1);return Li(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Je extends ${constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof Je&&t.side==this.side}split(){return new Je(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?ht.before(this.dom):ht.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Ft.prototype.children=ke.prototype.children=Je.prototype.children=mr;function ua(n,t){let e=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(t>r&&t<l&&o.dom.parentNode==e)return o.domAtPos(t-r);if(t<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==e)return o.domAtPos(0)}return new ht(e,0)}function da(n,t,e){let i,{children:s}=n;e>0&&t instanceof re&&s.length&&(i=s[s.length-1])instanceof re&&i.mark.eq(t.mark)?da(i,t.children[0],e-1):(s.push(t),t.setParent(n)),n.length+=t.length}function pa(n,t,e){let i=null,s=-1,r=null,o=-1;function l(c,h){for(let f=0,u=0;f<c.children.length&&u<=h;f++){let d=c.children[f],p=u+d.length;p>=h&&(d.children.length?l(d,h-u):(!r||r.isHidden&&e>0)&&(p>h||u==p&&d.getSide()>0)?(r=d,o=h-u):(u<h||u==p&&d.getSide()<0&&!d.isHidden)&&(i=d,s=h-u)),u=p}}l(n,t);let a=(e<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?s:o),e):of(n)}function of(n){let t=n.dom.lastChild;if(!t)return n.dom.getBoundingClientRect();let e=Ge(t);return e[e.length-1]||null}function Ns(n,t){for(let e in n)e=="class"&&t.class?t.class+=" "+n.class:e=="style"&&t.style?t.style+=";"+n.style:t[e]=n[e];return t}const po=Object.create(null);function wn(n,t,e){if(n==t)return!0;n||(n=po),t||(t=po);let i=Object.keys(n),s=Object.keys(t);if(i.length-(e&&i.indexOf(e)>-1?1:0)!=s.length-(e&&s.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(s.indexOf(r)==-1||n[r]!==t[r]))return!1;return!0}function Fs(n,t,e){let i=!1;if(t)for(let s in t)e&&s in e||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(e)for(let s in e)t&&t[s]==e[s]||(i=!0,s=="style"?n.style.cssText=e[s]:n.setAttribute(s,e[s]));return i}function lf(n){let t=Object.create(null);for(let e=0;e<n.attributes.length;e++){let i=n.attributes[e];t[i.name]=i.value}return t}class Ie{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Mt=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Mt||(Mt={}));class P extends De{constructor(t,e,i,s){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(t){return new Ei(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new ge(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=ga(t,e);i=(r?e?-3e8:-1:5e8)-1,s=(o?e?2e8:1:-6e8)+1}return new ge(t,i,s,e,t.widget||null,!0)}static line(t){return new Ii(t)}static set(t,e=!1){return K.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=K.empty;class Ei extends P{constructor(t){let{start:e,end:i}=ga(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Ei&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&wn(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Ei.prototype.point=!1;class Ii extends P{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Ii&&this.spec.class==t.spec.class&&wn(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Ii.prototype.mapMode=at.TrackBefore;Ii.prototype.point=!0;class ge extends P{constructor(t,e,i,s,r,o){super(e,i,r,t),this.block=s,this.isReplace=o,this.mapMode=s?e<=0?at.TrackBefore:at.TrackAfter:at.TrackDel}get type(){return this.startSide!=this.endSide?Mt.WidgetRange:this.startSide<=0?Mt.WidgetBefore:Mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ge&&af(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ge.prototype.point=!0;function ga(n,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=n;return e==null&&(e=n.inclusive),i==null&&(i=n.inclusive),{start:e??t,end:i??t}}function af(n,t){return n==t||!!(n&&t&&n.compare(t))}function fn(n,t,e,i=0){let s=e.length-1;s>=0&&e[s]+i>=n?e[s]=Math.max(e[s],t):e.push(n,t)}class Q extends ${constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,s,r,o){if(i){if(!(i instanceof Q))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),ha(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Q;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:s}=this.childPos(t);s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)e.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){wn(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){da(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Ns(e,this.attrs||{})),i&&(this.attrs=Ns({class:i},this.attrs||{}))}domAtPos(t){return ua(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(na(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Fs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let s=this.dom.lastChild;for(;s&&$.get(s)instanceof re;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=$.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof Ft))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Ft)||/[^ -~]/.test(i.text))return null;let s=Ge(i.dom);if(s.length!=1)return null;t+=s[0].width,e=s[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=pa(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight<r){let o=(r-s.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(t){return t instanceof Q&&this.children.length==0&&t.children.length==0&&wn(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let i=0,s=0;i<t.children.length;i++){let r=t.children[i],o=s+r.length;if(o>=e){if(r instanceof Q)return r;if(o>e)break}s=o+r.breakAfter}return null}}class ne extends ${constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,s,r,o){return i&&(!(i instanceof ne)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return t==0?ht.before(this.dom):ht.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new ne(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return mr}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):F.empty}domBoundsAround(){return null}become(t){return t instanceof ne&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof Vs?null:Li(this.dom.getBoundingClientRect(),this.length?t==0:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e==i?!1:t<0?e<0:i>0}}class Vs extends Ie{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class xi{constructor(t,e,i,s){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof ne&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Q),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ki(new Je(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof ne)&&this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(Ki(new Ft(this.text.slice(this.textOff,this.textOff+s)),e),i),this.atCursorPos=!0,this.textOff+=s,t-=s,i=0}}span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s)}point(t,e,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ge){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ge)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ne(i.widget||Ye.block,l,i));else{let a=ke.create(i.widget||Ye.inline,l,l?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(t<e||i.startSide>0),h=!a.isEditable&&(t<e||r>s.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(f.append(Ki(new Je(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ki(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?t<e||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,s,r){let o=new xi(t,e,i,r);return o.openEnd=K.spans(s,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ki(n,t){for(let e of t)n=new re(e,[n],n.length);return n}class Ye extends Ie{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ye.inline=new Ye("span");Ye.block=new Ye("div");var X=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(X||(X={}));const Pe=X.LTR,yr=X.RTL;function ma(n){let t=[];for(let e=0;e<n.length;e++)t.push(1<<+n[e]);return t}const hf=ma("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),cf=ma("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Hs=Object.create(null),qt=[];for(let n of["()","[]","{}"]){let t=n.charCodeAt(0),e=n.charCodeAt(1);Hs[t]=e,Hs[e]=-t}function ya(n){return n<=247?hf[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?cf[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const ff=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class fe{get dir(){return this.level%2?yr:Pe}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,s){let r=-1;for(let o=0;o<t.length;o++){let l=t[o];if(l.from<=e&&l.to>=e){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<e:l.to>e:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ba(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++){let i=n[e],s=t[e];if(i.from!=s.from||i.to!=s.to||i.direction!=s.direction||!ba(i.inner,s.inner))return!1}return!0}const q=[];function uf(n,t,e,i,s){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:t,l=r<i.length?i[r].from:e,a=r?256:s;for(let c=o,h=a,f=a;c<l;c++){let u=ya(n.charCodeAt(c));u==512?u=h:u==8&&f==4&&(u=16),q[c]=u==4?2:u,u&7&&(f=u),h=u}for(let c=o,h=a,f=a;c<l;c++){let u=q[c];if(u==128)c<l-1&&h==q[c+1]&&h&24?u=q[c]=h:q[c]=256;else if(u==64){let d=c+1;for(;d<l&&q[d]==64;)d++;let p=c&&h==8||d<e&&q[d]==8?f==1?1:8:256;for(let g=c;g<d;g++)q[g]=p;c=d-1}else u==8&&f==1&&(q[c]=1);h=u,u&7&&(f=u)}}}function df(n,t,e,i,s){let r=s==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:t,h=o<i.length?i[o].from:e;for(let f=c,u,d,p;f<h;f++)if(d=Hs[u=n.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(qt[g+1]==-d){let m=qt[g+2],y=m&2?s:m&4?m&1?r:s:0;y&&(q[f]=q[qt[g]]=y),l=g;break}}else{if(qt.length==189)break;qt[l++]=f,qt[l++]=u,qt[l++]=a}else if((p=q[f])==2||p==1){let g=p==s;a=g?0:1;for(let m=l-3;m>=0;m-=3){let y=qt[m+2];if(y&2)break;if(g)qt[m+2]|=2;else{if(y&4)break;qt[m+2]|=4}}}}}function pf(n,t,e,i){for(let s=0,r=i;s<=e.length;s++){let o=s?e[s-1].to:n,l=s<e.length?e[s].from:t;for(let a=o;a<l;){let c=q[a];if(c==256){let h=a+1;for(;;)if(h==l){if(s==e.length)break;h=e[s++].to,l=s<e.length?e[s].from:t}else if(q[h]==256)h++;else break;let f=r==1,u=(h<t?q[h]:i)==1,d=f==u?f?1:2:i;for(let p=h,g=s,m=g?e[g-1].to:n;p>a;)p==m&&(p=e[--g].from,m=g?e[g-1].to:n),q[--p]=d;a=h}else r=c,a++}}}function Ws(n,t,e,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=t,c=0;a<e;){let h=!0,f=!1;if(c==r.length||a<r[c].from){let g=q[a];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c<r.length&&p==r[c].from){if(f)break t;let g=r[c];if(!h)for(let m=g.to,y=c+1;;){if(m==e)break t;if(y<r.length&&r[y].from==m)m=r[y++].to;else{if(q[m]==l)break t;break}}if(c++,u)u.push(g);else{g.from>a&&o.push(new fe(a,g.from,d));let m=g.direction==Pe!=!(d%2);zs(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(h?q[p]!=l:q[p]==l))break;p++}u?Ws(n,a,p,i+1,s,u,o):a<p&&o.push(new fe(a,p,d)),a=p}else for(let a=e,c=r.length;a>t;){let h=!0,f=!1;if(!c||a>r[c-1].to){let g=q[a-1];g!=l&&(h=!1,f=g==16)}let u=!h&&l==1?[]:null,d=h?i:i+1,p=a;t:for(;;)if(c&&p==r[c-1].to){if(f)break t;let g=r[--c];if(!h)for(let m=g.from,y=c;;){if(m==t)break t;if(y&&r[y-1].to==m)m=r[--y].from;else{if(q[m-1]==l)break t;break}}if(u)u.push(g);else{g.to<a&&o.push(new fe(g.to,a,d));let m=g.direction==Pe!=!(d%2);zs(n,m?i+1:i,s,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==t||(h?q[p-1]!=l:q[p-1]==l))break;p--}u?Ws(n,p,a,i+1,s,u,o):p<a&&o.push(new fe(p,a,d)),a=p}}function zs(n,t,e,i,s,r,o){let l=t%2?2:1;uf(n,s,r,i,l),df(n,s,r,i,l),pf(s,r,i,l),Ws(n,s,r,t,e,i,o)}function gf(n,t,e){if(!n)return[new fe(0,0,t==yr?1:0)];if(t==Pe&&!e.length&&!ff.test(n))return xa(n.length);if(e.length)for(;n.length>q.length;)q[q.length]=256;let i=[],s=t==Pe?0:1;return zs(n,s,s,e,0,n.length,i),i}function xa(n){return[new fe(0,n,0)]}let wa="";function mf(n,t,e,i,s){var r;let o=i.head-n.from,l=fe.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],c=a.side(s,e);if(o==c){let u=l+=s?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!s,e),c=a.side(s,e)}let h=rt(n.text,o,a.forward(s,e));(h<a.from||h>a.to)&&(h=c),wa=n.text.slice(Math.min(o,h),Math.max(o,h));let f=l==(s?t.length-1:0)?null:t[l+(s?1:-1)];return f&&h==c&&f.level+(s?0:1)<a.level?b.cursor(f.side(!s,e)+n.from,f.forward(s,e)?1:-1,f.level):b.cursor(h+n.from,a.forward(s,e)?-1:1,a.level)}function yf(n,t,e){for(let i=t;i<e;i++){let s=ya(n.charCodeAt(i));if(s==1)return Pe;if(s==2||s==4)return yr}return Pe}const Sa=T.define(),va=T.define(),ka=T.define(),Ca=T.define(),qs=T.define(),Aa=T.define(),Ma=T.define(),br=T.define(),xr=T.define(),Da=T.define({combine:n=>n.some(t=>t)}),Oa=T.define({combine:n=>n.some(t=>t)}),Ta=T.define();class Ke{constructor(t,e="nearest",i="nearest",s=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Ke(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Ke(b.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $i=N.define({map:(n,t)=>n.map(t)}),Ba=N.define();function At(n,t,e){let i=n.facet(Ca);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ie=T.define({combine:n=>n.length?n[0]:!0});let bf=0;const fi=T.define();class ft{constructor(t,e,i,s,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=e||{};return new ft(bf++,t,i,s,l=>{let a=[fi.of(l)];return o&&a.push(Ci.of(c=>{let h=c.plugin(l);return h?o(h):P.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return ft.define(i=>new t(i),e)}}class ts{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(At(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){At(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){At(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Pa=T.define(),wr=T.define(),Ci=T.define(),Ra=T.define(),Sr=T.define(),La=T.define();function go(n,t){let e=n.state.facet(La);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(n):r),s=[];return K.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let c=r-t.from,h=o-t.from,f=s;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=yf(t.text,c,h)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=h,f=p.inner;else{let g={from:c,to:h,direction:d,inner:[]};f.push(g),f=g.inner}}}}),s}const Ea=T.define();function vr(n){let t=0,e=0,i=0,s=0;for(let r of n.state.facet(Ea)){let o=r(n);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:t,right:e,top:i,bottom:s}}const ui=T.define();class Et{constructor(t,e,i,s){this.fromA=t,this.toA=e,this.fromB=i,this.toB=s}join(t){return new Et(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(e.length==0)return t;let i=[];for(let s=0,r=0,o=0,l=0;;s++){let a=s==t.length?null:t[s],c=o-l,h=a?a.fromB:1e9;for(;r<e.length&&e[r]<h;){let f=e[r],u=e[r+1],d=Math.max(l,f),p=Math.min(h,u);if(d<=p&&new Et(d+c,p+c,d,p).addToSet(i),u>h)break;r+=2}if(!a)return i;new Et(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Sn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=tt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Et(r,o,l,a))),this.changedRanges=s}static create(t,e,i){return new Sn(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class mo extends ${get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=P.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Q],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Et(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?s=this.domChanged.newSel.head:!Af(t.changes,this.hasComposition)&&!t.selectionSet&&(s=t.state.selection.main.head));let r=s>-1?wf(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Et(c,h,t.changes.mapPos(c,-1),t.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=kf(o,l,t.changes);return i=Et.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof ne&&o.widget instanceof Vs&&r.push(o.dom);s.updateGaps(r)}updateChildren(t,e,i){let s=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(let o=s.length-1;;o--){let l=o>=0?s[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:f}=l,u,d,p,g;if(i&&i.range.fromB<f&&i.range.toB>h){let v=xi.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=xi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=v.breakAtStart,p=v.openStart,g=w.openEnd;let k=this.compositionView(i);w.breakAtStart?k.breakAfter=1:w.content.length&&k.merge(k.length,k.length,w.content[0],!1,w.openStart,0)&&(k.breakAfter=w.content[0].breakAfter,w.content.shift()),v.content.length&&k.merge(0,0,v.content[v.content.length-1],!0,0,v.openEnd)&&v.content.pop(),u=v.content.concat(k).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=xi.build(this.view.state.doc,h,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:y}=r.findPos(c,1),{i:x,off:S}=r.findPos(a,-1);aa(this,x,S,m,y,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(Ba)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new Ft(t.text.nodeValue);e.flags|=8;for(let{deco:s}of t.marks)e=new re(s,[e],e.length);let i=new Q;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=$.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(let r=t.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],e(r>=0?t.marks[r].node:t.text,s)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(ie)||this.dom.tabIndex>-1)&&cn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&xf(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=c=new ht(f,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!bi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!bi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&Cf(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=ki(this.view.root);if(f)if(l.empty){if(D.gecko){let u=Sf(a.node,a.offset);if(u&&u!=3){let d=(u==1?ra:oa)(a.node,a.offset);d&&(a=new ht(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(c.node,c.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),u.setEnd(c.node,c.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ht(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ht(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&bi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=ki(t.root),{anchorNode:s,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Q.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),c=this.coordsAt(e.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let s=t.offset;!i&&s<e.childNodes.length;s++){let r=$.get(e.childNodes[s]);r instanceof Q&&(i=r.domAtPos(0))}for(let s=t.offset-1;!i&&s>=0;s--){let r=$.get(e.childNodes[s]);r instanceof Q&&(i=r.domAtPos(r.length))}return i?new ht(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=$.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let s=this.children[e];if(i<s.length||s instanceof Q)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,s=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,c=a-l.length;if(a<t)break;if(c<=t&&(c<t||l.covers(-1))&&(a>t||l.covers(1))&&(!i||l instanceof Q&&!(i instanceof Q&&e>=0)))i=l,s=c;else if(i&&c==t&&a==t&&l instanceof ne&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=c}return i?i.coordsAt(t-s,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),s=this.children[e];if(!(s instanceof Q))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ft))return null;let r=rt(s.text,i);if(r==i)return null;let o=Be(s.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:s}=t,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==X.LTR;for(let c=0,h=0;h<this.children.length;h++){let f=this.children[h],u=c+f.length;if(u>s)break;if(c>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Ge(p):[];if(g.length){let m=g[g.length-1],y=a?m.right-d.left:d.right-m.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=u)}}}c=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?X.RTL:X.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Q){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Ge(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:s}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new la(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let r=s==e.viewports.length?null:e.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(P.replace({widget:new Vs(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Ci).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,s=this.view.state.facet(Ra).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(K.join(s))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let c=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=c.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let c of this.view.state.facet(Ta))try{if(c(this.view,t.range,t))return!0}catch(h){At(this.view.state,h,"scroll handler")}let{range:e}=t,i=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1),s;if(!i)return;!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=vr(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Qc(this.view.scrollDOM,o,e.head<e.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==X.LTR)}}function xf(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function Ia(n,t){let e=n.observer.selectionRange;if(!e.focusNode)return null;let i=ra(e.focusNode,e.focusOffset),s=oa(e.focusNode,e.focusOffset),r=i||s;if(s&&i&&s.node!=i.node){let l=$.get(s.node);if(!l||l instanceof Ft&&l.text!=s.node.nodeValue)r=s;else if(n.docView.lastCompositionAfterCursor){let a=$.get(i.node);!a||a instanceof Ft&&a.text!=i.node.nodeValue||(r=s)}}if(n.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=t-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function wf(n,t,e){let i=Ia(n,e);if(!i)return null;let{node:s,from:r,to:o}=i,l=s.nodeValue;if(/[\n\r]/.test(l)||n.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc,c=new Et(a.mapPos(r),a.mapPos(o),r,o),h=[];for(let f=s.parentNode;;f=f.parentNode){let u=$.get(f);if(u instanceof re)h.push({node:f,deco:u.mark});else{if(u instanceof Q||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:c,text:s,marks:h,line:f};if(f!=n.contentDOM)h.push({node:f,deco:new Ei({inclusive:!0,attributes:lf(f),tagName:f.tagName.toLowerCase()})});else return null}}}function Sf(n,t){return n.nodeType!=1?0:(t&&n.childNodes[t-1].contentEditable=="false"?1:0)|(t<n.childNodes.length&&n.childNodes[t].contentEditable=="false"?2:0)}let vf=class{constructor(){this.changes=[]}compareRange(t,e){fn(t,e,this.changes)}comparePoint(t,e){fn(t,e,this.changes)}boundChange(t){fn(t,t,this.changes)}};function kf(n,t,e){let i=new vf;return K.compare(n,t,e,i),i.changes}function Cf(n,t){for(let e=n;e&&e!=t;e=e.assignedSlot||e.parentNode)if(e.nodeType==1&&e.contentEditable=="false")return!0;return!1}function Af(n,t){let e=!1;return t&&n.iterChangedRanges((i,s)=>{i<t.to&&s>t.from&&(e=!0)}),e}function Mf(n,t,e=1){let i=n.charCategorizer(t),s=n.doc.lineAt(t),r=t-s.from;if(s.length==0)return b.cursor(t);r==0?e=1:r==s.length&&(e=-1);let o=r,l=r;e<0?o=rt(s.text,r,!1):l=rt(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=rt(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=rt(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return b.range(o+s.from,l+s.from)}function Df(n,t){return t.left>n?t.left-n:Math.max(0,n-t.right)}function Of(n,t){return t.top>n?t.top-n:Math.max(0,n-t.bottom)}function es(n,t){return n.top<t.bottom-1&&n.bottom>t.top+1}function yo(n,t){return t<n.top?{top:t,left:n.left,right:n.right,bottom:n.bottom}:n}function bo(n,t){return t>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:t}:n}function Ks(n,t,e){let i,s,r,o,l=!1,a,c,h,f;for(let p=n.firstChild;p;p=p.nextSibling){let g=Ge(p);for(let m=0;m<g.length;m++){let y=g[m];s&&es(s,y)&&(y=yo(bo(y,s.bottom),s.top));let x=Df(t,y),S=Of(e,y);if(x==0&&S==0)return p.nodeType==3?xo(p,t,e):Ks(p,t,e);if(!i||o>S||o==S&&r>x){i=p,s=y,r=x,o=S;let v=S?e<y.top?-1:1:x?t<y.left?-1:1:0;l=!v||(v>0?m<g.length-1:m>0)}x==0?e>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):e<y.top&&(!f||f.top>y.top)&&(c=p,f=y):h&&es(h,y)?h=bo(h,y.bottom):f&&es(f,y)&&(f=yo(f,y.top))}}if(h&&h.bottom>=e?(i=a,s=h):f&&f.top<=e&&(i=c,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,t));if(i.nodeType==3)return xo(i,u,e);if(l&&i.contentEditable!="false")return Ks(i,u,e);let d=Array.prototype.indexOf.call(n.childNodes,i)+(t>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function xo(n,t,e){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Be(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=t-h.left);let f=(h.top>e?h.top-e:e-h.bottom)-1;if(h.left-1<=t&&h.right+1>=t&&f<r){let u=t>=(h.left+h.right)/2,d=u;if((D.chrome||D.gecko)&&Be(n,l).getBoundingClientRect().left==h.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Na(n,t,e,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:f}=t,u=f-l;if(u<0)return 0;if(u>c)return n.state.doc.length;for(let v=n.viewState.heightOracle.textHeight/2,w=!1;a=n.elementAtHeight(u),a.type!=Mt.Text;)for(;u=i>0?a.bottom+v:a.top-v,!(u>=0&&u<=c);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(d<n.viewport.from)return n.viewport.from==0?0:e?null:wo(n,o,a,h,f);if(d>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:e?null:wo(n,o,a,h,f);let p=n.dom.ownerDocument,g=n.root.elementFromPoint?n.root:p,m=g.elementFromPoint(h,f);m&&!n.contentDOM.contains(m)&&(m=null),m||(h=Math.max(o.left+1,Math.min(o.right-1,h)),m=g.elementFromPoint(h,f),m&&!n.contentDOM.contains(m)&&(m=null));let y,x=-1;if(m&&((s=n.docView.nearest(m))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let v=p.caretPositionFromPoint(h,f);v&&({offsetNode:y,offset:x}=v)}else if(p.caretRangeFromPoint){let v=p.caretRangeFromPoint(h,f);v&&({startContainer:y,startOffset:x}=v,(!n.contentDOM.contains(y)||D.safari&&Tf(y,x,h)||D.chrome&&Bf(y,x,h))&&(y=void 0))}y&&(x=Math.min(Zt(y),x))}if(!y||!n.docView.dom.contains(y)){let v=Q.find(n.docView,d);if(!v)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=Ks(v.dom,h,f))}let S=n.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let v=S.dom.getBoundingClientRect();return t.y<v.top||t.y<=v.bottom&&t.x<=(v.left+v.right)/2?S.posAtStart:S.posAtEnd}else return S.localPosFromDOM(y,x)+S.posAtStart}function wo(n,t,e,i,s){let r=Math.round((i-t.left)*n.defaultCharacterWidth);if(n.lineWrapping&&e.height>n.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-e.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(e.from,e.to);return e.from+Ts(o,r,n.state.tabSize)}function Tf(n,t,e){let i;if(n.nodeType!=3||t!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Be(n,i-1,i).getBoundingClientRect().left>e}function Bf(n,t,e){if(t!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Be(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function $s(n,t){let e=n.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Mt.Text))return i}return e}function Pf(n,t,e,i){let s=$s(n,t.head),r=!i||s.type!=Mt.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(t.assoc<0&&t.head>s.from?t.head-1:t.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:e==(l==X.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,e?-1:1)}return b.cursor(e?s.to:s.from,e?-1:1)}function So(n,t,e,i){let s=n.state.doc.lineAt(t.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=t,a=null;;){let c=mf(s,r,o,l,e),h=wa;if(!c){if(s.number==(e?n.state.doc.lines:1))return l;h=`
+`,s=n.state.doc.line(s.number+(e?1:-1)),r=n.bidiSpans(s),c=n.visualLineSide(s,!e)}if(a){if(!a(h))return l}else{if(!i)return c;a=i(h)}l=c}}function Rf(n,t,e){let i=n.state.charCategorizer(t),s=i(e);return r=>{let o=i(r);return s==J.Space&&(s=o),s==o}}function Lf(n,t,e,i){let s=t.head,r=e?1:-1;if(s==(e?n.state.doc.length:0))return b.cursor(s,t.assoc);let o=t.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s,t.assoc||-1),h=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Na(n,{x:f,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let m=n.docView.coordsForChar(g),y=!m||p<m.top?-1:1;return b.cursor(g,y,void 0,o)}}}function un(n,t,e){for(;;){let i=0;for(let s of n)s.between(t-1,t+1,(r,o,l)=>{if(t>r&&t<o){let a=i||e||(t-r<o-t?-1:1);t=a<0?r:o,i=a}});if(!i)return t}}function is(n,t,e){let i=un(n.state.facet(Sr).map(s=>s(n)),e.from,t.head>e.from?-1:1);return i==e.from?e:b.cursor(i,i<e.from?1:-1)}const di="￿";class Ef{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(H.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=di}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let s=t;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==e)break;let l=$.get(s),a=$.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:xn(s))||xn(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=$.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(If(t,i.node,i.offset)?e:0))}}function If(n,t,e){for(;;){if(!t||e<Zt(t))return!1;if(t==n)return!0;e=Te(t)+1,t=t.parentNode}}class vo{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class Nf{constructor(t,e,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:Hf(t),a=new Ef(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Wf(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Rs(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Rs(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=t.viewport;if((D.ios||D.chrome)&&t.state.selection.main.empty&&a!=c&&(h.from>0||h.to<t.state.doc.length)){let f=Math.min(a,c),u=Math.max(a,c),d=h.from-f,p=h.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==t.state.doc.length)&&(a=0,c=t.state.doc.length)}this.newSel=b.single(c,a)}}}function Fa(n,t){let e,{newSel:i}=t,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=s.from,c=null;(r===8||D.android&&t.text.length<l-o)&&(a=s.to,c="end");let h=Vf(n.state.doc.sliceString(o,l,di),t.text,a-o,c);h&&(D.chrome&&r==13&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==di+di&&h.toB--,e={from:o+h.from,to:o+h.toA,insert:F.of(t.text.slice(h.from,h.toB).split(di))})}else i&&(!n.hasFocus&&n.state.facet(ie)||i.main.eq(s))&&(i=null);if(!e&&!i)return!1;if(!e&&t.typeOver&&!s.empty&&i&&i.main.empty?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,s.to)}:e&&e.from>=s.from&&e.to<=s.to&&(e.from!=s.from||e.to!=s.to)&&s.to-s.from-(e.to-e.from)<=4?e={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,e.from).append(e.insert).append(n.state.doc.slice(e.to,s.to))}:(D.mac||D.android)&&e&&e.from==e.to&&e.from==s.head-1&&/^\. ?$/.test(e.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}):D.chrome&&e&&e.from==e.to&&e.from==s.head&&e.insert.toString()==`
+ `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),e={from:s.from,to:s.to,insert:F.of([" "])}),e)return kr(n,e,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function kr(n,t,e,i=-1){if(D.ios&&n.inputState.flushIOSKey(t))return!0;let s=n.state.selection.main;if(D.android&&(t.to==s.to&&(t.from==s.from||t.from==s.from-1&&n.state.sliceDoc(t.from,s.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&qe(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||i==8&&t.insert.length<t.to-t.from&&t.to>s.head)&&qe(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&qe(n.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Ff(n,t,e));return n.state.facet(Aa).some(a=>a(n,t.from,t.to,r,l))||n.dispatch(l()),!0}function Ff(n,t,e){let i,s=n.state,r=s.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let l=r.from<t.from?s.sliceDoc(r.from,t.from):"",a=r.to>t.to?s.sliceDoc(t.to,r.to):"";i=s.replaceSelection(n.state.toText(l+t.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let c=n.state.sliceDoc(t.from,t.to),h,f=e&&Ia(n,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);h={from:f.from,to:f.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-c.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:m,to:g,insert:t.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vf(n,t,e,i){let s=Math.min(n.length,t.length),r=0;for(;r<s&&n.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==s&&n.length==t.length)return null;let o=n.length,l=t.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o<r&&n.length<t.length){let a=e<=r&&e>=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=e<=r&&e>=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Hf(n){let t=[];if(n.root.activeElement!=n.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return e&&(t.push(new vo(e,i)),(s!=e||r!=i)&&t.push(new vo(s,r))),t}function Wf(n,t){if(n.length==0)return null;let e=n[0].pos,i=n.length==2?n[1].pos:e;return e>-1&&i>-1?b.single(e+t,i+t):null}class zf{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,D.safari&&t.contentDOM.addEventListener("input",()=>null),D.gecko&&nu(t.contentDOM.ownerDocument)}handleEvent(t){!Yf(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let s of i.observers)s(this.view,e);for(let s of i.handlers){if(e.defaultPrevented)break;if(s(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=qf(t),i=this.handlers,s=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&Ha.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return D.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Va.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||Kf.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,qe(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0))}ignoreDuringComposition(t){return/^key/.test(t.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ko(n,t){return(e,i)=>{try{return t.call(n,i,e)}catch(s){At(e.state,s)}}}function qf(n){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&e(r).handlers.push(ko(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&e(r).observers.push(ko(i.value,o))}}for(let i in Vt)e(i).handlers.push(Vt[i]);for(let i in It)e(i).observers.push(It[i]);return t}const Va=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Kf="dthko",Ha=[16,17,18,20,91,92,224,225],ji=6;function Ui(n){return Math.max(0,n)*.7+8}function $f(n,t){return Math.max(Math.abs(n.clientX-t.clientX),Math.abs(n.clientY-t.clientY))}class jf{constructor(t,e,i,s){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=Zc(t.contentDOM),this.atoms=t.state.facet(Sr).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(H.allowMultipleSelections)&&Uf(t,e),this.dragging=Jf(t,e)&&qa(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&$f(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=vr(this.view);t.clientX-a.left<=s+ji?e=-Ui(s-t.clientX):t.clientX+a.right>=o-ji&&(e=Ui(t.clientX-o)),t.clientY-a.top<=r+ji?i=-Ui(r-t.clientY):t.clientY+a.bottom>=l-ji&&(i=Ui(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;i<t.ranges.length;i++){let s=t.ranges[i],r=null;if(s.empty){let o=un(this.atoms,s.from,0);o!=s.from&&(r=b.cursor(o,-1))}else{let o=un(this.atoms,s.from,-1),l=un(this.atoms,s.to,1);(o!=s.from||l!=s.to)&&(r=b.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(e||(e=t.ranges.slice()),e[i]=r)}return e?b.create(e,t.mainIndex):t}select(t){let{view:e}=this,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(e.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Uf(n,t){let e=n.state.facet(Sa);return e.length?e[0](t):D.mac?t.metaKey:t.ctrlKey}function Gf(n,t){let e=n.state.facet(va);return e.length?e[0](t):D.mac?!t.altKey:!t.ctrlKey}function Jf(n,t){let{main:e}=n.state.selection;if(e.empty)return!1;let i=ki(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=t.clientX&&o.right>=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function Yf(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=n.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=$.get(e))&&i.ignoreEvent(t))return!1;return!0}const Vt=Object.create(null),It=Object.create(null),Wa=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Xf(n){let t=n.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{n.focus(),e.remove(),za(n,e.value)},50)}function zn(n,t,e){for(let i of n.facet(t))e=i(e,n);return e}function za(n,t){t=zn(n.state,br,t);let{state:e}=n,i,s=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(js!=null&&e.selection.ranges.every(a=>a.empty)&&js==r.toString()){let a=-1;i=e.changeByRange(c=>{let h=e.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let f=e.toText((o?r.line(s++).text:t)+e.lineBreak);return{changes:{from:h.from,insert:f},range:b.cursor(c.from+f.length)}})}else o?i=e.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:b.cursor(a.from+c.length)}}):i=e.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}It.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Vt.keydown=(n,t)=>(n.inputState.setSelectionOrigin("select"),t.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);It.touchstart=(n,t)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};It.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Vt.mousedown=(n,t)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of n.state.facet(ka))if(e=i(n,t),e)break;if(!e&&t.button==0&&(e=Zf(n,t)),e){let i=!n.hasFocus;n.inputState.startMouseSelection(new jf(n,t,e,i)),i&&n.observer.ignore(()=>{ia(n.contentDOM);let r=n.root.activeElement;r&&!r.contains(n.contentDOM)&&r.blur()});let s=n.inputState.mouseSelection;if(s)return s.start(t),s.dragging===!1}return!1};function Co(n,t,e,i){if(i==1)return b.cursor(t,e);if(i==2)return Mf(n.state,t,e);{let s=Q.find(n.docView,t),r=n.state.doc.lineAt(s?s.posAtEnd:t),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,b.range(o,l)}}let Ao=(n,t,e)=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right;function _f(n,t,e,i){let s=Q.find(n.docView,t);if(!s)return 1;let r=t-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Ao(e,i,o))return-1;let l=s.coordsAt(r,1);return l&&Ao(e,i,l)?1:o&&o.bottom>=i?-1:1}function Mo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:_f(n,e,t.clientX,t.clientY)}}const Qf=D.ie&&D.ie_version<=11;let Do=null,Oo=0,To=0;function qa(n){if(!Qf)return n.detail;let t=Do,e=To;return Do=n,To=Date.now(),Oo=!t||e>Date.now()-400&&Math.abs(t.clientX-n.clientX)<2&&Math.abs(t.clientY-n.clientY)<2?(Oo+1)%3:1}function Zf(n,t){let e=Mo(n,t),i=qa(t),s=n.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),s=s.map(r.changes))},get(r,o,l){let a=Mo(n,r),c,h=Co(n,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=Co(n,e.pos,e.bias,i),u=Math.min(f.from,h.from),d=Math.max(f.to,h.to);h=u<h.from?b.range(u,d):b.range(d,u)}return o?s.replaceRange(s.main.extend(h.from,h.to)):l&&i==1&&s.ranges.length>1&&(c=tu(s,a.pos))?c:l?s.addRange(h):b.create([h])}}}function tu(n,t){for(let e=0;e<n.ranges.length;e++){let{from:i,to:s}=n.ranges[e];if(i<=t&&s>=t)return b.create(n.ranges.slice(0,e).concat(n.ranges.slice(e+1)),n.mainIndex==e?0:n.mainIndex-(n.mainIndex>e?1:0))}return null}Vt.dragstart=(n,t)=>{let{selection:{main:e}}=n.state;if(t.target.draggable){let s=n.docView.nearest(t.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=e.to||o<=e.from)&&(e=b.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",zn(n.state,xr,n.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Vt.dragend=n=>(n.inputState.draggedContent=null,!1);function Bo(n,t,e,i){if(e=zn(n.state,br,e),!e)return;let s=n.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&Gf(n,t)?{from:r.from,to:r.to}:null,l={from:s,insert:e},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Vt.drop=(n,t)=>{if(!t.dataTransfer)return!1;if(n.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),s=0,r=()=>{++s==e.length&&Bo(n,t,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<e.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Bo(n,t,i,!0),!0}return!1};Vt.paste=(n,t)=>{if(n.state.readOnly)return!0;n.observer.flush();let e=Wa?null:t.clipboardData;return e?(za(n,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Xf(n),!1)};function eu(n,t){let e=n.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function iu(n){let t=[],e=[],i=!1;for(let s of n.selection.ranges)s.empty||(t.push(n.sliceDoc(s.from,s.to)),e.push(s));if(!t.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(t.push(o.text),e.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:zn(n,xr,t.join(n.lineBreak)),ranges:e,linewise:i}}let js=null;Vt.copy=Vt.cut=(n,t)=>{let{text:e,ranges:i,linewise:s}=iu(n.state);if(!e&&!s)return!1;js=s?e:null,t.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Wa?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(eu(n,e),!1)};const Ka=oe.define();function $a(n,t){let e=[];for(let i of n.facet(Ma)){let s=i(n,t);s&&e.push(s)}return e?n.update({effects:e,annotations:Ka.of(!0)}):null}function ja(n){setTimeout(()=>{let t=n.hasFocus;if(t!=n.inputState.notifiedFocused){let e=$a(n.state,t);e?n.dispatch(e):n.update([])}},10)}It.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ja(n)};It.blur=n=>{n.observer.clearSelectionRange(),ja(n)};It.compositionstart=It.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};It.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,D.chrome&&D.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};It.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Vt.beforeinput=(n,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&n.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=n.posAtDOM(l.startContainer,l.startOffset),c=n.posAtDOM(l.endContainer,l.endOffset);return kr(n,{from:a,to:c,insert:n.state.toText(r)},null),!0}}let s;if(D.chrome&&D.android&&(s=Va.find(r=>r.inputType==t.inputType))&&(n.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return D.ios&&t.inputType=="deleteContentForward"&&n.observer.flushSoon(),D.safari&&t.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>It.compositionend(n,t),20),!1};const Po=new Set;function nu(n){Po.has(n)||(Po.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ro=["pre-wrap","normal","pre-line","break-spaces"];let Xe=!1;function Lo(){Xe=!1}class su{constructor(t){this.lineWrapping=t,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Ro.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let s=t[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(e=!0,this.heightSamples[Math.floor(s*10)]=!0)}return e}refresh(t,e,i,s,r,o){let l=Ro.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class ru{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class Jt{constructor(t,e,i,s,r){this.from=t,this.length=e,this.top=i,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Mt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ge?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Jt(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var G=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(G||(G={}));const dn=.001;class pt{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>dn&&(Xe=!0),this.height=t)}replace(t,e,i){return pt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:f}=s[l],u=r.lineAt(a,G.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=c?u:r.lineAt(c,G.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,G.ByPosNoHeight,i,0,0));h+=u.from-a,a=u.from;let p=Cr.build(i.setDoc(o),t,h,f);r=vn(r,r.replace(a,c,p))}return r.updateHeight(i,0)}static empty(){return new Ct(0,0)}static of(t){if(t.length==1)return t[0];let e=0,i=t.length,s=0,r=0;for(;;)if(e==i)if(s>r*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=t[e++];l&&(s+=l.size)}else{let l=t[--i];l&&(r+=l.size)}let o=0;return t[e-1]==null?(o=1,e--):t[e]==null&&(o=1,i++),new ou(pt.of(t.slice(0,e)),o,pt.of(t.slice(i)))}}function vn(n,t){return n==t?n:(n.constructor!=t.constructor&&(Xe=!0),t)}pt.prototype.size=1;class Ua extends pt{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,s){return new Jt(s,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(t,e,i,s,r,o){t<=r+this.length&&e>=r&&o(this.blockAt(0,i,s,r))}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ct extends Ua{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,s){return new Jt(s,this.length,i,this.height,this.breaks)}replace(t,e,i){let s=i[0];return i.length==1&&(s instanceof Ct||s instanceof nt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof nt?s=new Ct(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pt.of(i)}updateHeight(t,e=0,i=!1,s){return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nt extends pt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,r=s-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(t,e,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,s);if(e.lineWrapping){let c=s+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),h=e.doc.lineAt(c),f=l+h.length*a,u=Math.max(i,t-f/2);return new Jt(h.from,h.length,u,f,0)}else{let c=Math.max(0,Math.min(o-r,Math.floor((t-i)/l))),{from:h,length:f}=e.doc.line(r+c);return new Jt(h,f,i+l*c,l,0)}}lineAt(t,e,i,s,r){if(e==G.ByHeight)return this.blockAt(t,i,s,r);if(e==G.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(t);return new Jt(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),c=i.doc.lineAt(t),h=l+c.length*a,f=c.number-o,u=s+l*f+a*(c.from-r-f);return new Jt(c.from,c.length,Math.max(s,Math.min(u,s+this.height-h)),h,0)}forEachLine(t,e,i,s,r,o){t=Math.max(t,r),e=Math.min(e,r+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,r);for(let h=t,f=s;h<=e;){let u=i.doc.lineAt(h);if(h==t){let p=u.number-l;f+=a*p+c*(t-r-p)}let d=a+c*u.length;o(new Jt(u.from,u.length,f,d,0)),f+=d,h=u.to+1}}replace(t,e,i){let s=this.length-e;if(s>0){let r=i[i.length-1];r instanceof nt?i[i.length-1]=new nt(r.length+s):i.push(null,new nt(s-1))}if(t>0){let r=i[0];r instanceof nt?i[0]=new nt(t+r.length):i.unshift(new nt(t-1),null)}return pt.of(i)}decomposeLeft(t,e){e.push(new nt(t-1),null)}decomposeRight(t,e){e.push(null,new nt(this.length-t-1))}updateHeight(t,e=0,i=!1,s){let r=e+this.length;if(s&&s.from<=e+this.length&&s.more){let o=[],l=Math.max(e,s.from),a=-1;for(s.from>e&&o.push(new nt(s.from-e-1).updateHeight(t,e));l<=r&&s.more;){let h=t.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=dn&&(a=-2);let u=new Ct(h,f);u.outdated=!1,o.push(u),l+=h+1}l<=r&&o.push(null,new nt(r-l).updateHeight(t,l));let c=pt.of(o);return(a<0||Math.abs(c.height-this.height)>=dn||Math.abs(a-this.heightMetrics(t,e).perLine)>=dn)&&(Xe=!0),vn(this,c)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ou extends pt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,s){let r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,s):this.right.blockAt(t,e,r,s+this.left.length+this.break)}lineAt(t,e,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=e==G.ByHeight?t<o:t<l,c=a?this.left.lineAt(t,e,i,s,r):this.right.lineAt(t,e,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=e==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,i,o,l)):this.left.lineAt(l,h,i,s,r).join(c)}forEachLine(t,e,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,s,r,o),e>=a&&this.right.forEachLine(t,e,i,l,a,o);else{let c=this.lineAt(a,G.ByPos,i,s,r);t<c.from&&this.left.forEachLine(t,c.from-1,i,s,r,o),c.to>=t&&c.from<=e&&o(c),e>c.to&&this.right.forEachLine(c.to+1,e,i,l,a,o)}}replace(t,e,i){let s=this.left.length+this.break;if(e<s)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&Eo(r,o-1),e<this.length){let l=r.length;this.decomposeRight(e,r),Eo(r,l)}return pt.of(r)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<s&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?pt.of(this.break?[t,null,e]:[t,e]):(this.left=vn(this.left,t),this.right=vn(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,s){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return s&&s.from<=e+r.length&&s.more?a=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(t,l,i,s):o.updateHeight(t,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Eo(n,t){let e,i;n[t]==null&&(e=n[t-1])instanceof nt&&(i=n[t+1])instanceof nt&&n.splice(t-1,3,new nt(e.length+1+i.length))}const lu=5;class Cr{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ct?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ct(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=e-t;i.block?this.addBlock(new Ua(o,s,i)):(o||r||s>=lu)&&this.addLineDeco(s,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Ct(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new nt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Ct)return t;let e=new Ct(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof Ct)&&!this.isCovered?this.nodes.push(new Ct(0,-1)):(this.writtenTo<this.pos||e==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=t;for(let s of this.nodes)s instanceof Ct&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(t,e,i,s){let r=new Cr(i,t);return K.spans(e,i,s,r,0),r.finish(i)}}function au(n,t,e){let i=new hu;return K.compare(n,t,e,i,0),i.changes}class hu{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,s){(t<e||i&&i.heightRelevant||s&&s.heightRelevant)&&fn(t,e,this.changes,5)}}function cu(n,t){let e=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView||window,r=Math.max(0,e.left),o=Math.min(s.innerWidth,e.right),l=Math.max(0,e.top),a=Math.min(s.innerHeight,e.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let h=c,f=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&f.overflow!="visible"){let u=h.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(c==n.parentNode?s.innerHeight:a,u.bottom)}c=f.position=="absolute"||f.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function fu(n,t){let e=n.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class ns{constructor(t,e,i,s){this.from=t,this.to=e,this.size=i,this.displaySize=s}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let s=t[i],r=e[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(t,e){return P.replace({widget:new uu(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class uu extends Ie{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class Io{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=No,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=X.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(wr).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new su(e),this.stateDeco=t.facet(Ci).filter(i=>typeof i!="function"),this.heightMap=pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(t.doc),[new Et(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);t.push(new Gi(r,o))}}return this.viewports=t.sort((i,s)=>i.from-s.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?No:new Ar(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(pi(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ci).filter(h=>typeof h!="function");let s=t.changedRanges,r=Et.extendWithRanges(s,au(i,this.stateDeco,t?t.changes:tt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Lo(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||Xe)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(c||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Oa)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?X.RTL:X.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:v,scaleY:w}=ea(e,l);(v>.005&&Math.abs(this.scaleX-v)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=v,this.scaleY=w,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,c|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=16);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=sa(t.scrollDOM);let p=(this.printing?fu:cu)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,c|=16),a){let v=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(v)&&(o=!0),o||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:k,textHeight:A}=t.docView.measureTextSize();o=w>0&&s.refresh(r,w,k,A,x/k,v),o&&(t.docView.minWidth=0,c|=16)}g>0&&m>0?h=Math.max(g,m):g<0&&m<0&&(h=Math.min(g,m)),Lo();for(let w of this.viewports){let k=w.from==this.viewport.from?v:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?pt.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new Et(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new ru(w.from,k))}Xe&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Gi(s.lineAt(o-i*1e3,G.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,G.ByHeight,r,0,0).to);if(e){let{head:c}=e.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(c,G.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-h/2:e.y=="start"||e.y=="nearest"&&c<a.from?u=f.top:u=f.bottom-h,a=new Gi(s.lineAt(u-1e3/2,G.ByHeight,r,0,0).from,s.lineAt(u+h+1e3/2,G.ByHeight,r,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),s=e.mapPos(t.to,1);return new Gi(this.heightMap.lineAt(i,G.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,G.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(t==0||s<=o-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r<l+2*1e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let s of t)e.touchesRange(s.from,s.to)||i.push(new ns(e.mapPos(s.from),e.mapPos(s.to),s.size,s.displaySize));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=X.LTR&&!i)return[];let l=[],a=(h,f,u,d)=>{if(f-h<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let y of g)if(y>h&&y<f){a(h,y-10,u,d),a(y+10,f,u,d);return}let m=pu(t,y=>y.from>=u.from&&y.to<=u.to&&Math.abs(y.from-h)<r&&Math.abs(y.to-f)<r&&!g.some(x=>y.from<x&&y.to>x));if(!m){if(f<u.to&&e&&i&&e.visibleRanges.some(S=>S.from<=f&&S.to>=f)){let S=e.moveToLineBoundary(b.cursor(f),!1,!0).head;S>h&&(f=S)}let y=this.gapSize(u,h,f,d),x=i||y<2e6?y:2e6;m=new ns(h,f,y,x)}l.push(m)},c=h=>{if(h.length<o||h.type!=Mt.Text)return;let f=du(h.from,h.to,this.stateDeco);if(f.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let g=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,y;if(u!=null){let x=Yi(f,u),S=((this.visibleBottom-this.visibleTop)/2+g)/h.height;m=x-S,y=x+S}else m=(this.visibleTop-h.top-g)/h.height,y=(this.visibleBottom-h.top+g)/h.height;d=Ji(f,m),p=Ji(f,y)}else{let g=f.total*this.heightOracle.charWidth,m=s*this.heightOracle.charWidth,y=0;if(g>2e6)for(let k of t)k.from>=h.from&&k.from<h.to&&k.size!=k.displaySize&&k.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=k.size-k.displaySize);let x=this.pixelViewport.left+y,S=this.pixelViewport.right+y,v,w;if(u!=null){let k=Yi(f,u),A=((S-x)/2+m)/g;v=k-A,w=k+A}else v=(x-m)/g,w=(S+m)/g;d=Ji(f,v),p=Ji(f,w)}d>h.from&&a(h.from,d,h,f),p<h.to&&a(p,h.to,h,f)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(t,e,i,s){let r=Yi(s,i)-Yi(s,e);return this.heightOracle.lineWrapping?t.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(t){ns.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=P.set(t.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];K.spans(e,this.viewport.from,this.viewport.to,{span(r,o){i.push({from:r,to:o})},point(){}},20);let s=0;if(i.length!=this.visibleRanges.length)s=12;else for(let r=0;r<i.length&&!(s&8);r++){let o=this.visibleRanges[r],l=i[r];(o.from!=l.from||o.to!=l.to)&&(s|=4,t&&t.mapPos(o.from,-1)==l.from&&t.mapPos(o.to,1)==l.to||(s|=8))}return this.visibleRanges=i,s}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||pi(this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||pi(this.heightMap.lineAt(this.scaler.fromDOM(t),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return pi(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Gi{constructor(t,e){this.from=t,this.to=e}}function du(n,t,e){let i=[],s=n,r=0;return K.spans(e,n,t,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<t&&(i.push({from:s,to:t}),r+=t-s),{total:r,ranges:i}}function Ji({total:n,ranges:t},e){if(e<=0)return t[0].from;if(e>=1)return t[t.length-1].to;let i=Math.floor(n*e);for(let s=0;;s++){let{from:r,to:o}=t[s],l=o-r;if(i<=l)return r+i;i-=l}}function Yi(n,t){let e=0;for(let{from:i,to:s}of n.ranges){if(t<=s){e+=t-i;break}e+=s-i}return e/n.total}function pu(n,t){for(let e of n)if(t(e))return e}const No={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class Ar{constructor(t,e,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=e.lineAt(l,G.ByPos,t,0,0).top,h=e.lineAt(a,G.ByPos,t,0,0).bottom;return s+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(e.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(t){for(let e=0,i=0,s=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.top)return s+(t-i)*this.scale;if(t<=r.bottom)return r.domTop+(t-r.top);i=r.bottom,s=r.domBottom}}fromDOM(t){for(let e=0,i=0,s=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.domTop)return i+(t-s)/this.scale;if(t<=r.domBottom)return r.top+(t-r.domTop);i=r.bottom,s=r.domBottom}}eq(t){return t instanceof Ar?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,i)=>e.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function pi(n,t){if(t.scale==1)return n;let e=t.toDOM(n.top),i=t.toDOM(n.bottom);return new Jt(n.from,n.length,e,i-e,Array.isArray(n._content)?n._content.map(s=>pi(s,t)):n._content)}const Xi=T.define({combine:n=>n.join(" ")}),Us=T.define({combine:n=>n.indexOf(!0)>-1}),Gs=de.newName(),Ga=de.newName(),Ja=de.newName(),Ya={"&light":"."+Ga,"&dark":"."+Ja};function Js(n,t,e){return new de(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!e||!e[s])throw new RangeError(`Unsupported selector: ${s}`);return e[s]}):n+" "+i}})}const gu=Js("."+Gs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ya),mu={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ss=D.ie&&D.ie_version<=11;class yu{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new tf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new xu(t),t.state.facet(ie)&&(t.contentDOM.editContext=this.editContext.editContext)),ss&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(ie)?i.root.activeElement!=this.dom:!cn(this.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&s.focusNode&&bi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=ki(t.root);if(!e)return!1;let i=D.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&bu(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let s=cn(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&nf(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(i.nodeType==1)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=e)i.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,mu),ss&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ss&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let s=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&qe(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,s=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),s=this.selectionChanged&&cn(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Nf(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,s=Fa(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Fo(e,t.previousSibling||t.target.previousSibling,-1),s=Fo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ie)!=t.state.facet(ie)&&(t.view.contentDOM.editContext=t.state.facet(ie)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Fo(n,t,e){for(;t;){let i=$.get(t);if(i&&i.parent==n)return i;let s=t.parentNode;t=s!=n.dom?s:e>0?t.nextSibling:t.previousSibling}return null}function Vo(n,t){let e=t.startContainer,i=t.startOffset,s=t.endContainer,r=t.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return bi(o.node,o.offset,s,r)&&([e,i,s,r]=[s,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:r}}function bu(n,t){if(t.getComposedRanges){let s=t.getComposedRanges(n.root)[0];if(s)return Vo(n,s)}let e=null;function i(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),e?Vo(n,e):null}class xu{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:s}=t.state.selection.main,r=this.toEditorPos(i.updateRangeStart),o=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:o,insert:F.of(i.text.split(`
+`))};if(l.from==this.from&&s<this.from?l.from=s:l.to==this.to&&s>this.to&&(l.to=s),!(l.from==l.to&&!l.insert.length)){if(this.pendingContextChange=l,!t.state.readOnly){let a=this.to-this.from+(l.to-l.from+l.insert.length);kr(t,l,b.single(this.toEditorPos(i.selectionStart,a),this.toEditorPos(i.selectionEnd,a)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state))}},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=t.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}e.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),c=this.toEditorPos(r.rangeEnd);if(a<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(P.mark({attributes:{style:h}}).range(a,c))}}}t.dispatch({effects:Ba.of(P.set(s))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=ki(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,c)=>{if(i)return;let h=c.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(c)){s=this.pendingContextChange=null,e+=h,this.to+=h;return}else s=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),c.toString()),this.to+=h}e+=h}),s&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class O{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(s=>s.forEach(r=>i(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=t.root||ef(t.parent)||document,this.viewState=new Io(t.state||H.create(t)),t.scrollTo&&t.scrollTo.is($i)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(fi).map(s=>new ts(s));for(let s of this.plugins)s.update(this);this.observer=new yu(this),this.inputState=new zf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mo(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof Z?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,s,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Ka))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$a(r,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);s=Sn.create(this,r,t),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ke(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($i)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=kn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),e=this.docView.update(s),this.state.facet(ui)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Xi)!=s.state.facet(Xi)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!s.empty)for(let u of this.state.facet(qs))try{u(s)}catch(d){At(this.state,d,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Fa(this,h)&&c.force&&qe(this.contentDOM,c.key,c.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Io(t),this.plugins=t.facet(fi).map(i=>new ts(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new mo(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(fi),i=t.state.facet(fi);if(e!=i){let s=[];for(let r of i){let o=e.indexOf(r);if(o<0)s.push(new ts(r));else{let l=this.plugins[o];l.mustUpdate=t,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=t;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(i){At(this.state,i,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(sa(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(d=>{try{return d.read(this)}catch(p){return At(this.state,p),Ho}}),f=Sn.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(h[d]!=Ho)try{let p=c[d];p.write&&p.write(h[d],this)}catch(p){At(this.state,p)}if(u&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(qs))l(e)}get themeClasses(){return Gs+" "+(this.state.facet(Us)?Ja:Ga)+" "+this.state.facet(Xi)}updateAttrs(){let t=Wo(this,Pa,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ie)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Wo(this,wr,e);let i=this.observer.ignore(()=>{let s=Fs(this.contentDOM,this.contentAttrs,e),r=Fs(this.dom,this.editorAttrs,t);return s||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let s of i.effects)if(s.is(O.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ui);let t=this.state.facet(O.cspNonce);de.mount(this.root,this.styleModules.concat(gu).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key){this.measureRequests[e]=t;return}}this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(e===void 0||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(i=>i.spec==t)||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return is(this,t,So(this,t,e,i))}moveByGroup(t,e){return is(this,t,So(this,t,e,i=>Rf(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return b.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1)}moveToLineBoundary(t,e,i=!0){return Pf(this,t,e,i)}moveVertically(t,e,i){return is(this,t,Lf(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Na(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),r=this.bidiSpans(s),o=r[fe.find(r,t-s.from,-1,e)];return Li(i,o.dir==X.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Da)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>wu)return xa(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||ba(r.isolates,i=go(this,t))))return r.order;i||(i=go(this,t));let s=gf(t.text,e,i);return this.bidiCache.push(new kn(t.from,t.to,e,i,!0,s)),s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||D.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ia(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return $i.of(new Ke(typeof t=="number"?b.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return $i.of(new Ke(b.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ft.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ft.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=de.newName(),s=[Xi.of(i),ui.of(Js(`.${i}`,t))];return e&&e.dark&&s.push(Us.of(!0)),s}static baseTheme(t){return ye.lowest(ui.of(Js("."+Gs,t,Ya)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),s=i&&$.get(i)||$.get(t);return((e=s==null?void 0:s.rootView)===null||e===void 0?void 0:e.view)||null}}O.styleModule=ui;O.inputHandler=Aa;O.clipboardInputFilter=br;O.clipboardOutputFilter=xr;O.scrollHandler=Ta;O.focusChangeEffect=Ma;O.perLineTextDirection=Da;O.exceptionSink=Ca;O.updateListener=qs;O.editable=ie;O.mouseSelectionStyle=ka;O.dragMovesSelection=va;O.clickAddsSelectionRange=Sa;O.decorations=Ci;O.outerDecorations=Ra;O.atomicRanges=Sr;O.bidiIsolatedRanges=La;O.scrollMargins=Ea;O.darkTheme=Us;O.cspNonce=T.define({combine:n=>n.length?n[0]:""});O.contentAttributes=wr;O.editorAttributes=Pa;O.lineWrapping=O.contentAttributes.of({class:"cm-lineWrapping"});O.announce=N.define();const wu=4096,Ho={};class kn{constructor(t,e,i,s,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],s=t.length?t[t.length-1].dir:X.LTR;for(let r=Math.max(0,t.length-10);r<t.length;r++){let o=t[r];o.dir==s&&!e.touchesRange(o.from,o.to)&&i.push(new kn(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function Wo(n,t,e){for(let i=n.state.facet(t),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Ns(o,e)}return e}const Su=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function vu(n,t){const e=n.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<e.length-1;++a){const c=e[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))t=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function _i(n,t,e){return t.altKey&&(n="Alt-"+n),t.ctrlKey&&(n="Ctrl-"+n),t.metaKey&&(n="Meta-"+n),e!==!1&&t.shiftKey&&(n="Shift-"+n),n}const ku=ye.default(O.domEventHandlers({keydown(n,t){return _a(Xa(t.state),n,t,"editor")}})),Mr=T.define({enables:ku}),zo=new WeakMap;function Xa(n){let t=n.facet(Mr),e=zo.get(t);return e||zo.set(t,e=Mu(t.reduce((i,s)=>i.concat(s),[]))),e}function Cu(n,t,e){return _a(Xa(n.state),t,n,e)}let he=null;const Au=4e3;function Mu(n,t=Su){let e=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c,h)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>vu(y,t));for(let y=1;y<p.length;y++){let x=p.slice(0,y).join(" ");s(x,!0),d[x]||(d[x]={preventDefault:!0,stopPropagation:!1,run:[S=>{let v=he={view:S,prefix:x,scope:o};return setTimeout(()=>{he==v&&(he=null)},Au),!0}]})}let g=p.join(" ");s(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),c&&(m.preventDefault=!0),h&&(m.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let h=e[c]||(e[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in h)h[u].run.push(d=>f(d,Ys))}let a=o[t]||o.key;if(a)for(let c of l)r(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let Ys=null;function _a(n,t,e,i){Ys=t;let s=Xc(t),r=yt(s,0),o=Gt(r)==s.length&&s!=" ",l="",a=!1,c=!1,h=!1;he&&he.view==e&&he.scope==i&&(l=he.prefix+" ",Ha.indexOf(t.keyCode)<0&&(c=!0,he=null));let f=new Set,u=m=>{if(m){for(let y of m.run)if(!f.has(y)&&(f.add(y),y(e)))return m.stopPropagation&&(h=!0),!0;m.preventDefault&&(m.stopPropagation&&(h=!0),c=!0)}return!1},d=n[i],p,g;return d&&(u(d[l+_i(s,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(D.windows&&t.ctrlKey&&t.altKey)&&(p=pe[t.keyCode])&&p!=s?(u(d[l+_i(p,t,!0)])||t.shiftKey&&(g=vi[t.keyCode])!=s&&g!=p&&u(d[l+_i(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+_i(s,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),c&&(a=!0),a&&h&&t.stopPropagation(),Ys=null,a}class Ni{constructor(t,e,i,s,r){this.className=t,this.left=e,this.top=i,this.width=s,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Qa(t);return[new Ni(e,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Du(t,e,i)}}function Qa(n){let t=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==X.LTR?t.left:t.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:t.top-n.scrollDOM.scrollTop*n.scaleY}}function qo(n,t,e,i){let s=n.coordsAtPos(t,e*2);if(!s)return i;let r=n.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=n.posAtCoords({x:r.left+1,y:o}),a=n.posAtCoords({x:r.right-1,y:o});return l==null||a==null?i:{from:Math.max(i.from,Math.min(l,a)),to:Math.min(i.to,Math.max(l,a))}}function Du(n,t,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let i=Math.max(e.from,n.viewport.from),s=Math.min(e.to,n.viewport.to),r=n.textDirection==X.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Qa(n),c=o.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),f=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=l.right-(h?parseInt(h.paddingRight):0),d=$s(n,i),p=$s(n,s),g=d.type==Mt.Text?d:null,m=p.type==Mt.Text?p:null;if(g&&(n.lineWrapping||d.widgetLineBreaks)&&(g=qo(n,i,1,g)),m&&(n.lineWrapping||p.widgetLineBreaks)&&(m=qo(n,s,-1,m)),g&&m&&g.from==m.from&&g.to==m.to)return x(S(e.from,e.to,g));{let w=g?S(e.from,null,g):v(d,!1),k=m?S(null,e.to,m):v(p,!0),A=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2<k.top?A.push(y(f,w.bottom,u,k.top)):w.bottom<k.top&&n.elementAtHeight((w.bottom+k.top)/2).type==Mt.Text&&(w.bottom=k.top=(w.bottom+k.top)/2),x(w).concat(A).concat(x(k))}function y(w,k,A,R){return new Ni(t,w-a.left,k-a.top,A-w,R-k)}function x({top:w,bottom:k,horizontal:A}){let R=[];for(let I=0;I<A.length;I+=2)R.push(y(A[I],w,A[I+1],k));return R}function S(w,k,A){let R=1e9,I=-1e9,z=[];function E(V,j,dt,vt,Wt){let it=n.coordsAtPos(V,V==A.to?-2:2),Dt=n.coordsAtPos(dt,dt==A.from?2:-2);!it||!Dt||(R=Math.min(it.top,Dt.top,R),I=Math.max(it.bottom,Dt.bottom,I),Wt==X.LTR?z.push(r&&j?f:it.left,r&&vt?u:Dt.right):z.push(!r&&vt?f:Dt.left,!r&&j?u:it.right))}let B=w??A.from,W=k??A.to;for(let V of n.visibleRanges)if(V.to>B&&V.from<W)for(let j=Math.max(V.from,B),dt=Math.min(V.to,W);;){let vt=n.state.doc.lineAt(j);for(let Wt of n.bidiSpans(vt)){let it=Wt.from+vt.from,Dt=Wt.to+vt.from;if(it>=dt)break;Dt>j&&E(Math.max(it,j),w==null&&it<=B,Math.min(Dt,dt),k==null&&Dt>=W,Wt.dir)}if(j=vt.to+1,j>=dt)break}return z.length==0&&E(B,w==null,W,k==null,n.textDirection),{top:R,bottom:I,horizontal:z}}function v(w,k){let A=l.top+(k?w.top:w.bottom);return{top:A,bottom:A,horizontal:[]}}}function Ou(n,t){return n.constructor==t.constructor&&n.eq(t)}class Tu{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(pn)!=t.state.facet(pn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(pn);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;(t!=this.scaleX||e!=this.scaleY)&&(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((e,i)=>!Ou(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let s of t)s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(s.draw(),e);for(;e;){let s=e.nextSibling;e.remove(),e=s}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const pn=T.define();function Za(n){return[ft.define(t=>new Tu(t,n)),pn.of(n)]}const th=!(D.ios&&D.webkit&&D.webkit_version<534),Ai=T.define({combine(n){return Ee(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function Mm(n={}){return[Ai.of(n),Bu,Pu,Ru,Oa.of(!0)]}function eh(n){return n.startState.facet(Ai)!=n.state.facet(Ai)}const Bu=Za({above:!0,markers(n){let{state:t}=n,e=t.facet(Ai),i=[];for(let s of t.selection.ranges){let r=s==t.selection.main;if(s.empty?!r||th:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Ni.forRange(n,o,l))i.push(a)}}return i},update(n,t){n.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=eh(n);return e&&Ko(n.state,t),n.docChanged||n.selectionSet||e},mount(n,t){Ko(t.state,n)},class:"cm-cursorLayer"});function Ko(n,t){t.style.animationDuration=n.facet(Ai).cursorBlinkRate+"ms"}const Pu=Za({above:!1,markers(n){return n.state.selection.ranges.map(t=>t.empty?[]:Ni.forRange(n,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(n,t){return n.docChanged||n.selectionSet||n.viewportChanged||eh(n)},class:"cm-selectionLayer"}),Xs={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};th&&(Xs[".cm-line"].caretColor=Xs[".cm-content"].caretColor="transparent !important");const Ru=ye.highest(O.theme(Xs)),ih=N.define({map(n,t){return n==null?null:t.mapPos(n)}}),gi=mt.define({create(){return null},update(n,t){return n!=null&&(n=t.changes.mapPos(n)),t.effects.reduce((e,i)=>i.is(ih)?i.value:e,n)}}),Lu=ft.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var t;let e=n.state.field(gi);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(gi)!=e||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,t=n.state.field(gi),e=t!=null&&n.coordsAtPos(t);if(!e)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:e.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:e.bottom-e.top}}drawCursor(n){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;n?(this.cursor.style.left=n.left/t+"px",this.cursor.style.top=n.top/e+"px",this.cursor.style.height=n.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(gi)!=n&&this.view.dispatch({effects:ih.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Dm(){return[gi,Lu]}function $o(n,t,e,i,s){t.lastIndex=0;for(let r=n.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)s(o+l.index,l)}function Eu(n,t){let e=n.visibleRanges;if(e.length==1&&e[0].from==n.viewport.from&&e[0].to==n.viewport.to)return e;let i=[];for(let{from:s,to:r}of e)s=Math.max(n.state.doc.lineAt(s).from,s-t),r=Math.min(n.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Iu{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=(l,a,c,h)=>s(h,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,h)=>{let f=i(l,a,c);f&&h(c,c+l[0].length,f)};else if(i)this.addMatch=(l,a,c,h)=>h(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new Oe,i=e.add.bind(e);for(let{from:s,to:r}of Eu(t,this.maxLength))$o(t.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>=t.view.viewport.from&&l<=t.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e}updateRange(t,e,i,s){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=t.state.doc.lineAt(o),c=a.to<l?t.state.doc.lineAt(l):a,h=Math.max(r.from,a.from),f=Math.min(r.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){f=l;break}}let u=[],d,p=(g,m,y)=>u.push(y.range(g,m));if(a==c)for(this.regexp.lastIndex=h-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,t,d.index+a.from,p);else $o(t.state.doc,this.regexp,h,f,(g,m)=>this.addMatch(m,t,g,p));e=e.update({filterFrom:h,filterTo:f,filter:(g,m)=>g<h||m>f,add:u})}}return e}}const _s=/x/.unicode!=null?"gu":"g",Nu=new RegExp(`[\0-\b
+--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,_s),Fu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let rs=null;function Vu(){var n;if(rs==null&&typeof document<"u"&&document.body){let t=document.body.style;rs=((n=t.tabSize)!==null&&n!==void 0?n:t.MozTabSize)!=null}return rs||!1}const gn=T.define({combine(n){let t=Ee(n,{render:null,specialChars:Nu,addSpecialChars:null});return(t.replaceTabs=!Vu())&&(t.specialChars=new RegExp("	|"+t.specialChars.source,_s)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,_s)),t}});function Om(n={}){return[gn.of(n),Hu()]}let jo=null;function Hu(){return jo||(jo=ft.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Iu({regexp:n.specialChars,decoration:(t,e,i)=>{let{doc:s}=e.state,r=yt(t[0],0);if(r==9){let o=s.lineAt(i),l=e.state.tabSize,a=ei(o.text,l,i-o.from);return P.replace({widget:new Ku((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new qu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let t=n.state.facet(gn);n.startState.facet(gn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const Wu="•";function zu(n){return n>=32?Wu:n==10?"␤":String.fromCharCode(9216+n)}class qu extends Ie{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=zu(this.code),i=t.state.phrase("Control character")+" "+(Fu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Ku extends Ie{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="	",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}class $u extends Ie{constructor(t){super(),this.content=t}toDOM(t){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(t){let e=t.firstChild?Ge(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),s=Li(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Tm(n){return ft.fromClass(class{constructor(t){this.view=t,this.placeholder=n?P.set([P.widget({widget:new $u(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:t=>t.decorations})}const Qs=2e3;function ju(n,t,e){let i=Math.min(t.line,e.line),s=Math.max(t.line,e.line),r=[];if(t.off>Qs||e.off>Qs||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=s;a++){let c=n.doc.line(a);c.length<=l&&r.push(b.range(c.from+o,c.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=s;a++){let c=n.doc.line(a),h=Ts(c.text,o,n.tabSize,!0);if(h<0)r.push(b.cursor(c.to));else{let f=Ts(c.text,l,n.tabSize);r.push(b.range(c.from+h,c.from+f))}}}return r}function Uu(n,t){let e=n.coordsAtPos(n.viewport.from);return e?Math.round(Math.abs((e.left-t)/n.defaultCharacterWidth)):-1}function Uo(n,t){let e=n.posAtCoords({x:t.clientX,y:t.clientY},!1),i=n.state.doc.lineAt(e),s=e-i.from,r=s>Qs?-1:s==i.length?Uu(n,t.clientX):ei(i.text,n.state.tabSize,e-i.from);return{line:i.number,col:r,off:s}}function Gu(n,t){let e=Uo(n,t),i=n.state.selection;return e?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(e.line).from),o=s.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Uo(n,s);if(!l)return i;let a=ju(n.state,e,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Bm(n){let t=e=>e.altKey&&e.button==0;return O.mouseSelectionStyle.of((e,i)=>t(i)?Gu(e,i):null)}const li="-10000px";class Ju{constructor(t,e,i,s){this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let s=t.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;a<r.length;a++){let c=r[a],h=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let u=this.tooltips[f];u&&u.create==c.create&&(h=f)}if(h<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[h];l&&(l[a]=e[h]),f.update&&f.update(t)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return e&&(l.forEach((a,c)=>e[c]=a),e.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function Yu(n){let{win:t}=n;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const os=T.define({combine:n=>{var t,e,i;return{position:D.ios?"absolute":((t=n.find(s=>s.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=n.find(s=>s.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Yu}}}),Go=new WeakMap,nh=ft.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=n.state.facet(os);this.position=t.position,this.parent=t.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Ju(n,sh,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(n,this.above);t&&this.observeIntersection();let e=t||n.geometryChanged,i=n.state.facet(os);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(n,t){let e=n.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",e.dom.appendChild(s)}return e.dom.style.position=this.position,e.dom.style.top=li,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var n,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,t=1,e=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(D.gecko)e=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==li&&r.style.left=="0px"){let o=r.getBoundingClientRect();e=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(e||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(n=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:t}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),s=vr(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(os).tooltipSpace(this.view),scaleX:n,scaleY:t,makeAbsolute:e}}writeMeasure(n){var t;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:e,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:h}=c,f=n.pos[l],u=n.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(e.top,i.top)||f.top>=Math.min(e.bottom,i.bottom)||f.right<Math.max(e.left,i.left)-.1||f.left>Math.min(e.right,i.right)+.1)){h.style.top=li;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=Go.get(c))!==null&&t!==void 0?t:u.bottom-u.top,y=c.offset||_u,x=this.view.textDirection==X.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-y.x),i.right-g),v=this.above[l];!a.strictSide&&(v?f.top-m-p-y.y<i.top:f.bottom+m+p+y.y>i.bottom)&&v==i.bottom-f.bottom>f.top-i.top&&(v=this.above[l]=!v);let w=(v?f.top-i.top:i.bottom-f.bottom)-p;if(w<m&&c.resize!==!1){if(w<this.view.defaultLineHeight){h.style.top=li;continue}Go.set(c,m),h.style.height=(m=w)/r+"px"}else h.style.height&&(h.style.height="");let k=v?f.top-m-p-y.y:f.bottom+p+y.y,A=S+g;if(c.overlap!==!0)for(let R of o)R.left<A&&R.right>S&&R.top<k+m&&R.bottom>k&&(k=v?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(h.style.top=(k-n.parent.top)/r+"px",Jo(h,(S-n.parent.left)/s)):(h.style.top=k/r+"px",Jo(h,S/s)),d){let R=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=R/s+"px"}c.overlap!==!0&&o.push({left:S,top:k,right:A,bottom:k+m}),h.classList.toggle("cm-tooltip-above",v),h.classList.toggle("cm-tooltip-below",!v),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=li}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Jo(n,t){let e=parseInt(n.style.left,10);(isNaN(e)||Math.abs(t-e)>1)&&(n.style.left=t+"px")}const Xu=O.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),_u={x:0,y:0},sh=T.define({enables:[nh,Xu]});function rh(n,t){let e=n.plugin(nh);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const Yo=T.define({combine(n){let t,e;for(let i of n)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Cn(n,t){let e=n.plugin(oh),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const oh=ft.fromClass(class{constructor(n){this.input=n.state.facet(An),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(n));let t=n.state.facet(Yo);this.top=new Qi(n,!0,t.topContainer),this.bottom=new Qi(n,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(n){let t=n.state.facet(Yo);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Qi(n.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Qi(n.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=n.state.facet(An);if(e!=this.input){let i=e.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),l.push(h)):(h=this.panels[c],h.update&&h.update(n)),s.push(h),(h.top?r:o).push(h)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>O.scrollMargins.of(t=>{let e=t.plugin(n);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Qi{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Xo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Xo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Xo(n){let t=n.nextSibling;return n.remove(),t}const An=T.define({enables:oh});class Re extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Re.prototype.elementClass="";Re.prototype.toDOM=void 0;Re.prototype.mapMode=at.TrackBefore;Re.prototype.startSide=Re.prototype.endSide=-1;Re.prototype.point=!0;const Qu=T.define(),Zu=new class extends Re{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},td=Qu.compute(["selection"],n=>{let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>e&&(e=s,t.push(Zu.range(s)))}return K.of(t)});function Pm(){return td}const ed=1024;let id=0;class Bt{constructor(t,e){this.from=t,this.to=e}}class L{constructor(t={}){this.id=id++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=gt.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}L.closedBy=new L({deserialize:n=>n.split(" ")});L.openedBy=new L({deserialize:n=>n.split(" ")});L.group=new L({deserialize:n=>n.split(" ")});L.isolate=new L({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});L.contextHash=new L({perNode:!0});L.lookAhead=new L({perNode:!0});L.mounted=new L({perNode:!0});class Mi{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[L.mounted.id]}}const nd=Object.create(null);class gt{constructor(t,e,i,s=0){this.name=t,this.props=e,this.id=i,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):nd,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),s=new gt(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return s}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(L.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let s of i.split(" "))e[s]=t[i];return i=>{for(let s=i.prop(L.group),r=-1;r<(s?s.length:0);r++){let o=e[r<0?i.name:s[r]];if(o)return o}}}}gt.none=new gt("",Object.create(null),0,8);class Dr{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let s=null;for(let r of t){let o=r(i);o&&(s||(s=Object.assign({},i.props)),s[o[0].id]=o[1])}e.push(s?new gt(i.name,s,i.id,i.flags):i)}return new Dr(e)}}const Zi=new WeakMap,_o=new WeakMap;var Y;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(Y||(Y={}));class U{constructor(t,e,i,s,r){if(this.type=t,this.children=e,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=Mi.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let s=i.toString();s&&(e&&(e+=","),e+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Mn(this.topNode,t)}cursorAt(t,e=0,i=0){let s=Zi.get(this)||this.topNode,r=new Mn(s);return r.moveTo(t,e),Zi.set(this,r._tree),r}get topNode(){return new ct(this,0,0,null)}resolve(t,e=0){let i=Di(Zi.get(this)||this.topNode,t,e,!1);return Zi.set(this,i),i}resolveInner(t,e=0){let i=Di(_o.get(this)||this.topNode,t,e,!0);return _o.set(this,i),i}resolveStack(t,e=0){return od(this,t,e)}iterate(t){let{enter:e,leave:i,from:s=0,to:r=this.length}=t,o=t.mode||0,l=(o&Y.IncludeAnonymous)>0;for(let a=this.cursor(o|Y.IncludeAnonymous);;){let c=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Br(gt.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,s)=>new U(this.type,e,i,s,this.propValues),t.makeTree||((e,i,s)=>new U(gt.none,e,i,s)))}static build(t){return ld(t)}}U.empty=new U(gt.none,[],[],0);class Or{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Or(this.buffer,this.index)}}class me{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return gt.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],s=this.set.types[e],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,s,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(lh(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let s=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=s[l++],r[a++]=s[l++]-i;let c=r[a++]=s[l++]-i;r[a++]=s[l++]-t,o=Math.max(o,c)}return new me(r,o,this.set)}}function lh(n,t,e,i){switch(n){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Di(n,t,e,i){for(var s;n.from==n.to||(e<1?n.from>=t:n.from>t)||(e>-1?n.to<=t:n.to<t);){let o=!i&&n instanceof ct&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:Y.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof ct&&o.index<0&&((s=l.enter(t,e,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(t,e,r);if(!o)return n;n=o}}class ah{cursor(t=0){return new Mn(this,t)}getChild(t,e=null,i=null){let s=Qo(this,t,e,i);return s.length?s[0]:null}getChildren(t,e=null,i=null){return Qo(this,t,e,i)}resolve(t,e=0){return Di(this,t,e,!1)}resolveInner(t,e=0){return Di(this,t,e,!0)}matchContext(t){return Zs(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let s=e.lastChild;if(!s||s.to!=e.to)break;s.type.isError&&s.from==s.to?(i=e,e=s.prevSibling):e=s}return i}get node(){return this}get next(){return this.parent}}class ct extends ah{constructor(t,e,i,s){super(),this._tree=t,this.from=e,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,s,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=e>0?l.length:-1;t!=c;t+=e){let h=l[t],f=a[t]+o.from;if(lh(s,i,f,f+h.length)){if(h instanceof me){if(r&Y.ExcludeBuffers)continue;let u=h.findChild(0,h.buffer.length,e,i-f,s);if(u>-1)return new Yt(new sd(o,h,t,f),null,u)}else if(r&Y.IncludeAnonymous||!h.type.isAnonymous||Tr(h)){let u;if(!(r&Y.IgnoreMounts)&&(u=Mi.get(h))&&!u.overlay)return new ct(u.tree,f,t,o);let d=new ct(h,f,t,o);return r&Y.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?h.children.length-1:0,e,i,s)}}}if(r&Y.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let s;if(!(i&Y.IgnoreOverlays)&&(s=Mi.get(this._tree))&&s.overlay){let r=t-this.from;for(let{from:o,to:l}of s.overlay)if((e>0?o<=r:o<r)&&(e<0?l>=r:l>r))return new ct(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Qo(n,t,e,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=s.type.is(e),!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(t)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Zs(n,t,e=t.length-1){for(let i=n;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class sd{constructor(t,e,i,s){this.parent=t,this.buffer=e,this.index=i,this.start=s}}class Yt extends ah{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Yt(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Y.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Yt(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Yt(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Yt(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];t.push(i.slice(s,r,o)),e.push(0)}return new U(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hh(n){if(!n.length)return null;let t=0,e=n[0];for(let r=1;r<n.length;r++){let o=n[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof ct&&e.index<0?null:e.parent,s=n.slice();return i?s[t]=i:s.splice(t,1),new rd(s,e)}class rd{constructor(t,e){this.heads=t,this.node=e}get next(){return hh(this.heads)}}function od(n,t,e){let i=n.resolveInner(t,e),s=null;for(let r=i instanceof ct?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[i])).push(o.resolve(t,e)),r=o}else{let o=Mi.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new ct(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(Di(l,t,e,!1))}}return s?hh(s):i}class Mn{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ct)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:s}=this.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0}yield(t){return t?t instanceof ct?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Y.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Y.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Y.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(e.findChild(s,this.index,-1,0,4))}else{let s=e.buffer[this.index+3];if(s<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:s}=this;if(s){if(t>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=s)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Y.IncludeAnonymous||l instanceof me||!l.type.isAnonymous||Tr(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==s){if(s==this.index)return o;e=o,i=r+1;break t}s=this.stack[--r]}for(let s=i;s<this.stack.length;s++)e=new Yt(this.buffer,e,this.stack[s]);return this.bufferNode=new Yt(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let s=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&e&&e(this),s=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,s=!0}}}matchContext(t){if(!this.buffer)return Zs(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let s=t.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return Zs(this._tree,t,s);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[s]&&t[s]!=o.name)return!1;s--}}return!0}}function Tr(n){return n.children.some(t=>t instanceof me||!t.type.isAnonymous||Tr(t))}function ld(n){var t;let{buffer:e,nodeSet:i,maxBufferLength:s=ed,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(e)?new Or(e,e.length):e,a=i.types,c=0,h=0;function f(w,k,A,R,I,z){let{id:E,start:B,end:W,size:V}=l,j=h,dt=c;for(;V<0;)if(l.next(),V==-1){let ee=r[E];A.push(ee),R.push(B-w);return}else if(V==-3){c=E;return}else if(V==-4){h=E;return}else throw new RangeError(`Unrecognized record size: ${V}`);let vt=a[E],Wt,it,Dt=B-w;if(W-B<=s&&(it=m(l.pos-k,I))){let ee=new Uint16Array(it.size-it.skip),Ot=l.pos-it.size,zt=ee.length;for(;l.pos>Ot;)zt=y(it.start,ee,zt);Wt=new me(ee,W-it.start,i),Dt=it.start-w}else{let ee=l.pos-V;l.next();let Ot=[],zt=[],xe=E>=o?E:-1,Ne=0,Wi=W;for(;l.pos>ee;)xe>=0&&l.id==xe&&l.size>=0?(l.end<=Wi-s&&(p(Ot,zt,B,Ne,l.end,Wi,xe,j,dt),Ne=Ot.length,Wi=l.end),l.next()):z>2500?u(B,ee,Ot,zt):f(B,ee,Ot,zt,xe,z+1);if(xe>=0&&Ne>0&&Ne<Ot.length&&p(Ot,zt,B,Ne,B,Wi,xe,j,dt),Ot.reverse(),zt.reverse(),xe>-1&&Ne>0){let Jr=d(vt,dt);Wt=Br(vt,Ot,zt,0,Ot.length,0,W-B,Jr,Jr)}else Wt=g(vt,Ot,zt,W-B,j-W,dt)}A.push(Wt),R.push(Dt)}function u(w,k,A,R){let I=[],z=0,E=-1;for(;l.pos>k;){let{id:B,start:W,end:V,size:j}=l;if(j>4)l.next();else{if(E>-1&&W<E)break;E<0&&(E=V-s),I.push(B,W,V),z++,l.next()}}if(z){let B=new Uint16Array(z*4),W=I[I.length-2];for(let V=I.length-3,j=0;V>=0;V-=3)B[j++]=I[V],B[j++]=I[V+1]-W,B[j++]=I[V+2]-W,B[j++]=j;A.push(new me(B,I[2]-W,i)),R.push(W-w)}}function d(w,k){return(A,R,I)=>{let z=0,E=A.length-1,B,W;if(E>=0&&(B=A[E])instanceof U){if(!E&&B.type==w&&B.length==I)return B;(W=B.prop(L.lookAhead))&&(z=R[E]+B.length+W)}return g(w,A,R,I,z,k)}}function p(w,k,A,R,I,z,E,B,W){let V=[],j=[];for(;w.length>R;)V.push(w.pop()),j.push(k.pop()+A-I);w.push(g(i.types[E],V,j,z-I,B-z,W)),k.push(I-A)}function g(w,k,A,R,I,z,E){if(z){let B=[L.contextHash,z];E=E?[B].concat(E):[B]}if(I>25){let B=[L.lookAhead,I];E=E?[B].concat(E):[B]}return new U(w,k,A,R,E)}function m(w,k){let A=l.fork(),R=0,I=0,z=0,E=A.end-s,B={size:0,start:0,skip:0};t:for(let W=A.pos-w;A.pos>W;){let V=A.size;if(A.id==k&&V>=0){B.size=R,B.start=I,B.skip=z,z+=4,R+=4,A.next();continue}let j=A.pos-V;if(V<0||j<W||A.start<E)break;let dt=A.id>=o?4:0,vt=A.start;for(A.next();A.pos>j;){if(A.size<0)if(A.size==-3)dt+=4;else break t;else A.id>=o&&(dt+=4);A.next()}I=vt,R+=V,z+=dt}return(k<0||R==w)&&(B.size=R,B.start=I,B.skip=z),B.size>4?B:void 0}function y(w,k,A){let{id:R,start:I,end:z,size:E}=l;if(l.next(),E>=0&&R<o){let B=A;if(E>4){let W=l.pos-(E-4);for(;l.pos>W;)A=y(w,k,A)}k[--A]=B,k[--A]=z-w,k[--A]=I-w,k[--A]=R}else E==-3?c=R:E==-4&&(h=R);return A}let x=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,x,S,-1,0);let v=(t=n.length)!==null&&t!==void 0?t:x.length?S[0]+x[0].length:0;return new U(a[n.topID],x.reverse(),S.reverse(),v)}const Zo=new WeakMap;function mn(n,t){if(!n.isAnonymous||t instanceof me||t.type!=n)return 1;let e=Zo.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=n||!(i instanceof U)){e=1;break}e+=mn(n,i)}Zo.set(t,e)}return e}function Br(n,t,e,i,s,r,o,l,a){let c=0;for(let p=i;p<s;p++)c+=mn(n,t[p]);let h=Math.ceil(c*1.5/8),f=[],u=[];function d(p,g,m,y,x){for(let S=m;S<y;){let v=S,w=g[S],k=mn(n,p[S]);for(S++;S<y;S++){let A=mn(n,p[S]);if(k+A>=h)break;k+=A}if(S==v+1){if(k>h){let A=p[v];d(A.children,A.positions,0,A.children.length,g[v]+x);continue}f.push(p[v])}else{let A=g[S-1]+p[S-1].length-w;f.push(Br(n,p,g,v,S,w,A,null,a))}u.push(w+x-r)}}return d(t,e,i,s,0),(l||a)(f,u,o)}class Rm{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let s=this.map.get(t);s||this.map.set(t,s=new Map),s.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Yt?this.setBuffer(t.context.buffer,t.index,e):t instanceof ct&&this.map.set(t.tree,e)}get(t){return t instanceof Yt?this.getBuffer(t.context.buffer,t.index):t instanceof ct?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class se{constructor(t,e,i,s,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let s=[new se(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&s.push(r);return s}static applyChanges(t,e,i=128){if(!e.length)return t;let s=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,c=0;;l++){let h=l<e.length?e[l]:null,f=h?h.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||c){let d=Math.max(u.from,a)-c,p=Math.min(u.to,f)-c;u=d>=p?null:new se(d,p,u.tree,u.offset+c,l>0,!!h)}if(u&&s.push(u),o.to>f)break;o=r<t.length?t[r++]:null}if(!h)break;a=h.toA,c=h.toA-h.toB}return s}}class ch{startParse(t,e,i){return typeof t=="string"&&(t=new ad(t)),i=i?i.length?i.map(s=>new Bt(s.from,s.to)):[new Bt(0,0)]:[new Bt(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let s=this.startParse(t,e,i);for(;;){let r=s.advance();if(r)return r}}}class ad{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function Lm(n){return(t,e,i,s)=>new cd(t,n,e,i,s)}class tl{constructor(t,e,i,s,r){this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r}}function el(n){if(!n.length||n.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class hd{constructor(t,e,i,s,r,o,l){this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const tr=new L({perNode:!0});class cd{constructor(t,e,i,s,r){this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new U(i.type,i.children,i.positions,i.length,i.propValues.concat([[tr,this.stoppedAt]]))),i}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[L.mounted.id]=new Mi(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].from<t&&(t=Math.min(t,this.inner[e].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let e=this.innerDone;e<this.inner.length;e++)this.inner[e].parse.stopAt(t)}startInner(){let t=new dd(this.fragments),e=null,i=null,s=new Mn(new ct(this.baseTree,this.ranges[0].from,0,null),Y.IncludeAnonymous|Y.IgnoreMounts);t:for(let r,o;;){let l=!0,a;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)l=!1;else if(t.hasNode(s)){if(e){let c=e.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let f=h.from+c.pos,u=h.to+c.pos;f>=s.from&&u<=s.to&&!e.ranges.some(d=>d.from<u&&d.to>f)&&e.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=fd(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.from<s.to||!r.overlay)){s.tree||ud(s);let c=t.findMounts(s.from,r.parser);if(typeof r.overlay=="function")e=new hd(r.parser,r.overlay,c,this.inner.length,s.from,s.tree,e);else{let h=sl(this.ranges,r.overlay||(s.from<s.to?[new Bt(s.from,s.to)]:[]));h.length&&el(h),(h.length||!r.overlay)&&this.inner.push(new tl(r.parser,h.length?r.parser.startParse(this.input,rl(c,h),h):r.parser.startParse(""),r.overlay?r.overlay.map(f=>new Bt(f.from-s.from,f.to-s.from)):null,s.tree,h.length?h[0].from:s.from)),r.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):l=!1}}else if(e&&(a=e.predicate(s))&&(a===!0&&(a=new Bt(s.from,s.to)),a.from<a.to)){let c=e.ranges.length-1;c>=0&&e.ranges[c].to==a.from?e.ranges[c]={from:e.ranges[c].from,to:a.to}:e.ranges.push(a)}if(l&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&!--e.depth){let c=sl(this.ranges,e.ranges);c.length&&(el(c),this.inner.splice(e.index,0,new tl(e.parser,e.parser.startParse(this.input,rl(e.mounts,c),c),e.ranges.map(h=>new Bt(h.from-e.start,h.to-e.start)),e.target,c[0].from))),e=e.prev}i&&!--i.depth&&(i=i.prev)}}}}function fd(n,t,e){for(let i of n){if(i.from>=e)break;if(i.to>t)return i.from<=t&&i.to>=e?2:1}return 0}function il(n,t,e,i,s,r){if(t<e){let o=n.buffer[t+1];i.push(n.slice(t,e,o)),s.push(o-r)}}function ud(n){let{node:t}=n,e=[],i=t.context.buffer;do e.push(n.index),n.parent();while(!n.tree);let s=n.tree,r=s.children.indexOf(i),o=s.children[r],l=o.buffer,a=[r];function c(h,f,u,d,p,g){let m=e[g],y=[],x=[];il(o,h,m,y,x,d);let S=l[m+1],v=l[m+2];a.push(y.length);let w=g?c(m+4,l[m+3],o.set.types[l[m]],S,v-S,g-1):t.toTree();return y.push(w),x.push(S-d),il(o,l[m+3],f,y,x,d),new U(u,y,x,p)}s.children[r]=c(0,l.length,gt.none,0,o.length,e.length-1);for(let h of a){let f=n.tree.children[h],u=n.tree.positions[h];n.yield(new ct(f,u+n.from,h,n._tree))}}class nl{constructor(t,e){this.offset=e,this.done=!1,this.cursor=t.cursor(Y.IncludeAnonymous|Y.IgnoreMounts)}moveTo(t){let{cursor:e}=this,i=t-this.offset;for(;!this.done&&e.from<i;)e.to>=t&&e.enter(i,1,Y.IgnoreOverlays|Y.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(e.children.length&&e.positions[0]==0&&e.children[0]instanceof U)e=e.children[0];else break}return!1}}class dd{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=(e=i.tree.prop(tr))!==null&&e!==void 0?e:i.to,this.inner=new nl(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=(t=e.tree.prop(tr))!==null&&t!==void 0?t:e.to,this.inner=new nl(e.tree,-e.offset)}}findMounts(t,e){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(L.mounted);if(o&&o.parser==e)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function sl(n,t){let e=null,i=t;for(let s=1,r=0;s<n.length;s++){let o=n[s-1].to,l=n[s].from;for(;r<i.length;r++){let a=i[r];if(a.from>=l)break;a.to<=o||(e||(i=e=t.slice()),a.from<o?(e[r]=new Bt(a.from,o),a.to>l&&e.splice(r+1,0,new Bt(l,a.to))):a.to>l?e[r--]=new Bt(l,a.to):e.splice(r--,1))}}return i}function pd(n,t,e,i){let s=0,r=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let h=s==n.length?1e9:o?n[s].to:n[s].from,f=r==t.length?1e9:l?t[r].to:t[r].from;if(o!=l){let u=Math.max(a,e),d=Math.min(h,f,i);u<d&&c.push(new Bt(u,d))}if(a=Math.min(h,f),a==1e9)break;h==a&&(o?(o=!1,s++):o=!0),f==a&&(l?(l=!1,r++):l=!0)}return c}function rl(n,t){let e=[];for(let{pos:i,mount:s,frag:r}of n){let o=i+(s.overlay?s.overlay[0].from:0),l=o+s.tree.length,a=Math.max(r.from,o),c=Math.min(r.to,l);if(s.overlay){let h=s.overlay.map(u=>new Bt(u.from+i,u.to+i)),f=pd(t,h,a,c);for(let u=0,d=a;;u++){let p=u==f.length,g=p?c:f[u].from;if(g>d&&e.push(new se(d,g,s.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else e.push(new se(a,c,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return e}let gd=0;class Tt{constructor(t,e,i,s){this.name=t,this.set=e,this.base=i,this.modified=s,this.id=gd++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof Tt&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let s=new Tt(i,[],null,[]);if(s.set.push(s),e)for(let r of e.set)s.set.push(r);return s}static defineModifier(t){let e=new Dn(t);return i=>i.modified.indexOf(e)>-1?i:Dn.get(i.base||i,i.modified.concat(e).sort((s,r)=>s.id-r.id))}}let md=0;class Dn{constructor(t){this.name=t,this.instances=[],this.id=md++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&yd(e,l.modified));if(i)return i;let s=[],r=new Tt(t.name,s,t,e);for(let l of e)l.instances.push(r);let o=bd(e);for(let l of t.set)if(!l.modified.length)for(let a of o)s.push(Dn.get(l,a));return r}}function yd(n,t){return n.length==t.length&&n.every((e,i)=>e==t[i])}function bd(n){let t=[[]];for(let e=0;e<n.length;e++)for(let i=0,s=t.length;i<s;i++)t.push(t[i].concat(n[e]));return t.sort((e,i)=>i.length-e.length)}function xd(n){let t=Object.create(null);for(let e in n){let i=n[e];Array.isArray(i)||(i=[i]);for(let s of e.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let h=new On(i,o,a>0?r.slice(0,a):null);t[c]=h.sort(t[c])}}return fh.add(t)}const fh=new L;class On{constructor(t,e,i,s){this.tags=t,this.mode=e,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}On.empty=new On([],2,null);function uh(n,t){let e=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))e[r.tag.id]=r.class;else for(let o of r.tag)e[o.id]=r.class;let{scope:i,all:s=null}=t||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let c=e[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function wd(n,t){let e=null;for(let i of n){let s=i.style(t);s&&(e=e?e+" "+s:s)}return e}function Sd(n,t,e,i=0,s=n.length){let r=new vd(i,Array.isArray(t)?t:[t],e);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class vd{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,s,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=s,h=kd(t)||On.empty,f=wd(r,h.tags);if(f&&(c&&(c+=" "),c+=f,h.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,l),c),h.opaque)return;let u=t.tree&&t.tree.prop(L.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,y=l;;m++){let x=m<u.overlay.length?u.overlay[m]:null,S=x?x.from+l:a,v=Math.max(e,y),w=Math.min(i,S);if(v<w&&g)for(;t.from<w&&(this.highlightRange(t,v,w,s,r),this.startSpan(Math.min(w,t.to),c),!(t.to>=S||!t.nextSibling())););if(!x||S>i)break;y=x.to+l,y>e&&(this.highlightRange(d.cursor(),Math.max(e,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}g&&t.parent()}else if(t.firstChild()){u&&(s="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),c)}while(t.nextSibling());t.parent()}}}function kd(n){let t=n.type.prop(fh);for(;t&&t.context&&!n.matchContext(t.context);)t=t.next;return t||null}const C=Tt.define,tn=C(),le=C(),ol=C(le),ll=C(le),ae=C(),en=C(ae),ls=C(ae),jt=C(),we=C(jt),Kt=C(),$t=C(),er=C(),ai=C(er),nn=C(),M={comment:tn,lineComment:C(tn),blockComment:C(tn),docComment:C(tn),name:le,variableName:C(le),typeName:ol,tagName:C(ol),propertyName:ll,attributeName:C(ll),className:C(le),labelName:C(le),namespace:C(le),macroName:C(le),literal:ae,string:en,docString:C(en),character:C(en),attributeValue:C(en),number:ls,integer:C(ls),float:C(ls),bool:C(ae),regexp:C(ae),escape:C(ae),color:C(ae),url:C(ae),keyword:Kt,self:C(Kt),null:C(Kt),atom:C(Kt),unit:C(Kt),modifier:C(Kt),operatorKeyword:C(Kt),controlKeyword:C(Kt),definitionKeyword:C(Kt),moduleKeyword:C(Kt),operator:$t,derefOperator:C($t),arithmeticOperator:C($t),logicOperator:C($t),bitwiseOperator:C($t),compareOperator:C($t),updateOperator:C($t),definitionOperator:C($t),typeOperator:C($t),controlOperator:C($t),punctuation:er,separator:C(er),bracket:ai,angleBracket:C(ai),squareBracket:C(ai),paren:C(ai),brace:C(ai),content:jt,heading:we,heading1:C(we),heading2:C(we),heading3:C(we),heading4:C(we),heading5:C(we),heading6:C(we),contentSeparator:C(jt),list:C(jt),quote:C(jt),emphasis:C(jt),strong:C(jt),link:C(jt),monospace:C(jt),strikethrough:C(jt),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:nn,documentMeta:C(nn),annotation:C(nn),processingInstruction:C(nn),definition:Tt.defineModifier("definition"),constant:Tt.defineModifier("constant"),function:Tt.defineModifier("function"),standard:Tt.defineModifier("standard"),local:Tt.defineModifier("local"),special:Tt.defineModifier("special")};for(let n in M){let t=M[n];t instanceof Tt&&(t.name=n)}uh([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var as;const Ce=new L;function dh(n){return T.define({combine:n?t=>t.concat(n):void 0})}const Cd=new L;class Pt{constructor(t,e,i=[],s=""){this.data=t,this.name=s,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return St(this)}}),this.parser=e,this.extension=[Ze.of(this),H.languageData.of((r,o,l)=>{let a=al(r,o,l),c=a.type.prop(Ce);if(!c)return[];let h=r.facet(c),f=a.type.prop(Cd);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(h)}}return h})].concat(i)}isActiveAt(t,e,i=-1){return al(t,e,i).type.prop(Ce)==this.data}findRegions(t){let e=t.facet(Ze);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Ce)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(L.mounted);if(l){if(l.tree.prop(Ce)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let c=r.children[a];c instanceof U&&s(c,r.positions[a]+o)}};return s(St(t),0),i}get allowsNesting(){return!0}}Pt.setState=N.define();function al(n,t,e){let i=n.facet(Ze),s=St(n).topNode;if(!i||i.allowsNesting)for(let r=s;r;r=r.enter(t,e,Y.ExcludeBuffers))r.type.isTop&&(s=r);return s}class ir extends Pt{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=dh(t.languageData);return new ir(e,t.parser.configure({props:[Ce.add(i=>i.isTop?e:void 0)]}),t.name)}configure(t,e){return new ir(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function St(n){let t=n.field(Pt.state,!1);return t?t.tree:U.empty}class Ad{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let hi=null;class _e{constructor(t,e,i=[],s,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new _e(t,e,[],U.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ad(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=U.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let s=Date.now()+t;t=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(se.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(se.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=hi;hi=this;try{return t()}finally{hi=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=hl(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((c,h,f,u)=>a.push({fromA:c,toA:h,fromB:f,toB:u})),i=se.applyChanges(i,a),s=U.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let h=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);h<f&&l.push({from:h,to:f})}}}return new _e(this.parser,e,i,s,r,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:r}=this.skipped[i];s<t.to&&r>t.from&&(this.fragments=hl(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends ch{createParse(e,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=hi;if(a){for(let c of s)a.tempSkipped.push(c);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new U(gt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return hi}}function hl(n,t,e){return se.applyChanges(n,[{fromA:t,toA:e,fromB:t,toB:e}])}class Qe{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Qe(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=_e.create(t.facet(Ze).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Qe(i)}}Pt.state=mt.define({create:Qe.init,update(n,t){for(let e of t.effects)if(e.is(Pt.setState))return e.value;return t.startState.facet(Ze)!=t.state.facet(Ze)?Qe.init(t.state):n.apply(t)}});let ph=n=>{let t=setTimeout(()=>n(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(ph=n=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(n,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const hs=typeof navigator<"u"&&(!((as=navigator.scheduling)===null||as===void 0)&&as.isInputPending)?()=>navigator.scheduling.isInputPending():null,Md=ft.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Pt.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Pt.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=ph(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,r=i.field(Pt.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!hs?Math.max(25,t.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>hs&&hs()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Pt.setState.of(new Qe(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>At(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ze=T.define({combine(n){return n.length?n[0]:null},enables:n=>[Pt.state,Md,O.contentAttributes.compute([n],t=>{let e=t.facet(n);return e&&e.name?{"data-language":e.name}:{}})]});class Im{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const Dd=T.define(),qn=T.define({combine:n=>{if(!n.length)return"  ";let t=n[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return t}});function Le(n){let t=n.facet(qn);return t.charCodeAt(0)==9?n.tabSize*t.length:t.length}function Tn(n,t){let e="",i=n.tabSize,s=n.facet(qn)[0];if(s=="	"){for(;t>=i;)e+="	",t-=i;s=" "}for(let r=0;r<t;r++)e+=s;return e}function gh(n,t){n instanceof H&&(n=new Kn(n));for(let i of n.state.facet(Dd)){let s=i(n,t);if(s!==void 0)return s}let e=St(n.state);return e.length>=t?Od(n,e,t):null}class Kn{constructor(t,e={}){this.state=t,this.options=e,this.unit=Le(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(t,e);return i.slice(t-s,Math.min(i.length,t+100-s))}column(t,e=1){let{text:i,from:s}=this.lineAt(t,e),r=this.countColumn(i,t-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return ei(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:s}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const mh=new L;function Od(n,t,e){let i=t.resolveStack(e),s=t.resolveInner(e,-1).resolve(e,0).enterUnfinishedNodesBefore(e);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return yh(i,n,e)}function yh(n,t,e){for(let i=n;i;i=i.next){let s=Bd(i.node);if(s)return s(Pr.create(t,e,i))}return 0}function Td(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Bd(n){let t=n.type.prop(mh);if(t)return t;let e=n.firstChild,i;if(e&&(i=e.type.prop(L.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>bh(o,!0,1,void 0,r&&!Td(o)?s.from:void 0)}return n.parent==null?Pd:null}function Pd(){return 0}class Pr extends Kn{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Pr(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Rd(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return yh(this.context.next,this.base,this.pos)}}function Rd(n,t){for(let e=t;e;e=e.parent)if(n==e)return!0;return!1}function Ld(n){let t=n.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(e.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+c}}l=a.to}}function Nm({closing:n,align:t=!0,units:e=1}){return i=>bh(i,t,e,n)}function bh(n,t,e,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=t?Ld(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*e)}const Fm=n=>n.baseIndent;function Vm({except:n,units:t=1}={}){return e=>{let i=n&&n.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const Hm=new L;function Wm(n){let t=n.firstChild,e=n.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?n.to:e.from}:null}class $n{constructor(t,e){this.specs=t;let i;function s(l){let a=de.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof e.all=="string"?e.all:e.all?s(e.all):void 0,o=e.scope;this.scope=o instanceof Pt?l=>l.prop(Ce)==o.data:o?l=>l==o:void 0,this.style=uh(t.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new de(i):null,this.themeType=e.themeType}static define(t,e){return new $n(t,e||{})}}const nr=T.define(),xh=T.define({combine(n){return n.length?[n[0]]:null}});function cs(n){let t=n.facet(nr);return t.length?t:n.facet(xh)}function zm(n,t){let e=[Id],i;return n instanceof $n&&(n.module&&e.push(O.styleModule.of(n.module)),i=n.themeType),t!=null&&t.fallback?e.push(xh.of(n)):i?e.push(nr.computeN([O.darkTheme],s=>s.facet(O.darkTheme)==(i=="dark")?[n]:[])):e.push(nr.of(n)),e}class Ed{constructor(t){this.markCache=Object.create(null),this.tree=St(t.state),this.decorations=this.buildDeco(t,cs(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=St(t.state),i=cs(t.state),s=i!=cs(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!s&&e.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return P.none;let i=new Oe;for(let{from:s,to:r}of t.visibleRanges)Sd(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},s,r);return i.finish()}}const Id=ye.high(ft.fromClass(Ed,{decorations:n=>n.decorations})),qm=$n.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),Nd=O.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),wh=1e4,Sh="()[]{}",vh=T.define({combine(n){return Ee(n,{afterCursor:!0,brackets:Sh,maxScanDistance:wh,renderMatch:Hd})}}),Fd=P.mark({class:"cm-matchingBracket"}),Vd=P.mark({class:"cm-nonmatchingBracket"});function Hd(n){let t=[],e=n.matched?Fd:Vd;return t.push(e.range(n.start.from,n.start.to)),n.end&&t.push(e.range(n.end.from,n.end.to)),t}const Wd=mt.define({create(){return P.none},update(n,t){if(!t.docChanged&&!t.selection)return n;let e=[],i=t.state.facet(vh);for(let s of t.state.selection.ranges){if(!s.empty)continue;let r=Xt(t.state,s.head,-1,i)||s.head>0&&Xt(t.state,s.head-1,1,i)||i.afterCursor&&(Xt(t.state,s.head,1,i)||s.head<t.state.doc.length&&Xt(t.state,s.head+1,-1,i));r&&(e=e.concat(i.renderMatch(r,t.state)))}return P.set(e,!0)},provide:n=>O.decorations.from(n)}),zd=[Wd,Nd];function Km(n={}){return[vh.of(n),zd]}const qd=new L;function sr(n,t,e){let i=n.prop(t<0?L.openedBy:L.closedBy);if(i)return i;if(n.name.length==1){let s=e.indexOf(n.name);if(s>-1&&s%2==(t<0?1:0))return[e[s+t]]}return null}function rr(n){let t=n.type.prop(qd);return t?t(n.node):n}function Xt(n,t,e,i={}){let s=i.maxScanDistance||wh,r=i.brackets||Sh,o=St(n),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let c=sr(a.type,e,r);if(c&&a.from<a.to){let h=rr(a);if(h&&(e>0?t>=h.from&&t<h.to:t>h.from&&t<=h.to))return Kd(n,t,e,a,h,c,r)}}return $d(n,t,e,o,l.type,s,r)}function Kd(n,t,e,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},c=0,h=l==null?void 0:l.cursor();if(h&&(e<0?h.childBefore(i.from):h.childAfter(i.to)))do if(e<0?h.to<=i.from:h.from>=i.to){if(c==0&&r.indexOf(h.type.name)>-1&&h.from<h.to){let f=rr(h);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(sr(h.type,e,o))c++;else if(sr(h.type,-e,o)){if(c==0){let f=rr(h);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(e<0?h.prevSibling():h.nextSibling());return{start:a,matched:!1}}function $d(n,t,e,i,s,r,o){let l=e<0?n.sliceDoc(t-1,t):n.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let c={from:e<0?t-1:t,to:e>0?t+1:t},h=n.doc.iterRange(t,e>0?n.doc.length:0),f=0;for(let u=0;!h.next().done&&u<=r;){let d=h.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let y=o.indexOf(d[g]);if(!(y<0||i.resolveInner(p+g,1).type!=s))if(y%2==0==e>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==a>>1};f--}}e>0&&(u+=d.length)}return h.done?{start:c,matched:!1}:null}function cl(n,t,e,i=0,s=0){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));let r=s;for(let o=i;o<t;o++)n.charCodeAt(o)==9?r+=e-r%e:r++;return r}class kh{constructor(t,e,i,s){this.string=t,this.tabSize=e,this.indentUnit=i,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e=this.string.charAt(this.pos),i;if(typeof t=="string"?i=e==t:i=e&&(t instanceof RegExp?t.test(e):t(e)),i)return++this.pos,e}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=cl(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return(t=this.overrideIndent)!==null&&t!==void 0?t:cl(this.string,null,this.tabSize)}match(t,e,i){if(typeof t=="string"){let s=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,t.length);return s(r)==s(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let s=this.string.slice(this.pos).match(t);return s&&s.index>0?null:(s&&e!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function jd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Ud,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||Lr}}function Ud(n){if(typeof n!="object")return n;let t={};for(let e in n){let i=n[e];t[e]=i instanceof Array?i.slice():i}return t}const fl=new WeakMap;class Ch extends Pt{constructor(t){let e=dh(t.languageData),i=jd(t),s,r=new class extends ch{createParse(o,l,a){return new Jd(s,o,l,a)}};super(e,r,[],t.name),this.topNode=_d(e,this),s=this,this.streamParser=i,this.stateAfter=new L({perNode:!0}),this.tokenTable=t.tokenTable?new Oh(i.tokenTable):Xd}static define(t){return new Ch(t)}getIndent(t){let e,{overrideIndentation:i}=t.options;i&&(e=fl.get(t.state),e!=null&&e<t.pos-1e4&&(e=void 0));let s=Rr(this,t.node.tree,t.node.from,t.node.from,e??t.pos),r,o;if(s?(o=s.state,r=s.pos+1):(o=this.streamParser.startState(t.unit),r=t.node.from),t.pos-r>1e4)return null;for(;r<t.pos;){let a=t.state.doc.lineAt(r),c=Math.min(t.pos,a.to);if(a.length){let h=i?i(a.from):-1,f=new kh(a.text,t.state.tabSize,t.unit,h<0?void 0:h);for(;f.pos<c-a.from;)Mh(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,t.unit);if(c==t.pos)break;r=a.to+1}let l=t.lineAt(t.pos);return i&&e==null&&fl.set(t.state,l.from),this.streamParser.indent(o,/^\s*(.*)/.exec(l.text)[1],t)}get allowsNesting(){return!1}}function Rr(n,t,e,i,s){let r=e>=i&&e+t.length<=s&&t.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=e+t.positions[o],c=l instanceof U&&a<s&&Rr(n,l,a,i,s);if(c)return c}return null}function Ah(n,t,e,i,s){if(s&&e<=0&&i>=t.length)return t;!s&&e==0&&t.type==n.topNode&&(s=!0);for(let r=t.children.length-1;r>=0;r--){let o=t.positions[r],l=t.children[r],a;if(o<i&&l instanceof U){if(!(a=Ah(n,l,e-o,i-o,s)))break;return s?new U(t.type,t.children.slice(0,r).concat(a),t.positions.slice(0,r+1),o+a.length):a}}return null}function Gd(n,t,e,i,s){for(let r of t){let o=r.from+(r.openStart?25:0),l=r.to-(r.openEnd?25:0),a=o<=e&&l>e&&Rr(n,r.tree,0-r.offset,e,l),c;if(a&&a.pos<=i&&(c=Ah(n,r.tree,e+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:c}}return{state:n.streamParser.startState(s?Le(s):4),tree:U.empty}}class Jd{constructor(t,e,i,s){this.lang=t,this.input=e,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=_e.get(),o=s[0].from,{state:l,tree:a}=Gd(t,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);r&&this.parsedPos<r.viewport.from-1e5&&s.some(c=>c.from<=r.viewport.from&&c.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(Le(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let t=_e.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(e,this.chunkStart+2048);for(t&&(i=Math.min(i,t.viewport.to));this.parsedPos<i;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==`
 `&&(e="");else{let i=e.indexOf(`
-`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-s}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),s}parseLine(t){let{line:e,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new vh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Mh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=U.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Yd,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new U(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new U(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Mh(n,t,e){t.start=t.pos;for(let i=0;i<10;i++){let s=n(t,e);if(t.pos>t.start)return s}throw new Error("Stream parser failed to advance stream.")}const Lr=Object.create(null),Oi=[gt.none],Yd=new Dr(Oi),ul=[],dl=Object.create(null),Dh=Object.create(null);for(let[n,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dh[n]=Th(Lr,t);class Oh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Dh)}resolve(t){return t?this.table[t]||(this.table[t]=Th(this.extra,t)):0}}const Xd=new Oh(Lr);function fs(n,t){ul.indexOf(n)>-1||(ul.push(n),console.warn(t))}function Th(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=n[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):fs(c,`Modifier ${c} used at start of tag`):a.length?fs(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:fs(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+e.map(l=>l.id),r=dl[s];if(r)return r.id;let o=dl[s]=gt.define({id:Oi.length,name:i,props:[xd({[i]:e})]});return Oi.push(o),o.id}function _d(n,t){let e=gt.define({id:Oi.length,name:"Document",props:[Ce.add(()=>n),mh.add(()=>i=>t.getIndent(i))],top:!0});return Oi.push(e),e}X.RTL,X.LTR;const Qd=n=>{let{state:t}=n,e=t.doc.lineAt(t.selection.main.from),i=Ir(n.state,e.from);return i.line?Zd(n):i.block?ep(n):!1};function Er(n,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=n(t,e);return s?(i(e.update(s)),!0):!1}}const Zd=Er(sp,0),tp=Er(Bh,0),ep=Er((n,t)=>Bh(n,t,np(t)),0);function Ir(n,t){let e=n.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const ci=50;function ip(n,{open:t,close:e},i,s){let r=n.sliceDoc(i-ci,i),o=n.sliceDoc(s,s+ci),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,f;s-i<=2*ci?h=f=n.sliceDoc(i,s):(h=n.sliceDoc(i,i+ci),f=n.sliceDoc(s-ci,s));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:s-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function np(n){let t=[];for(let e of n.selection.ranges){let i=n.doc.lineAt(e.from),s=e.to<=i.to?i:n.doc.lineAt(e.to);s.from>i.from&&s.from==e.to&&(s=e.to==i.to+1?i:n.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=s.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return t}function Bh(n,t,e=t.selection.ranges){let i=e.map(r=>Ir(t,r.from).block);if(!i.every(r=>r))return null;let s=e.map((r,o)=>ip(t,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:t.changes(e.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:c,close:h}=l;r.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:h.pos-h.margin,to:h.pos+a.close.length})}return{changes:r}}return null}function sp(n,t,e=t.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of e){let l=i.length,a=1e9,c=Ir(t,r).line;if(c){for(let h=r;h<=o;){let f=t.doc.lineAt(h);if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;u<f.text.length&&u<a&&(a=u),i.push({line:f,comment:p,token:c,indent:u,empty:d,single:!1})}h=f.to+1}if(a<1e9)for(let h=l;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=a);i.length==l+1&&(i[l].single=!0)}}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const or=oe.define(),rp=oe.define(),op=T.define(),Ph=T.define({combine(n){return Ee(n,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,s)=>t(i,s)||e(i,s)})}}),Rh=mt.define({create(){return _t.empty},update(n,t){let e=t.state.facet(Ph),i=t.annotation(or);if(i){let a=wt.fromTransaction(t,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=Bn(h,h.length,e.minDepth,a):h=Ih(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let s=t.annotation(rp);if((s=="full"||s=="before")&&(n=n.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?n:n.addMapping(t.changes.desc);let r=wt.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,e,t):t.selection&&(n=n.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(t=>t.toJSON()),undone:n.undone.map(t=>t.toJSON())}},fromJSON(n){return new _t(n.done.map(wt.fromJSON),n.undone.map(wt.fromJSON))}});function $m(n={}){return[Rh,Ph.of(n),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Lh:t.inputType=="historyRedo"?lr:null;return i?(t.preventDefault(),i(e)):!1}})]}function jn(n,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let s=e.field(Rh,!1);if(!s)return!1;let r=s.pop(n,e,t);return r?(i(r),!0):!1}}const Lh=jn(0,!1),lr=jn(1,!1),lp=jn(0,!0),ap=jn(1,!0);class wt{constructor(t,e,i,s,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(t){return new wt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new wt(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Rt;for(let s of t.startState.facet(op)){let r=s(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new wt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Rt)}static selection(t){return new wt(void 0,Rt,void 0,void 0,t)}}function Bn(n,t,e,i){let s=t+1>e+20?t-e-1:0,r=n.slice(s,t);return r.push(i),r}function hp(n,t){let e=[],i=!1;return n.iterChangedRanges((s,r)=>e.push(s,r)),t.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<e.length;){let c=e[a++],h=e[a++];l>=c&&o<=h&&(i=!0)}}),i}function cp(n,t){return n.ranges.length==t.ranges.length&&n.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Eh(n,t){return n.length?t.length?n.concat(t):n:t}const Rt=[],fp=200;function Ih(n,t){if(n.length){let e=n[n.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-fp));return i.length&&i[i.length-1].eq(t)?n:(i.push(t),Bn(n,n.length-1,1e9,e.setSelAfter(i)))}else return[wt.selection([t])]}function up(n){let t=n[n.length-1],e=n.slice();return e[n.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function us(n,t){if(!n.length)return n;let e=n.length,i=Rt;for(;e;){let s=dp(n[e-1],t,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,e);return r[e-1]=s,r}else t=s.mapped,e--,i=s.selectionsAfter}return i.length?[wt.selection(i)]:Rt}function dp(n,t,e){let i=Eh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(t)):Rt,e);if(!n.changes)return wt.selection(i);let s=n.changes.map(t),r=t.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new wt(s,N.mapEffects(n.effects,t),o,n.startSelection.map(r),i)}const pp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,s=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||pp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,hp(l.changes,t.changes))||i=="input.type.compose")?o=Bn(o,o.length-1,s.minDepth,new wt(t.changes.compose(l.changes),Eh(N.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,Rt)):o=Bn(o,o.length,s.minDepth,t),new _t(o,Rt,e,i)}addSelection(t,e,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Rt;return r.length>0&&e-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&cp(r[r.length-1],t)?this:new _t(Ih(this.done,t),this.undone,e,i)}addMapping(t){return new _t(us(this.done,t),us(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let s=t==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:or.of({side:t,rest:up(s),selection:o}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Rt:s.slice(0,s.length-1);return r.mapped&&(l=us(l,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:or.of({side:t,rest:l,selection:o}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}_t.empty=new _t(Rt,Rt);const jm=[{key:"Mod-z",run:Lh,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:lr,preventDefault:!0},{linux:"Ctrl-Shift-z",run:lr,preventDefault:!0},{key:"Mod-u",run:lp,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ap,preventDefault:!0}];function ii(n,t){return b.create(n.ranges.map(t),n.mainIndex)}function te(n,t){return n.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ht({state:n,dispatch:t},e){let i=ii(n.selection,e);return i.eq(n.selection,!0)?!1:(t(te(n,i)),!0)}function Un(n,t){return b.cursor(t?n.to:n.from)}function Nh(n,t){return Ht(n,e=>e.empty?n.moveByChar(e,t):Un(e,t))}function ut(n){return n.textDirectionAt(n.state.selection.main.head)==X.LTR}const Fh=n=>Nh(n,!ut(n)),Vh=n=>Nh(n,ut(n));function Hh(n,t){return Ht(n,e=>e.empty?n.moveByGroup(e,t):Un(e,t))}const gp=n=>Hh(n,!ut(n)),mp=n=>Hh(n,ut(n));function yp(n,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(t.from,t.to)))||t.firstChild}function Gn(n,t,e){let i=St(n).resolveInner(t.head),s=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;yp(n,c,s)?i=c:a=e?c.to:c.from}let r=i.type.prop(s),o,l;return r&&(o=e?Xt(n,i.from,1):Xt(n,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const bp=n=>Ht(n,t=>Gn(n.state,t,!ut(n))),xp=n=>Ht(n,t=>Gn(n.state,t,ut(n)));function Wh(n,t){return Ht(n,e=>{if(!e.empty)return Un(e,t);let i=n.moveVertically(e,t);return i.head!=e.head?i:n.moveToLineBoundary(e,t)})}const zh=n=>Wh(n,!1),qh=n=>Wh(n,!0);function Kh(n){let t=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,e=0,i=0,s;if(t){for(let r of n.state.facet(O.scrollMargins)){let o=r(n);o!=null&&o.top&&(e=Math.max(o==null?void 0:o.top,e)),o!=null&&o.bottom&&(i=Math.max(o==null?void 0:o.bottom,i))}s=n.scrollDOM.clientHeight-e-i}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:e,marginBottom:i,selfScroll:t,height:Math.max(n.defaultLineHeight,s-5)}}function $h(n,t){let e=Kh(n),{state:i}=n,s=ii(i.selection,o=>o.empty?n.moveVertically(o,t,e.height):Un(o,t));if(s.eq(i.selection))return!1;let r;if(e.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottom<c&&(r=O.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-a}))}return n.dispatch(te(i,s),{effects:r}),!0}const pl=n=>$h(n,!1),ar=n=>$h(n,!0);function be(n,t,e){let i=n.lineBlockAt(t.head),s=n.moveToLineBoundary(t,e);if(s.head==t.head&&s.head!=(e?i.to:i.from)&&(s=n.moveToLineBoundary(t,e,!1)),!e&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const wp=n=>Ht(n,t=>be(n,t,!0)),Sp=n=>Ht(n,t=>be(n,t,!1)),kp=n=>Ht(n,t=>be(n,t,!ut(n))),vp=n=>Ht(n,t=>be(n,t,ut(n))),Cp=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).from,1)),Ap=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).to,-1));function Mp(n,t,e){let i=!1,s=ii(n.selection,r=>{let o=Xt(n,r.head,-1)||Xt(n,r.head,1)||r.head>0&&Xt(n,r.head-1,1)||r.head<n.doc.length&&Xt(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return b.cursor(l)});return i?(t(te(n,s)),!0):!1}const Dp=({state:n,dispatch:t})=>Mp(n,t);function Nt(n,t){let e=ii(n.state.selection,i=>{let s=t(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return e.eq(n.state.selection)?!1:(n.dispatch(te(n.state,e)),!0)}function jh(n,t){return Nt(n,e=>n.moveByChar(e,t))}const Uh=n=>jh(n,!ut(n)),Gh=n=>jh(n,ut(n));function Jh(n,t){return Nt(n,e=>n.moveByGroup(e,t))}const Op=n=>Jh(n,!ut(n)),Tp=n=>Jh(n,ut(n)),Bp=n=>Nt(n,t=>Gn(n.state,t,!ut(n))),Pp=n=>Nt(n,t=>Gn(n.state,t,ut(n)));function Yh(n,t){return Nt(n,e=>n.moveVertically(e,t))}const Xh=n=>Yh(n,!1),_h=n=>Yh(n,!0);function Qh(n,t){return Nt(n,e=>n.moveVertically(e,t,Kh(n).height))}const gl=n=>Qh(n,!1),ml=n=>Qh(n,!0),Rp=n=>Nt(n,t=>be(n,t,!0)),Lp=n=>Nt(n,t=>be(n,t,!1)),Ep=n=>Nt(n,t=>be(n,t,!ut(n))),Ip=n=>Nt(n,t=>be(n,t,ut(n))),Np=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).from)),Fp=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).to)),yl=({state:n,dispatch:t})=>(t(te(n,{anchor:0})),!0),bl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.doc.length})),!0),xl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:0})),!0),wl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Vp=({state:n,dispatch:t})=>(t(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Hp=({state:n,dispatch:t})=>{let e=Jn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return t(n.update({selection:b.create(e),userEvent:"select"})),!0},Wp=({state:n,dispatch:t})=>{let e=ii(n.selection,i=>{let s=St(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return e.eq(n.selection)?!1:(t(te(n,e)),!0)},zp=({state:n,dispatch:t})=>{let e=n.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(te(n,i)),!0):!1};function Fi(n,t){if(n.state.readOnly)return!1;let e="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);a<o?(e="delete.backward",a=sn(n,a,!1)):a>o&&(e="delete.forward",a=sn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=sn(n,o,!1),l=sn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:e,effects:e=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function sn(n,t,e){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(t,t,(s,r)=>{s<t&&r>t&&(t=e?r:s)});return t}const Zh=(n,t,e)=>Fi(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(e&&!t&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]=="	")return s-1;let c=ei(l,r.tabSize),h=c%Le(r)||Le(r);for(let f=0;f<h&&l[l.length-1-f]==" ";f++)s--;a=s}else a=rt(o.text,s-o.from,t,t)+o.from,a==s&&o.number!=(t?r.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,s-o.from))&&(a=rt(o.text,a-o.from,!1,!1)+o.from);return a}),hr=n=>Zh(n,!1,!0),tc=n=>Zh(n,!0,!1),ec=(n,t)=>Fi(n,e=>{let i=e.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?s.doc.lines:1)&&(i+=t?1:-1);break}let a=rt(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),ic=n=>ec(n,!1),qp=n=>ec(n,!0),Kp=n=>Fi(n,t=>{let e=n.lineBlockAt(t.head).to;return t.head<e?e:Math.min(n.state.doc.length,t.head+1)}),$p=n=>Fi(n,t=>{let e=n.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),jp=n=>Fi(n,t=>{let e=n.moveToLineBoundary(t,!0).head;return t.head<e?e:Math.min(n.state.doc.length,t.head+1)}),Up=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:b.cursor(i.from)}));return t(n.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Gp=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:rt(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:rt(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return e.changes.empty?!1:(t(n.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Jn(n){let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),e>=s.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:s.from,to:r.to,ranges:[i]});e=r.number+1}return t}function nc(n,t,e){if(n.readOnly)return!1;let i=[],s=[];for(let r of Jn(n)){if(e?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Jp=({state:n,dispatch:t})=>nc(n,t,!1),Yp=({state:n,dispatch:t})=>nc(n,t,!0);function sc(n,t,e){if(n.readOnly)return!1;let i=[];for(let s of Jn(n))e?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return t(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Xp=({state:n,dispatch:t})=>sc(n,t,!1),_p=({state:n,dispatch:t})=>sc(n,t,!0),Qp=n=>{if(n.state.readOnly)return!1;let{state:t}=n,e=t.changes(Jn(t).map(({from:s,to:r})=>(s>0?s--:r<t.doc.length&&r++,{from:s,to:r}))),i=ii(t.selection,s=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(e);return n.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Zp(n,t){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=St(n).resolveInner(t),i=e.childBefore(t),s=e.childAfter(t),r;return i&&s&&i.to<=t&&s.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Sl=rc(!1),tg=rc(!0);function rc(n){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(s=>{let{from:r,to:o}=s,l=t.doc.lineAt(r),a=!n&&r==o&&Zp(t,r);n&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Kn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=gh(c,r);for(h==null&&(h=ei(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let f=["",Tn(t,h)];return a&&f.push(Tn(t,c.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:F.of(f)},range:b.cursor(r+1+f[1].length)}});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Nr(n,t){let e=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,s,i),e=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const eg=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=Object.create(null),i=new Kn(n,{overrideIndentation:r=>{let o=e[r];return o??-1}}),s=Nr(n,(r,o,l)=>{let a=gh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Tn(n,a);(c!=h||l.from<r.from+c.length)&&(e[r.from]=a,o.push({from:r.from,to:r.from+c.length,insert:h}))});return s.changes.empty||t(n.update(s,{userEvent:"indent"})),!0},oc=({state:n,dispatch:t})=>n.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{i.push({from:e.from,insert:n.facet(qn)})}),{userEvent:"input.indent"})),!0),lc=({state:n,dispatch:t})=>n.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{let s=/^\s*/.exec(e.text)[0];if(!s)return;let r=ei(s,n.tabSize),o=0,l=Tn(n,Math.max(0,r-Le(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:e.from+o,to:e.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),ig=n=>(n.setTabFocusMode(),!0),ng=[{key:"Ctrl-b",run:Fh,shift:Uh,preventDefault:!0},{key:"Ctrl-f",run:Vh,shift:Gh},{key:"Ctrl-p",run:zh,shift:Xh},{key:"Ctrl-n",run:qh,shift:_h},{key:"Ctrl-a",run:Cp,shift:Np},{key:"Ctrl-e",run:Ap,shift:Fp},{key:"Ctrl-d",run:tc},{key:"Ctrl-h",run:hr},{key:"Ctrl-k",run:Kp},{key:"Ctrl-Alt-h",run:ic},{key:"Ctrl-o",run:Up},{key:"Ctrl-t",run:Gp},{key:"Ctrl-v",run:ar}],sg=[{key:"ArrowLeft",run:Fh,shift:Uh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:gp,shift:Op,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:kp,shift:Ep,preventDefault:!0},{key:"ArrowRight",run:Vh,shift:Gh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:mp,shift:Tp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:vp,shift:Ip,preventDefault:!0},{key:"ArrowUp",run:zh,shift:Xh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yl,shift:xl},{mac:"Ctrl-ArrowUp",run:pl,shift:gl},{key:"ArrowDown",run:qh,shift:_h,preventDefault:!0},{mac:"Cmd-ArrowDown",run:bl,shift:wl},{mac:"Ctrl-ArrowDown",run:ar,shift:ml},{key:"PageUp",run:pl,shift:gl},{key:"PageDown",run:ar,shift:ml},{key:"Home",run:Sp,shift:Lp,preventDefault:!0},{key:"Mod-Home",run:yl,shift:xl},{key:"End",run:wp,shift:Rp,preventDefault:!0},{key:"Mod-End",run:bl,shift:wl},{key:"Enter",run:Sl,shift:Sl},{key:"Mod-a",run:Vp},{key:"Backspace",run:hr,shift:hr},{key:"Delete",run:tc},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ic},{key:"Mod-Delete",mac:"Alt-Delete",run:qp},{mac:"Mod-Backspace",run:$p},{mac:"Mod-Delete",run:jp}].concat(ng.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Um=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bp,shift:Bp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:xp,shift:Pp},{key:"Alt-ArrowUp",run:Jp},{key:"Shift-Alt-ArrowUp",run:Xp},{key:"Alt-ArrowDown",run:Yp},{key:"Shift-Alt-ArrowDown",run:_p},{key:"Escape",run:zp},{key:"Mod-Enter",run:tg},{key:"Alt-l",mac:"Ctrl-l",run:Hp},{key:"Mod-i",run:Wp,preventDefault:!0},{key:"Mod-[",run:lc},{key:"Mod-]",run:oc},{key:"Mod-Alt-\\",run:eg},{key:"Shift-Mod-k",run:Qp},{key:"Shift-Mod-\\",run:Dp},{key:"Mod-/",run:Qd},{key:"Alt-A",run:tp},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ig}].concat(sg),Gm={key:"Tab",run:oc,shift:lc};function ot(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=e[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}t++}for(;t<arguments.length;t++)ac(n,arguments[t]);return n}function ac(n,t){if(typeof t=="string")n.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)n.appendChild(t);else if(Array.isArray(t))for(var e=0;e<t.length;e++)ac(n,t[e]);else throw new RangeError("Unsupported child node: "+t)}const kl=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class ti{constructor(t,e,i=0,s=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(kl(l)):kl,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=ur(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Gt(t);let s=this.normalize(e);if(s.length)for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&r<e.length&&e.charCodeAt(r)==l&&o++}}}match(t,e,i){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?s={from:this.matches[r+1],to:i}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:e,to:i}:this.matches.push(1,e)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(ti.prototype[Symbol.iterator]=function(){return this});const hc={from:-1,to:-1,match:/.*/.exec("")},Fr="gm"+(/x/.unicode==null?"":"u");class cc{constructor(t,e,i,s=0,r=t.length){if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=hc,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new fc(t,e,i,s,r);this.re=new RegExp(e,Fr+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=t.iter();let o=t.lineAt(s);this.curLineStart=o.from,this.matchPos=Pn(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,s=i+e[0].length;if(this.matchPos=Pn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const ds=new WeakMap;class $e{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let s=ds.get(t);if(!s||s.from>=i||s.to<=e){let l=new $e(e,t.sliceString(e,i));return ds.set(t,l),l}if(s.from==e&&s.to==i)return s;let{text:r,from:o}=s;return o>e&&(r=t.sliceString(e,o)+r,o=e),s.to<i&&(r+=t.sliceString(s.to,i)),ds.set(t,new $e(o,r)),new $e(e,r.slice(e-o,i-o))}}class fc{constructor(t,e,i,s,r){this.text=t,this.to=r,this.done=!1,this.value=hc,this.matchPos=Pn(t,s),this.re=new RegExp(e,Fr+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=$e.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,s=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this.matchPos=Pn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=$e.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cc.prototype[Symbol.iterator]=fc.prototype[Symbol.iterator]=function(){return this});function rg(n){try{return new RegExp(n,Fr),!0}catch{return!1}}function Pn(n,t){if(t>=n.length)return t;let e=n.lineAt(t),i;for(;t<e.to&&(i=e.text.charCodeAt(t-e.from))>=56320&&i<57344;)t++;return t}function cr(n){let t=String(n.state.doc.lineAt(n.state.selection.main.head).number),e=ot("input",{class:"cm-textfield",name:"line",value:t}),i=ot("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Rn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},ot("label",n.state.phrase("Go to line"),": ",e)," ",ot("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Rn.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:i}}const Rn=N.define(),vl=mt.define({create(){return!0},update(n,t){for(let e of t.effects)e.is(Rn)&&(n=e.value);return n},provide:n=>An.from(n,t=>t?cr:null)}),og=n=>{let t=Cn(n,cr);if(!t){let e=[Rn.of(!0)];n.state.field(vl,!1)==null&&e.push(N.appendConfig.of([vl,lg])),n.dispatch({effects:e}),t=Cn(n,cr)}return t&&t.dom.querySelector("input").select(),!0},lg=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ag={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hg=T.define({combine(n){return Ee(n,ag,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jm(n){return[pg,dg]}const cg=P.mark({class:"cm-selectionMatch"}),fg=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Cl(n,t,e,i){return(e==0||n(t.sliceDoc(e-1,e))!=J.Word)&&(i==t.doc.length||n(t.sliceDoc(i,i+1))!=J.Word)}function ug(n,t,e,i){return n(t.sliceDoc(e,e+1))==J.Word&&n(t.sliceDoc(i-1,i))==J.Word}const dg=ft.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let t=n.state.facet(hg),{state:e}=n,i=e.selection;if(i.ranges.length>1)return P.none;let s=i.main,r,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return P.none;let a=e.wordAt(s.head);if(!a)return P.none;o=e.charCategorizer(s.head),r=e.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<t.minSelectionLength||a>200)return P.none;if(t.wholeWords){if(r=e.sliceDoc(s.from,s.to),o=e.charCategorizer(s.head),!(Cl(o,e,s.from,s.to)&&ug(o,e,s.from,s.to)))return P.none}else if(r=e.sliceDoc(s.from,s.to),!r)return P.none}let l=[];for(let a of n.visibleRanges){let c=new ti(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||Cl(o,e,h,f))&&(s.empty&&h<=s.from&&f>=s.to?l.push(fg.range(h,f)):(h>=s.to||f<=s.from)&&l.push(cg.range(h,f)),l.length>t.maxMatches))return P.none}}return P.set(l)}},{decorations:n=>n.decorations}),pg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),gg=({state:n,dispatch:t})=>{let{selection:e}=n,i=b.create(e.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),e.mainIndex);return i.eq(e)?!1:(t(n.update({selection:i})),!0)};function mg(n,t){let{main:e,ranges:i}=n.selection,s=n.wordAt(e.head),r=s&&s.from==e.from&&s.to==e.to;for(let o=!1,l=new ti(n.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ti(n.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const yg=({state:n,dispatch:t})=>{let{ranges:e}=n.selection;if(e.some(r=>r.from===r.to))return gg({state:n,dispatch:t});let i=n.sliceDoc(e[0].from,e[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=mg(n,i);return s?(t(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},ni=T.define({combine(n){return Ee(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Og(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class uc{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||rg(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?`
-`:i=="r"?"\r":i=="t"?"	":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Sg(this):new xg(this)}getCursor(t,e=0,i){let s=t.doc?t:H.create({doc:t});return i==null&&(i=s.doc.length),this.regexp?He(this,s,e,i):Ve(this,s,e,i)}}class dc{constructor(t){this.spec=t}}function Ve(n,t,e,i){return new ti(t.doc,n.unquoted,e,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?bg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function bg(n,t){return(e,i,s,r)=>((r>e||r+s.length<i)&&(r=Math.max(0,e-2),s=n.sliceString(r,Math.min(n.length,i+2))),(t(Ln(s,e-r))!=J.Word||t(En(s,e-r))!=J.Word)&&(t(En(s,i-r))!=J.Word||t(Ln(s,i-r))!=J.Word))}class xg extends dc{constructor(t){super(t)}nextMatch(t,e,i){let s=Ve(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){let r=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Ve(this.spec,t,0,r).nextOverlapping()}return s.done||s.value.from==e&&s.value.to==i?null:s.value}prevMatchInRange(t,e,i){for(let s=i;;){let r=Math.max(e,s-1e4-this.spec.unquoted.length),o=Ve(this.spec,t,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==e)return null;s-=1e4}}prevMatch(t,e,i){let s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=e||s.to!=i)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Ve(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function He(n,t,e,i){return new cc(t.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?wg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Ln(n,t){return n.slice(rt(n,t,!1),t)}function En(n,t){return n.slice(t,rt(n,t))}function wg(n){return(t,e,i)=>!i[0].length||(n(Ln(i.input,i.index))!=J.Word||n(En(i.input,i.index))!=J.Word)&&(n(En(i.input,i.index+i[0].length))!=J.Word||n(Ln(i.input,i.index+i[0].length))!=J.Word)}class Sg extends dc{nextMatch(t,e,i){let s=He(this.spec,t,i,t.doc.length).next();return s.done&&(s=He(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let r=Math.max(e,i-s*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i<t.match.length?t.match[i]:e)}matchAll(t,e){let i=He(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ti=N.define(),Vr=N.define(),ue=mt.define({create(n){return new ps(fr(n).create(),null)},update(n,t){for(let e of t.effects)e.is(Ti)?n=new ps(e.value.create(),n.panel):e.is(Vr)&&(n=new ps(n.query,e.value?Hr:null));return n},provide:n=>An.from(n,t=>t.panel)});class ps{constructor(t,e){this.query=t,this.panel=e}}const kg=P.mark({class:"cm-searchMatch"}),vg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Cg=ft.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ue))}update(n){let t=n.state.field(ue);(t!=n.startState.field(ue)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:n,panel:t}){if(!t||!n.spec.valid)return P.none;let{view:e}=this,i=new Oe;for(let s=0,r=e.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?vg:kg)})}return i.finish()}},{decorations:n=>n.decorations});function Vi(n){return t=>{let e=t.state.field(ue,!1);return e&&e.query.spec.valid?n(t,e):mc(t)}}const In=Vi((n,{query:t})=>{let{to:e}=n.state.selection.main,i=t.nextMatch(n.state,e,e);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(ni);return n.dispatch({selection:s,effects:[Wr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),gc(n),!0}),Nn=Vi((n,{query:t})=>{let{state:e}=n,{from:i}=e.selection.main,s=t.prevMatch(e,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(ni);return n.dispatch({selection:r,effects:[Wr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),gc(n),!0}),Ag=Vi((n,{query:t})=>{let e=t.matchAll(n.state,1e3);return!e||!e.length?!1:(n.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Mg=({state:n,dispatch:t})=>{let e=n.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:s}=e.main,r=[],o=0;for(let l=new ti(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Al=Vi((n,{query:t})=>{let{state:e}=n,{from:i,to:s}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=r,l=[],a,c,h=[];if(o.from==i&&o.to==s&&(c=e.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=t.nextMatch(e,o.from,o.to),h.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),o){let f=l.length==0||l[0].from>=r.to?0:r.to-r.from-c.length;a=b.single(o.from-f,o.to-f),h.push(Wr(n,o)),h.push(e.facet(ni).scrollToMatch(a.main,n))}return n.dispatch({changes:l,selection:a,effects:h,userEvent:"input.replace"}),!0}),Dg=Vi((n,{query:t})=>{if(n.state.readOnly)return!1;let e=t.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:t.getReplacement(s)}});if(!e.length)return!1;let i=n.state.phrase("replaced $ matches",e.length)+".";return n.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Hr(n){return n.state.facet(ni).createPanel(n)}function fr(n,t){var e,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=n.facet(ni);return new uc({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(s=t==null?void 0:t.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function pc(n){let t=Cn(n,Hr);return t&&t.dom.querySelector("[main-field]")}function gc(n){let t=pc(n);t&&t==n.root.activeElement&&t.select()}const mc=n=>{let t=n.state.field(ue,!1);if(t&&t.panel){let e=pc(n);if(e&&e!=n.root.activeElement){let i=fr(n.state,t.query.spec);i.valid&&n.dispatch({effects:Ti.of(i)}),e.focus(),e.select()}}else n.dispatch({effects:[Vr.of(!0),t?Ti.of(fr(n.state,t.query.spec)):N.appendConfig.of(Bg)]});return!0},yc=n=>{let t=n.state.field(ue,!1);if(!t||!t.panel)return!1;let e=Cn(n,Hr);return e&&e.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Vr.of(!1)}),!0},Ym=[{key:"Mod-f",run:mc,scope:"editor search-panel"},{key:"F3",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Mg},{key:"Mod-Alt-g",run:og},{key:"Mod-d",run:yg,preventDefault:!0}];class Og{constructor(t){this.view=t;let e=this.query=t.state.field(ue).query.spec;this.commit=this.commit.bind(this),this.searchField=ot("input",{value:e.search,placeholder:vt(t,"Find"),"aria-label":vt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ot("input",{value:e.replace,placeholder:vt(t,"Replace"),"aria-label":vt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ot("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=ot("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=ot("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(s,r,o){return ot("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=ot("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>In(t),[vt(t,"next")]),i("prev",()=>Nn(t),[vt(t,"previous")]),i("select",()=>Ag(t),[vt(t,"all")]),ot("label",null,[this.caseField,vt(t,"match case")]),ot("label",null,[this.reField,vt(t,"regexp")]),ot("label",null,[this.wordField,vt(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,i("replace",()=>Al(t),[vt(t,"replace")]),i("replaceAll",()=>Dg(t),[vt(t,"replace all")])],ot("button",{name:"close",onclick:()=>yc(t),"aria-label":vt(t,"close"),type:"button"},["×"])])}commit(){let t=new uc({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Ti.of(t)}))}keydown(t){Cu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Nn:In)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Al(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Ti)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ni).top}}function vt(n,t){return n.state.phrase(t)}const rn=30,on=/[\s\.,:;?!]/;function Wr(n,{from:t,to:e}){let i=n.state.doc.lineAt(t),s=n.state.doc.lineAt(e).to,r=Math.max(i.from,t-rn),o=Math.min(s,e+rn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<rn;a++)if(!on.test(l[a+1])&&on.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-rn;a--)if(!on.test(l[a-1])&&on.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Tg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Bg=[ue,ye.low(Cg),Tg];class bc{constructor(t,e,i,s){this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=St(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),r=s.search(xc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Ml(n){let t=Object.keys(n).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Pg(n){let t=Object.create(null),e=Object.create(null);for(let{label:s}of n){t[s[0]]=!0;for(let r=1;r<s.length;r++)e[s[r]]=!0}let i=Ml(t)+Ml(e)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Rg(n){let t=n.map(s=>typeof s=="string"?{label:s}:s),[e,i]=t.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Pg(t);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:t,validFor:e}:null}}function Xm(n,t){return e=>{for(let i=St(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class Dl{constructor(t,e,i,s){this.completion=t,this.source=e,this.match=i,this.score=s}}function Me(n){return n.selection.main.from}function xc(n,t){var e;let{source:i}=n,s=t&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(e=n.flags)!==null&&e!==void 0?e:n.ignoreCase?"i":"")}const zr=oe.define();function Lg(n,t,e,i){let{main:s}=n.selection,r=e-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=s&&e!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(e,i))return{range:l};let a=n.toText(t);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Ol=new WeakMap;function Eg(n){if(!Array.isArray(n))return n;let t=Ol.get(n);return t||Ol.set(n,t=Rg(n)),t}const Fn=N.define(),Bi=N.define();class Ig{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=yt(t,e),s=Gt(i);this.chars.push(i);let r=t.slice(e,e+s),o=r.toUpperCase();this.folded.push(yt(o==r?r.toLowerCase():o,0)),e+=s}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:s,precise:r,byWord:o}=this;if(e.length==1){let x=yt(t,0),S=Gt(x),k=S==t.length?0:-100;if(x!=e[0])if(x==i[0])k+=-200;else return null;return this.ret(k,[0,S])}let l=t.indexOf(this.pattern);if(l==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,c=0;if(l<0){for(let x=0,S=Math.min(t.length,200);x<S&&c<a;){let k=yt(t,x);(k==e[c]||k==i[c])&&(s[c++]=x),x+=Gt(k)}if(c<a)return null}let h=0,f=0,u=!1,d=0,p=-1,g=-1,m=/[a-z]/.test(t),y=!0;for(let x=0,S=Math.min(t.length,200),k=0;x<S&&f<a;){let w=yt(t,x);l<0&&(h<a&&w==e[h]&&(r[h++]=x),d<a&&(w==e[d]||w==i[d]?(d==0&&(p=x),g=x+1,d++):d=0));let v,A=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(v=ur(w))!=v.toLowerCase()?1:v!=v.toUpperCase()?2:0;(!x||A==1&&m||k==0&&A!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),k=A,x+=Gt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,t)}result(t,e,i){let s=[],r=0;for(let o of e){let l=o+(this.astral?Gt(yt(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(t-i.length,s)}}class Ng{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const et=T.define({combine(n){return Ee(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Fg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Tl(t(i),e(i)),optionClass:(t,e)=>i=>Tl(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function Tl(n,t){return n?t?n+" "+t:n:t}function Fg(n,t,e,i,s,r){let o=n.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-s.left,d=s.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))h=Math.max(s.top,Math.min(e.top,s.bottom-g))-t.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?t.right:s.right-t.left)-30);let x=s.bottom-t.bottom;x>=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Vg(n){let t=n.addToOptions.slice();return n.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;c<r.length;){let h=r[c++],f=r[c++];h>a&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(e){if(!e.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=e.detail,i},position:80}),t.sort((e,i)=>e.position-i.position).map(e=>e.render)}function gs(n,t,e){if(n<=e)return{from:0,to:n};if(t<0&&(t=0),t<=n>>1){let s=Math.floor(t/e);return{from:s*e,to:(s+1)*e}}let i=Math.floor((n-t)/e);return{from:n-(i+1)*e,to:n-i*e}}class Hg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=t.state.field(e),{options:r,selected:o}=s.open,l=t.state.facet(et);this.optionContent=Vg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=gs(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]<c.length){this.applyCompletion(t,c[+f[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(et).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Bi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=gs(r.length,o,t.state.facet(et).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=s.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=gs(e.options.length,e.selected,this.view.state.facet(et).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>At(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:s,destroy:r}=t;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&zg(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,e.bottom)-10||s.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(et).positionInfo(this.view,e,s,i,r,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const s=document.createElement("ul");s.id=e,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=t[o],{section:c}=l;if(c){let u=typeof c=="string"?c:c.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=s.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Wg(n,t){return e=>new Hg(e,n,t)}function zg(n,t){let e=n.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.height/n.offsetHeight;i.top<e.top?n.scrollTop-=(e.top-i.top)/s:i.bottom>e.bottom&&(n.scrollTop+=(i.bottom-e.bottom)/s)}function Bl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function qg(n,t){let e=[],i=null,s=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(et);for(let c of n)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new Dl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new Ng(f):new Ig(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;s(new Dl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.name<d.name?-1:1)};for(let u of i.sort(f))h-=1e5,c[u.name]=h;for(let u of e){let{section:d}=u.completion;d&&(u.score+=c[typeof d=="string"?d:d.name])}}let o=[],l=null,a=r.compareCompletions;for(let c of e.sort((h,f)=>f.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):Bl(c.completion)>Bl(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,s,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,Pl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,s,r,o){if(s&&!o&&t.some(c=>c.isPending))return s.setDisabled();let l=qg(t,e);if(!l.length)return s&&t.some(c=>c.isPending)?s.setDisabled():null;let a=e.facet(et).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let c=s.options[s.selected].completion;for(let h=0;h<l.length;h++)if(l[h].completion==c){a=h;break}}return new We(l,Pl(i,a),{pos:t.reduce((c,h)=>h.hasResult()?Math.min(c,h.from):c,1e8),create:Jg,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new We(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vn{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Vn(Ug,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(et),r=(i.override||e.languageDataAt("autocomplete",Me(e)).map(Eg)).map(a=>(this.active.find(h=>h.source==a)||new Lt(a,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=t.effects.some(a=>a.is(qr));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!Kg(r,this.active)||l?o=We.build(r,e,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Lt(a.source,0):a));for(let a of t.effects)a.is(Sc)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$g:jg}}function Kg(n,t){if(n==t)return!0;for(let e=0,i=0;;){for(;e<n.length&&!n[e].hasResult();)e++;for(;i<t.length&&!t[i].hasResult();)i++;let s=e==n.length,r=i==t.length;if(s||r)return s==r;if(n[e++].result!=t[i++].result)return!1}}const $g={"aria-autocomplete":"list"},jg={};function Pl(n,t){let e={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return t>-1&&(e["aria-activedescendant"]=n+"-"+t),e}const Ug=[];function wc(n,t){if(n.isUserEvent("input.complete")){let i=n.annotation(zr);if(i&&t.activateOnCompletion(i))return 12}let e=n.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Lt{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,e){let i=wc(t,e),s=this;(i&8||i&16&&this.touches(t))&&(s=new Lt(s.source,0)),i&4&&s.state==0&&(s=new Lt(this.source,1)),s=s.updateFor(t,i);for(let r of t.effects)if(r.is(Fn))s=new Lt(s.source,1,r.value);else if(r.is(Bi))s=new Lt(s.source,0);else if(r.is(qr))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Me(t.state))}}class je extends Lt{constructor(t,e,i,s,r,o){super(t,3,e),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Me(t.state);if(l>o||!s||e&2&&(Me(t.startState)==this.from||l<this.limit))return new Lt(this.source,e&4?1:0);let a=t.changes.mapPos(this.limit);return Gg(s.validFor,t.state,r,o)?new je(this.source,this.explicit,a,s,r,o):s.update&&(s=s.update(s,r,o,new bc(t.state,l,!1)))?new je(this.source,this.explicit,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:Me(t.state)):new Lt(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new je(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Lt(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function Gg(n,t,e,i){if(!n)return!1;let s=t.sliceDoc(e,i);return typeof n=="function"?n(s,e,i,t):xc(n,!0).test(s)}const qr=N.define({map(n,t){return n.map(e=>e.map(t))}}),Sc=N.define(),xt=mt.define({create(){return Vn.start()},update(n,t){return n.update(t)},provide:n=>[sh.from(n,t=>t.tooltip),O.contentAttributes.from(n,t=>t.attrs)]});function Kr(n,t){const e=t.completion.apply||t.completion.label;let i=n.state.field(xt).active.find(s=>s.source==t.source);return i instanceof je?(typeof e=="string"?n.dispatch(Object.assign(Object.assign({},Lg(n.state,e,i.from,i.to)),{annotations:zr.of(t.completion)})):e(n,t.completion,i.from,i.to),!0):!1}const Jg=Wg(xt,Kr);function ln(n,t="option"){return e=>{let i=e.state.field(xt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<e.state.facet(et).interactionDelay)return!1;let s=1,r;t=="page"&&(r=rh(e,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:Sc.of(l)}),!0}}const Yg=n=>{let t=n.state.field(xt,!1);return n.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<n.state.facet(et).interactionDelay?!1:Kr(n,t.open.options[t.open.selected])},Rl=n=>n.state.field(xt,!1)?(n.dispatch({effects:Fn.of(!0)}),!0):!1,Xg=n=>{let t=n.state.field(xt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(n.dispatch({effects:Bi.of(null)}),!0)};class _g{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Qg=50,Zg=1e3,tm=ft.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of n.state.field(xt).active)t.isPending&&this.startQuery(t)}update(n){let t=n.state.field(xt),e=n.state.facet(et);if(!n.selectionSet&&!n.docChanged&&n.startState.field(xt)==t)return;let i=n.transactions.some(r=>{let o=wc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>Qg&&Date.now()-o.time>Zg){for(let l of o.context.abortListeners)try{l()}catch(a){At(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Fn)))&&(this.pendingStart=!0);let s=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,t=n.field(xt);for(let e of t.active)e.isPending&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}startQuery(n){let{state:t}=this.view,e=Me(t),i=new bc(t,e,n.explicit,this.view),s=new _g(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),At(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(et),i=this.view.state.field(xt);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=Me(r.updates.length?r.updates[0].startState:this.view.state),a=Math.min(l,r.done.from+(r.active.explicit?0:1)),c=new je(r.active.source,r.active.explicit,a,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let h of r.updates)c=c.update(h,e);if(c.hasResult()){t.push(c);continue}}let o=i.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Lt(r.active.source,0);for(let a of r.updates)l=l.update(a,e);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:qr.of(t)})}},{eventHandlers:{blur(n){let t=this.view.state.field(xt,!1);if(t&&t.tooltip&&this.view.state.facet(et).closeOnBlur){let e=t.open&&rh(this.view,t.open.tooltip);(!e||!e.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Bi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Fn.of(!1)}),20),this.composing=0}}}),em=typeof navigator=="object"&&/Win/.test(navigator.platform),im=ye.highest(O.domEventHandlers({keydown(n,t){let e=t.state.field(xt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||n.key.length>1||n.ctrlKey&&!(em&&n.altKey)||n.metaKey)return!1;let i=e.open.options[e.open.selected],s=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Kr(t,i),!1}})),kc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class nm{constructor(t,e,i,s){this.field=t,this.line=e,this.from=i,this.to=s}}class $r{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,at.TrackDel),i=t.mapPos(this.to,1,at.TrackDel);return e==null||i==null?null:new $r(this.field,e,i)}}class jr{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],s=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;f<h;f++)c+=t.facet(qn);s.push(e+c.length-h),a=c+a.slice(h)}i.push(a),e+=a.length+1}let l=this.fieldPositions.map(a=>new $r(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],s=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<e.length;f++)(l!=null?e[f].seq==l:h&&e[f].name==h)&&(c=f);if(c<0){let f=0;for(;f<e.length&&(l==null||e[f].seq!=null&&e[f].seq<l);)f++;e.splice(f,0,{seq:l,name:h}),c=f;for(let u of s)u.field>=c&&u.field++}s.push(new nm(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of s)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new jr(i,s)}}let sm=P.widget({widget:new class extends Ie{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),rm=P.mark({class:"cm-snippetField"});class si{constructor(t,e){this.ranges=t,this.active=e,this.deco=P.set(t.map(i=>(i.from==i.to?sm:rm).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let s=i.map(t);if(!s)return null;e.push(s)}return new si(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Hi=N.define({map(n,t){return n&&n.map(t)}}),om=N.define(),Pi=mt.define({create(){return null},update(n,t){for(let e of t.effects){if(e.is(Hi))return e.value;if(e.is(om)&&n)return new si(n.ranges,e.value)}return n&&t.docChanged&&(n=n.map(t.changes)),n&&t.selection&&!n.selectionInsideField(t.selection)&&(n=null),n},provide:n=>O.decorations.from(n,t=>t?t.deco:P.none)});function Ur(n,t){return b.create(n.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function lm(n){let t=jr.parse(n);return(e,i,s,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,s),a={changes:{from:s,to:r,insert:F.of(o)},scrollIntoView:!0,annotations:i?[zr.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=Ur(l,0)),l.some(c=>c.field>0)){let c=new si(l,0),h=a.effects=[Hi.of(c)];e.state.field(Pi,!1)===void 0&&h.push(N.appendConfig.of([Pi,um,dm,kc]))}e.dispatch(e.state.update(a))}}function vc(n){return({state:t,dispatch:e})=>{let i=t.field(Pi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return e(t.update({selection:Ur(i.ranges,s),effects:Hi.of(r?null:new si(i.ranges,s)),scrollIntoView:!0})),!0}}const am=({state:n,dispatch:t})=>n.field(Pi,!1)?(t(n.update({effects:Hi.of(null)})),!0):!1,hm=vc(1),cm=vc(-1),fm=[{key:"Tab",run:hm,shift:cm},{key:"Escape",run:am}],Ll=T.define({combine(n){return n.length?n[0]:fm}}),um=ye.highest(Mr.compute([Ll],n=>n.facet(Ll)));function _m(n,t){return Object.assign(Object.assign({},t),{apply:lm(n)})}const dm=O.domEventHandlers({mousedown(n,t){let e=t.state.field(Pi,!1),i;if(!e||(i=t.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=e.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==e.active?!1:(t.dispatch({selection:Ur(e.ranges,s.field),effects:Hi.of(e.ranges.some(r=>r.field>s.field)?new si(e.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Ri={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ae=N.define({map(n,t){let e=t.mapPos(n,-1,at.TrackAfter);return e??void 0}}),Gr=new class extends De{};Gr.startSide=1;Gr.endSide=-1;const Cc=mt.define({create(){return K.empty},update(n,t){if(n=n.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);n=n.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Ae)&&(n=n.update({add:[Gr.range(e.value,e.value+1)]}));return n}});function Qm(){return[gm,Cc]}const ms="()[]{}<>";function Ac(n){for(let t=0;t<ms.length;t+=2)if(ms.charCodeAt(t)==n)return ms.charAt(t+1);return ur(n<128?n:n+1)}function Mc(n,t){return n.languageDataAt("closeBrackets",t)[0]||Ri}const pm=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gm=O.inputHandler.of((n,t,e,i)=>{if((pm?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Gt(yt(i,0))==1||t!=s.from||e!=s.to)return!1;let r=ym(n.state,i);return r?(n.dispatch(r),!0):!1}),mm=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let i=Mc(n,n.selection.main.head).brackets||Ri.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=bm(n.doc,o.head);for(let a of i)if(a==l&&Yn(n.doc,o.head)==Ac(yt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||t(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Zm=[{key:"Backspace",run:mm}];function ym(n,t){let e=Mc(n,n.selection.main.head),i=e.brackets||Ri.brackets;for(let s of i){let r=Ac(yt(s,0));if(t==s)return r==s?Sm(n,s,i.indexOf(s+s+s)>-1,e):xm(n,s,r,e.before||Ri.before);if(t==r&&Dc(n,n.selection.main.from))return wm(n,s,r)}return null}function Dc(n,t){let e=!1;return n.field(Cc).between(0,n.doc.length,i=>{i==t&&(e=!0)}),e}function Yn(n,t){let e=n.sliceString(t,t+2);return e.slice(0,Gt(yt(e,0)))}function bm(n,t){let e=n.sliceString(t-2,t);return Gt(yt(e,0))==e.length?e:e.slice(1)}function xm(n,t,e,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Ae.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=Yn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Ae.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function wm(n,t,e){let i=null,s=n.changeByRange(r=>r.empty&&Yn(n.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Sm(n,t,e,i){let s=i.stringPrefixes||Ri.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ae.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=Yn(n.doc,a),h;if(c==t){if(El(n,a))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(Dc(n,a)){let u=e&&n.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&n.sliceDoc(a-2*t.length,a)==t+t&&(h=Il(n,a-2*t.length,s))>-1&&El(n,h))return{changes:{insert:t+t+t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(n.charCategorizer(a)(c)!=J.Word&&Il(n,a,s)>-1&&!km(n,a,t,s))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function El(n,t){let e=St(n).resolveInner(t+1);return e.parent&&e.from==t}function km(n,t,e,i){let s=St(n).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>e.length+a;){if(n.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=s.to==t&&s.parent;if(!c)break;s=c}return!1}function Il(n,t,e){let i=n.charCategorizer(t);if(i(n.sliceDoc(t-1,t))!=J.Word)return t;for(let s of e){let r=t-s.length;if(n.sliceDoc(r,t)==s&&i(n.sliceDoc(r-1,r))!=J.Word)return r}return-1}function t0(n={}){return[im,xt,et.of(n),tm,Cm,kc]}const vm=[{key:"Ctrl-Space",run:Rl},{mac:"Alt-`",run:Rl},{key:"Escape",run:Xg},{key:"ArrowDown",run:ln(!0)},{key:"ArrowUp",run:ln(!1)},{key:"PageDown",run:ln(!0,"page")},{key:"PageUp",run:ln(!1,"page")},{key:"Enter",run:Yg}],Cm=ye.highest(Mr.computeN([et],n=>n.facet(et).defaultKeymap?[vm]:[]));export{Lm as A,mh as B,Hn as C,ed as D,O as E,Vm as F,Hm as G,Wm as H,Y as I,Im as J,Rm as K,ir as L,Fm as M,Dr as N,Nm as O,ch as P,Cd as Q,Xm as R,Ch as S,U as T,Rg as U,b as V,_m as W,dh as X,qd as Y,vm as a,H as b,Zm as c,Um as d,Pm as e,Om as f,$m as g,jm as h,Mm as i,Dm as j,zm as k,Km as l,Qm as m,Jm as n,Mr as o,t0 as p,Tm as q,Bm as r,Ym as s,Gm as t,qm as u,St as v,gt as w,L as x,xd as y,M as z};
+`);i>-1&&(e=e.slice(0,i))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(e=e.slice(0,r-(i-e.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);e+=l,i=o+l.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=t+e;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;e+=o-s}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return r==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=i:this.chunk.push(t,e,i,r),s}parseLine(t){let{line:e,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new kh(e,t?t.state.tabSize:4,t?Le(t.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Mh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=U.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Yd,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new U(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new U(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Mh(n,t,e){t.start=t.pos;for(let i=0;i<10;i++){let s=n(t,e);if(t.pos>t.start)return s}throw new Error("Stream parser failed to advance stream.")}const Lr=Object.create(null),Oi=[gt.none],Yd=new Dr(Oi),ul=[],dl=Object.create(null),Dh=Object.create(null);for(let[n,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dh[n]=Th(Lr,t);class Oh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Dh)}resolve(t){return t?this.table[t]||(this.table[t]=Th(this.extra,t)):0}}const Xd=new Oh(Lr);function fs(n,t){ul.indexOf(n)>-1||(ul.push(n),console.warn(t))}function Th(n,t){let e=[];for(let l of t.split(" ")){let a=[];for(let c of l.split(".")){let h=n[c]||M[c];h?typeof h=="function"?a.length?a=a.map(h):fs(c,`Modifier ${c} used at start of tag`):a.length?fs(c,`Tag ${c} used as modifier`):a=Array.isArray(h)?h:[h]:fs(c,`Unknown highlighting tag ${c}`)}for(let c of a)e.push(c)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+e.map(l=>l.id),r=dl[s];if(r)return r.id;let o=dl[s]=gt.define({id:Oi.length,name:i,props:[xd({[i]:e})]});return Oi.push(o),o.id}function _d(n,t){let e=gt.define({id:Oi.length,name:"Document",props:[Ce.add(()=>n),mh.add(()=>i=>t.getIndent(i))],top:!0});return Oi.push(e),e}X.RTL,X.LTR;const Qd=n=>{let{state:t}=n,e=t.doc.lineAt(t.selection.main.from),i=Ir(n.state,e.from);return i.line?Zd(n):i.block?ep(n):!1};function Er(n,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=n(t,e);return s?(i(e.update(s)),!0):!1}}const Zd=Er(sp,0),tp=Er(Bh,0),ep=Er((n,t)=>Bh(n,t,np(t)),0);function Ir(n,t){let e=n.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const ci=50;function ip(n,{open:t,close:e},i,s){let r=n.sliceDoc(i-ci,i),o=n.sliceDoc(s,s+ci),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-t.length,c)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,f;s-i<=2*ci?h=f=n.sliceDoc(i,s):(h=n.sliceDoc(i,i+ci),f=n.sliceDoc(s-ci,s));let u=/^\s*/.exec(h)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return h.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(h.charAt(u+t.length))?1:0},close:{pos:s-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function np(n){let t=[];for(let e of n.selection.ranges){let i=n.doc.lineAt(e.from),s=e.to<=i.to?i:n.doc.lineAt(e.to);s.from>i.from&&s.from==e.to&&(s=e.to==i.to+1?i:n.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=s.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return t}function Bh(n,t,e=t.selection.ranges){let i=e.map(r=>Ir(t,r.from).block);if(!i.every(r=>r))return null;let s=e.map((r,o)=>ip(t,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:t.changes(e.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:c,close:h}=l;r.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:h.pos-h.margin,to:h.pos+a.close.length})}return{changes:r}}return null}function sp(n,t,e=t.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of e){let l=i.length,a=1e9,c=Ir(t,r).line;if(c){for(let h=r;h<=o;){let f=t.doc.lineAt(h);if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+c.length)==c?u:-1;u<f.text.length&&u<a&&(a=u),i.push({line:f,comment:p,token:c,indent:u,empty:d,single:!1})}h=f.to+1}if(a<1e9)for(let h=l;h<i.length;h++)i[h].indent<i[h].line.text.length&&(i[h].indent=a);i.length==l+1&&(i[l].single=!0)}}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:h,single:f}of i)(f||!h)&&r.push({from:l.from+c,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,h=c+a.length;o.text[h-o.from]==" "&&h++,r.push({from:c,to:h})}return{changes:r}}return null}const or=oe.define(),rp=oe.define(),op=T.define(),Ph=T.define({combine(n){return Ee(n,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,s)=>t(i,s)||e(i,s)})}}),Rh=mt.define({create(){return _t.empty},update(n,t){let e=t.state.facet(Ph),i=t.annotation(or);if(i){let a=wt.fromTransaction(t,i.selection),c=i.side,h=c==0?n.undone:n.done;return a?h=Bn(h,h.length,e.minDepth,a):h=Ih(h,t.startState.selection),new _t(c==0?i.rest:h,c==0?h:i.rest)}let s=t.annotation(rp);if((s=="full"||s=="before")&&(n=n.isolate()),t.annotation(Z.addToHistory)===!1)return t.changes.empty?n:n.addMapping(t.changes.desc);let r=wt.fromTransaction(t),o=t.annotation(Z.time),l=t.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,e,t):t.selection&&(n=n.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(t=>t.toJSON()),undone:n.undone.map(t=>t.toJSON())}},fromJSON(n){return new _t(n.done.map(wt.fromJSON),n.undone.map(wt.fromJSON))}});function $m(n={}){return[Rh,Ph.of(n),O.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Lh:t.inputType=="historyRedo"?lr:null;return i?(t.preventDefault(),i(e)):!1}})]}function jn(n,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let s=e.field(Rh,!1);if(!s)return!1;let r=s.pop(n,e,t);return r?(i(r),!0):!1}}const Lh=jn(0,!1),lr=jn(1,!1),lp=jn(0,!0),ap=jn(1,!0);class wt{constructor(t,e,i,s,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(t){return new wt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(t){return new wt(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Qt.fromJSON(t.mapped),t.startSelection&&b.fromJSON(t.startSelection),t.selectionsAfter.map(b.fromJSON))}static fromTransaction(t,e){let i=Rt;for(let s of t.startState.facet(op)){let r=s(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new wt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Rt)}static selection(t){return new wt(void 0,Rt,void 0,void 0,t)}}function Bn(n,t,e,i){let s=t+1>e+20?t-e-1:0,r=n.slice(s,t);return r.push(i),r}function hp(n,t){let e=[],i=!1;return n.iterChangedRanges((s,r)=>e.push(s,r)),t.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<e.length;){let c=e[a++],h=e[a++];l>=c&&o<=h&&(i=!0)}}),i}function cp(n,t){return n.ranges.length==t.ranges.length&&n.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Eh(n,t){return n.length?t.length?n.concat(t):n:t}const Rt=[],fp=200;function Ih(n,t){if(n.length){let e=n[n.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-fp));return i.length&&i[i.length-1].eq(t)?n:(i.push(t),Bn(n,n.length-1,1e9,e.setSelAfter(i)))}else return[wt.selection([t])]}function up(n){let t=n[n.length-1],e=n.slice();return e[n.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function us(n,t){if(!n.length)return n;let e=n.length,i=Rt;for(;e;){let s=dp(n[e-1],t,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,e);return r[e-1]=s,r}else t=s.mapped,e--,i=s.selectionsAfter}return i.length?[wt.selection(i)]:Rt}function dp(n,t,e){let i=Eh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(t)):Rt,e);if(!n.changes)return wt.selection(i);let s=n.changes.map(t),r=t.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new wt(s,N.mapEffects(n.effects,t),o,n.startSelection.map(r),i)}const pp=/^(input\.type|delete)($|\.)/;class _t{constructor(t,e,i=0,s=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new _t(this.done,this.undone):this}addChanges(t,e,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||pp.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,hp(l.changes,t.changes))||i=="input.type.compose")?o=Bn(o,o.length-1,s.minDepth,new wt(t.changes.compose(l.changes),Eh(N.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,Rt)):o=Bn(o,o.length,s.minDepth,t),new _t(o,Rt,e,i)}addSelection(t,e,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Rt;return r.length>0&&e-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&cp(r[r.length-1],t)?this:new _t(Ih(this.done,t),this.undone,e,i)}addMapping(t){return new _t(us(this.done,t),us(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let s=t==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:or.of({side:t,rest:up(s),selection:o}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Rt:s.slice(0,s.length-1);return r.mapped&&(l=us(l,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:or.of({side:t,rest:l,selection:o}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}_t.empty=new _t(Rt,Rt);const jm=[{key:"Mod-z",run:Lh,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:lr,preventDefault:!0},{linux:"Ctrl-Shift-z",run:lr,preventDefault:!0},{key:"Mod-u",run:lp,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ap,preventDefault:!0}];function ii(n,t){return b.create(n.ranges.map(t),n.mainIndex)}function te(n,t){return n.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ht({state:n,dispatch:t},e){let i=ii(n.selection,e);return i.eq(n.selection,!0)?!1:(t(te(n,i)),!0)}function Un(n,t){return b.cursor(t?n.to:n.from)}function Nh(n,t){return Ht(n,e=>e.empty?n.moveByChar(e,t):Un(e,t))}function ut(n){return n.textDirectionAt(n.state.selection.main.head)==X.LTR}const Fh=n=>Nh(n,!ut(n)),Vh=n=>Nh(n,ut(n));function Hh(n,t){return Ht(n,e=>e.empty?n.moveByGroup(e,t):Un(e,t))}const gp=n=>Hh(n,!ut(n)),mp=n=>Hh(n,ut(n));function yp(n,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(t.from,t.to)))||t.firstChild}function Gn(n,t,e){let i=St(n).resolveInner(t.head),s=e?L.closedBy:L.openedBy;for(let a=t.head;;){let c=e?i.childAfter(a):i.childBefore(a);if(!c)break;yp(n,c,s)?i=c:a=e?c.to:c.from}let r=i.type.prop(s),o,l;return r&&(o=e?Xt(n,i.from,1):Xt(n,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,b.cursor(l,e?-1:1)}const bp=n=>Ht(n,t=>Gn(n.state,t,!ut(n))),xp=n=>Ht(n,t=>Gn(n.state,t,ut(n)));function Wh(n,t){return Ht(n,e=>{if(!e.empty)return Un(e,t);let i=n.moveVertically(e,t);return i.head!=e.head?i:n.moveToLineBoundary(e,t)})}const zh=n=>Wh(n,!1),qh=n=>Wh(n,!0);function Kh(n){let t=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,e=0,i=0,s;if(t){for(let r of n.state.facet(O.scrollMargins)){let o=r(n);o!=null&&o.top&&(e=Math.max(o==null?void 0:o.top,e)),o!=null&&o.bottom&&(i=Math.max(o==null?void 0:o.bottom,i))}s=n.scrollDOM.clientHeight-e-i}else s=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:e,marginBottom:i,selfScroll:t,height:Math.max(n.defaultLineHeight,s-5)}}function $h(n,t){let e=Kh(n),{state:i}=n,s=ii(i.selection,o=>o.empty?n.moveVertically(o,t,e.height):Un(o,t));if(s.eq(i.selection))return!1;let r;if(e.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,c=l.bottom-e.marginBottom;o&&o.top>a&&o.bottom<c&&(r=O.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-a}))}return n.dispatch(te(i,s),{effects:r}),!0}const pl=n=>$h(n,!1),ar=n=>$h(n,!0);function be(n,t,e){let i=n.lineBlockAt(t.head),s=n.moveToLineBoundary(t,e);if(s.head==t.head&&s.head!=(e?i.to:i.from)&&(s=n.moveToLineBoundary(t,e,!1)),!e&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const wp=n=>Ht(n,t=>be(n,t,!0)),Sp=n=>Ht(n,t=>be(n,t,!1)),vp=n=>Ht(n,t=>be(n,t,!ut(n))),kp=n=>Ht(n,t=>be(n,t,ut(n))),Cp=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).from,1)),Ap=n=>Ht(n,t=>b.cursor(n.lineBlockAt(t.head).to,-1));function Mp(n,t,e){let i=!1,s=ii(n.selection,r=>{let o=Xt(n,r.head,-1)||Xt(n,r.head,1)||r.head>0&&Xt(n,r.head-1,1)||r.head<n.doc.length&&Xt(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return b.cursor(l)});return i?(t(te(n,s)),!0):!1}const Dp=({state:n,dispatch:t})=>Mp(n,t);function Nt(n,t){let e=ii(n.state.selection,i=>{let s=t(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return e.eq(n.state.selection)?!1:(n.dispatch(te(n.state,e)),!0)}function jh(n,t){return Nt(n,e=>n.moveByChar(e,t))}const Uh=n=>jh(n,!ut(n)),Gh=n=>jh(n,ut(n));function Jh(n,t){return Nt(n,e=>n.moveByGroup(e,t))}const Op=n=>Jh(n,!ut(n)),Tp=n=>Jh(n,ut(n)),Bp=n=>Nt(n,t=>Gn(n.state,t,!ut(n))),Pp=n=>Nt(n,t=>Gn(n.state,t,ut(n)));function Yh(n,t){return Nt(n,e=>n.moveVertically(e,t))}const Xh=n=>Yh(n,!1),_h=n=>Yh(n,!0);function Qh(n,t){return Nt(n,e=>n.moveVertically(e,t,Kh(n).height))}const gl=n=>Qh(n,!1),ml=n=>Qh(n,!0),Rp=n=>Nt(n,t=>be(n,t,!0)),Lp=n=>Nt(n,t=>be(n,t,!1)),Ep=n=>Nt(n,t=>be(n,t,!ut(n))),Ip=n=>Nt(n,t=>be(n,t,ut(n))),Np=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).from)),Fp=n=>Nt(n,t=>b.cursor(n.lineBlockAt(t.head).to)),yl=({state:n,dispatch:t})=>(t(te(n,{anchor:0})),!0),bl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.doc.length})),!0),xl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:0})),!0),wl=({state:n,dispatch:t})=>(t(te(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Vp=({state:n,dispatch:t})=>(t(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Hp=({state:n,dispatch:t})=>{let e=Jn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return t(n.update({selection:b.create(e),userEvent:"select"})),!0},Wp=({state:n,dispatch:t})=>{let e=ii(n.selection,i=>{let s=St(n),r=s.resolveStack(i.from,1);if(i.empty){let o=s.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return b.range(l.to,l.from)}return i});return e.eq(n.selection)?!1:(t(te(n,e)),!0)},zp=({state:n,dispatch:t})=>{let e=n.selection,i=null;return e.ranges.length>1?i=b.create([e.main]):e.main.empty||(i=b.create([b.cursor(e.main.head)])),i?(t(te(n,i)),!0):!1};function Fi(n,t){if(n.state.readOnly)return!1;let e="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);a<o?(e="delete.backward",a=sn(n,a,!1)):a>o&&(e="delete.forward",a=sn(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=sn(n,o,!1),l=sn(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:e,effects:e=="delete.selection"?O.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function sn(n,t,e){if(n instanceof O)for(let i of n.state.facet(O.atomicRanges).map(s=>s(n)))i.between(t,t,(s,r)=>{s<t&&r>t&&(t=e?r:s)});return t}const Zh=(n,t,e)=>Fi(n,i=>{let s=i.from,{state:r}=n,o=r.doc.lineAt(s),l,a;if(e&&!t&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]=="	")return s-1;let c=ei(l,r.tabSize),h=c%Le(r)||Le(r);for(let f=0;f<h&&l[l.length-1-f]==" ";f++)s--;a=s}else a=rt(o.text,s-o.from,t,t)+o.from,a==s&&o.number!=(t?r.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,s-o.from))&&(a=rt(o.text,a-o.from,!1,!1)+o.from);return a}),hr=n=>Zh(n,!1,!0),tc=n=>Zh(n,!0,!1),ec=(n,t)=>Fi(n,e=>{let i=e.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?s.doc.lines:1)&&(i+=t?1:-1);break}let a=rt(r.text,i-r.from,t)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),h=o(c);if(l!=null&&h!=l)break;(c!=" "||i!=e.head)&&(l=h),i=a}return i}),ic=n=>ec(n,!1),qp=n=>ec(n,!0),Kp=n=>Fi(n,t=>{let e=n.lineBlockAt(t.head).to;return t.head<e?e:Math.min(n.state.doc.length,t.head+1)}),$p=n=>Fi(n,t=>{let e=n.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),jp=n=>Fi(n,t=>{let e=n.moveToLineBoundary(t,!0).head;return t.head<e?e:Math.min(n.state.doc.length,t.head+1)}),Up=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:b.cursor(i.from)}));return t(n.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},Gp=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:rt(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:rt(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return e.changes.empty?!1:(t(n.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Jn(n){let t=[],e=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),e>=s.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:s.from,to:r.to,ranges:[i]});e=r.number+1}return t}function nc(n,t,e){if(n.readOnly)return!1;let i=[],s=[];for(let r of Jn(n)){if(e?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(t(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Jp=({state:n,dispatch:t})=>nc(n,t,!1),Yp=({state:n,dispatch:t})=>nc(n,t,!0);function sc(n,t,e){if(n.readOnly)return!1;let i=[];for(let s of Jn(n))e?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return t(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Xp=({state:n,dispatch:t})=>sc(n,t,!1),_p=({state:n,dispatch:t})=>sc(n,t,!0),Qp=n=>{if(n.state.readOnly)return!1;let{state:t}=n,e=t.changes(Jn(t).map(({from:s,to:r})=>(s>0?s--:r<t.doc.length&&r++,{from:s,to:r}))),i=ii(t.selection,s=>{let r;if(n.lineWrapping){let o=n.lineBlockAt(s.head),l=n.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+n.documentTop-l.bottom+n.defaultLineHeight/2)}return n.moveVertically(s,!0,r)}).map(e);return n.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Zp(n,t){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=St(n).resolveInner(t),i=e.childBefore(t),s=e.childAfter(t),r;return i&&s&&i.to<=t&&s.from>=t&&(r=i.type.prop(L.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Sl=rc(!1),tg=rc(!0);function rc(n){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(s=>{let{from:r,to:o}=s,l=t.doc.lineAt(r),a=!n&&r==o&&Zp(t,r);n&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let c=new Kn(t,{simulateBreak:r,simulateDoubleBreak:!!a}),h=gh(c,r);for(h==null&&(h=ei(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let f=["",Tn(t,h)];return a&&f.push(Tn(t,c.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:F.of(f)},range:b.cursor(r+1+f[1].length)}});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Nr(n,t){let e=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,s,i),e=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const eg=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let e=Object.create(null),i=new Kn(n,{overrideIndentation:r=>{let o=e[r];return o??-1}}),s=Nr(n,(r,o,l)=>{let a=gh(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],h=Tn(n,a);(c!=h||l.from<r.from+c.length)&&(e[r.from]=a,o.push({from:r.from,to:r.from+c.length,insert:h}))});return s.changes.empty||t(n.update(s,{userEvent:"indent"})),!0},oc=({state:n,dispatch:t})=>n.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{i.push({from:e.from,insert:n.facet(qn)})}),{userEvent:"input.indent"})),!0),lc=({state:n,dispatch:t})=>n.readOnly?!1:(t(n.update(Nr(n,(e,i)=>{let s=/^\s*/.exec(e.text)[0];if(!s)return;let r=ei(s,n.tabSize),o=0,l=Tn(n,Math.max(0,r-Le(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:e.from+o,to:e.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),ig=n=>(n.setTabFocusMode(),!0),ng=[{key:"Ctrl-b",run:Fh,shift:Uh,preventDefault:!0},{key:"Ctrl-f",run:Vh,shift:Gh},{key:"Ctrl-p",run:zh,shift:Xh},{key:"Ctrl-n",run:qh,shift:_h},{key:"Ctrl-a",run:Cp,shift:Np},{key:"Ctrl-e",run:Ap,shift:Fp},{key:"Ctrl-d",run:tc},{key:"Ctrl-h",run:hr},{key:"Ctrl-k",run:Kp},{key:"Ctrl-Alt-h",run:ic},{key:"Ctrl-o",run:Up},{key:"Ctrl-t",run:Gp},{key:"Ctrl-v",run:ar}],sg=[{key:"ArrowLeft",run:Fh,shift:Uh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:gp,shift:Op,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:vp,shift:Ep,preventDefault:!0},{key:"ArrowRight",run:Vh,shift:Gh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:mp,shift:Tp,preventDefault:!0},{mac:"Cmd-ArrowRight",run:kp,shift:Ip,preventDefault:!0},{key:"ArrowUp",run:zh,shift:Xh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yl,shift:xl},{mac:"Ctrl-ArrowUp",run:pl,shift:gl},{key:"ArrowDown",run:qh,shift:_h,preventDefault:!0},{mac:"Cmd-ArrowDown",run:bl,shift:wl},{mac:"Ctrl-ArrowDown",run:ar,shift:ml},{key:"PageUp",run:pl,shift:gl},{key:"PageDown",run:ar,shift:ml},{key:"Home",run:Sp,shift:Lp,preventDefault:!0},{key:"Mod-Home",run:yl,shift:xl},{key:"End",run:wp,shift:Rp,preventDefault:!0},{key:"Mod-End",run:bl,shift:wl},{key:"Enter",run:Sl,shift:Sl},{key:"Mod-a",run:Vp},{key:"Backspace",run:hr,shift:hr},{key:"Delete",run:tc},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ic},{key:"Mod-Delete",mac:"Alt-Delete",run:qp},{mac:"Mod-Backspace",run:$p},{mac:"Mod-Delete",run:jp}].concat(ng.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Um=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bp,shift:Bp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:xp,shift:Pp},{key:"Alt-ArrowUp",run:Jp},{key:"Shift-Alt-ArrowUp",run:Xp},{key:"Alt-ArrowDown",run:Yp},{key:"Shift-Alt-ArrowDown",run:_p},{key:"Escape",run:zp},{key:"Mod-Enter",run:tg},{key:"Alt-l",mac:"Ctrl-l",run:Hp},{key:"Mod-i",run:Wp,preventDefault:!0},{key:"Mod-[",run:lc},{key:"Mod-]",run:oc},{key:"Mod-Alt-\\",run:eg},{key:"Shift-Mod-k",run:Qp},{key:"Shift-Mod-\\",run:Dp},{key:"Mod-/",run:Qd},{key:"Alt-A",run:tp},{key:"Ctrl-m",mac:"Shift-Alt-m",run:ig}].concat(sg),Gm={key:"Tab",run:oc,shift:lc};function ot(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=e[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}t++}for(;t<arguments.length;t++)ac(n,arguments[t]);return n}function ac(n,t){if(typeof t=="string")n.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)n.appendChild(t);else if(Array.isArray(t))for(var e=0;e<t.length;e++)ac(n,t[e]);else throw new RangeError("Unsupported child node: "+t)}const vl=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class ti{constructor(t,e,i=0,s=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(vl(l)):vl,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return yt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=ur(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Gt(t);let s=this.normalize(e);if(s.length)for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&r<e.length&&e.charCodeAt(r)==l&&o++}}}match(t,e,i){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?s={from:this.matches[r+1],to:i}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:e,to:i}:this.matches.push(1,e)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(ti.prototype[Symbol.iterator]=function(){return this});const hc={from:-1,to:-1,match:/.*/.exec("")},Fr="gm"+(/x/.unicode==null?"":"u");class cc{constructor(t,e,i,s=0,r=t.length){if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=hc,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new fc(t,e,i,s,r);this.re=new RegExp(e,Fr+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=t.iter();let o=t.lineAt(s);this.curLineStart=o.from,this.matchPos=Pn(t,s),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,s=i+e[0].length;if(this.matchPos=Pn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const ds=new WeakMap;class $e{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let s=ds.get(t);if(!s||s.from>=i||s.to<=e){let l=new $e(e,t.sliceString(e,i));return ds.set(t,l),l}if(s.from==e&&s.to==i)return s;let{text:r,from:o}=s;return o>e&&(r=t.sliceString(e,o)+r,o=e),s.to<i&&(r+=t.sliceString(s.to,i)),ds.set(t,new $e(o,r)),new $e(e,r.slice(e-o,i-o))}}class fc{constructor(t,e,i,s,r){this.text=t,this.to=r,this.done=!1,this.value=hc,this.matchPos=Pn(t,s),this.re=new RegExp(e,Fr+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=$e.get(t,s,this.chunkEnd(s+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,s=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,e)))return this.value={from:i,to:s,match:e},this.matchPos=Pn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=$e.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cc.prototype[Symbol.iterator]=fc.prototype[Symbol.iterator]=function(){return this});function rg(n){try{return new RegExp(n,Fr),!0}catch{return!1}}function Pn(n,t){if(t>=n.length)return t;let e=n.lineAt(t),i;for(;t<e.to&&(i=e.text.charCodeAt(t-e.from))>=56320&&i<57344;)t++;return t}function cr(n){let t=String(n.state.doc.lineAt(n.state.selection.main.head).number),e=ot("input",{class:"cm-textfield",name:"line",value:t}),i=ot("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Rn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},ot("label",n.state.phrase("Go to line"),": ",e)," ",ot("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,c,h,f]=r,u=h?+h.slice(1):0,d=c?+c:l.number;if(c&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Rn.of(!1),O.scrollIntoView(g.from,{y:"center"})],selection:g}),n.focus()}return{dom:i}}const Rn=N.define(),kl=mt.define({create(){return!0},update(n,t){for(let e of t.effects)e.is(Rn)&&(n=e.value);return n},provide:n=>An.from(n,t=>t?cr:null)}),og=n=>{let t=Cn(n,cr);if(!t){let e=[Rn.of(!0)];n.state.field(kl,!1)==null&&e.push(N.appendConfig.of([kl,lg])),n.dispatch({effects:e}),t=Cn(n,cr)}return t&&t.dom.querySelector("input").select(),!0},lg=O.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ag={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},hg=T.define({combine(n){return Ee(n,ag,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function Jm(n){return[pg,dg]}const cg=P.mark({class:"cm-selectionMatch"}),fg=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Cl(n,t,e,i){return(e==0||n(t.sliceDoc(e-1,e))!=J.Word)&&(i==t.doc.length||n(t.sliceDoc(i,i+1))!=J.Word)}function ug(n,t,e,i){return n(t.sliceDoc(e,e+1))==J.Word&&n(t.sliceDoc(i-1,i))==J.Word}const dg=ft.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let t=n.state.facet(hg),{state:e}=n,i=e.selection;if(i.ranges.length>1)return P.none;let s=i.main,r,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return P.none;let a=e.wordAt(s.head);if(!a)return P.none;o=e.charCategorizer(s.head),r=e.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<t.minSelectionLength||a>200)return P.none;if(t.wholeWords){if(r=e.sliceDoc(s.from,s.to),o=e.charCategorizer(s.head),!(Cl(o,e,s.from,s.to)&&ug(o,e,s.from,s.to)))return P.none}else if(r=e.sliceDoc(s.from,s.to),!r)return P.none}let l=[];for(let a of n.visibleRanges){let c=new ti(e.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!o||Cl(o,e,h,f))&&(s.empty&&h<=s.from&&f>=s.to?l.push(fg.range(h,f)):(h>=s.to||f<=s.from)&&l.push(cg.range(h,f)),l.length>t.maxMatches))return P.none}}return P.set(l)}},{decorations:n=>n.decorations}),pg=O.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),gg=({state:n,dispatch:t})=>{let{selection:e}=n,i=b.create(e.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),e.mainIndex);return i.eq(e)?!1:(t(n.update({selection:i})),!0)};function mg(n,t){let{main:e,ranges:i}=n.selection,s=n.wordAt(e.head),r=s&&s.from==e.from&&s.to==e.to;for(let o=!1,l=new ti(n.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new ti(n.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const yg=({state:n,dispatch:t})=>{let{ranges:e}=n.selection;if(e.some(r=>r.from===r.to))return gg({state:n,dispatch:t});let i=n.sliceDoc(e[0].from,e[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=mg(n,i);return s?(t(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:O.scrollIntoView(s.to)})),!0):!1},ni=T.define({combine(n){return Ee(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Og(t),scrollToMatch:t=>O.scrollIntoView(t)})}});class uc{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||rg(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?`
+`:i=="r"?"\r":i=="t"?"	":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new Sg(this):new xg(this)}getCursor(t,e=0,i){let s=t.doc?t:H.create({doc:t});return i==null&&(i=s.doc.length),this.regexp?He(this,s,e,i):Ve(this,s,e,i)}}class dc{constructor(t){this.spec=t}}function Ve(n,t,e,i){return new ti(t.doc,n.unquoted,e,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?bg(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function bg(n,t){return(e,i,s,r)=>((r>e||r+s.length<i)&&(r=Math.max(0,e-2),s=n.sliceString(r,Math.min(n.length,i+2))),(t(Ln(s,e-r))!=J.Word||t(En(s,e-r))!=J.Word)&&(t(En(s,i-r))!=J.Word||t(Ln(s,i-r))!=J.Word))}class xg extends dc{constructor(t){super(t)}nextMatch(t,e,i){let s=Ve(this.spec,t,i,t.doc.length).nextOverlapping();if(s.done){let r=Math.min(t.doc.length,e+this.spec.unquoted.length);s=Ve(this.spec,t,0,r).nextOverlapping()}return s.done||s.value.from==e&&s.value.to==i?null:s.value}prevMatchInRange(t,e,i){for(let s=i;;){let r=Math.max(e,s-1e4-this.spec.unquoted.length),o=Ve(this.spec,t,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==e)return null;s-=1e4}}prevMatch(t,e,i){let s=this.prevMatchInRange(t,0,e);return s||(s=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),s&&(s.from!=e||s.to!=i)?s:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Ve(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=Ve(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function He(n,t,e,i){return new cc(t.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?wg(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Ln(n,t){return n.slice(rt(n,t,!1),t)}function En(n,t){return n.slice(t,rt(n,t))}function wg(n){return(t,e,i)=>!i[0].length||(n(Ln(i.input,i.index))!=J.Word||n(En(i.input,i.index))!=J.Word)&&(n(En(i.input,i.index+i[0].length))!=J.Word||n(Ln(i.input,i.index+i[0].length))!=J.Word)}class Sg extends dc{nextMatch(t,e,i){let s=He(this.spec,t,i,t.doc.length).next();return s.done&&(s=He(this.spec,t,0,e).next()),s.done?null:s.value}prevMatchInRange(t,e,i){for(let s=1;;s++){let r=Math.max(e,i-s*1e4),o=He(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i<t.match.length?t.match[i]:e)}matchAll(t,e){let i=He(this.spec,t,0,t.doc.length),s=[];for(;!i.next().done;){if(s.length>=e)return null;s.push(i.value)}return s}highlight(t,e,i,s){let r=He(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ti=N.define(),Vr=N.define(),ue=mt.define({create(n){return new ps(fr(n).create(),null)},update(n,t){for(let e of t.effects)e.is(Ti)?n=new ps(e.value.create(),n.panel):e.is(Vr)&&(n=new ps(n.query,e.value?Hr:null));return n},provide:n=>An.from(n,t=>t.panel)});class ps{constructor(t,e){this.query=t,this.panel=e}}const vg=P.mark({class:"cm-searchMatch"}),kg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Cg=ft.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ue))}update(n){let t=n.state.field(ue);(t!=n.startState.field(ue)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:n,panel:t}){if(!t||!n.spec.valid)return P.none;let{view:e}=this,i=new Oe;for(let s=0,r=e.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(e.state,l,a,(c,h)=>{let f=e.state.selection.ranges.some(u=>u.from==c&&u.to==h);i.add(c,h,f?kg:vg)})}return i.finish()}},{decorations:n=>n.decorations});function Vi(n){return t=>{let e=t.state.field(ue,!1);return e&&e.query.spec.valid?n(t,e):mc(t)}}const In=Vi((n,{query:t})=>{let{to:e}=n.state.selection.main,i=t.nextMatch(n.state,e,e);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(ni);return n.dispatch({selection:s,effects:[Wr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),gc(n),!0}),Nn=Vi((n,{query:t})=>{let{state:e}=n,{from:i}=e.selection.main,s=t.prevMatch(e,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(ni);return n.dispatch({selection:r,effects:[Wr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),gc(n),!0}),Ag=Vi((n,{query:t})=>{let e=t.matchAll(n.state,1e3);return!e||!e.length?!1:(n.dispatch({selection:b.create(e.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Mg=({state:n,dispatch:t})=>{let e=n.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:s}=e.main,r=[],o=0;for(let l=new ti(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return t(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Al=Vi((n,{query:t})=>{let{state:e}=n,{from:i,to:s}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=r,l=[],a,c,h=[];if(o.from==i&&o.to==s&&(c=e.toText(t.getReplacement(o)),l.push({from:o.from,to:o.to,insert:c}),o=t.nextMatch(e,o.from,o.to),h.push(O.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),o){let f=l.length==0||l[0].from>=r.to?0:r.to-r.from-c.length;a=b.single(o.from-f,o.to-f),h.push(Wr(n,o)),h.push(e.facet(ni).scrollToMatch(a.main,n))}return n.dispatch({changes:l,selection:a,effects:h,userEvent:"input.replace"}),!0}),Dg=Vi((n,{query:t})=>{if(n.state.readOnly)return!1;let e=t.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:t.getReplacement(s)}});if(!e.length)return!1;let i=n.state.phrase("replaced $ matches",e.length)+".";return n.dispatch({changes:e,effects:O.announce.of(i),userEvent:"input.replace.all"}),!0});function Hr(n){return n.state.facet(ni).createPanel(n)}function fr(n,t){var e,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(t&&!a)return t;let c=n.facet(ni);return new uc({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(s=t==null?void 0:t.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function pc(n){let t=Cn(n,Hr);return t&&t.dom.querySelector("[main-field]")}function gc(n){let t=pc(n);t&&t==n.root.activeElement&&t.select()}const mc=n=>{let t=n.state.field(ue,!1);if(t&&t.panel){let e=pc(n);if(e&&e!=n.root.activeElement){let i=fr(n.state,t.query.spec);i.valid&&n.dispatch({effects:Ti.of(i)}),e.focus(),e.select()}}else n.dispatch({effects:[Vr.of(!0),t?Ti.of(fr(n.state,t.query.spec)):N.appendConfig.of(Bg)]});return!0},yc=n=>{let t=n.state.field(ue,!1);if(!t||!t.panel)return!1;let e=Cn(n,Hr);return e&&e.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Vr.of(!1)}),!0},Ym=[{key:"Mod-f",run:mc,scope:"editor search-panel"},{key:"F3",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:In,shift:Nn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:yc,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Mg},{key:"Mod-Alt-g",run:og},{key:"Mod-d",run:yg,preventDefault:!0}];class Og{constructor(t){this.view=t;let e=this.query=t.state.field(ue).query.spec;this.commit=this.commit.bind(this),this.searchField=ot("input",{value:e.search,placeholder:kt(t,"Find"),"aria-label":kt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ot("input",{value:e.replace,placeholder:kt(t,"Replace"),"aria-label":kt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ot("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=ot("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=ot("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(s,r,o){return ot("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=ot("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>In(t),[kt(t,"next")]),i("prev",()=>Nn(t),[kt(t,"previous")]),i("select",()=>Ag(t),[kt(t,"all")]),ot("label",null,[this.caseField,kt(t,"match case")]),ot("label",null,[this.reField,kt(t,"regexp")]),ot("label",null,[this.wordField,kt(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,i("replace",()=>Al(t),[kt(t,"replace")]),i("replaceAll",()=>Dg(t),[kt(t,"replace all")])],ot("button",{name:"close",onclick:()=>yc(t),"aria-label":kt(t,"close"),type:"button"},["×"])])}commit(){let t=new uc({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Ti.of(t)}))}keydown(t){Cu(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Nn:In)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Al(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Ti)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ni).top}}function kt(n,t){return n.state.phrase(t)}const rn=30,on=/[\s\.,:;?!]/;function Wr(n,{from:t,to:e}){let i=n.state.doc.lineAt(t),s=n.state.doc.lineAt(e).to,r=Math.max(i.from,t-rn),o=Math.min(s,e+rn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<rn;a++)if(!on.test(l[a+1])&&on.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-rn;a--)if(!on.test(l[a-1])&&on.test(l[a])){l=l.slice(0,a);break}}return O.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const Tg=O.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Bg=[ue,ye.low(Cg),Tg];class bc{constructor(t,e,i,s){this.state=t,this.pos=e,this.explicit=i,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=St(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),s=e.text.slice(i-e.from,this.pos-e.from),r=s.search(xc(t,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,i){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Ml(n){let t=Object.keys(n).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Pg(n){let t=Object.create(null),e=Object.create(null);for(let{label:s}of n){t[s[0]]=!0;for(let r=1;r<s.length;r++)e[s[r]]=!0}let i=Ml(t)+Ml(e)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Rg(n){let t=n.map(s=>typeof s=="string"?{label:s}:s),[e,i]=t.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Pg(t);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:t,validFor:e}:null}}function Xm(n,t){return e=>{for(let i=St(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}class Dl{constructor(t,e,i,s){this.completion=t,this.source=e,this.match=i,this.score=s}}function Me(n){return n.selection.main.from}function xc(n,t){var e;let{source:i}=n,s=t&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(e=n.flags)!==null&&e!==void 0?e:n.ignoreCase?"i":"")}const zr=oe.define();function Lg(n,t,e,i){let{main:s}=n.selection,r=e-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>{if(l!=s&&e!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(e,i))return{range:l};let a=n.toText(t);return{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:a},range:b.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const Ol=new WeakMap;function Eg(n){if(!Array.isArray(n))return n;let t=Ol.get(n);return t||Ol.set(n,t=Rg(n)),t}const Fn=N.define(),Bi=N.define();class Ig{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=yt(t,e),s=Gt(i);this.chars.push(i);let r=t.slice(e,e+s),o=r.toUpperCase();this.folded.push(yt(o==r?r.toLowerCase():o,0)),e+=s}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:s,precise:r,byWord:o}=this;if(e.length==1){let x=yt(t,0),S=Gt(x),v=S==t.length?0:-100;if(x!=e[0])if(x==i[0])v+=-200;else return null;return this.ret(v,[0,S])}let l=t.indexOf(this.pattern);if(l==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,c=0;if(l<0){for(let x=0,S=Math.min(t.length,200);x<S&&c<a;){let v=yt(t,x);(v==e[c]||v==i[c])&&(s[c++]=x),x+=Gt(v)}if(c<a)return null}let h=0,f=0,u=!1,d=0,p=-1,g=-1,m=/[a-z]/.test(t),y=!0;for(let x=0,S=Math.min(t.length,200),v=0;x<S&&f<a;){let w=yt(t,x);l<0&&(h<a&&w==e[h]&&(r[h++]=x),d<a&&(w==e[d]||w==i[d]?(d==0&&(p=x),g=x+1,d++):d=0));let k,A=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(k=ur(w))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!x||A==1&&m||v==0&&A!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),v=A,x+=Gt(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-900-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,t):e.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,t)}result(t,e,i){let s=[],r=0;for(let o of e){let l=o+(this.astral?Gt(yt(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(t-i.length,s)}}class Ng{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const et=T.define({combine(n){return Ee(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Fg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Tl(t(i),e(i)),optionClass:(t,e)=>i=>Tl(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function Tl(n,t){return n?t?n+" "+t:n:t}function Fg(n,t,e,i,s,r){let o=n.textDirection==X.RTL,l=o,a=!1,c="top",h,f,u=t.left-s.left,d=s.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))h=Math.max(s.top,Math.min(e.top,s.bottom-g))-t.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?t.right:s.right-t.left)-30);let x=s.bottom-t.bottom;x>=g||x>t.top?h=e.bottom-t.top:(c="bottom",h=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,y=(t.right-t.left)/r.offsetWidth;return{style:`${c}: ${h/m}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function Vg(n){let t=n.addToOptions.slice();return n.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let c=0;c<r.length;){let h=r[c++],f=r[c++];h>a&&o.appendChild(document.createTextNode(l.slice(a,h)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(h,f))),u.className="cm-completionMatchedText",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(e){if(!e.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=e.detail,i},position:80}),t.sort((e,i)=>e.position-i.position).map(e=>e.render)}function gs(n,t,e){if(n<=e)return{from:0,to:n};if(t<0&&(t=0),t<=n>>1){let s=Math.floor(t/e);return{from:s*e,to:(s+1)*e}}let i=Math.floor((n-t)/e);return{from:n-(i+1)*e,to:n-i*e}}class Hg{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=t.state.field(e),{options:r,selected:o}=s.open,l=t.state.facet(et);this.optionContent=Vg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=gs(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=t.state.field(e).open;for(let h=a.target,f;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(f=/-(\d+)$/.exec(h.id))&&+f[1]<c.length){this.applyCompletion(t,c[+f[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(et).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Bi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),s=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=gs(r.length,o,t.state.facet(et).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=s.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=gs(e.options.length,e.selected,this.view.state.facet(et).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>At(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:s,destroy:r}=t;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&zg(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,e.bottom)-10||s.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(et).positionInfo(this.view,e,s,i,r,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const s=document.createElement("ul");s.id=e,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=t[o],{section:c}=l;if(c){let u=typeof c=="string"?c:c.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof c!="string"&&c.header)s.appendChild(c.header(c));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const h=s.appendChild(document.createElement("li"));h.id=e+"-"+o,h.setAttribute("role","option");let f=this.optionClass(l);f&&(h.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&h.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Wg(n,t){return e=>new Hg(e,n,t)}function zg(n,t){let e=n.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.height/n.offsetHeight;i.top<e.top?n.scrollTop-=(e.top-i.top)/s:i.bottom>e.bottom&&(n.scrollTop+=(i.bottom-e.bottom)/s)}function Bl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function qg(n,t){let e=[],i=null,s=c=>{e.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let f=typeof h=="string"?h:h.name;i.some(u=>u.name==f)||i.push(typeof h=="string"?{name:f}:h)}},r=t.facet(et);for(let c of n)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new Dl(f,c.source,h?h(f):[],1e9-e.length));else{let f=t.sliceDoc(c.from,c.to),u,d=r.filterStrict?new Ng(f):new Ig(f);for(let p of c.result.options)if(u=d.match(p.label)){let g=p.displayLabel?h?h(p,u.matched):[]:u.matched;s(new Dl(p,c.source,g,u.score+(p.boost||0)))}}}if(i){let c=Object.create(null),h=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.name<d.name?-1:1)};for(let u of i.sort(f))h-=1e5,c[u.name]=h;for(let u of e){let{section:d}=u.completion;d&&(u.score+=c[typeof d=="string"?d:d.name])}}let o=[],l=null,a=r.compareCompletions;for(let c of e.sort((h,f)=>f.score-h.score||a(h.completion,f.completion))){let h=c.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(c):Bl(c.completion)>Bl(l)&&(o[o.length-1]=c),l=c.completion}return o}class We{constructor(t,e,i,s,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new We(this.options,Pl(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,s,r,o){if(s&&!o&&t.some(c=>c.isPending))return s.setDisabled();let l=qg(t,e);if(!l.length)return s&&t.some(c=>c.isPending)?s.setDisabled():null;let a=e.facet(et).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let c=s.options[s.selected].completion;for(let h=0;h<l.length;h++)if(l[h].completion==c){a=h;break}}return new We(l,Pl(i,a),{pos:t.reduce((c,h)=>h.hasResult()?Math.min(c,h.from):c,1e8),create:Jg,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(t){return new We(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new We(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Vn{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new Vn(Ug,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(et),r=(i.override||e.languageDataAt("autocomplete",Me(e)).map(Eg)).map(a=>(this.active.find(h=>h.source==a)||new Lt(a,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open,l=t.effects.some(a=>a.is(qr));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!Kg(r,this.active)||l?o=We.build(r,e,this.id,o,i,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Lt(a.source,0):a));for(let a of t.effects)a.is(Sc)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Vn(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$g:jg}}function Kg(n,t){if(n==t)return!0;for(let e=0,i=0;;){for(;e<n.length&&!n[e].hasResult();)e++;for(;i<t.length&&!t[i].hasResult();)i++;let s=e==n.length,r=i==t.length;if(s||r)return s==r;if(n[e++].result!=t[i++].result)return!1}}const $g={"aria-autocomplete":"list"},jg={};function Pl(n,t){let e={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return t>-1&&(e["aria-activedescendant"]=n+"-"+t),e}const Ug=[];function wc(n,t){if(n.isUserEvent("input.complete")){let i=n.annotation(zr);if(i&&t.activateOnCompletion(i))return 12}let e=n.isUserEvent("input.type");return e&&t.activateOnTyping?5:e?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Lt{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(t,e){let i=wc(t,e),s=this;(i&8||i&16&&this.touches(t))&&(s=new Lt(s.source,0)),i&4&&s.state==0&&(s=new Lt(this.source,1)),s=s.updateFor(t,i);for(let r of t.effects)if(r.is(Fn))s=new Lt(s.source,1,r.value);else if(r.is(Bi))s=new Lt(s.source,0);else if(r.is(qr))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Me(t.state))}}class je extends Lt{constructor(t,e,i,s,r,o){super(t,3,e),this.limit=i,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(e&3))return this.map(t.changes);let s=this.result;s.map&&!t.changes.empty&&(s=s.map(s,t.changes));let r=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),l=Me(t.state);if(l>o||!s||e&2&&(Me(t.startState)==this.from||l<this.limit))return new Lt(this.source,e&4?1:0);let a=t.changes.mapPos(this.limit);return Gg(s.validFor,t.state,r,o)?new je(this.source,this.explicit,a,s,r,o):s.update&&(s=s.update(s,r,o,new bc(t.state,l,!1)))?new je(this.source,this.explicit,a,s,s.from,(i=s.to)!==null&&i!==void 0?i:Me(t.state)):new Lt(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new je(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Lt(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function Gg(n,t,e,i){if(!n)return!1;let s=t.sliceDoc(e,i);return typeof n=="function"?n(s,e,i,t):xc(n,!0).test(s)}const qr=N.define({map(n,t){return n.map(e=>e.map(t))}}),Sc=N.define(),xt=mt.define({create(){return Vn.start()},update(n,t){return n.update(t)},provide:n=>[sh.from(n,t=>t.tooltip),O.contentAttributes.from(n,t=>t.attrs)]});function Kr(n,t){const e=t.completion.apply||t.completion.label;let i=n.state.field(xt).active.find(s=>s.source==t.source);return i instanceof je?(typeof e=="string"?n.dispatch(Object.assign(Object.assign({},Lg(n.state,e,i.from,i.to)),{annotations:zr.of(t.completion)})):e(n,t.completion,i.from,i.to),!0):!1}const Jg=Wg(xt,Kr);function ln(n,t="option"){return e=>{let i=e.state.field(xt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<e.state.facet(et).interactionDelay)return!1;let s=1,r;t=="page"&&(r=rh(e,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:Sc.of(l)}),!0}}const Yg=n=>{let t=n.state.field(xt,!1);return n.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<n.state.facet(et).interactionDelay?!1:Kr(n,t.open.options[t.open.selected])},Rl=n=>n.state.field(xt,!1)?(n.dispatch({effects:Fn.of(!0)}),!0):!1,Xg=n=>{let t=n.state.field(xt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(n.dispatch({effects:Bi.of(null)}),!0)};class _g{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const Qg=50,Zg=1e3,tm=ft.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of n.state.field(xt).active)t.isPending&&this.startQuery(t)}update(n){let t=n.state.field(xt),e=n.state.facet(et);if(!n.selectionSet&&!n.docChanged&&n.startState.field(xt)==t)return;let i=n.transactions.some(r=>{let o=wc(r,e);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>Qg&&Date.now()-o.time>Zg){for(let l of o.context.abortListeners)try{l()}catch(a){At(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(r=>r.effects.some(o=>o.is(Fn)))&&(this.pendingStart=!0);let s=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of n.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,t=n.field(xt);for(let e of t.active)e.isPending&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}startQuery(n){let{state:t}=this.view,e=Me(t),i=new bc(t,e,n.explicit,this.view),s=new _g(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Bi.of(null)}),At(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(et).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(et),i=this.view.state.field(xt);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=Me(r.updates.length?r.updates[0].startState:this.view.state),a=Math.min(l,r.done.from+(r.active.explicit?0:1)),c=new je(r.active.source,r.active.explicit,a,r.done,r.done.from,(n=r.done.to)!==null&&n!==void 0?n:l);for(let h of r.updates)c=c.update(h,e);if(c.hasResult()){t.push(c);continue}}let o=i.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Lt(r.active.source,0);for(let a of r.updates)l=l.update(a,e);l.isPending||t.push(l)}else this.startQuery(o)}(t.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:qr.of(t)})}},{eventHandlers:{blur(n){let t=this.view.state.field(xt,!1);if(t&&t.tooltip&&this.view.state.facet(et).closeOnBlur){let e=t.open&&rh(this.view,t.open.tooltip);(!e||!e.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Bi.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Fn.of(!1)}),20),this.composing=0}}}),em=typeof navigator=="object"&&/Win/.test(navigator.platform),im=ye.highest(O.domEventHandlers({keydown(n,t){let e=t.state.field(xt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||n.key.length>1||n.ctrlKey&&!(em&&n.altKey)||n.metaKey)return!1;let i=e.open.options[e.open.selected],s=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(n.key)>-1&&Kr(t,i),!1}})),vc=O.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class nm{constructor(t,e,i,s){this.field=t,this.line=e,this.from=i,this.to=s}}class $r{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,at.TrackDel),i=t.mapPos(this.to,1,at.TrackDel);return e==null||i==null?null:new $r(this.field,e,i)}}class jr{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],s=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let c=o,h=/^\t*/.exec(a)[0].length;for(let f=0;f<h;f++)c+=t.facet(qn);s.push(e+c.length-h),a=c+a.slice(h)}i.push(a),e+=a.length+1}let l=this.fieldPositions.map(a=>new $r(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],s=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",c=-1,h=a.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<e.length;f++)(l!=null?e[f].seq==l:h&&e[f].name==h)&&(c=f);if(c<0){let f=0;for(;f<e.length&&(l==null||e[f].seq!=null&&e[f].seq<l);)f++;e.splice(f,0,{seq:l,name:h}),c=f;for(let u of s)u.field>=c&&u.field++}s.push(new nm(c,i.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let h of s)h.line==i.length&&h.from>c&&(h.from--,h.to--);return a}),i.push(o)}return new jr(i,s)}}let sm=P.widget({widget:new class extends Ie{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),rm=P.mark({class:"cm-snippetField"});class si{constructor(t,e){this.ranges=t,this.active=e,this.deco=P.set(t.map(i=>(i.from==i.to?sm:rm).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let s=i.map(t);if(!s)return null;e.push(s)}return new si(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const Hi=N.define({map(n,t){return n&&n.map(t)}}),om=N.define(),Pi=mt.define({create(){return null},update(n,t){for(let e of t.effects){if(e.is(Hi))return e.value;if(e.is(om)&&n)return new si(n.ranges,e.value)}return n&&t.docChanged&&(n=n.map(t.changes)),n&&t.selection&&!n.selectionInsideField(t.selection)&&(n=null),n},provide:n=>O.decorations.from(n,t=>t?t.deco:P.none)});function Ur(n,t){return b.create(n.filter(e=>e.field==t).map(e=>b.range(e.from,e.to)))}function lm(n){let t=jr.parse(n);return(e,i,s,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,s),{main:a}=e.state.selection,c={changes:{from:s,to:r==a.from?a.to:r,insert:F.of(o)},scrollIntoView:!0,annotations:i?[zr.of(i),Z.userEvent.of("input.complete")]:void 0};if(l.length&&(c.selection=Ur(l,0)),l.some(h=>h.field>0)){let h=new si(l,0),f=c.effects=[Hi.of(h)];e.state.field(Pi,!1)===void 0&&f.push(N.appendConfig.of([Pi,um,dm,vc]))}e.dispatch(e.state.update(c))}}function kc(n){return({state:t,dispatch:e})=>{let i=t.field(Pi,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return e(t.update({selection:Ur(i.ranges,s),effects:Hi.of(r?null:new si(i.ranges,s)),scrollIntoView:!0})),!0}}const am=({state:n,dispatch:t})=>n.field(Pi,!1)?(t(n.update({effects:Hi.of(null)})),!0):!1,hm=kc(1),cm=kc(-1),fm=[{key:"Tab",run:hm,shift:cm},{key:"Escape",run:am}],Ll=T.define({combine(n){return n.length?n[0]:fm}}),um=ye.highest(Mr.compute([Ll],n=>n.facet(Ll)));function _m(n,t){return Object.assign(Object.assign({},t),{apply:lm(n)})}const dm=O.domEventHandlers({mousedown(n,t){let e=t.state.field(Pi,!1),i;if(!e||(i=t.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=e.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==e.active?!1:(t.dispatch({selection:Ur(e.ranges,s.field),effects:Hi.of(e.ranges.some(r=>r.field>s.field)?new si(e.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Ri={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ae=N.define({map(n,t){let e=t.mapPos(n,-1,at.TrackAfter);return e??void 0}}),Gr=new class extends De{};Gr.startSide=1;Gr.endSide=-1;const Cc=mt.define({create(){return K.empty},update(n,t){if(n=n.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);n=n.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(Ae)&&(n=n.update({add:[Gr.range(e.value,e.value+1)]}));return n}});function Qm(){return[gm,Cc]}const ms="()[]{}<>";function Ac(n){for(let t=0;t<ms.length;t+=2)if(ms.charCodeAt(t)==n)return ms.charAt(t+1);return ur(n<128?n:n+1)}function Mc(n,t){return n.languageDataAt("closeBrackets",t)[0]||Ri}const pm=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gm=O.inputHandler.of((n,t,e,i)=>{if((pm?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Gt(yt(i,0))==1||t!=s.from||e!=s.to)return!1;let r=ym(n.state,i);return r?(n.dispatch(r),!0):!1}),mm=({state:n,dispatch:t})=>{if(n.readOnly)return!1;let i=Mc(n,n.selection.main.head).brackets||Ri.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=bm(n.doc,o.head);for(let a of i)if(a==l&&Yn(n.doc,o.head)==Ac(yt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||t(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Zm=[{key:"Backspace",run:mm}];function ym(n,t){let e=Mc(n,n.selection.main.head),i=e.brackets||Ri.brackets;for(let s of i){let r=Ac(yt(s,0));if(t==s)return r==s?Sm(n,s,i.indexOf(s+s+s)>-1,e):xm(n,s,r,e.before||Ri.before);if(t==r&&Dc(n,n.selection.main.from))return wm(n,s,r)}return null}function Dc(n,t){let e=!1;return n.field(Cc).between(0,n.doc.length,i=>{i==t&&(e=!0)}),e}function Yn(n,t){let e=n.sliceString(t,t+2);return e.slice(0,Gt(yt(e,0)))}function bm(n,t){let e=n.sliceString(t-2,t);return Gt(yt(e,0))==e.length?e:e.slice(1)}function xm(n,t,e,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:Ae.of(o.to+t.length),range:b.range(o.anchor+t.length,o.head+t.length)};let l=Yn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:Ae.of(o.head+t.length),range:b.cursor(o.head+t.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function wm(n,t,e){let i=null,s=n.changeByRange(r=>r.empty&&Yn(n.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:b.cursor(r.head+e.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Sm(n,t,e,i){let s=i.stringPrefixes||Ri.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Ae.of(l.to+t.length),range:b.range(l.anchor+t.length,l.head+t.length)};let a=l.head,c=Yn(n.doc,a),h;if(c==t){if(El(n,a))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(Dc(n,a)){let u=e&&n.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(e&&n.sliceDoc(a-2*t.length,a)==t+t&&(h=Il(n,a-2*t.length,s))>-1&&El(n,h))return{changes:{insert:t+t+t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)};if(n.charCategorizer(a)(c)!=J.Word&&Il(n,a,s)>-1&&!vm(n,a,t,s))return{changes:{insert:t+t,from:a},effects:Ae.of(a+t.length),range:b.cursor(a+t.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function El(n,t){let e=St(n).resolveInner(t+1);return e.parent&&e.from==t}function vm(n,t,e,i){let s=St(n).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>e.length+a;){if(n.sliceDoc(h.to-e.length,h.to)==e)return!1;h=h.firstChild}return!0}let c=s.to==t&&s.parent;if(!c)break;s=c}return!1}function Il(n,t,e){let i=n.charCategorizer(t);if(i(n.sliceDoc(t-1,t))!=J.Word)return t;for(let s of e){let r=t-s.length;if(n.sliceDoc(r,t)==s&&i(n.sliceDoc(r-1,r))!=J.Word)return r}return-1}function t0(n={}){return[im,xt,et.of(n),tm,Cm,vc]}const km=[{key:"Ctrl-Space",run:Rl},{mac:"Alt-`",run:Rl},{key:"Escape",run:Xg},{key:"ArrowDown",run:ln(!0)},{key:"ArrowUp",run:ln(!1)},{key:"PageDown",run:ln(!0,"page")},{key:"PageUp",run:ln(!1,"page")},{key:"Enter",run:Yg}],Cm=ye.highest(Mr.computeN([et],n=>n.facet(et).defaultKeymap?[km]:[]));export{Lm as A,mh as B,Hn as C,ed as D,O as E,Vm as F,Hm as G,Wm as H,Y as I,Im as J,Rm as K,ir as L,Fm as M,Dr as N,Nm as O,ch as P,Cd as Q,Xm as R,Ch as S,U as T,Rg as U,b as V,_m as W,dh as X,qd as Y,km as a,H as b,Zm as c,Um as d,Pm as e,Om as f,$m as g,jm as h,Mm as i,Dm as j,zm as k,Km as l,Qm as m,Jm as n,Mr as o,t0 as p,Tm as q,Bm as r,Ym as s,Gm as t,qm as u,St as v,gt as w,L as x,xd as y,M as z};
diff --git a/ui/dist/assets/index-Bw7x2V1B.js b/ui/dist/assets/index-DCriA6MP.js
similarity index 77%
rename from ui/dist/assets/index-Bw7x2V1B.js
rename to ui/dist/assets/index-DCriA6MP.js
index 00479885..44df705a 100644
--- a/ui/dist/assets/index-Bw7x2V1B.js
+++ b/ui/dist/assets/index-DCriA6MP.js
@@ -1,128 +1,128 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-DbGqmGAP.js","./index-CH-gyH77.js","./ListApiDocs-D4zfzAhd.js","./FieldsQueryParam-DvIo4uvz.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-DsJmXTBN.js","./CreateApiDocs-C9nzLaaI.js","./UpdateApiDocs-C65dej9I.js","./AuthMethodsDocs-CmjGo_HC.js","./AuthWithPasswordDocs-Cqv3HyrN.js","./AuthWithOAuth2Docs-CJcj5RbS.js","./AuthRefreshDocs-DcPt_azs.js","./CodeEditor-8naseTA8.js"])))=>i.map(i=>d[i]);
-var Ek=Object.defineProperty;var Dk=(n,e,t)=>e in n?Ek(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Dk(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 lo=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function Ik(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function zb(n){return n()}function df(){return Object.create(null)}function Ie(n){n.forEach(zb)}function It(n){return typeof n=="function"}function ye(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function bn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function Lk(n){return Object.keys(n).length===0}function cu(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 Ub(n){let e;return cu(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(cu(e,t))}function Lt(n,e,t,i){if(n){const l=Vb(n,e,t,i);return n[0](l)}}function Vb(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=Vb(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 Wt(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 zs(n){return n??""}function Rn(n,e,t){return n.set(t),e}function Me(n){return n&&It(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 Bb=typeof window<"u";let $r=Bb?()=>window.performance.now():()=>Date.now(),du=Bb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Wb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&du(Wb)}function Or(n){let e;return Zl.size===0&&du(Wb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Yb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Ak(n){const e=b("style");return e.textContent="/* empty */",Pk(Yb(n),e),e.sheet}function Pk(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 dt(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 W(n){return document.createTextNode(n)}function $(){return W(" ")}function ve(){return W("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function nt(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 Nk=["width","height"];function ei(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&&Nk.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Rk(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function Fk(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function he(n,e){n.value=e??""}function qk(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function ee(n,e,t){n.classList.toggle(e,!!t)}function Kb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function zt(n,e){return new n(e)}const fr=new Map;let cr=0;function Hk(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function jk(n,e){const t={stylesheet:Ak(e),rules:{}};return fr.set(n,t),t}function Us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CXrfVJaY.js","./index-CEH5UG_e.js","./ListApiDocs-GWn-CPMs.js","./FieldsQueryParam-JXZpoc_D.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-CWljd9ob.js","./CreateApiDocs-dx3XBFzI.js","./UpdateApiDocs-XHS3RD1Q.js","./AuthMethodsDocs-DubXYrz3.js","./AuthWithPasswordDocs-CepW6s1g.js","./AuthWithOAuth2Docs-C6WI1jtR.js","./AuthRefreshDocs-Bv2HZYxd.js","./CodeEditor-kYUfoxD0.js"])))=>i.map(i=>d[i]);
+var Dk=Object.defineProperty;var Ik=(n,e,t)=>e in n?Dk(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>Ik(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 lo=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function Lk(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ub(n){return n()}function pf(){return Object.create(null)}function Ie(n){n.forEach(Ub)}function It(n){return typeof n=="function"}function ye(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function bn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function Ak(n){return Object.keys(n).length===0}function du(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 Vb(n){let e;return du(n,t=>e=t)(),e}function Qe(n,e,t){n.$$.on_destroy.push(du(e,t))}function Lt(n,e,t,i){if(n){const l=Bb(n,e,t,i);return n[0](l)}}function Bb(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=Bb(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 Wt(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 zs(n){return n??""}function Rn(n,e,t){return n.set(t),e}function Me(n){return n&&It(n.destroy)?n.destroy:te}function mf(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Wb=typeof window<"u";let $r=Wb?()=>window.performance.now():()=>Date.now(),pu=Wb?n=>requestAnimationFrame(n):te;const Zl=new Set;function Yb(n){Zl.forEach(e=>{e.c(n)||(Zl.delete(e),e.f())}),Zl.size!==0&&pu(Yb)}function Or(n){let e;return Zl.size===0&&pu(Yb),{promise:new Promise(t=>{Zl.add(e={c:n,f:t})}),abort(){Zl.delete(e)}}}function w(n,e){n.appendChild(e)}function Kb(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Pk(n){const e=b("style");return e.textContent="/* empty */",Nk(Kb(n),e),e.sheet}function Nk(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 dt(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 W(n){return document.createTextNode(n)}function $(){return W(" ")}function ve(){return W("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function nt(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 Rk=["width","height"];function ei(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&&Rk.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function Fk(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function gt(n){return n===""?null:+n}function qk(n){return Array.from(n.childNodes)}function oe(n,e){e=""+e,n.data!==e&&(n.data=e)}function he(n,e){n.value=e??""}function Hk(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function ee(n,e,t){n.classList.toggle(e,!!t)}function Jb(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function zt(n,e){return new n(e)}const fr=new Map;let cr=0;function jk(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function zk(n,e){const t={stylesheet:Pk(e),rules:{}};return fr.set(n,t),t}function Us(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_${Hk(f)}_${r}`,d=Yb(n),{stylesheet:m,rules:h}=fr.get(d)||jk(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 Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),cr-=l,cr||zk())}function zk(){du(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),fr.clear())})}function Uk(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=lo,start:a=$r()+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=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return Or(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),_()),!d)return!1;if(m){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),g(),f(0,1),_}function Vk(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,Jb(n,l)}}function Jb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function ln(n){so().$$.on_mount.push(n)}function Bk(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function yt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Kb(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 Na=[],Zb=Promise.resolve();let Ra=!1;function Gb(){Ra||(Ra=!0,Zb.then(pu))}function dn(){return Gb(),Zb}function tt(n){Gl.push(n)}function Ce(n){Na.push(n)}const Zr=new Set;let jl=0;function pu(){if(jl!==0)return;const n=Bs;do{try{for(;jl<Yl.length;){const e=Yl[jl];jl++,Fi(e),Wk(e.$$)}}catch(e){throw Yl.length=0,jl=0,e}for(Fi(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(;Na.length;)Na.pop()();Ra=!1,Zr.clear(),Fi(n)}function Wk(n){if(n.fragment!==null){n.update(),Ie(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function Yk(n){const e=[],t=[];Gl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let ys;function mu(){return ys||(ys=Promise.resolve(),ys.then(()=>{ys=null})),ys}function $l(n,e,t){n.dispatchEvent(Kb(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||Ie(wi.c),wi=wi.p}function M(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 hu={duration:0};function Xb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||hu;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const y=$r()+d,S=y+m;r&&r.abort(),s=!0,tt(()=>$l(n,!0,"start")),r=Or(C=>{if(s){if(C>=S)return g(1,0),$l(n,!0,"end"),u(),s=!1;if(C>=y){const T=h((C-y)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),mu().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function _u(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=lo,tick:m=te,css:h}=l||hu;h&&(o=Us(n,1,0,c,f,d,h));const g=$r()+f,_=g+c;tt(()=>$l(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Or(y=>{if(s){if(y>=_)return m(0,1),$l(n,!1,"end"),--r.r||Ie(r.c),!1;if(y>=g){const S=d((y-g)/c);m(1-S,S)}}return s})}return It(l)?mu().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function He(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,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=lo,tick:S=te,css:C}=s||hu,T={start:$r()+g,b:h};h||(T.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&&(c(),u=Us(n,o,h,_,g,y,C)),h&&S(0,1),r=d(T,_),tt(()=>$l(n,h,"start")),Or(O=>{if(a&&O>a.start&&(r=d(a,_),a=null,$l(n,r.b,"start"),C&&(c(),u=Us(n,o,r.b,r.duration,0,y,s.css))),r){if(O>=r.end)S(o=r.b,1-o),$l(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*y(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){It(s)?mu().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(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&pu()}if(Ik(n)){const l=so();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Kk(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 di(n,e){n.d(1),e.delete(n.key)}function Bt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Jk(n,e){n.f(),Bt(n,e)}function vt(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,C=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?C.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 T=new Set,O=new Set;function E(L){M(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)||T.has(A)?E(L):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),E(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];y.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ie(C),_}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(zb).filter(It);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Yk(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Zk(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Gb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function we(n,e,t,i,l,s,o=null,r=[-1]){const a=Bs;Fi(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&&Zk(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Fk(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),pu()}Fi(a)}class Se{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!It(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&&!Lk(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Gk="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Gk);class Al extends Error{}class Xk extends Al{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Qk extends Al{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class xk extends Al{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Al{}class Qb extends Al{constructor(e){super(`Invalid unit ${e}`)}}class pn extends Al{}class Wi extends Al{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Wn="long",dr={year:Ue,month:Ue,day:Ue},xb={year:Ue,month:ci,day:Ue},ev={year:Ue,month:ci,day:Ue,weekday:ci},e0={year:Ue,month:Wn,day:Ue},t0={year:Ue,month:Wn,day:Ue,weekday:Wn},n0={hour:Ue,minute:Ue},i0={hour:Ue,minute:Ue,second:Ue},l0={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},s0={hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn},o0={hour:Ue,minute:Ue,hourCycle:"h23"},r0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},a0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},u0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Wn},f0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},c0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},d0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},p0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},tv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},m0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},h0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},_0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,timeZoneName:Wn},g0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn};class ro{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ro{static get instance(){return Gr===null&&(Gr=new Mr),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return $0(e,t,i)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function nv(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 iv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function lv(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 sv(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l<t.length;l++){const{type:s,value:o}=t[l],r=iv[s];s==="era"?i[r]=o:it(r)||(i[r]=parseInt(o,10))}return i}let To={};class Hi extends ro{static create(e){return To[e]||(To[e]=new Hi(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=Hi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return $0(e,t,i,this.name)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=nv(this.name);let[l,s,o,r,a,u,f]=i.formatToParts?sv(i,t):lv(i,t);r==="BC"&&(l=-Math.abs(l)+1);const d=Dr({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 ov(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 Fa={};function qa(n,e={}){const t=JSON.stringify([n,e]);let i=Fa[t];return i||(i=new Intl.DateTimeFormat(n,e),Fa[t]=i),i}let Ha={};function rv(n,e={}){const t=JSON.stringify([n,e]);let i=Ha[t];return i||(i=new Intl.NumberFormat(n,e),Ha[t]=i),i}let ja={};function av(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=ja[l];return s||(s=new Intl.RelativeTimeFormat(n,e),ja[l]=s),s}let $s=null;function uv(){return $s||($s=new Intl.DateTimeFormat().resolvedOptions().locale,$s)}let _f={};function fv(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 cv(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=qa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=qa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function dv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function pv(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function mv(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function Co(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function hv(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 _v{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=rv(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):vu(e,3);return xt(t,this.padTo)}}}class gv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=qa(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 bv{constructor(e,t,i){this.opts={style:"long",...i},!t&&T0()&&(this.rtf=av(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):zv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const yv={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||Jt.defaultLocale,r=o||(s?"en-US":uv()),a=t||Jt.defaultNumberingSystem,u=i||Jt.defaultOutputCalendar,f=za(l)||Jt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){$s=null,Fa={},Ha={},ja={}}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]=cv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=dv(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=hv(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,za(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Co(this,e,E0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=pv(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Co(this,e,L0,()=>{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]=mv(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Co(this,void 0,()=>A0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Co(this,e,P0,()=>{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 _v(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new gv(e,this.intl,t)}relFormatter(e={}){return new bv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return ov(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()?fv(this.locale):yv}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 $n extends ro{static get utcInstance(){return Xr===null&&(Xr=new $n(0)),Xr}static instance(e){return e===0?$n.utcInstance:new $n(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new $n(Ir(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Is(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Is(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Is(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 kv extends ro{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ro)return n;if($v(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?$n.utcInstance:$n.parseSpecifier(t)||Hi.create(n)}else return el(n)?$n.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new kv(n)}const gu={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]},vv=gu.hanidec.replace(/[\[|\]]/g,"").split("");function wv(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(gu.hanidec)!==-1)e+=vv.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 Sv(){Kl={}}function oi({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${gu[t]}${e}`)),Kl[t][e]}let bf=()=>Date.now(),yf="system",kf=null,vf=null,wf=null,Sf=60,Tf,Cf=null;class Jt{static get now(){return bf}static set now(e){bf=e}static set defaultZone(e){yf=e}static get defaultZone(){return Gi(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 Cf}static set defaultWeekSettings(e){Cf=za(e)}static get twoDigitCutoffYear(){return Sf}static set twoDigitCutoffYear(e){Sf=e%100}static get throwOnInvalid(){return Tf}static set throwOnInvalid(e){Tf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),Sv()}}class ai{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const b0=[0,31,59,90,120,151,181,212,243,273,304,334],y0=[0,31,60,91,121,152,182,213,244,274,305,335];function Qn(n,e){return new ai("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function bu(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 k0(n,e,t){return t+(ao(n)?y0:b0)[e-1]}function v0(n,e){const t=ao(n)?y0:b0,i=t.findIndex(s=>s<e),l=e-t[i];return{month:i+1,day:l}}function yu(n,e){return(n-e+7)%7+1}function pr(n,e=4,t=1){const{year:i,month:l,day:s}=n,o=k0(i,l,s),r=yu(bu(i,l,s),t);let a=Math.floor((o-r+14-e)/7),u;return a<1?(u=i-1,a=Ws(u,e,t)):a>Ws(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Lr(n)}}function $f(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=yu(bu(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}=v0(u,a);return{year:u,month:f,day:c,...Lr(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=k0(e,t,i);return{year:e,ordinal:l,...Lr(n)}}function Of(n){const{year:e,ordinal:t}=n,{month:i,day:l}=v0(e,t);return{year:e,month:i,day:l,...Lr(n)}}function Mf(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 Tv(n,e=4,t=1){const i=Er(n.weekYear),l=xn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=xn(n.weekday,1,7);return i?l?s?!1:Qn("weekday",n.weekday):Qn("week",n.weekNumber):Qn("weekYear",n.weekYear)}function Cv(n){const e=Er(n.year),t=xn(n.ordinal,1,Xl(n.year));return e?t?!1:Qn("ordinal",n.ordinal):Qn("year",n.year)}function w0(n){const e=Er(n.year),t=xn(n.month,1,12),i=xn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Qn("day",n.day):Qn("month",n.month):Qn("year",n.year)}function S0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=xn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=xn(t,0,59),r=xn(i,0,59),a=xn(l,0,999);return s?o?r?a?!1:Qn("millisecond",l):Qn("second",i):Qn("minute",t):Qn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Er(n){return typeof n=="number"&&n%1===0}function $v(n){return typeof n=="string"}function Ov(n){return Object.prototype.toString.call(n)==="[object Date]"}function T0(){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 Mv(n){return Array.isArray(n)?n:[n]}function Ef(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 Ev(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function za(n){if(n==null)return null;if(typeof n!="object")throw new pn("Week settings must be an object");if(!xn(n.firstDay,1,7)||!xn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!xn(e,1,7)))throw new pn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function xn(n,e,t){return Er(n)&&n>=e&&n<=t}function Dv(n,e){return n-e*Math.floor(n/e)}function xt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function ml(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function ku(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function vu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ao(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ao(n)?366:365}function mr(n,e){const t=Dv(e-1,12)+1,i=n+(e-t)/12;return t===2?ao(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Dr(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-yu(bu(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=Df(n,e,t),l=Df(n+1,e,t);return(Xl(n)-i+l)/7}function Ua(n){return n>99?n:n>Jt.twoDigitCutoffYear?1900+n:2e3+n}function $0(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ir(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 O0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new pn(`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)]=O0(l)}return t}function Is(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 Lr(n){return Ev(n,["hour","minute","second","millisecond"])}const Iv=["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"],Lv=["J","F","M","A","M","J","J","A","S","O","N","D"];function E0(n){switch(n){case"narrow":return[...Lv];case"short":return[...M0];case"long":return[...Iv];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 D0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],I0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Av=["M","T","W","T","F","S","S"];function L0(n){switch(n){case"narrow":return[...Av];case"short":return[...I0];case"long":return[...D0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const A0=["AM","PM"],Pv=["Before Christ","Anno Domini"],Nv=["BC","AD"],Rv=["B","A"];function P0(n){switch(n){case"narrow":return[...Rv];case"short":return[...Nv];case"long":return[...Pv];default:return null}}function Fv(n){return A0[n.hour<12?0:1]}function qv(n,e){return L0(e)[n.weekday-1]}function Hv(n,e){return E0(e)[n.month-1]}function jv(n,e){return P0(e)[n.year<0?0:1]}function zv(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 Uv={D:dr,DD:xb,DDD:e0,DDDD:t0,t:n0,tt:i0,ttt:l0,tttt:s0,T:o0,TT:r0,TTT:a0,TTTT:u0,f:f0,ff:d0,fff:m0,ffff:_0,F:c0,FF:p0,FFF:h0,FFFF:g0};class hn{static create(e,t={}){return new hn(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 Uv[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?Fv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Hv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?qv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=hn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?jv(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(hn.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=hn.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 N0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function us(...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 fs(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 R0(...n){return(e,t)=>{const i={};let l;for(l=0;l<n.length;l++)i[n[l]]=Ji(e[t+l]);return[i,null,t+l]}}const F0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Vv=`(?:${F0.source}?(?:\\[(${N0.source})\\])?)?`,wu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,q0=RegExp(`${wu.source}${Vv}`),Su=RegExp(`(?:T${q0.source})?`),Bv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Wv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Yv=/(\d{4})-?(\d{3})/,Kv=R0("weekYear","weekNumber","weekDay"),Jv=R0("year","ordinal"),Zv=/(\d{4})-(\d\d)-(\d\d)/,H0=RegExp(`${wu.source} ?(?:${F0.source}|(${N0.source}))?`),Gv=RegExp(`(?: ${H0.source})?`);function Ql(n,e,t){const i=n[e];return it(i)?t:Ji(i)}function Xv(n,e){return[{year:Ql(n,e),month:Ql(n,e+1,1),day:Ql(n,e+2,1)},null,e+3]}function cs(n,e){return[{hours:Ql(n,e,0),minutes:Ql(n,e+1,0),seconds:Ql(n,e+2,0),milliseconds:ku(n[e+3])},null,e+4]}function uo(n,e){const t=!n[e]&&!n[e+1],i=Ir(n[e+1],n[e+2]),l=t?null:$n.instance(i);return[{},l,e+3]}function fo(n,e){const t=n[e]?Hi.create(n[e]):null;return[{},t,e+1]}const Qv=RegExp(`^T?${wu.source}$`),xv=/^-?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 e2(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(ml(t)),months:d(ml(i)),weeks:d(ml(l)),days:d(ml(s)),hours:d(ml(o)),minutes:d(ml(r)),seconds:d(ml(a),a==="-0"),milliseconds:d(ku(u),c)}]}const t2={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 Tu(n,e,t,i,l,s,o){const r={year:e.length===2?Ua(Ji(e)):Ji(e),month:M0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?D0.indexOf(n)+1:I0.indexOf(n)+1),r}const n2=/^(?:(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 i2(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Tu(e,l,i,t,s,o,r);let m;return a?m=t2[a]:u?m=0:m=Ir(f,c),[d,new $n(m)]}function l2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const s2=/^(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$/,o2=/^(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$/,r2=/^(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[Tu(e,l,i,t,s,o,r),$n.utcInstance]}function a2(n){const[,e,t,i,l,s,o,r]=n;return[Tu(e,r,t,i,l,s,o),$n.utcInstance]}const u2=as(Bv,Su),f2=as(Wv,Su),c2=as(Yv,Su),d2=as(q0),j0=us(Xv,cs,uo,fo),p2=us(Kv,cs,uo,fo),m2=us(Jv,cs,uo,fo),h2=us(cs,uo,fo);function _2(n){return fs(n,[u2,j0],[f2,p2],[c2,m2],[d2,h2])}function g2(n){return fs(l2(n),[n2,i2])}function b2(n){return fs(n,[s2,Lf],[o2,Lf],[r2,a2])}function y2(n){return fs(n,[xv,e2])}const k2=us(cs);function v2(n){return fs(n,[Qv,k2])}const w2=as(Zv,Gv),S2=as(H0),T2=us(cs,uo,fo);function C2(n){return fs(n,[w2,j0],[S2,T2])}const Af="Invalid Duration",z0={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}},$2={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},...z0},Jn=146097/400,zl=146097/4800,O2={years:{quarters:4,months:12,weeks:Jn/7,days:Jn,hours:Jn*24,minutes:Jn*24*60,seconds:Jn*24*60*60,milliseconds:Jn*24*60*60*1e3},quarters:{months:3,weeks:Jn/28,days:Jn/4,hours:Jn*24/4,minutes:Jn*24*60/4,seconds:Jn*24*60*60/4,milliseconds:Jn*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},...z0},Sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],M2=Sl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function U0(n,e){let t=e.milliseconds??0;for(const i of M2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Pf(n,e){const t=U0(n,e)<0?-1:1;Sl.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),Sl.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 E2(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?O2:$2;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 pn(`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(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new pn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=y2(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]=v2(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 pn("need to specify a reason the Duration is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new xk(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?hn.create(this.loc,i).formatDurationFromString(this,e):Af}toHuman(e={}){if(!this.isValid)return Af;const t=Sl.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+=vu(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?U0(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 Sl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=O0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Pf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=E2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Sl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Pf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Sl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function D2(n,e){return!n||!n.isValid?Kt.invalid("missing or invalid start"):!e||!e.isValid?Kt.invalid("missing or invalid end"):e<n?Kt.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 Kt{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 pn("need to specify a reason the Interval is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new Qk(i);return new Kt({invalid:i})}static fromDateTimes(e,t){const i=ks(e),l=ks(t),s=D2(i,l);return s??new Kt({start:i,end:l})}static after(e,t){const i=St.fromDurationLike(t),l=ks(e);return Kt.fromDateTimes(l,l.plus(i))}static before(e,t){const i=St.fromDurationLike(t),l=ks(e);return Kt.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 Kt.fromDateTimes(s,r);if(o){const u=St.fromISO(l,t);if(u.isValid)return Kt.after(s,u)}else if(a){const u=St.fromISO(i,t);if(u.isValid)return Kt.before(r,u)}}return Kt.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?Kt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ks).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l<this.e;){const o=t[s]||this.e,r=+o>+this.e?this.e:o;i.push(Kt.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(Kt.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:Kt.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 Kt.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(Kt.fromDateTimes(t,a.time)),t=null);return Kt.merge(l)}difference(...e){return Kt.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?hn.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 Kt.fromDateTimes(e(this.s),e(this.e))}}class $o{static hasDST(e=Jt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Jt.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:T0(),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 I2(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 L2(n,e,t,i){let[l,s,o,r]=I2(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 A2="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(wv(t))}}const P2=" ",V0=`[ ${P2}]`,B0=new RegExp(V0,"g");function N2(n){return n.replace(/\./g,"\\.?").replace(B0,V0)}function Rf(n){return n.replace(/\./g,"").replace(B0," ").toLowerCase()}function ri(n,e){return n===null?null:{regex:RegExp(n.map(N2).join("|")),deser:([t])=>n.findIndex(i=>Rf(t)===Rf(i))+e}}function Ff(n,e){return{regex:n,deser:([,t,i])=>Ir(t,i),groups:e}}function Oo(n){return{regex:n,deser:([e])=>e}}function R2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function F2(n,e){const t=oi(e),i=oi(e,"{2}"),l=oi(e,"{3}"),s=oi(e,"{4}"),o=oi(e,"{6}"),r=oi(e,"{1,2}"),a=oi(e,"{1,3}"),u=oi(e,"{1,6}"),f=oi(e,"{1,9}"),c=oi(e,"{2,4}"),d=oi(e,"{4,6}"),m=_=>({regex:RegExp(R2(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return ri(e.eras("short"),0);case"GG":return ri(e.eras("long"),0);case"y":return $t(u);case"yy":return $t(c,Ua);case"yyyy":return $t(s);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return ri(e.months("short",!0),1);case"MMMM":return ri(e.months("long",!0),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return ri(e.months("short",!1),1);case"LLLL":return ri(e.months("long",!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(l);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(l);case"u":return Oo(f);case"uu":return Oo(r);case"uuu":return $t(t);case"a":return ri(e.meridiems(),0);case"kkkk":return $t(s);case"kk":return $t(c,Ua);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return ri(e.weekdays("short",!1),1);case"EEEE":return ri(e.weekdays("long",!1),1);case"ccc":return ri(e.weekdays("short",!0),1);case"cccc":return ri(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:A2};return g.token=n,g}const q2={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 H2(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=q2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function j2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function z2(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 U2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new $n(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=ku(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 V2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function B2(n,e){if(n.literal)return n;const t=hn.macroTokenToFormatOpts(n.val),i=J0(t,e);return i==null||i.includes(void 0)?n:i}function W0(n,e){return Array.prototype.concat(...n.map(t=>B2(t,e)))}class Y0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=W0(hn.parseFormat(t),e),this.units=this.tokens.map(i=>F2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=j2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=z2(e,this.regex,this.handlers),[l,s,o]=i?U2(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 K0(n,e,t){return new Y0(n,t).explainFromTokens(e)}function W2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=K0(n,e,t);return[i,l,s,o]}function J0(n,e){if(!n)return null;const i=hn.create(e,n).dtFormatter(V2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>H2(o,n,s))}const ea="Invalid DateTime",qf=864e13;function Os(n){return new ai("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 hl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function Z0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function xo(n,e,t){return Z0(Dr(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=Dr(s);let[a,u]=Z0(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=Xe.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return Xe.invalid(new ai("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Eo(n,e,t=!0){return n.isValid?hn.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 G0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Y2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},K2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},X0=["year","month","day","hour","minute","second","millisecond"],J2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Z2=["year","ordinal","hour","minute","second","millisecond"];function G2(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 G2(n)}}function X2(n){return tr[n]||(er===void 0&&(er=Jt.now()),tr[n]=n.offset(er)),tr[n]}function Uf(n,e){const t=Gi(e.zone,Jt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Jt.now();else{for(const a of X0)it(n[a])&&(n[a]=G0[a]);const o=w0(n)||S0(n);if(o)return Xe.invalid(o);const r=X2(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=vu(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||Jt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ai("invalid input"):null)||(t.isValid?null:Os(t));this.ts=it(e.ts)?Jt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ai("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=$n.utcInstance,Uf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Ov(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Jt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Os(l))}static fromMillis(e,t={}){if(el(e))return e<-qf||e>qf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Jt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const l=Et.fromObject(t),s=hr(e,zf),{minDaysInFirstWeek:o,startOfWeek:r}=Mf(s,l),a=Jt.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=Mo(a,u);g?(_=J2,y=Y2,S=pr(S,o,r)):f?(_=Z2,y=K2,S=Qr(S)):(_=X0,y=G0);let C=!1;for(const P of _){const N=s[P];it(N)?C?s[P]=y[P]:s[P]=S[P]:C=!0}const T=g?Tv(s,o,r):f?Cv(s):w0(s),O=T||S0(s);if(O)return Xe.invalid(O);const E=g?$f(s,o,r):f?Of(s):s,[L,I]=xo(E,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]=_2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=g2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=b2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new pn("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]=W2(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]=C2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the DateTime is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new Xk(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=J0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return W0(hn.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?$o.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$o.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$o.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$o.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=Dr(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[hl(this,{ts:a}),hl(this,{ts:u})]:[this]}get isInLeapYear(){return ao(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=hn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone($n.instance(e),t)}toLocal(){return this.setZone(Jt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Jt.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 hl(this,{ts:l,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return hl(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}=Mf(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=$f({...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 hl(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return hl(this,Hf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return hl(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?hn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ea}toLocaleString(e=dr,t={}){return this.isValid?hn.create(this.loc.clone(t),e).formatDateTime(this):ea}toLocaleParts(e={}){return this.isValid?hn.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 Eo(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 Eo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Eo(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")),Eo(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=Mv(t).map(St.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=L2(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?Kt.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 pn("min requires all arguments be DateTimes");return Ef(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new pn("max requires all arguments be DateTimes");return Ef(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 K0(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 Y0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new pn("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 pn(`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 xb}static get DATE_MED_WITH_WEEKDAY(){return ev}static get DATE_FULL(){return e0}static get DATE_HUGE(){return t0}static get TIME_SIMPLE(){return n0}static get TIME_WITH_SECONDS(){return i0}static get TIME_WITH_SHORT_OFFSET(){return l0}static get TIME_WITH_LONG_OFFSET(){return s0}static get TIME_24_SIMPLE(){return o0}static get TIME_24_WITH_SECONDS(){return r0}static get TIME_24_WITH_SHORT_OFFSET(){return a0}static get TIME_24_WITH_LONG_OFFSET(){return u0}static get DATETIME_SHORT(){return f0}static get DATETIME_SHORT_WITH_SECONDS(){return c0}static get DATETIME_MED(){return d0}static get DATETIME_MED_WITH_SECONDS(){return p0}static get DATETIME_MED_WITH_WEEKDAY(){return tv}static get DATETIME_FULL(){return m0}static get DATETIME_FULL_WITH_SECONDS(){return h0}static get DATETIME_HUGE(){return _0}static get DATETIME_HUGE_WITH_SECONDS(){return g0}}function ks(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new pn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Q2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],x2=[".mp4",".avi",".mov",".3gp",".wmv"],ew=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],tw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],nw=["relation","file","select"],iw=["text","email","url","editor"],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 U{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||U.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 U.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!U.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!U.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){U.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)U.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]=U.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(!U.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)(!U.isObject(s)&&!Array.isArray(s)||!U.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)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):U.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||U.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.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 U.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=U.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(),U.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():"",U.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 U.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return U.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);U.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||"",!!Q2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!x2.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!ew.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!tw.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return U.hasImageExtension(e)?"image":U.hasDocumentExtension(e)?"document":U.hasVideoExtension(e)?"video":U.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(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)U.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):U.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},U.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||t&&o.type==="autodate")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)&&!U.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=U.isObject(u)&&U.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=U.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=U.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=U.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(U.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?U.plainText(e):e,U.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return U.truncate(e.join(","),i);if(typeof e=="object")try{return U.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 U.extractColumnsFromQuery(e.viewQuery))U.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)U.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=U.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=U.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&nw.includes(r.type)?(o.push(a+":each"),o.push(a+":length")):iw.includes(r.type)&&o.push(a+":lower")}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=U.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=U.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=U.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)U.pushUnique(i,r)}if(t){const s=U.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=!U.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_"+U.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=`
+}`,c=`__svelte_${jk(f)}_${r}`,d=Kb(n),{stylesheet:m,rules:h}=fr.get(d)||zk(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 Vs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),cr-=l,cr||Uk())}function Uk(){pu(()=>{cr||(fr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),fr.clear())})}function Vk(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=lo,start:a=$r()+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=Us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&Vs(n,h),d=!1}return Or(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),_()),!d)return!1;if(m){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),g(),f(0,1),_}function Bk(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,Zb(n,l)}}function Zb(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Bs;function Fi(n){Bs=n}function so(){if(!Bs)throw new Error("Function called outside component initialization");return Bs}function ln(n){so().$$.on_mount.push(n)}function Wk(n){so().$$.after_update.push(n)}function oo(n){so().$$.on_destroy.push(n)}function yt(){const n=so();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Jb(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 Na=[],Gb=Promise.resolve();let Ra=!1;function Xb(){Ra||(Ra=!0,Gb.then(mu))}function dn(){return Xb(),Gb}function tt(n){Gl.push(n)}function Ce(n){Na.push(n)}const Zr=new Set;let jl=0;function mu(){if(jl!==0)return;const n=Bs;do{try{for(;jl<Yl.length;){const e=Yl[jl];jl++,Fi(e),Yk(e.$$)}}catch(e){throw Yl.length=0,jl=0,e}for(Fi(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(;Na.length;)Na.pop()();Ra=!1,Zr.clear(),Fi(n)}function Yk(n){if(n.fragment!==null){n.update(),Ie(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(tt)}}function Kk(n){const e=[],t=[];Gl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Gl=e}let ys;function hu(){return ys||(ys=Promise.resolve(),ys.then(()=>{ys=null})),ys}function $l(n,e,t){n.dispatchEvent(Jb(`${e?"intro":"outro"}${t}`))}const Xo=new Set;let wi;function re(){wi={r:0,c:[],p:wi}}function ae(){wi.r||Ie(wi.c),wi=wi.p}function M(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 _u={duration:0};function Qb(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&Vs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=lo,tick:g=te,css:_}=l||_u;_&&(o=Us(n,0,1,m,d,h,_,a++)),g(0,1);const y=$r()+d,S=y+m;r&&r.abort(),s=!0,tt(()=>$l(n,!0,"start")),r=Or(C=>{if(s){if(C>=S)return g(1,0),$l(n,!0,"end"),u(),s=!1;if(C>=y){const T=h((C-y)/m);g(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,Vs(n),It(l)?(l=l(i),hu().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function gu(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=lo,tick:m=te,css:h}=l||_u;h&&(o=Us(n,1,0,c,f,d,h));const g=$r()+f,_=g+c;tt(()=>$l(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Or(y=>{if(s){if(y>=_)return m(0,1),$l(n,!1,"end"),--r.r||Ie(r.c),!1;if(y>=g){const S=d((y-g)/c);m(1-S,S)}}return s})}return It(l)?hu().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&Vs(n,o),s=!1)}}}function He(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Vs(n,u)}function d(h,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=lo,tick:S=te,css:C}=s||_u,T={start:$r()+g,b:h};h||(T.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&&(c(),u=Us(n,o,h,_,g,y,C)),h&&S(0,1),r=d(T,_),tt(()=>$l(n,h,"start")),Or(O=>{if(a&&O>a.start&&(r=d(a,_),a=null,$l(n,r.b,"start"),C&&(c(),u=Us(n,o,r.b,r.duration,0,y,s.css))),r){if(O>=r.end)S(o=r.b,1-o),$l(n,r.b,"end"),a||(r.b?c():--r.group.r||Ie(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*y(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){It(s)?hu().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function hf(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(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&mu()}if(Lk(n)){const l=so();if(n.then(s=>{Fi(l),i(e.then,1,e.value,s),Fi(null)},s=>{if(Fi(l),i(e.catch,2,e.error,s),Fi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Jk(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 di(n,e){n.d(1),e.delete(n.key)}function Bt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function Zk(n,e){n.f(),Bt(n,e)}function vt(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,C=[];for(h=m;h--;){const L=c(l,s,h),I=t(L);let A=o.get(I);A?C.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 T=new Set,O=new Set;function E(L){M(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)||T.has(A)?E(L):O.has(P)?d--:S.get(A)>S.get(P)?(O.add(A),E(L)):(T.add(P),d--):(a(I,o),d--)}for(;d--;){const L=n[d];y.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ie(C),_}function wt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Rt(n){return typeof n=="object"&&n!==null?n:{}}function be(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function j(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),tt(()=>{const s=n.$$.on_mount.map(Ub).filter(It);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ie(s),n.$$.on_mount=[]}),l.forEach(tt)}function H(n,e){const t=n.$$;t.fragment!==null&&(Kk(t.after_update),Ie(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Gk(n,e){n.$$.dirty[0]===-1&&(Yl.push(n),Xb(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function we(n,e,t,i,l,s,o=null,r=[-1]){const a=Bs;Fi(n);const u=n.$$={fragment:null,ctx:[],props:s,update:te,not_equal:l,bound:pf(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:pf(),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&&Gk(n,c)),d}):[],u.update(),f=!0,Ie(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=qk(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),mu()}Fi(a)}class Se{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!It(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&&!Ak(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Xk="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Xk);class Al extends Error{}class Qk extends Al{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class xk extends Al{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ev extends Al{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Jl extends Al{}class xb extends Al{constructor(e){super(`Invalid unit ${e}`)}}class pn extends Al{}class Wi extends Al{constructor(){super("Zone is an abstract class")}}const Ue="numeric",ci="short",Wn="long",dr={year:Ue,month:Ue,day:Ue},e0={year:Ue,month:ci,day:Ue},tv={year:Ue,month:ci,day:Ue,weekday:ci},t0={year:Ue,month:Wn,day:Ue},n0={year:Ue,month:Wn,day:Ue,weekday:Wn},i0={hour:Ue,minute:Ue},l0={hour:Ue,minute:Ue,second:Ue},s0={hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},o0={hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn},r0={hour:Ue,minute:Ue,hourCycle:"h23"},a0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23"},u0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:ci},f0={hour:Ue,minute:Ue,second:Ue,hourCycle:"h23",timeZoneName:Wn},c0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue},d0={year:Ue,month:Ue,day:Ue,hour:Ue,minute:Ue,second:Ue},p0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue},m0={year:Ue,month:ci,day:Ue,hour:Ue,minute:Ue,second:Ue},nv={year:Ue,month:ci,day:Ue,weekday:ci,hour:Ue,minute:Ue},h0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,timeZoneName:ci},_0={year:Ue,month:Wn,day:Ue,hour:Ue,minute:Ue,second:Ue,timeZoneName:ci},g0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,timeZoneName:Wn},b0={year:Ue,month:Wn,day:Ue,weekday:Wn,hour:Ue,minute:Ue,second:Ue,timeZoneName:Wn};class ro{get type(){throw new Wi}get name(){throw new Wi}get ianaName(){return this.name}get isUniversal(){throw new Wi}offsetName(e,t){throw new Wi}formatOffset(e,t){throw new Wi}offset(e){throw new Wi}equals(e){throw new Wi}get isValid(){throw new Wi}}let Gr=null;class Mr extends ro{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 O0(e,t,i)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let Qo={};function iv(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 lv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function sv(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 ov(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l<t.length;l++){const{type:s,value:o}=t[l],r=lv[s];s==="era"?i[r]=o:it(r)||(i[r]=parseInt(o,10))}return i}let To={};class Hi extends ro{static create(e){return To[e]||(To[e]=new Hi(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=Hi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return O0(e,t,i,this.name)}formatOffset(e,t){return Is(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=iv(this.name);let[l,s,o,r,a,u,f]=i.formatToParts?ov(i,t):sv(i,t);r==="BC"&&(l=-Math.abs(l)+1);const d=Dr({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 _f={};function rv(n,e={}){const t=JSON.stringify([n,e]);let i=_f[t];return i||(i=new Intl.ListFormat(n,e),_f[t]=i),i}let Fa={};function qa(n,e={}){const t=JSON.stringify([n,e]);let i=Fa[t];return i||(i=new Intl.DateTimeFormat(n,e),Fa[t]=i),i}let Ha={};function av(n,e={}){const t=JSON.stringify([n,e]);let i=Ha[t];return i||(i=new Intl.NumberFormat(n,e),Ha[t]=i),i}let ja={};function uv(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=ja[l];return s||(s=new Intl.RelativeTimeFormat(n,e),ja[l]=s),s}let $s=null;function fv(){return $s||($s=new Intl.DateTimeFormat().resolvedOptions().locale,$s)}let gf={};function cv(n){let e=gf[n];if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,gf[n]=e}return e}function dv(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=qa(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=qa(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function pv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function mv(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function hv(n){const e=[];for(let t=1;t<=7;t++){const i=Xe.utc(2016,11,13+t);e.push(n(i))}return e}function Co(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function _v(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 gv{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=av(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):wu(e,3);return xt(t,this.padTo)}}}class bv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Hi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=qa(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 yv{constructor(e,t,i){this.opts={style:"long",...i},!t&&C0()&&(this.rtf=uv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Uv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const kv={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||Jt.defaultLocale,r=o||(s?"en-US":fv()),a=t||Jt.defaultNumberingSystem,u=i||Jt.defaultOutputCalendar,f=za(l)||Jt.defaultWeekSettings;return new Et(r,a,u,f,o)}static resetCache(){$s=null,Fa={},Ha={},ja={}}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]=dv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=pv(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=_v(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,za(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Co(this,e,D0,()=>{const i=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=mv(s=>this.extract(s,i,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1){return Co(this,e,A0,()=>{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]=hv(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Co(this,void 0,()=>P0,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Xe.utc(2016,11,13,9),Xe.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Co(this,e,N0,()=>{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 gv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new bv(e,this.intl,t)}relFormatter(e={}){return new yv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return rv(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:$0()?cv(this.locale):kv}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 $n extends ro{static get utcInstance(){return Xr===null&&(Xr=new $n(0)),Xr}static instance(e){return e===0?$n.utcInstance:new $n(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new $n(Ir(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Is(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Is(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Is(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 vv extends ro{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gi(n,e){if(it(n)||n===null)return e;if(n instanceof ro)return n;if(Ov(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Mr.instance:t==="utc"||t==="gmt"?$n.utcInstance:$n.parseSpecifier(t)||Hi.create(n)}else return el(n)?$n.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new vv(n)}const bu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},bf={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]},wv=bu.hanidec.replace(/[\[|\]]/g,"").split("");function Sv(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(bu.hanidec)!==-1)e+=wv.indexOf(n[t]);else for(const l in bf){const[s,o]=bf[l];i>=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}let Kl={};function Tv(){Kl={}}function oi({numberingSystem:n},e=""){const t=n||"latn";return Kl[t]||(Kl[t]={}),Kl[t][e]||(Kl[t][e]=new RegExp(`${bu[t]}${e}`)),Kl[t][e]}let yf=()=>Date.now(),kf="system",vf=null,wf=null,Sf=null,Tf=60,Cf,$f=null;class Jt{static get now(){return yf}static set now(e){yf=e}static set defaultZone(e){kf=e}static get defaultZone(){return Gi(kf,Mr.instance)}static get defaultLocale(){return vf}static set defaultLocale(e){vf=e}static get defaultNumberingSystem(){return wf}static set defaultNumberingSystem(e){wf=e}static get defaultOutputCalendar(){return Sf}static set defaultOutputCalendar(e){Sf=e}static get defaultWeekSettings(){return $f}static set defaultWeekSettings(e){$f=za(e)}static get twoDigitCutoffYear(){return Tf}static set twoDigitCutoffYear(e){Tf=e%100}static get throwOnInvalid(){return Cf}static set throwOnInvalid(e){Cf=e}static resetCaches(){Et.resetCache(),Hi.resetCache(),Xe.resetCache(),Tv()}}class ai{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const y0=[0,31,59,90,120,151,181,212,243,273,304,334],k0=[0,31,60,91,121,152,182,213,244,274,305,335];function Qn(n,e){return new ai("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function yu(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 v0(n,e,t){return t+(ao(n)?k0:y0)[e-1]}function w0(n,e){const t=ao(n)?k0:y0,i=t.findIndex(s=>s<e),l=e-t[i];return{month:i+1,day:l}}function ku(n,e){return(n-e+7)%7+1}function pr(n,e=4,t=1){const{year:i,month:l,day:s}=n,o=v0(i,l,s),r=ku(yu(i,l,s),t);let a=Math.floor((o-r+14-e)/7),u;return a<1?(u=i-1,a=Ws(u,e,t)):a>Ws(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Lr(n)}}function Of(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=ku(yu(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}=w0(u,a);return{year:u,month:f,day:c,...Lr(n)}}function Qr(n){const{year:e,month:t,day:i}=n,l=v0(e,t,i);return{year:e,ordinal:l,...Lr(n)}}function Mf(n){const{year:e,ordinal:t}=n,{month:i,day:l}=w0(e,t);return{year:e,month:i,day:l,...Lr(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 Cv(n,e=4,t=1){const i=Er(n.weekYear),l=xn(n.weekNumber,1,Ws(n.weekYear,e,t)),s=xn(n.weekday,1,7);return i?l?s?!1:Qn("weekday",n.weekday):Qn("week",n.weekNumber):Qn("weekYear",n.weekYear)}function $v(n){const e=Er(n.year),t=xn(n.ordinal,1,Xl(n.year));return e?t?!1:Qn("ordinal",n.ordinal):Qn("year",n.year)}function S0(n){const e=Er(n.year),t=xn(n.month,1,12),i=xn(n.day,1,mr(n.year,n.month));return e?t?i?!1:Qn("day",n.day):Qn("month",n.month):Qn("year",n.year)}function T0(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=xn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=xn(t,0,59),r=xn(i,0,59),a=xn(l,0,999);return s?o?r?a?!1:Qn("millisecond",l):Qn("second",i):Qn("minute",t):Qn("hour",e)}function it(n){return typeof n>"u"}function el(n){return typeof n=="number"}function Er(n){return typeof n=="number"&&n%1===0}function Ov(n){return typeof n=="string"}function Mv(n){return Object.prototype.toString.call(n)==="[object Date]"}function C0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function $0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ev(n){return Array.isArray(n)?n:[n]}function Df(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 Dv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function ns(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function za(n){if(n==null)return null;if(typeof n!="object")throw new pn("Week settings must be an object");if(!xn(n.firstDay,1,7)||!xn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!xn(e,1,7)))throw new pn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function xn(n,e,t){return Er(n)&&n>=e&&n<=t}function Iv(n,e){return n-e*Math.floor(n/e)}function xt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ji(n){if(!(it(n)||n===null||n===""))return parseInt(n,10)}function ml(n){if(!(it(n)||n===null||n===""))return parseFloat(n)}function vu(n){if(!(it(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function wu(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function ao(n){return n%4===0&&(n%100!==0||n%400===0)}function Xl(n){return ao(n)?366:365}function mr(n,e){const t=Iv(e-1,12)+1,i=n+(e-t)/12;return t===2?ao(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Dr(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 If(n,e,t){return-ku(yu(n,1,e),t)+e-1}function Ws(n,e=4,t=1){const i=If(n,e,t),l=If(n+1,e,t);return(Xl(n)-i+l)/7}function Ua(n){return n>99?n:n>Jt.twoDigitCutoffYear?1900+n:2e3+n}function O0(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 Ir(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 M0(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new pn(`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)]=M0(l)}return t}function Is(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 Lr(n){return Dv(n,["hour","minute","second","millisecond"])}const Lv=["January","February","March","April","May","June","July","August","September","October","November","December"],E0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Av=["J","F","M","A","M","J","J","A","S","O","N","D"];function D0(n){switch(n){case"narrow":return[...Av];case"short":return[...E0];case"long":return[...Lv];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 I0=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],L0=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Pv=["M","T","W","T","F","S","S"];function A0(n){switch(n){case"narrow":return[...Pv];case"short":return[...L0];case"long":return[...I0];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const P0=["AM","PM"],Nv=["Before Christ","Anno Domini"],Rv=["BC","AD"],Fv=["B","A"];function N0(n){switch(n){case"narrow":return[...Fv];case"short":return[...Rv];case"long":return[...Nv];default:return null}}function qv(n){return P0[n.hour<12?0:1]}function Hv(n,e){return A0(e)[n.weekday-1]}function jv(n,e){return D0(e)[n.month-1]}function zv(n,e){return N0(e)[n.year<0?0:1]}function Uv(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 Lf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Vv={D:dr,DD:e0,DDD:t0,DDDD:n0,t:i0,tt:l0,ttt:s0,tttt:o0,T:r0,TT:a0,TTT:u0,TTTT:f0,f:c0,ff:p0,fff:h0,ffff:g0,F:d0,FF:m0,FFF:_0,FFFF:b0};class hn{static create(e,t={}){return new hn(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 Vv[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?qv(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?jv(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Hv(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=hn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?zv(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 Lf(hn.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=hn.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 Lf(s,l(r))}}const R0=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function as(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function us(...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 fs(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 F0(...n){return(e,t)=>{const i={};let l;for(l=0;l<n.length;l++)i[n[l]]=Ji(e[t+l]);return[i,null,t+l]}}const q0=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Bv=`(?:${q0.source}?(?:\\[(${R0.source})\\])?)?`,Su=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,H0=RegExp(`${Su.source}${Bv}`),Tu=RegExp(`(?:T${H0.source})?`),Wv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Yv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Kv=/(\d{4})-?(\d{3})/,Jv=F0("weekYear","weekNumber","weekDay"),Zv=F0("year","ordinal"),Gv=/(\d{4})-(\d\d)-(\d\d)/,j0=RegExp(`${Su.source} ?(?:${q0.source}|(${R0.source}))?`),Xv=RegExp(`(?: ${j0.source})?`);function Ql(n,e,t){const i=n[e];return it(i)?t:Ji(i)}function Qv(n,e){return[{year:Ql(n,e),month:Ql(n,e+1,1),day:Ql(n,e+2,1)},null,e+3]}function cs(n,e){return[{hours:Ql(n,e,0),minutes:Ql(n,e+1,0),seconds:Ql(n,e+2,0),milliseconds:vu(n[e+3])},null,e+4]}function uo(n,e){const t=!n[e]&&!n[e+1],i=Ir(n[e+1],n[e+2]),l=t?null:$n.instance(i);return[{},l,e+3]}function fo(n,e){const t=n[e]?Hi.create(n[e]):null;return[{},t,e+1]}const xv=RegExp(`^T?${Su.source}$`),e2=/^-?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 t2(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(ml(t)),months:d(ml(i)),weeks:d(ml(l)),days:d(ml(s)),hours:d(ml(o)),minutes:d(ml(r)),seconds:d(ml(a),a==="-0"),milliseconds:d(vu(u),c)}]}const n2={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 Cu(n,e,t,i,l,s,o){const r={year:e.length===2?Ua(Ji(e)):Ji(e),month:E0.indexOf(t)+1,day:Ji(i),hour:Ji(l),minute:Ji(s)};return o&&(r.second=Ji(o)),n&&(r.weekday=n.length>3?I0.indexOf(n)+1:L0.indexOf(n)+1),r}const i2=/^(?:(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 l2(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Cu(e,l,i,t,s,o,r);let m;return a?m=n2[a]:u?m=0:m=Ir(f,c),[d,new $n(m)]}function s2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const o2=/^(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$/,r2=/^(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$/,a2=/^(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 Af(n){const[,e,t,i,l,s,o,r]=n;return[Cu(e,l,i,t,s,o,r),$n.utcInstance]}function u2(n){const[,e,t,i,l,s,o,r]=n;return[Cu(e,r,t,i,l,s,o),$n.utcInstance]}const f2=as(Wv,Tu),c2=as(Yv,Tu),d2=as(Kv,Tu),p2=as(H0),z0=us(Qv,cs,uo,fo),m2=us(Jv,cs,uo,fo),h2=us(Zv,cs,uo,fo),_2=us(cs,uo,fo);function g2(n){return fs(n,[f2,z0],[c2,m2],[d2,h2],[p2,_2])}function b2(n){return fs(s2(n),[i2,l2])}function y2(n){return fs(n,[o2,Af],[r2,Af],[a2,u2])}function k2(n){return fs(n,[e2,t2])}const v2=us(cs);function w2(n){return fs(n,[xv,v2])}const S2=as(Gv,Xv),T2=as(j0),C2=us(cs,uo,fo);function $2(n){return fs(n,[S2,z0],[T2,C2])}const Pf="Invalid Duration",U0={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}},O2={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},...U0},Jn=146097/400,zl=146097/4800,M2={years:{quarters:4,months:12,weeks:Jn/7,days:Jn,hours:Jn*24,minutes:Jn*24*60,seconds:Jn*24*60*60,milliseconds:Jn*24*60*60*1e3},quarters:{months:3,weeks:Jn/28,days:Jn/4,hours:Jn*24/4,minutes:Jn*24*60/4,seconds:Jn*24*60*60/4,milliseconds:Jn*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},...U0},Sl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],E2=Sl.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new St(i)}function V0(n,e){let t=e.milliseconds??0;for(const i of E2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Nf(n,e){const t=V0(n,e)<0?-1:1;Sl.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),Sl.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 D2(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?M2:O2;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 pn(`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(el(e))return St.fromMillis(e);if(St.isDuration(e))return e;if(typeof e=="object")return St.fromObject(e);throw new pn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=k2(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]=w2(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 pn("need to specify a reason the Duration is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new ev(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 xb(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?hn.create(this.loc,i).formatDurationFromString(this,e):Pf}toHuman(e={}){if(!this.isValid)return Pf;const t=Sl.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+=wu(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?V0(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 Sl)(ns(t.values,l)||ns(this.values,l))&&(i[l]=t.get(l)+this.get(l));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=M0(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[St.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...hr(e,St.normalizeUnit)};return Yi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return Yi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Nf(this.matrix,e),Yi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=D2(this.normalize().shiftToAll().toObject());return Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>St.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Sl)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;el(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else el(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Nf(this.matrix,t),Yi(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Sl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Ul="Invalid Interval";function I2(n,e){return!n||!n.isValid?Kt.invalid("missing or invalid start"):!e||!e.isValid?Kt.invalid("missing or invalid end"):e<n?Kt.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 Kt{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 pn("need to specify a reason the Interval is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new xk(i);return new Kt({invalid:i})}static fromDateTimes(e,t){const i=ks(e),l=ks(t),s=I2(i,l);return s??new Kt({start:i,end:l})}static after(e,t){const i=St.fromDurationLike(t),l=ks(e);return Kt.fromDateTimes(l,l.plus(i))}static before(e,t){const i=St.fromDurationLike(t),l=ks(e);return Kt.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 Kt.fromDateTimes(s,r);if(o){const u=St.fromISO(l,t);if(u.isValid)return Kt.after(s,u)}else if(a){const u=St.fromISO(i,t);if(u.isValid)return Kt.before(r,u)}}return Kt.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?Kt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ks).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l<this.e;){const o=t[s]||this.e,r=+o>+this.e?this.e:o;i.push(Kt.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(Kt.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:Kt.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 Kt.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(Kt.fromDateTimes(t,a.time)),t=null);return Kt.merge(l)}difference(...e){return Kt.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?hn.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 Kt.fromDateTimes(e(this.s),e(this.e))}}class $o{static hasDST(e=Jt.defaultZone){const t=Xe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Hi.isValidZone(e)}static normalizeZone(e){return Gi(e,Jt.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:C0(),localeWeek:$0()}}}function Rf(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 L2(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=Rf(a,u);return(f-f%7)/7}],["days",Rf]],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 A2(n,e,t,i){let[l,s,o,r]=L2(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 P2="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(Sv(t))}}const N2=" ",B0=`[ ${N2}]`,W0=new RegExp(B0,"g");function R2(n){return n.replace(/\./g,"\\.?").replace(W0,B0)}function Ff(n){return n.replace(/\./g,"").replace(W0," ").toLowerCase()}function ri(n,e){return n===null?null:{regex:RegExp(n.map(R2).join("|")),deser:([t])=>n.findIndex(i=>Ff(t)===Ff(i))+e}}function qf(n,e){return{regex:n,deser:([,t,i])=>Ir(t,i),groups:e}}function Oo(n){return{regex:n,deser:([e])=>e}}function F2(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function q2(n,e){const t=oi(e),i=oi(e,"{2}"),l=oi(e,"{3}"),s=oi(e,"{4}"),o=oi(e,"{6}"),r=oi(e,"{1,2}"),a=oi(e,"{1,3}"),u=oi(e,"{1,6}"),f=oi(e,"{1,9}"),c=oi(e,"{2,4}"),d=oi(e,"{4,6}"),m=_=>({regex:RegExp(F2(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return ri(e.eras("short"),0);case"GG":return ri(e.eras("long"),0);case"y":return $t(u);case"yy":return $t(c,Ua);case"yyyy":return $t(s);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return ri(e.months("short",!0),1);case"MMMM":return ri(e.months("long",!0),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return ri(e.months("short",!1),1);case"LLLL":return ri(e.months("long",!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(l);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(l);case"u":return Oo(f);case"uu":return Oo(r);case"uuu":return $t(t);case"a":return ri(e.meridiems(),0);case"kkkk":return $t(s);case"kk":return $t(c,Ua);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return ri(e.weekdays("short",!1),1);case"EEEE":return ri(e.weekdays("long",!1),1);case"ccc":return ri(e.weekdays("short",!0),1);case"cccc":return ri(e.weekdays("long",!0),1);case"Z":case"ZZ":return qf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return qf(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:P2};return g.token=n,g}const H2={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 j2(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=H2[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function z2(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function U2(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 V2(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return it(n.z)||(t=Hi.create(n.z)),it(n.Z)||(t||(t=new $n(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=vu(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 B2(){return xr||(xr=Xe.fromMillis(1555555555555)),xr}function W2(n,e){if(n.literal)return n;const t=hn.macroTokenToFormatOpts(n.val),i=Z0(t,e);return i==null||i.includes(void 0)?n:i}function Y0(n,e){return Array.prototype.concat(...n.map(t=>W2(t,e)))}class K0{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Y0(hn.parseFormat(t),e),this.units=this.tokens.map(i=>q2(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=z2(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=U2(e,this.regex,this.handlers),[l,s,o]=i?V2(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 J0(n,e,t){return new K0(n,t).explainFromTokens(e)}function Y2(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=J0(n,e,t);return[i,l,s,o]}function Z0(n,e){if(!n)return null;const i=hn.create(e,n).dtFormatter(B2()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>j2(o,n,s))}const ea="Invalid DateTime",Hf=864e13;function Os(n){return new ai("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 hl(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 G0(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Mo(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function xo(n,e,t){return G0(Dr(n),e,t)}function jf(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=Dr(s);let[a,u]=G0(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 ai("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Eo(n,e,t=!0){return n.isValid?hn.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 zf(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 X0={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},K2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},J2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Q0=["year","month","day","hour","minute","second","millisecond"],Z2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],G2=["year","ordinal","hour","minute","second","millisecond"];function X2(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 xb(n);return e}function Uf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return X2(n)}}function Q2(n){return tr[n]||(er===void 0&&(er=Jt.now()),tr[n]=n.offset(er)),tr[n]}function Vf(n,e){const t=Gi(e.zone,Jt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Et.fromObject(e);let l,s;if(it(n.year))l=Jt.now();else{for(const a of Q0)it(n[a])&&(n[a]=X0[a]);const o=S0(n)||T0(n);if(o)return Xe.invalid(o);const r=Q2(t);[l,s]=xo(n,r,t)}return new Xe({ts:l,zone:t,loc:i,o:s})}function Bf(n,e,t){const i=it(t.round)?!0:t.round,l=(o,r)=>(o=wu(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 Wf(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||Jt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ai("invalid input"):null)||(t.isValid?null:Os(t));this.ts=it(e.ts)?Jt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=el(e.o)&&!e.old?e.o:t.offset(this.ts);l=Mo(this.ts,r),i=Number.isNaN(l.year)?new ai("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]=Wf(arguments),[i,l,s,o,r,a,u]=t;return Vf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Wf(arguments),[i,l,s,o,r,a,u]=t;return e.zone=$n.utcInstance,Vf({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Mv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const l=Gi(t.zone,Jt.defaultZone);return l.isValid?new Xe({ts:i,zone:l,loc:Et.fromObject(t)}):Xe.invalid(Os(l))}static fromMillis(e,t={}){if(el(e))return e<-Hf||e>Hf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(el(e))return new Xe({ts:e*1e3,zone:Gi(t.zone,Jt.defaultZone),loc:Et.fromObject(t)});throw new pn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Gi(t.zone,Jt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const l=Et.fromObject(t),s=hr(e,Uf),{minDaysInFirstWeek:o,startOfWeek:r}=Ef(s,l),a=Jt.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=Mo(a,u);g?(_=Z2,y=K2,S=pr(S,o,r)):f?(_=G2,y=J2,S=Qr(S)):(_=Q0,y=X0);let C=!1;for(const P of _){const N=s[P];it(N)?C?s[P]=y[P]:s[P]=S[P]:C=!0}const T=g?Cv(s,o,r):f?$v(s):S0(s),O=T||T0(s);if(O)return Xe.invalid(O);const E=g?Of(s,o,r):f?Mf(s):s,[L,I]=xo(E,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]=g2(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=b2(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=y2(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(it(e)||it(t))throw new pn("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]=Y2(o,e,t);return f?Xe.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=$2(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new pn("need to specify a reason the DateTime is invalid");const i=e instanceof ai?e:new ai(e,t);if(Jt.throwOnInvalid)throw new Qk(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=Z0(e,Et.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return Y0(hn.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?$o.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$o.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$o.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$o.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=Dr(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Mo(a,o),c=Mo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[hl(this,{ts:a}),hl(this,{ts:u})]:[this]}get isInLeapYear(){return ao(this.year)}get daysInMonth(){return mr(this.year,this.month)}get daysInYear(){return this.isValid?Xl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ws(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ws(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=hn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone($n.instance(e),t)}toLocal(){return this.setZone(Jt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Gi(e,Jt.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 hl(this,{ts:l,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return hl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=hr(e,Uf),{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=Of({...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=Mf({...Qr(this.c),...t});const[d,m]=xo(c,this.o,this.zone);return hl(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e);return hl(this,jf(this,t))}minus(e){if(!this.isValid)return this;const t=St.fromDurationLike(e).negate();return hl(this,jf(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?hn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ea}toLocaleString(e=dr,t={}){return this.isValid?hn.create(this.loc.clone(t),e).formatDateTime(this):ea}toLocaleParts(e={}){return this.isValid?hn.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+=zf(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?ia(this,e==="extended"):null}toISOWeekDate(){return Eo(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":"")+zf(this,o==="extended",t,e,i,s):null}toRFC2822(){return Eo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Eo(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")),Eo(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=Ev(t).map(St.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=A2(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?Kt.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),Bf(t,this.plus(i),{...e,numeric:"always",units:l,unit:s})}toRelativeCalendar(e={}){return this.isValid?Bf(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 pn("min requires all arguments be DateTimes");return Df(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new pn("max requires all arguments be DateTimes");return Df(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 J0(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 K0(s,e)}static fromFormatParser(e,t,i={}){if(it(e)||it(t))throw new pn("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 pn(`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 e0}static get DATE_MED_WITH_WEEKDAY(){return tv}static get DATE_FULL(){return t0}static get DATE_HUGE(){return n0}static get TIME_SIMPLE(){return i0}static get TIME_WITH_SECONDS(){return l0}static get TIME_WITH_SHORT_OFFSET(){return s0}static get TIME_WITH_LONG_OFFSET(){return o0}static get TIME_24_SIMPLE(){return r0}static get TIME_24_WITH_SECONDS(){return a0}static get TIME_24_WITH_SHORT_OFFSET(){return u0}static get TIME_24_WITH_LONG_OFFSET(){return f0}static get DATETIME_SHORT(){return c0}static get DATETIME_SHORT_WITH_SECONDS(){return d0}static get DATETIME_MED(){return p0}static get DATETIME_MED_WITH_SECONDS(){return m0}static get DATETIME_MED_WITH_WEEKDAY(){return nv}static get DATETIME_FULL(){return h0}static get DATETIME_FULL_WITH_SECONDS(){return _0}static get DATETIME_HUGE(){return g0}static get DATETIME_HUGE_WITH_SECONDS(){return b0}}function ks(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&el(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new pn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const x2=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],ew=[".mp4",".avi",".mov",".3gp",".wmv"],tw=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],nw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],iw=["relation","file","select"],lw=["text","email","url","editor"],x0=[{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 U{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||U.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 U.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!U.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!U.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){U.inArray(e,t)||e.push(t)}static mergeUnique(e,t){for(let i of t)U.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]=U.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(!U.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)(!U.isObject(s)&&!Array.isArray(s)||!U.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)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):U.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||U.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.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 U.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=U.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(),U.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():"",U.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 U.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return U.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);U.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||"",!!x2.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!ew.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!tw.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!nw.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return U.hasImageExtension(e)?"image":U.hasDocumentExtension(e)?"document":U.hasVideoExtension(e)?"video":U.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(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)U.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):U.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},U.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||t&&o.type==="autodate")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)&&!U.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=U.isObject(u)&&U.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=U.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=U.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=U.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(U.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?U.plainText(e):e,U.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return U.truncate(e.join(","),i);if(typeof e=="object")try{return U.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 U.extractColumnsFromQuery(e.viewQuery))U.pushUnique(i,t+s);const l=e.fields||[];for(const s of l)U.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=U.getAllCollectionIdentifiers(s,i);for(const r of s.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=U.getCollectionAutocompleteKeys(e,r.collectionId,a+".",l+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&iw.includes(r.type)?(o.push(a+":each"),o.push(a+":length")):lw.includes(r.type)&&o.push(a+":lower")}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=U.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=U.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=U.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)U.pushUnique(i,r)}if(t){const s=U.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=!U.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_"+U.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=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=U.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?U.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 U.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 Va,_l;const Ba="app-tooltip";function Wf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function tl(){return _l=_l||document.querySelector("."+Ba),_l||(_l=document.createElement("div"),_l.classList.add(Ba),document.body.appendChild(_l)),_l}function x0(n,e){let t=tl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Wa();return}t.textContent=e.text,t.className=Ba+" 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 Wa(){clearTimeout(Va),tl().classList.remove("active"),tl().activeNode=void 0}function lw(n,e){tl().activeNode=n,clearTimeout(Va),Va=setTimeout(()=>{tl().classList.add("active"),x0(n,e)},isNaN(e.delay)?0:e.delay)}function qe(n,e){let t=Wf(e);function i(){lw(n,t)}function l(){Wa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",l),tl(),{update(s){var o,r;t=Wf(s),(r=(o=tl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&x0(n,t)},destroy(){var s,o;(o=(s=tl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Wa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Ar(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ar,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pf(l),[m,h]=pf(s);return{delay:e,duration:t,easing:i,css:(g,_)=>`
+`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=U.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?U.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 U.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 Va,_l;const Ba="app-tooltip";function Yf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function tl(){return _l=_l||document.querySelector("."+Ba),_l||(_l=document.createElement("div"),_l.classList.add(Ba),document.body.appendChild(_l)),_l}function ey(n,e){let t=tl();if(!t.classList.contains("active")||!(e!=null&&e.text)){Wa();return}t.textContent=e.text,t.className=Ba+" 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 Wa(){clearTimeout(Va),tl().classList.remove("active"),tl().activeNode=void 0}function sw(n,e){tl().activeNode=n,clearTimeout(Va),Va=setTimeout(()=>{tl().classList.add("active"),ey(n,e)},isNaN(e.delay)?0:e.delay)}function qe(n,e){let t=Yf(e);function i(){sw(n,t)}function l(){Wa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",l),tl(),{update(s){var o,r;t=Yf(s),(r=(o=tl())==null?void 0:o.activeNode)!=null&&r.contains(n)&&ey(n,t)},destroy(){var s,o;(o=(s=tl())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Wa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Ar(n){const e=n-1;return e*e*e+1}function Ys(n,{delay:e=0,duration:t=400,easing:i=lo}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ar,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]=mf(l),[m,h]=mf(s);return{delay:e,duration:t,easing:i,css:(g,_)=>`
 			transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${h});
 			opacity: ${a-f*_}`}}function mt(n,{delay:e=0,duration:t=400,easing:i=Ar,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 Ct(n,{delay:e=0,duration:t=400,easing:i=Ar,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 sw=n=>({}),Yf=n=>({}),ow=n=>({}),Kf=n=>({});function Jf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=n[4]&&!n[2]&&Zf(n);const T=n[19].header,O=Lt(T,n,n[18],Kf);let E=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=$(),s=b("div"),o=b("div"),C&&C.c(),r=$(),O&&O.c(),a=$(),E&&E.c(),u=$(),f=b("div"),I&&I.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]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),C&&C.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,y||(S=[Y(t,"click",nt(n[20])),Y(f,"scroll",n[22])],y=!0)},p(N,R){n=N,n[4]&&!n[2]?C?(C.p(n,R),R[0]&20&&M(C,1)):(C=Zf(n),C.c(),M(C,1),C.m(o,r)):C&&(re(),D(C,1,1,()=>{C=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?At(T,n[18],R,ow):Nt(n[18]),Kf),n[4]&&n[2]?E?E.p(n,R):(E=Gf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,sw):Nt(n[18]),Yf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M(C),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Xb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D(C),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=_u(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&k(e),N&&i&&i.end(),C&&C.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),y=!1,Ie(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=Y(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!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=Y(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function rw(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=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Jf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function ey(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Xf(){return 1e3+ey().querySelectorAll(".overlay-panel-container.active").length}function aw(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=yt(),h="op_"+U.randomString(10);let g,_,y,S,C="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(y=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Xf(),g):t(6,g.style="",g))}function P(){U.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){U.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!U.isInput(G.target)&&g&&g.style.zIndex==Xf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,de){de&&t(8,C=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}G.scrollTop==0?t(8,C+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100))}ln(()=>{ey().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const B=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const V=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,C,R,z,F,f,c,d,O,L,T,l,i,B,J,V,Z]}class Xt extends Se{constructor(e){super(),we(this,e,aw,rw,ye,{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 ty(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ye(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 ny(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 ty(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=It(h)?h:te},m=l.map((h,g)=>cu(h,_=>{u[g]=_,f&=~(1<<g),a&&d()},()=>{f|=1<<g}));return a=!0,d(),function(){Ie(m),c(),a=!1}})}const Cu=Hn({});function _n(n,e,t){Cu.set({text:n,yesCallback:e,noCallback:t})}function iy(){Cu.set({})}function uw(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){v(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&k(e)}}}function fw(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=$(),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],ee(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=[Y(e,"click",n[4]),Y(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&ee(l,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(l)),o=!1,Ie(r)}}}function cw(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:[fw],header:[uw]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),H(e,l)}}}function dw(n,e,t){let i;Qe(n,Cu,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 dn(),t(3,o=!1),iy()};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 pw extends Se{constructor(e){super(),we(this,e,dw,cw,ye,{})}}function mw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),qk(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 hw(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 _w(n){let e;function t(s,o){return s[1]?hw:mw}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 gw(){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 bw=gw();function sa(){return window&&window.tinymce?window.tinymce:null}function yw(n,e,t){let{id:i="tinymce_svelte"+U.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,y=u,S=s;const C=yt();function T(){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,C),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}ln(()=>(sa()!==null?T():bw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(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,O,E,L]}class $u extends Se{constructor(e){super(),we(this,e,yw,_w,ye,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function kw(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=Ar}=i;return{delay:f,duration:It(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 Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function tn(n,e=3e3){return Nr(n,"success",e)}function $i(n,e=4500){return Nr(n,"error",e)}function vw(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{ly(i)},t)};Pr.update(l=>(Ou(l,i.message),U.pushOrReplaceByKey(l,i,"message"),l))}function ly(n){Pr.update(e=>(Ou(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Ou(n,e);return[]})}function Ou(n,e){let t;typeof e=="string"?t=U.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),U.removeByKey(n,"message",t.message))}function Qf(n,e,t){const i=n.slice();return i[2]=e[t],i}function ww(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 Sw(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 Tw(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 Cw(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(E,L){return E[2].type==="info"?Cw:E[2].type==="success"?Tw:E[2].type==="warning"?Sw:ww}let C=S(e),T=C(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=$(),s=b("div"),r=W(o),a=$(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=$(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(y=Y(u,"click",nt(O)),_=!0)},p(E,L){e=E,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Vk(t),h(),Jb(t,m)},a(){h(),h=Uk(t,m,kw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Xb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=_u(t,Ys,{duration:150})),g=!1},d(E){E&&k(t),T.d(),E&&d&&d.end(),_=!1,y()}}}function $w(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=vt(t,a,o,1,r,s,i,e,Jk,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)M(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 Ow(n,e,t){let i;return Qe(n,Pr,s=>t(0,i=s)),[i,s=>ly(s)]}class Mw extends Se{constructor(e){super(),we(this,e,Ow,$w,ye,{})}}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]),ee(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)&&ee(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{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 Ew(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=[Y(window,"click",n[7]),Y(window,"mousedown",n[6]),Y(window,"keydown",n[5]),Y(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=ec(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Dw(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=yt();function S(G=0){o&&(clearTimeout(g),g=setTimeout(C,G))}function C(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){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 O(){o?C():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&C()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),C())}function B(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var de;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((de=G.target)!=null&&de.closest(".flatpickr-calendar"))&&C()}ln(()=>(L(),()=>I()));function V(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,de;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((de=m==null?void 0:m.classList)==null||de.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,f,c,d,z,F,B,J,s,r,a,u,S,C,T,O,m,l,i,V,Z]}class jn extends Se{constructor(e){super(),we(this,e,Dw,Ew,ye,{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 un=Hn(""),_r=Hn(""),Dl=Hn(!1),kn=Hn({});function Ut(n){kn.set(n||{})}function Yn(n){kn.update(e=>(U.deleteByPath(e,n),e))}const Rr=Hn({});function tc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Iw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Lw;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||Aw;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 Lw(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Aw(n){return encodeURIComponent(n)}const Pw=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let sy;function xl(n){if(n)try{const e=decodeURIComponent(sy(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function Fr(n,e=0){let t=xl(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}sy=typeof atob!="function"||Pw?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 Mu{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!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}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=Iw(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 oy extends Mu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Nw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Rw=["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)Rw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ry(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 ay extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Eu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),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 uy extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class Fw extends uy{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;if(((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)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return 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 C;const _=r.authStore.token;if((C=g.query)!=null&&C.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let y=r.authStore.isValid;if(y&&Fr(r.authStore.token,a))try{await u()}catch{y=!1}y||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=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=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=lc(void 0));const l=new ay(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async C=>{var O;const T=l.clientId;try{if(!C.state||T!==C.state)throw new Error("State parameters don't match.");if(C.error||!C.code)throw new Error("OAuth2 redirect error or missing code: "+C.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,C.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}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(C){i?i.location.href=C:i=lc(C)})(y)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Mu,this.client.lang),s=await l.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return l.authStore.save(s==null?void 0:s.token,this.decode((s==null?void 0:s.record)||{})),l}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class qw extends uy{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 Hw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class jw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class zw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Uw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(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(Ya(i))return!0}return!1}class Vw extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Bw(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 Bw{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=ry(t.query);i&&(e.url+=(e.url.includes("?")?"&":"?")+i)}for(const i in t.body){const l=t.body[i];if(Ya(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)Ya(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 co{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 Mu:this.authStore=new oy,this.collections=new qw(this),this.files=new zw(this),this.logs=new Hw(this),this.settings=new Nw(this),this.realtime=new ay(this),this.health=new jw(this),this.backups=new Uw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Vw(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Fw(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=ry(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||sc(l)||!oc(l))return l;const s=new FormData;for(const o in l){const r=l[o];if(typeof r!="object"||oc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)s.append(o,u)}else{let a={};a[o]=r,s.append("@jsonPayload",JSON.stringify(a))}}return s}(t.body),Eu(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||sc(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}}const Mn=Hn([]),ti=Hn({}),Js=Hn(!1),fy=Hn({}),Du=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Iu((n=Ub(ti))==null?void 0:n.id)});function cy(){As==null||As.postMessage("reload")}function Ww(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Yw(n){ti.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(U.pushOrReplaceByKey(e,n,"id"),Lu(),cy(),U.sortCollections(e)))}function Kw(n){Mn.update(e=>(U.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Lu(),cy(),e))}async function Iu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=U.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Lu(),Du.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Lu(){fy.update(n=>(Mn.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 dy(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 Jw(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,wt(l,[Rt(r[2])]))),{props:u}}return s&&(e=zt(s,o(n)),e.$on("routeEvent",n[7])),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Zw(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,wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]))),{props:u}}return s&&(e=zt(s,o(n)),e.$on("routeEvent",n[6])),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Gw(n){let e,t,i,l;const s=[Zw,Jw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(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=ty(null,function(e){e(rc());const t=()=>{e(rc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});ny(qr,n=>n.location);const Au=ny(qr,n=>n.querystring),ac=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();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 Bn(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 Xw(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||Qw(i.currentTarget.getAttribute("href"))})}function fc(n){return n&&typeof n=="string"?{href:n}:n||{}}function Qw(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function xw(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=dy(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(E[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(O){for(let E=0;E<this.conditions.length;E++)if(!await this.conditions[E](O))return!1;return!0}}const r=[];i instanceof Map?i.forEach((T,O)=>{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=yt();async function d(T,O){await dn(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Bk(()=>{Xw(m)}));let g=null,_=null;const y=qr.subscribe(async T=>{g=T;let O=0;for(;O<r.length;){const E=r[O].match(T.location);if(!E){O++;continue}const L={route:r[O].path,location:T.location,querystring:T.querystring,userData:r[O].userData,params:E&&typeof E=="object"&&Object.keys(E).length?E:null};if(!await r[O].checkConditions(L)){t(0,a=null),_=null,d("conditionsFailed",L);return}d("routeLoading",Object.assign({},L));const I=r[O].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(T!=g)return;t(0,a=A&&A.default||A),_=I}E&&typeof E=="object"&&Object.keys(E).length?t(1,u=E):t(1,u=null),t(2,f=r[O].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)});oo(()=>{y(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,C]}class e3 extends Se{constructor(e){super(),we(this,e,xw,Gw,ye,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.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),U.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Ub(fy);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(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 t3 extends oy{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 _e=new co("../",new t3);_e.authStore.isValid&&_e.collection(_e.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)&&_e.authStore.clear()});const nr=[];let py;function my(n){const e=n.pattern.test(py);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=>{py=n.location+(n.querystring?"?"+n.querystring:""),nr.map(my)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?dy(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),my(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const n3="modulepreload",i3=function(n,e){return new URL(n,e).href},dc={},Tt=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=i3(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":n3,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)})};function l3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class s3 extends Se{constructor(e){super(),we(this,e,l3,null,ye,{})}}function pc(n,e,t){const i=n.slice();return i[12]=e[t],i}const o3=n=>({}),mc=n=>({uniqueId:n[4]});function r3(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=hc(pc(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=ve()},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=pc(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=hc(u),l[a].c(),M(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)M(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),dt(l,o)}}}function a3(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=qe.call(null,t,{position:"left",text:n[3].map(gr).join(`
+		`}}const ow=n=>({}),Kf=n=>({}),rw=n=>({}),Jf=n=>({});function Zf(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=n[4]&&!n[2]&&Gf(n);const T=n[19].header,O=Lt(T,n,n[18],Jf);let E=n[4]&&n[2]&&Xf(n);const L=n[19].default,I=Lt(L,n,n[18],null),A=n[19].footer,P=Lt(A,n,n[18],Kf);return{c(){e=b("div"),t=b("div"),l=$(),s=b("div"),o=b("div"),C&&C.c(),r=$(),O&&O.c(),a=$(),E&&E.c(),u=$(),f=b("div"),I&&I.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]),ee(s,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(N,R){v(N,e,R),w(e,t),w(e,l),w(e,s),w(s,o),C&&C.m(o,null),w(o,r),O&&O.m(o,null),w(o,a),E&&E.m(o,null),w(s,u),w(s,f),I&&I.m(f,null),n[21](f),w(s,c),w(s,d),P&&P.m(d,null),_=!0,y||(S=[Y(t,"click",nt(n[20])),Y(f,"scroll",n[22])],y=!0)},p(N,R){n=N,n[4]&&!n[2]?C?(C.p(n,R),R[0]&20&&M(C,1)):(C=Gf(n),C.c(),M(C,1),C.m(o,r)):C&&(re(),D(C,1,1,()=>{C=null}),ae()),O&&O.p&&(!_||R[0]&262144)&&Pt(O,T,n,n[18],_?At(T,n[18],R,rw):Nt(n[18]),Jf),n[4]&&n[2]?E?E.p(n,R):(E=Xf(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Pt(I,L,n,n[18],_?At(L,n[18],R,null):Nt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Pt(P,A,n,n[18],_?At(A,n[18],R,ow):Nt(n[18]),Kf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||R[0]&262)&&ee(s,"popup",n[2]),(!_||R[0]&4)&&ee(e,"padded",n[2]),(!_||R[0]&1)&&ee(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!0)),i.run(1))}),M(C),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=Qb(s,qn,n[2]?{duration:Zi,y:-10}:{duration:Zi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=He(t,Ys,{duration:Zi,opacity:0},!1)),i.run(0)),D(C),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=gu(s,qn,n[2]?{duration:Zi,y:10}:{duration:Zi,x:50})),_=!1},d(N){N&&k(e),N&&i&&i.end(),C&&C.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),y=!1,Ie(S)}}}function Gf(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=Y(e,"click",nt(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ys,{duration:Zi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ys,{duration:Zi},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function Xf(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=Y(e,"click",nt(n[5])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function aw(n){let e,t,i,l,s=n[0]&&Zf(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=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=Zf(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[23](null),i=!1,Ie(l)}}}let gl,la=[];function ty(){return gl=gl||document.querySelector(".overlays"),gl||(gl=document.createElement("div"),gl.classList.add("overlays"),document.body.appendChild(gl)),gl}let Zi=150;function Qf(){return 1e3+ty().querySelectorAll(".overlay-panel-container.active").length}function uw(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=yt(),h="op_"+U.randomString(10);let g,_,y,S,C="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(y=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await dn(),A()}function A(){g&&(o?t(6,g.style.zIndex=Qf(),g):t(6,g.style="",g))}function P(){U.pushUnique(la,h),document.body.classList.add("overlay-active")}function N(){U.removeByValue(la,h),la.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!U.isInput(G.target)&&g&&g.style.zIndex==Qf()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,de){de&&t(8,C=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}G.scrollTop==0?t(8,C+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100))}ln(()=>{ty().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const B=()=>a?E():!0;function J(G){ie[G?"unshift":"push"](()=>{_=G,t(7,_)})}const V=G=>F(G.target);function Z(G){ie[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,s=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,l=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(_,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,s,r,a,u,E,g,_,C,R,z,F,f,c,d,O,L,T,l,i,B,J,V,Z]}class Xt extends Se{constructor(e){super(),we(this,e,uw,aw,ye,{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 ny(n,e){return{subscribe:Hn(n,e).subscribe}}function Hn(n,e=te){let t;const i=new Set;function l(r){if(ye(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 iy(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 ny(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=It(h)?h:te},m=l.map((h,g)=>du(h,_=>{u[g]=_,f&=~(1<<g),a&&d()},()=>{f|=1<<g}));return a=!0,d(),function(){Ie(m),c(),a=!1}})}const $u=Hn({});function _n(n,e,t){$u.set({text:n,yesCallback:e,noCallback:t})}function ly(){$u.set({})}function fw(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){v(s,e,o),w(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&oe(i,t)},d(s){s&&k(e)}}}function cw(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=$(),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],ee(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=[Y(e,"click",n[4]),Y(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&ee(l,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(l)),o=!1,Ie(r)}}}function dw(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:[cw],header:[fw]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[6](null),H(e,l)}}}function pw(n,e,t){let i;Qe(n,$u,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 dn(),t(3,o=!1),ly()};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 mw extends Se{constructor(e){super(),we(this,e,pw,dw,ye,{})}}function hw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Hk(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 _w(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 gw(n){let e;function t(s,o){return s[1]?_w:hw}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 bw(){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 yw=bw();function sa(){return window&&window.tinymce?window.tinymce:null}function kw(n,e,t){let{id:i="tinymce_svelte"+U.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,y=u,S=s;const C=yt();function T(){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,C),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),sa().init(I)}ln(()=>(sa()!==null?T():yw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=sa())==null||A.remove(_))}catch{}}));function O(I){ie[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(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,O,E,L]}class Ou extends Se{constructor(e){super(),we(this,e,kw,gw,ye,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function vw(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=Ar}=i;return{delay:f,duration:It(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 Pr=Hn([]);function Ks(n,e=4e3){return Nr(n,"info",e)}function tn(n,e=3e3){return Nr(n,"success",e)}function $i(n,e=4500){return Nr(n,"error",e)}function ww(n,e=4500){return Nr(n,"warning",e)}function Nr(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{sy(i)},t)};Pr.update(l=>(Mu(l,i.message),U.pushOrReplaceByKey(l,i,"message"),l))}function sy(n){Pr.update(e=>(Mu(e,n),e))}function Ls(){Pr.update(n=>{for(let e of n)Mu(n,e);return[]})}function Mu(n,e){let t;typeof e=="string"?t=U.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),U.removeByKey(n,"message",t.message))}function xf(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 Tw(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 Cw(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 $w(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 ec(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,y;function S(E,L){return E[2].type==="info"?$w:E[2].type==="success"?Cw:E[2].type==="warning"?Tw:Sw}let C=S(e),T=C(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=$(),s=b("div"),r=W(o),a=$(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=$(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),ee(t,"alert-info",e[2].type=="info"),ee(t,"alert-success",e[2].type=="success"),ee(t,"alert-danger",e[2].type=="error"),ee(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){v(E,t,L),w(t,i),T.m(i,null),w(t,l),w(t,s),w(s,r),w(t,a),w(t,u),w(t,f),g=!0,_||(y=Y(u,"click",nt(O)),_=!0)},p(E,L){e=E,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&oe(r,o),(!g||L&1)&&ee(t,"alert-info",e[2].type=="info"),(!g||L&1)&&ee(t,"alert-success",e[2].type=="success"),(!g||L&1)&&ee(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&ee(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){Bk(t),h(),Zb(t,m)},a(){h(),h=Vk(t,m,vw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=Qb(t,mt,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=gu(t,Ys,{duration:150})),g=!1},d(E){E&&k(t),T.d(),E&&d&&d.end(),_=!1,y()}}}function Ow(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=xf(n,s,r),u=o(a);i.set(u,t[r]=ec(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=vt(t,a,o,1,r,s,i,e,Zk,ec,null,xf);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)M(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 Mw(n,e,t){let i;return Qe(n,Pr,s=>t(0,i=s)),[i,s=>sy(s)]}class Ew extends Se{constructor(e){super(),we(this,e,Mw,Ow,ye,{})}}function tc(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]),ee(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)&&ee(e,"active",o[0])},i(o){i||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,qn,{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]&&tc(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=[Y(window,"click",n[7]),Y(window,"mousedown",n[6]),Y(window,"keydown",n[5]),Y(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&M(s,1)):(s=tc(o),s.c(),M(s,1),s.m(e,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){t||(M(s),t=!0)},o(o){D(s),t=!1},d(o){o&&k(e),s&&s.d(),n[20](null),i=!1,Ie(l)}}}function Iw(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=yt();function S(G=0){o&&(clearTimeout(g),g=setTimeout(C,G))}function C(){o&&(t(0,o=!1),_=!1,clearTimeout(h),clearTimeout(g))}function T(){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 O(){o?C():T()}function E(G){return!c||G.classList.contains(u)||c.contains(G)&&G.closest&&G.closest("."+u)}function L(G){I(),c==null||c.addEventListener("click",A),c==null||c.addEventListener("keydown",P),t(16,m=G||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",N),m==null||m.addEventListener("keydown",R)}function I(){clearTimeout(h),clearTimeout(g),c==null||c.removeEventListener("click",A),c==null||c.removeEventListener("keydown",P),m==null||m.removeEventListener("click",N),m==null||m.removeEventListener("keydown",R)}function A(G){G.stopPropagation(),E(G.target)&&C()}function P(G){(G.code==="Enter"||G.code==="Space")&&(G.stopPropagation(),E(G.target)&&S(150))}function N(G){G.preventDefault(),G.stopPropagation(),O()}function R(G){(G.code==="Enter"||G.code==="Space")&&(G.preventDefault(),G.stopPropagation(),O())}function z(G){o&&!(m!=null&&m.contains(G.target))&&!(c!=null&&c.contains(G.target))&&O()}function F(G){o&&r&&G.code==="Escape"&&(G.preventDefault(),C())}function B(G){o&&(_=!(c!=null&&c.contains(G.target)))}function J(G){var de;o&&_&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((de=G.target)!=null&&de.closest(".flatpickr-calendar"))&&C()}ln(()=>(L(),()=>I()));function V(G){ie[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ie[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,s=G.trigger),"active"in G&&t(0,o=G.active),"escClose"in G&&t(9,r=G.escClose),"autoScroll"in G&&t(10,a=G.autoScroll),"closableClass"in G&&t(11,u=G.closableClass),"class"in G&&t(1,f=G.class),"$$scope"in G&&t(17,l=G.$$scope)},n.$$.update=()=>{var G,de;n.$$.dirty[0]&260&&c&&L(s),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((de=m==null?void 0:m.classList)==null||de.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,f,c,d,z,F,B,J,s,r,a,u,S,C,T,O,m,l,i,V,Z]}class jn extends Se{constructor(e){super(),we(this,e,Iw,Dw,ye,{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 un=Hn(""),_r=Hn(""),Dl=Hn(!1),kn=Hn({});function Ut(n){kn.set(n||{})}function Yn(n){kn.update(e=>(U.deleteByPath(e,n),e))}const Rr=Hn({});function nc(n){Rr.set(n||{})}class Fn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Fn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Fn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Do=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Lw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||Aw;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 ic(n,e,t){const i=Object.assign({},t||{}),l=i.encode||Pw;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 Aw(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Pw(n){return encodeURIComponent(n)}const Nw=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let oy;function xl(n){if(n)try{const e=decodeURIComponent(oy(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function Fr(n,e=0){let t=xl(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}oy=typeof atob!="function"||Nw?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 lc="pb_auth";class Eu{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!Fr(this.token)}get isSuperuser(){var t,i;let e=xl(this.token);return e.type=="auth"&&(((t=this.record)==null?void 0:t.collectionName)=="_superusers"||!((i=this.record)!=null&&i.collectionName)&&e.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),xl(this.token).type=="auth"&&!this.isSuperuser}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=lc){const i=Lw(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=lc){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=ic(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=ic(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 ry extends Eu{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const e=this._storageGet(this.storageKey)||{};return e.record||e.model||null}get model(){return this.record}save(e,t){this._storageSet(this.storageKey,{token:e,record:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.record||t.model||null)})}}class al{constructor(e){this.client=e}}class Rw extends al{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i,l){return l=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},l),this.client.send("/api/settings/test/email",l).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const Fw=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Du(n){if(n){n.query=n.query||{};for(let e in n)Fw.includes(e)||(n.query[e]=n[e],delete n[e])}}function ay(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 uy extends al{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Du(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Fn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),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 fy extends al{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new Fn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function Ki(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function oa(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class qw extends fy{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;if(((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)){let a=Object.assign({},this.client.authStore.record.expand),u=Object.assign({},this.client.authStore.record,l);a&&(u.expand=Object.assign(a,l.expand)),this.client.authStore.save(this.client.authStore.token,u)}return 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 C;const _=r.authStore.token;if((C=g.query)!=null&&C.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let y=r.authStore.isValid;if(y&&Fr(r.authStore.token,a))try{await u()}catch{y=!1}y||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&_==S[T]&&r.authStore.token){S[T]=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=Ki("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=sc(void 0));const l=new uy(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.oauth2.providers.find(m=>m.name===t.provider);if(!u)throw new Fn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var g;try{await l.subscribe("@oauth2",async C=>{var O;const T=l.clientId;try{if(!C.state||T!==C.state)throw new Error("State parameters don't match.");if(C.error||!C.code)throw new Error("OAuth2 redirect error or missing code: "+C.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,C.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new Fn(E))}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(C){i?i.location.href=C:i=sc(C)})(y)}catch(_){s(),h(new Fn(_))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ki("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ki("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=Ki("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=Ki("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=xl(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=Ki("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=Ki("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=xl(e),r=this.client.authStore.record;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return this.client.collection("_externalAuths").getFullList(Object.assign({},t,{filter:this.client.filter("recordRef = {:id}",{id:e})}))}async unlinkExternalAuth(e,t,i){const l=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(l.id,i).then(()=>!0)}async requestOTP(e,t){return t=Object.assign({method:"POST",body:{email:e}},t),this.client.send(this.baseCollectionPath+"/request-otp",t)}async authWithOTP(e,t,i){return i=Object.assign({method:"POST",body:{otpId:e,password:t}},i),this.client.send(this.baseCollectionPath+"/auth-with-otp",i).then(l=>this.authResponse(l))}async impersonate(e,t,i){(i=Object.assign({method:"POST",body:{duration:t}},i)).headers=i.headers||{},i.headers.Authorization||(i.headers.Authorization=this.client.authStore.token);const l=new co(this.client.baseURL,new Eu,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 sc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Fn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class Hw extends fy{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 jw extends al{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new Fn({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class zw extends al{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Uw extends al{getUrl(e,t,i={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(e,t,i)}getURL(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildURL(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class Vw extends al{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(e,t)}getDownloadURL(e,t){return this.client.buildURL(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}function Ya(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 Ka(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(Ya(i))return!0}return!1}const Bw=/^[\-\.\d]+$/;function rc(n){if(typeof n!="string")return n;if(n=="true")return!0;if(n=="false")return!1;if((n[0]==="-"||n[0]>="0"&&n[0]<="9")&&Bw.test(n)){let e=+n;if(""+e===n)return e}return n}class Ww extends al{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new Yw(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 Yw{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(Du(t),e.headers=t.headers,e.json={},e.files={},t.query!==void 0){const l=ay(t.query);l&&(e.url+=(e.url.includes("?")?"&":"?")+l)}let i=t.body;Ka(i)&&(i=function(s){let o={};return s.forEach((r,a)=>{if(a==="@jsonPayload"&&typeof r=="string")try{let u=JSON.parse(r);Object.assign(o,u)}catch(u){console.warn("@jsonPayload error:",u)}else o[a]!==void 0?(Array.isArray(o[a])||(o[a]=[o[a]]),o[a].push(rc(r))):o[a]=rc(r)}),o}(i));for(const l in i){const s=i[l];if(Ya(s))e.files[l]=e.files[l]||[],e.files[l].push(s);else if(Array.isArray(s)){const o=[],r=[];for(const a of s)Ya(a)?o.push(a):r.push(a);if(o.length>0&&o.length==s.length){e.files[l]=e.files[l]||[];for(let a of o)e.files[l].push(a)}else if(e.json[l]=r,o.length>0){let a=l;l.startsWith("+")||l.endsWith("+")||(a+="+"),e.files[a]=e.files[a]||[];for(let u of o)e.files[a].push(u)}}else e.json[l]=s}}}class co{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 Eu:this.authStore=new ry,this.collections=new Hw(this),this.files=new Uw(this),this.logs=new jw(this),this.settings=new Rw(this),this.realtime=new uy(this),this.health=new zw(this),this.backups=new Vw(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Ww(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new qw(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=ay(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s,t)),l.status>=400)throw new Fn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new Fn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(l){if(typeof FormData>"u"||l===void 0||typeof l!="object"||l===null||Ka(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),Du(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||Ka(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 Mn=Hn([]),ti=Hn({}),Js=Hn(!1),cy=Hn({}),Iu=Hn({});let As;typeof BroadcastChannel<"u"&&(As=new BroadcastChannel("collections"),As.onmessage=()=>{var n;Lu((n=Vb(ti))==null?void 0:n.id)});function dy(){As==null||As.postMessage("reload")}function Kw(n){Mn.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),e})}function Jw(n){ti.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Mn.update(e=>(U.pushOrReplaceByKey(e,n,"id"),Au(),dy(),U.sortCollections(e)))}function Zw(n){Mn.update(e=>(U.removeByKey(e,"id",n.id),ti.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Au(),dy(),e))}async function Lu(n=null){Js.set(!0);try{let e=await _e.collections.getFullList(200,{sort:"+name"});e=U.sortCollections(e),Mn.set(e);const t=n&&e.find(i=>i.id==n||i.name==n);t?ti.set(t):e.length&&ti.set(e.find(i=>!i.system)||e[0]),Au(),Iu.set(await _e.collections.getScaffolds())}catch(e){_e.error(e)}Js.set(!1)}function Au(){cy.update(n=>(Mn.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 py(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 Gw(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,wt(l,[Rt(r[2])]))),{props:u}}return s&&(e=zt(s,o(n)),e.$on("routeEvent",n[7])),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[7]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&4?wt(l,[Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Xw(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,wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]))),{props:u}}return s&&(e=zt(s,o(n)),e.$on("routeEvent",n[6])),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),e.$on("routeEvent",r[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a&6?wt(l,[a&2&&{params:r[1]},a&4&&Rt(r[2])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Qw(n){let e,t,i,l;const s=[Xw,Gw],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function ac(){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=ny(null,function(e){e(ac());const t=()=>{e(ac())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});iy(qr,n=>n.location);const Pu=iy(qr,n=>n.querystring),uc=Hn(void 0);async function is(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await dn();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 Bn(n,e){if(e=cc(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return fc(n,e),{update(t){t=cc(t),fc(n,t)}}}function xw(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function fc(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||e3(i.currentTarget.getAttribute("href"))})}function cc(n){return n&&typeof n=="string"?{href:n}:n||{}}function e3(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function t3(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(O,E){if(!E||typeof E!="function"&&(typeof E!="object"||E._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=py(O);this.path=O,typeof E=="object"&&E._sveltesparouter===!0?(this.component=E.component,this.conditions=E.conditions||[],this.userData=E.userData,this.props=E.props||{}):(this.component=()=>Promise.resolve(E),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(O){if(l){if(typeof l=="string")if(O.startsWith(l))O=O.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const A=O.match(l);if(A&&A[0])O=O.substr(A[0].length)||"/";else return null}}const E=this._pattern.exec(O);if(E===null)return null;if(this._keys===!1)return E;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(E[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(O){for(let E=0;E<this.conditions.length;E++)if(!await this.conditions[E](O))return!1;return!0}}const r=[];i instanceof Map?i.forEach((T,O)=>{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=yt();async function d(T,O){await dn(),c(T,O)}let m=null,h=null;s&&(h=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",h),Wk(()=>{xw(m)}));let g=null,_=null;const y=qr.subscribe(async T=>{g=T;let O=0;for(;O<r.length;){const E=r[O].match(T.location);if(!E){O++;continue}const L={route:r[O].path,location:T.location,querystring:T.querystring,userData:r[O].userData,params:E&&typeof E=="object"&&Object.keys(E).length?E:null};if(!await r[O].checkConditions(L)){t(0,a=null),_=null,d("conditionsFailed",L);return}d("routeLoading",Object.assign({},L));const I=r[O].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(T!=g)return;t(0,a=A&&A.default||A),_=I}E&&typeof E=="object"&&Object.keys(E).length?t(1,u=E):t(1,u=null),t(2,f=r[O].props),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u})).then(()=>{uc.set(u)});return}t(0,a=null),_=null,uc.set(void 0)});oo(()=>{y(),h&&window.removeEventListener("popstate",h)});function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,C]}class n3 extends Se{constructor(e){super(),we(this,e,t3,Qw,ye,{routes:3,prefix:4,restoreScrollState:5})}}const ra="pb_superuser_file_token";co.prototype.logout=function(n=!0){this.authStore.clear(),n&&is("/login")};co.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),U.isEmpty(l.data)||Ut(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),is("/")};co.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=Vb(cy);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(ra)||"";return(!t||Fr(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 i3 extends ry{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"&&nc(t)}clear(){super.clear(),nc(null)}}const _e=new co("../",new i3);_e.authStore.isValid&&_e.collection(_e.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)&&_e.authStore.clear()});const nr=[];let my;function hy(n){const e=n.pattern.test(my);dc(n,n.className,e),dc(n,n.inactiveClassName,!e)}function dc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qr.subscribe(n=>{my=n.location+(n.querystring?"?"+n.querystring:""),nr.map(hy)});function qi(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?py(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return nr.push(i),hy(i),{destroy(){nr.splice(nr.indexOf(i),1)}}}const l3="modulepreload",s3=function(n,e){return new URL(n,e).href},pc={},Tt=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=s3(u,i),u in pc)return;pc[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":l3,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)})};function o3(n){e();function e(){_e.authStore.isValid?is("/collections"):_e.logout()}return[]}class r3 extends Se{constructor(e){super(),we(this,e,o3,null,ye,{})}}function mc(n,e,t){const i=n.slice();return i[12]=e[t],i}const a3=n=>({}),hc=n=>({uniqueId:n[4]});function u3(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=_c(mc(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=ve()},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=mc(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=_c(u),l[a].c(),M(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)M(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),dt(l,o)}}}function f3(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=qe.call(null,t,{position:"left",text:n[3].map(gr).join(`
 `)})),o=!0)},p(a,u){i&&It(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(gr).join(`
-`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=He(t,Ct,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,Ct,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&k(e),a&&l&&l.end(),o=!1,r()}}}function hc(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=$(),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=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function u3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],mc),f=[a3,r3],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=$(),l.c(),p(e,"class",n[1]),ee(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=Y(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,o3):Nt(m[8]),mc);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()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const _c="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||_c:n||_c}function f3(n,e,t){let i;Qe(n,kn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}ln(()=>(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=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class ce extends Se{constructor(e){super(),we(this,e,f3,u3,ye,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const c3=n=>({}),gc=n=>({});function bc(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=$(),i=b("span"),i.textContent="|",l=$(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.11",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 d3(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],gc);let d=((m=n[2])==null?void 0:m.id)&&bc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=$(),l=b("footer"),c&&c.c(),s=$(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(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,c3):Nt(h[3]),gc),(_=h[2])!=null&&_.id?d||(d=bc(),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)&&ee(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&k(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function p3(n,e,t){let i;Qe(n,Rr,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 pi extends Se{constructor(e){super(),we(this,e,p3,d3,ye,{center:0,class:1})}}function m3(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){v(s,e,o),n[13](e),he(e,n[7]),i||(l=Y(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]&&he(e,s[7])},i:te,o:te,d(s){s&&k(e),n[13](null),i=!1,l()}}}function h3(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function yc(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&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function kc(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=Y(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function _3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[h3,m3],m=[];function h(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]&&yc(),_=(n[0].length||n[7].length)&&kc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=$(),o.c(),r=$(),g&&g.c(),a=$(),_&&_.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=[Y(e,"click",On(n[11])),Y(e,"submit",nt(n[10]))],f=!0)},p(y,[S]){let C=s;s=h(y),s===C?m[s].p(y,S):(re(),D(m[C],1,1,()=>{m[C]=null}),ae(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),M(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?S&129&&M(g,1):(g=yc(),g.c(),M(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&&M(_,1)):(_=kc(y),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(y){u||(M(o),M(g),M(_),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,Ie(c)}}}function g3(n,e,t){const i=yt(),l="search_"+U.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:O}=await import("./FilterAutocompleteInput-DbGqmGAP.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}ln(()=>{g()});function _(O){Pe.call(this,n,O)}function y(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function C(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,y,S,C,T]}class Hr extends Se{constructor(e){super(),we(this,e,g3,_3,ye,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function b3(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),ee(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Me(l=qe.call(null,e,n[0])),Y(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&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&k(e),s=!1,Ie(o)}}}function y3(n,e,t){const i=yt();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 ln(()=>()=>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 Pu extends Se{constructor(e){super(),we(this,e,y3,b3,ye,{tooltip:0,class:1})}}const k3=n=>({}),vc=n=>({}),v3=n=>({}),wc=n=>({});function w3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],wc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],vc);return{c(){e=b("div"),f&&f.c(),t=$(),i=b("div"),d&&d.c(),s=$(),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=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,v3):Nt(g[10]),wc),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],_,k3):Nt(g[10]),vc)},i(g){o||(M(f,g),M(d,g),M(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,Ie(a)}}}function S3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();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 C(){f&&t(2,f.scrollLeft=0,f)}function T(){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 O(){d||(d=setTimeout(()=>{T(),d=null},150))}ln(()=>(O(),y=new MutationObserver(O),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,C,T,l,i,E]}class Nu extends Se{constructor(e){super(),we(this,e,S3,w3,ye,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function T3(n){let e,t,i,l,s;const o=n[6].default,r=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]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[Y(e,"click",n[7]),Y(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)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,Ie(s)}}}function C3(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 Se{constructor(e){super(),we(this,e,C3,T3,ye,{class:1,name:2,sort:0,disable:3})}}function $3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Me(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&k(e),l=!1,s()}}}function O3(n,e,t){let{date:i}=e;const l={get text(){return U.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 hy extends Se{constructor(e){super(),we(this,e,O3,$3,ye,{date:0})}}function M3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=W(i),s=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){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")+"")&&oe(l,i),f&1&&oe(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 E3(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 _y extends Se{constructor(e){super(),we(this,e,E3,M3,ye,{level:0})}}function Sc(n,e,t){var o;const i=n.slice();i[32]=e[t];const l=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=l;const s=z3(i[32]);return i[34]=s,i}function Tc(n,e,t){const i=n.slice();return i[37]=e[t],i}function D3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=$(),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=Y(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 I3(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 L3(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 A3(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 P3(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${U.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 Cc(n){let e;function t(s,o){return s[7]?R3:N3}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 N3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&$c(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=$(),o&&o.c(),s=$(),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=$c(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function R3(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 $c(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=Y(e,"click",n[26]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Oc(n){let e,t=pe(n[34]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Mc(Tc(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=Tc(l,t,o);i[o]?i[o].p(r,s):(i[o]=Mc(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),dt(i,l)}}}function F3(n){let e=n[37].key+"",t,i,l=U.stringifyValue(n[32].data[n[37].key],"N/A",80)+"",s;return{c(){t=W(e),i=W(": "),s=W(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+"")&&oe(t,e),r[0]&8&&l!==(l=U.stringifyValue(o[32].data[o[37].key],"N/A",80)+"")&&oe(s,l)},d(o){o&&(k(t),k(i),k(s))}}}function q3(n){let e=n[37].key+"",t,i,l=n[32].data[n[37].key]+"",s,o;return{c(){t=W(e),i=W(": "),s=W(l),o=W("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+"")&&oe(t,e),a[0]&8&&l!==(l=r[32].data[r[37].key]+"")&&oe(s,l)},d(r){r&&(k(t),k(i),k(s),k(o))}}}function Mc(n){let e,t,i;function l(r,a){return r[33]&&r[37].key=="execTime"?q3:F3}let s=l(n),o=s(n);return{c(){e=b("span"),o.c(),t=$(),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 Ec(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=e[32].message+"",C,T,O,E,L,I,A,P,N,R,z;function F(){return e[23](e[32])}m=new _y({props:{level:e[32].level}});let B=e[34].length&&Oc(e);L=new hy({props:{date:e[32].created}});function J(){return e[24](e[32])}function V(...Z){return e[25](e[32],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=$(),u=b("label"),c=$(),d=b("td"),j(m.$$.fragment),h=$(),g=b("td"),_=b("div"),y=b("span"),C=W(S),T=$(),B&&B.c(),O=$(),E=b("td"),j(L.$$.fragment),I=$(),A=b("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',P=$(),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(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,y),w(y,C),w(g,T),B&&B.m(g,null),w(t,O),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[Y(s,"change",F),Y(l,"click",On(e[18])),Y(t,"click",J),Y(t,"keydown",V)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const de={};G[0]&8&&(de.level=e[32].level),m.$set(de),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe(C,S),e[34].length?B?B.p(e,G):(B=Oc(e),B.c(),B.m(g,null)):B&&(B.d(1),B=null);const fe={};G[0]&8&&(fe.date=e[32].created),L.$set(fe)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&k(t),H(m),B&&B.d(),H(L),R=!1,Ie(z)}}}function H3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=[],C=new Map,T;function O(V,Z){return V[7]?I3:D3}let E=O(n),L=E(n);function I(V){n[20](V)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[L3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(V){n[21](V)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[A3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(V){n[22](V)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[P3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=pe(n[3]);const B=V=>V[32].id;for(let V=0;V<F.length;V+=1){let Z=Sc(n,F,V),G=B(Z);C.set(G,S[V]=Ec(G,Z))}let J=null;return F.length||(J=Cc(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),L.c(),s=$(),j(o.$$.fragment),a=$(),j(u.$$.fragment),c=$(),j(d.$$.fragment),h=$(),g=b("th"),_=$(),y=b("tbody");for(let V=0;V<S.length;V+=1)S[V].c();J&&J.c(),p(l,"class","bulk-select-col min-width"),p(g,"class","col-type-action min-width"),p(e,"class","table"),ee(e,"table-loading",n[7])},m(V,Z){v(V,e,Z),w(e,t),w(t,i),w(i,l),L.m(l,null),w(i,s),q(o,i,null),w(i,a),q(u,i,null),w(i,c),q(d,i,null),w(i,h),w(i,g),w(e,_),w(e,y);for(let G=0;G<S.length;G+=1)S[G]&&S[G].m(y,null);J&&J.m(y,null),T=!0},p(V,Z){E===(E=O(V))&&L?L.p(V,Z):(L.d(1),L=E(V),L&&(L.c(),L.m(l,null)));const G={};Z[1]&512&&(G.$$scope={dirty:Z,ctx:V}),!r&&Z[0]&2&&(r=!0,G.sort=V[1],Ce(()=>r=!1)),o.$set(G);const de={};Z[1]&512&&(de.$$scope={dirty:Z,ctx:V}),!f&&Z[0]&2&&(f=!0,de.sort=V[1],Ce(()=>f=!1)),u.$set(de);const fe={};Z[1]&512&&(fe.$$scope={dirty:Z,ctx:V}),!m&&Z[0]&2&&(m=!0,fe.sort=V[1],Ce(()=>m=!1)),d.$set(fe),Z[0]&9369&&(F=pe(V[3]),re(),S=vt(S,Z,B,1,V,F,C,y,Bt,Ec,null,Sc),ae(),!F.length&&J?J.p(V,Z):F.length?J&&(J.d(1),J=null):(J=Cc(V),J.c(),J.m(y,null))),(!T||Z[0]&128)&&ee(e,"table-loading",V[7])},i(V){if(!T){M(o.$$.fragment,V),M(u.$$.fragment,V),M(d.$$.fragment,V);for(let Z=0;Z<F.length;Z+=1)M(S[Z]);T=!0}},o(V){D(o.$$.fragment,V),D(u.$$.fragment,V),D(d.$$.fragment,V);for(let Z=0;Z<S.length;Z+=1)D(S[Z]);T=!1},d(V){V&&k(e),L.d(),H(o),H(u),H(d);for(let Z=0;Z<S.length;Z+=1)S[Z].d();J&&J.d()}}}function Dc(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"),ee(t,"btn-loading",n[7]),ee(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=Y(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&k(e),i=!1,l()}}}function Ic(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=W("Selected "),l=b("strong"),s=W(n[5]),o=$(),a=W(r),u=$(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=$(),d=b("div"),m=$(),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(C,T){v(C,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,y||(S=[Y(f,"click",n[28]),Y(h,"click",n[14])],y=!0)},p(C,T){(!_||T[0]&32)&&oe(s,C[5]),(!_||T[0]&32)&&r!==(r=C[5]===1?"log":"logs")&&oe(a,r)},i(C){_||(C&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(C){C&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(C){C&&k(e),C&&g&&g.end(),y=!1,Ie(S)}}}function j3(n){let e,t,i,l,s;e=new Nu({props:{class:"table-wrapper",$$slots:{default:[H3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Dc(n),r=n[5]&&Ic(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=$(),r&&r.c(),l=ve()},m(a,u){q(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=Dc(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Ic(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(k(t),k(i),k(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Lc=50,aa=/[-:\. ]/gi;function z3(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","authId","userIP"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function U3(n,e,t){let i,l,s;const o=yt();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(G=1,de=!0){t(7,h=!0);const fe=[a,U.normalizeLogsFilter(r)];return u.min&&u.max&&fe.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Lc,{sort:f,skipTotal:1,filter:fe.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=U.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),de){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)U.pushOrReplaceByKey(c,et);t(3,c),await U.yieldToMain()}}else{for(let Je of Te)U.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!fe||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function C(){s?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.created<Te.created?1:ue.created>Te.created?-1:0);if(!G.length)return;if(G.length==1)return U.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const de=G[0].created.replaceAll(aa,""),fe=G[G.length-1].created.replaceAll(aa,"");return U.downloadJson(G,`${G.length}_logs_${fe}_to_${de}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>C();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),B=(G,de)=>{de.code==="Enter"&&(de.preventDefault(),o("select",G))},J=()=>t(0,r=""),V=()=>y(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.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>=Lc),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,C,T,E,L,a,u,m,I,A,P,N,R,z,F,B,J,V,Z]}class V3 extends Se{constructor(e){super(),we(this,e,U3,j3,ye,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*!
+`)})},i(a){s||(a&&tt(()=>{s&&(l||(l=He(t,Ct,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=He(t,Ct,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&k(e),a&&l&&l.end(),o=!1,r()}}}function _c(n){let e,t,i=gr(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=W(i),s=$(),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=gr(a[12])+"")&&oe(l,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=He(e,mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function c3(n){let e,t,i,l,s,o,r;const a=n[9].default,u=Lt(a,n,n[8],hc),f=[f3,u3],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=$(),l.c(),p(e,"class",n[1]),ee(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=Y(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,a3):Nt(m[8]),hc);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()),M(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(e,"error",m[3].length)},i(m){s||(M(u,m),M(l),s=!0)},o(m){D(u,m),D(l),s=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const gc="Invalid value";function gr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||gc:n||gc}function d3(n,e,t){let i;Qe(n,kn,g=>t(7,i=g));let{$$slots:l={},$$scope:s}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Yn(r)}ln(()=>(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=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class ce extends Se{constructor(e){super(),we(this,e,d3,c3,ye,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const p3=n=>({}),bc=n=>({});function yc(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=$(),i=b("span"),i.textContent="|",l=$(),s=b("a"),o=b("span"),o.textContent="PocketBase v0.23.11",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 m3(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],bc);let d=((m=n[2])==null?void 0:m.id)&&yc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=$(),l=b("footer"),c&&c.c(),s=$(),d&&d.c(),p(t,"class","page-content"),p(l,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),ee(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,p3):Nt(h[3]),bc),(_=h[2])!=null&&_.id?d||(d=yc(),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)&&ee(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&k(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function h3(n,e,t){let i;Qe(n,Rr,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 pi extends Se{constructor(e){super(),we(this,e,h3,m3,ye,{center:0,class:1})}}function _3(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),he(e,n[7]),i||(l=Y(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]&&he(e,s[7])},i:te,o:te,d(s){s&&k(e),n[13](null),i=!1,l()}}}function g3(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=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("submit",a[10]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function kc(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&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function vc(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=Y(e,"click",n[15]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function b3(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[g3,_3],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]&&kc(),_=(n[0].length||n[7].length)&&vc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=$(),o.c(),r=$(),g&&g.c(),a=$(),_&&_.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=[Y(e,"click",On(n[11])),Y(e,"submit",nt(n[10]))],f=!0)},p(y,[S]){let C=s;s=h(y),s===C?m[s].p(y,S):(re(),D(m[C],1,1,()=>{m[C]=null}),ae(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),M(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?S&129&&M(g,1):(g=kc(),g.c(),M(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&&M(_,1)):(_=vc(y),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae())},i(y){u||(M(o),M(g),M(_),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,Ie(c)}}}function y3(n,e,t){const i=yt(),l="search_"+U.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=null}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(O=!0){t(7,d=""),O&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function g(){u||f||(t(5,f=!0),t(4,u=(await Tt(async()=>{const{default:O}=await import("./FilterAutocompleteInput-CXrfVJaY.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}ln(()=>{g()});function _(O){Pe.call(this,n,O)}function y(O){d=O,t(7,d),t(0,s)}function S(O){ie[O?"unshift":"push"](()=>{c=O,t(6,c)})}function C(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,_,y,S,C,T]}class Hr extends Se{constructor(e){super(),we(this,e,y3,b3,ye,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function k3(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"),ee(e,"refreshing",n[2])},m(r,a){v(r,e,a),w(e,t),s||(o=[Me(l=qe.call(null,e,n[0])),Y(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&&It(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&ee(e,"refreshing",r[2])},i:te,o:te,d(r){r&&k(e),s=!1,Ie(o)}}}function v3(n,e,t){const i=yt();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 ln(()=>()=>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 Nu extends Se{constructor(e){super(),we(this,e,v3,k3,ye,{tooltip:0,class:1})}}const w3=n=>({}),wc=n=>({}),S3=n=>({}),Sc=n=>({});function T3(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=Lt(u,n,n[10],Sc),c=n[11].default,d=Lt(c,n,n[10],null),m=n[11].after,h=Lt(m,n,n[10],wc);return{c(){e=b("div"),f&&f.c(),t=$(),i=b("div"),d&&d.c(),s=$(),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=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&Pt(f,u,g,g[10],o?At(u,g[10],_,S3):Nt(g[10]),Sc),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],_,w3):Nt(g[10]),wc)},i(g){o||(M(f,g),M(d,g),M(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,Ie(a)}}}function C3(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();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 C(){f&&t(2,f.scrollLeft=0,f)}function T(){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 O(){d||(d=setTimeout(()=>{T(),d=null},150))}ln(()=>(O(),y=new MutationObserver(O),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function E(L){ie[L?"unshift":"push"](()=>{f=L,t(2,f)})}return n.$$set=L=>{"class"in L&&t(0,o=L.class),"vThreshold"in L&&t(4,r=L.vThreshold),"hThreshold"in L&&t(5,a=L.hThreshold),"dispatchOnNoScroll"in L&&t(6,u=L.dispatchOnNoScroll),"$$scope"in L&&t(10,l=L.$$scope)},[o,O,f,c,r,a,u,S,C,T,l,i,E]}class Ru extends Se{constructor(e){super(),we(this,e,C3,T3,ye,{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 $3(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]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[Y(e,"click",n[7]),Y(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)&&ee(e,"col-sort-disabled",a[3]),(!i||u&7)&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&ee(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,Ie(s)}}}function O3(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 Se{constructor(e){super(),we(this,e,O3,$3,ye,{class:1,name:2,sort:0,disable:3})}}function M3(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){v(o,e,r),w(e,i),l||(s=Me(qe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&oe(i,t)},i:te,o:te,d(o){o&&k(e),l=!1,s()}}}function E3(n,e,t){let{date:i}=e;const l={get text(){return U.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 _y extends Se{constructor(e){super(),we(this,e,E3,M3,ye,{date:0})}}function D3(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=W(i),s=W(" ("),o=W(n[0]),r=W(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){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")+"")&&oe(l,i),f&1&&oe(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 I3(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=x0.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class gy extends Se{constructor(e){super(),we(this,e,I3,D3,ye,{level:0})}}function Tc(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=V3(i[32]);return i[34]=s,i}function Cc(n,e,t){const i=n.slice();return i[37]=e[t],i}function L3(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=$(),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=Y(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 A3(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 P3(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 N3(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 R3(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${U.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 $c(n){let e;function t(s,o){return s[7]?q3:F3}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 F3(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&Oc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=$(),o&&o.c(),s=$(),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=Oc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function q3(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 Oc(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=Y(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]=Ec(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]=Ec(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),dt(i,l)}}}function H3(n){let e=n[37].key+"",t,i,l=U.stringifyValue(n[32].data[n[37].key],"N/A",80)+"",s;return{c(){t=W(e),i=W(": "),s=W(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+"")&&oe(t,e),r[0]&8&&l!==(l=U.stringifyValue(o[32].data[o[37].key],"N/A",80)+"")&&oe(s,l)},d(o){o&&(k(t),k(i),k(s))}}}function j3(n){let e=n[37].key+"",t,i,l=n[32].data[n[37].key]+"",s,o;return{c(){t=W(e),i=W(": "),s=W(l),o=W("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+"")&&oe(t,e),a[0]&8&&l!==(l=r[32].data[r[37].key]+"")&&oe(s,l)},d(r){r&&(k(t),k(i),k(s),k(o))}}}function Ec(n){let e,t,i;function l(r,a){return r[33]&&r[37].key=="execTime"?j3:H3}let s=l(n),o=s(n);return{c(){e=b("span"),o.c(),t=$(),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 Dc(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=e[32].message+"",C,T,O,E,L,I,A,P,N,R,z;function F(){return e[23](e[32])}m=new gy({props:{level:e[32].level}});let B=e[34].length&&Mc(e);L=new _y({props:{date:e[32].created}});function J(){return e[24](e[32])}function V(...Z){return e[25](e[32],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=$(),u=b("label"),c=$(),d=b("td"),j(m.$$.fragment),h=$(),g=b("td"),_=b("div"),y=b("span"),C=W(S),T=$(),B&&B.c(),O=$(),E=b("td"),j(L.$$.fragment),I=$(),A=b("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',P=$(),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(E,"class","col-type-date col-field-created"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,G){v(Z,t,G),w(t,i),w(i,l),w(l,s),w(l,a),w(l,u),w(t,c),w(t,d),q(m,d,null),w(t,h),w(t,g),w(g,_),w(_,y),w(y,C),w(g,T),B&&B.m(g,null),w(t,O),w(t,E),q(L,E,null),w(t,I),w(t,A),w(t,P),N=!0,R||(z=[Y(s,"change",F),Y(l,"click",On(e[18])),Y(t,"click",J),Y(t,"keydown",V)],R=!0)},p(Z,G){e=Z,(!N||G[0]&8&&o!==(o="checkbox_"+e[32].id))&&p(s,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(s.checked=r),(!N||G[0]&8&&f!==(f="checkbox_"+e[32].id))&&p(u,"for",f);const de={};G[0]&8&&(de.level=e[32].level),m.$set(de),(!N||G[0]&8)&&S!==(S=e[32].message+"")&&oe(C,S),e[34].length?B?B.p(e,G):(B=Mc(e),B.c(),B.m(g,null)):B&&(B.d(1),B=null);const fe={};G[0]&8&&(fe.date=e[32].created),L.$set(fe)},i(Z){N||(M(m.$$.fragment,Z),M(L.$$.fragment,Z),N=!0)},o(Z){D(m.$$.fragment,Z),D(L.$$.fragment,Z),N=!1},d(Z){Z&&k(t),H(m),B&&B.d(),H(L),R=!1,Ie(z)}}}function z3(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S=[],C=new Map,T;function O(V,Z){return V[7]?A3:L3}let E=O(n),L=E(n);function I(V){n[20](V)}let A={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[P3]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new ir({props:A}),ie.push(()=>be(o,"sort",I));function P(V){n[21](V)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[N3]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new ir({props:N}),ie.push(()=>be(u,"sort",P));function R(V){n[22](V)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[R3]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new ir({props:z}),ie.push(()=>be(d,"sort",R));let F=pe(n[3]);const B=V=>V[32].id;for(let V=0;V<F.length;V+=1){let Z=Tc(n,F,V),G=B(Z);C.set(G,S[V]=Dc(G,Z))}let J=null;return F.length||(J=$c(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),L.c(),s=$(),j(o.$$.fragment),a=$(),j(u.$$.fragment),c=$(),j(d.$$.fragment),h=$(),g=b("th"),_=$(),y=b("tbody");for(let V=0;V<S.length;V+=1)S[V].c();J&&J.c(),p(l,"class","bulk-select-col min-width"),p(g,"class","col-type-action min-width"),p(e,"class","table"),ee(e,"table-loading",n[7])},m(V,Z){v(V,e,Z),w(e,t),w(t,i),w(i,l),L.m(l,null),w(i,s),q(o,i,null),w(i,a),q(u,i,null),w(i,c),q(d,i,null),w(i,h),w(i,g),w(e,_),w(e,y);for(let G=0;G<S.length;G+=1)S[G]&&S[G].m(y,null);J&&J.m(y,null),T=!0},p(V,Z){E===(E=O(V))&&L?L.p(V,Z):(L.d(1),L=E(V),L&&(L.c(),L.m(l,null)));const G={};Z[1]&512&&(G.$$scope={dirty:Z,ctx:V}),!r&&Z[0]&2&&(r=!0,G.sort=V[1],Ce(()=>r=!1)),o.$set(G);const de={};Z[1]&512&&(de.$$scope={dirty:Z,ctx:V}),!f&&Z[0]&2&&(f=!0,de.sort=V[1],Ce(()=>f=!1)),u.$set(de);const fe={};Z[1]&512&&(fe.$$scope={dirty:Z,ctx:V}),!m&&Z[0]&2&&(m=!0,fe.sort=V[1],Ce(()=>m=!1)),d.$set(fe),Z[0]&9369&&(F=pe(V[3]),re(),S=vt(S,Z,B,1,V,F,C,y,Bt,Dc,null,Tc),ae(),!F.length&&J?J.p(V,Z):F.length?J&&(J.d(1),J=null):(J=$c(V),J.c(),J.m(y,null))),(!T||Z[0]&128)&&ee(e,"table-loading",V[7])},i(V){if(!T){M(o.$$.fragment,V),M(u.$$.fragment,V),M(d.$$.fragment,V);for(let Z=0;Z<F.length;Z+=1)M(S[Z]);T=!0}},o(V){D(o.$$.fragment,V),D(u.$$.fragment,V),D(d.$$.fragment,V);for(let Z=0;Z<S.length;Z+=1)D(S[Z]);T=!1},d(V){V&&k(e),L.d(),H(o),H(u),H(d);for(let Z=0;Z<S.length;Z+=1)S[Z].d();J&&J.d()}}}function Ic(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"),ee(t,"btn-loading",n[7]),ee(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=Y(t,"click",n[27]),i=!0)},p(s,o){o[0]&128&&ee(t,"btn-loading",s[7]),o[0]&128&&ee(t,"btn-disabled",s[7])},d(s){s&&k(e),i=!1,l()}}}function Lc(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=W("Selected "),l=b("strong"),s=W(n[5]),o=$(),a=W(r),u=$(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=$(),d=b("div"),m=$(),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(C,T){v(C,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,y||(S=[Y(f,"click",n[28]),Y(h,"click",n[14])],y=!0)},p(C,T){(!_||T[0]&32)&&oe(s,C[5]),(!_||T[0]&32)&&r!==(r=C[5]===1?"log":"logs")&&oe(a,r)},i(C){_||(C&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(C){C&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(C){C&&k(e),C&&g&&g.end(),y=!1,Ie(S)}}}function U3(n){let e,t,i,l,s;e=new Ru({props:{class:"table-wrapper",$$slots:{default:[z3]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Ic(n),r=n[5]&&Lc(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=$(),r&&r.c(),l=ve()},m(a,u){q(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=Ic(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&M(r,1)):(r=Lc(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){s||(M(e.$$.fragment,a),M(r),s=!0)},o(a){D(e.$$.fragment,a),D(r),s=!1},d(a){a&&(k(t),k(i),k(l)),H(e,a),o&&o.d(a),r&&r.d(a)}}}const Ac=50,aa=/[-:\. ]/gi;function V3(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 B3(n,e,t){let i,l,s;const o=yt();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(G=1,de=!0){t(7,h=!0);const fe=[a,U.normalizeLogsFilter(r)];return u.min&&u.max&&fe.push(`created >= "${u.min}" && created <= "${u.max}"`),_e.logs.getList(G,Ac,{sort:f,skipTotal:1,filter:fe.filter(Boolean).map(ue=>"("+ue+")").join("&&")}).then(async ue=>{var Ke;G<=1&&S();const Te=U.toArray(ue.items);if(t(7,h=!1),t(6,d=ue.page),t(17,m=((Ke=ue.items)==null?void 0:Ke.length)||0),o("load",c.concat(Te)),de){const Je=++g;for(;Te.length&&g==Je;){const ft=Te.splice(0,10);for(let et of ft)U.pushOrReplaceByKey(c,et);t(3,c),await U.yieldToMain()}}else{for(let Je of Te)U.pushOrReplaceByKey(c,Je);t(3,c)}}).catch(ue=>{ue!=null&&ue.isAbort||(t(7,h=!1),console.warn(ue),S(),_e.error(ue,!fe||(ue==null?void 0:ue.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function C(){s?T():O()}function T(){t(4,_={})}function O(){for(const G of c)t(4,_[G.id]=G,_);t(4,_)}function E(G){_[G.id]?delete _[G.id]:t(4,_[G.id]=G,_),t(4,_)}function L(){const G=Object.values(_).sort((ue,Te)=>ue.created<Te.created?1:ue.created>Te.created?-1:0);if(!G.length)return;if(G.length==1)return U.downloadJson(G[0],"log_"+G[0].created.replaceAll(aa,"")+".json");const de=G[0].created.replaceAll(aa,""),fe=G[G.length-1].created.replaceAll(aa,"");return U.downloadJson(G,`${G.length}_logs_${fe}_to_${de}.json`)}function I(G){Pe.call(this,n,G)}const A=()=>C();function P(G){f=G,t(1,f)}function N(G){f=G,t(1,f)}function R(G){f=G,t(1,f)}const z=G=>E(G),F=G=>o("select",G),B=(G,de)=>{de.code==="Enter"&&(de.preventDefault(),o("select",G))},J=()=>t(0,r=""),V=()=>y(d+1),Z=()=>T();return n.$$set=G=>{"filter"in G&&t(0,r=G.filter),"presets"in G&&t(15,a=G.presets),"zoom"in G&&t(16,u=G.zoom),"sort"in G&&t(1,f=G.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>=Ac),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,C,T,E,L,a,u,m,I,A,P,N,R,z,F,B,J,V,Z]}class W3 extends Se{constructor(e){super(),we(this,e,B3,U3,ye,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*!
  * @kurkle/color v0.3.4
  * https://github.com/kurkle/color#readme
  * (c) 2024 Jukka Kurkela
  * Released under the MIT License
- */function po(n){return n+.5|0}const Xi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ms(n){return Xi(po(n*2.55),0,255)}function nl(n){return Xi(po(n*255),0,255)}function Ri(n){return Xi(po(n/2.55)/100,0,1)}function Ac(n){return Xi(po(n*100),0,100)}const Zn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ka=[..."0123456789ABCDEF"],B3=n=>Ka[n&15],W3=n=>Ka[(n&240)>>4]+Ka[n&15],Io=n=>(n&240)>>4===(n&15),Y3=n=>Io(n.r)&&Io(n.g)&&Io(n.b)&&Io(n.a);function K3(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Zn[n[1]]*17,g:255&Zn[n[2]]*17,b:255&Zn[n[3]]*17,a:e===5?Zn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Zn[n[1]]<<4|Zn[n[2]],g:Zn[n[3]]<<4|Zn[n[4]],b:Zn[n[5]]<<4|Zn[n[6]],a:e===9?Zn[n[7]]<<4|Zn[n[8]]:255})),t}const J3=(n,e)=>n<255?e(n):"";function Z3(n){var e=Y3(n)?B3:W3;return n?"#"+e(n.r)+e(n.g)+e(n.b)+J3(n.a,e):void 0}const G3=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function gy(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function X3(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Q3(n,e,t){const i=gy(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function x3(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Ru(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=x3(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Fu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(nl)}function qu(n,e,t){return Fu(gy,n,e,t)}function e4(n,e,t){return Fu(Q3,n,e,t)}function t4(n,e,t){return Fu(X3,n,e,t)}function by(n){return(n%360+360)%360}function n4(n){const e=G3.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ms(+e[5]):nl(+e[5]));const l=by(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=e4(l,s,o):e[1]==="hsv"?i=t4(l,s,o):i=qu(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function i4(n,e){var t=Ru(n);t[0]=by(t[0]+e),t=qu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function l4(n){if(!n)return;const e=Ru(n),t=e[0],i=Ac(e[1]),l=Ac(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Ri(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Pc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function s4(){const n={},e=Object.keys(Nc),t=Object.keys(Pc);let i,l,s,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],l=0;l<t.length;l++)s=t[l],r=r.replace(s,Pc[s]);s=parseInt(Nc[o],16),n[r]=[s>>16&255,s>>8&255,s&255]}return n}let Lo;function o4(n){Lo||(Lo=s4(),Lo.transparent=[0,0,0,0]);const e=Lo[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const r4=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function a4(n){const e=r4.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Ms(o):Xi(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Ms(i):Xi(i,0,255)),l=255&(e[4]?Ms(l):Xi(l,0,255)),s=255&(e[6]?Ms(s):Xi(s,0,255)),{r:i,g:l,b:s,a:t}}}function u4(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ri(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ua=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function f4(n,e,t){const i=Wl(Ri(n.r)),l=Wl(Ri(n.g)),s=Wl(Ri(n.b));return{r:nl(ua(i+t*(Wl(Ri(e.r))-i))),g:nl(ua(l+t*(Wl(Ri(e.g))-l))),b:nl(ua(s+t*(Wl(Ri(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Ao(n,e,t){if(n){let i=Ru(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=qu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function yy(n,e){return n&&Object.assign(e||{},n)}function Rc(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=nl(n[3]))):(e=yy(n,{r:0,g:0,b:0,a:1}),e.a=nl(e.a)),e}function c4(n){return n.charAt(0)==="r"?a4(n):n4(n)}class Zs{constructor(e){if(e instanceof Zs)return e;const t=typeof e;let i;t==="object"?i=Rc(e):t==="string"&&(i=K3(e)||o4(e)||c4(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=yy(this._rgb);return e&&(e.a=Ri(e.a)),e}set rgb(e){this._rgb=Rc(e)}rgbString(){return this._valid?u4(this._rgb):void 0}hexString(){return this._valid?Z3(this._rgb):void 0}hslString(){return this._valid?l4(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=f4(this._rgb,e._rgb,t)),this}clone(){return new Zs(this.rgb)}alpha(e){return this._rgb.a=nl(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=po(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ao(this._rgb,2,e),this}darken(e){return Ao(this._rgb,2,-e),this}saturate(e){return Ao(this._rgb,1,e),this}desaturate(e){return Ao(this._rgb,1,-e),this}rotate(e){return i4(this._rgb,e),this}}/*!
+ */function po(n){return n+.5|0}const Xi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ms(n){return Xi(po(n*2.55),0,255)}function nl(n){return Xi(po(n*255),0,255)}function Ri(n){return Xi(po(n/2.55)/100,0,1)}function Pc(n){return Xi(po(n*100),0,100)}const Zn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ja=[..."0123456789ABCDEF"],Y3=n=>Ja[n&15],K3=n=>Ja[(n&240)>>4]+Ja[n&15],Io=n=>(n&240)>>4===(n&15),J3=n=>Io(n.r)&&Io(n.g)&&Io(n.b)&&Io(n.a);function Z3(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Zn[n[1]]*17,g:255&Zn[n[2]]*17,b:255&Zn[n[3]]*17,a:e===5?Zn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Zn[n[1]]<<4|Zn[n[2]],g:Zn[n[3]]<<4|Zn[n[4]],b:Zn[n[5]]<<4|Zn[n[6]],a:e===9?Zn[n[7]]<<4|Zn[n[8]]:255})),t}const G3=(n,e)=>n<255?e(n):"";function X3(n){var e=J3(n)?Y3:K3;return n?"#"+e(n.r)+e(n.g)+e(n.b)+G3(n.a,e):void 0}const Q3=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function by(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function x3(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function e4(n,e,t){const i=by(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function t4(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Fu(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=t4(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function qu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(nl)}function Hu(n,e,t){return qu(by,n,e,t)}function n4(n,e,t){return qu(e4,n,e,t)}function i4(n,e,t){return qu(x3,n,e,t)}function yy(n){return(n%360+360)%360}function l4(n){const e=Q3.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ms(+e[5]):nl(+e[5]));const l=yy(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=n4(l,s,o):e[1]==="hsv"?i=i4(l,s,o):i=Hu(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function s4(n,e){var t=Fu(n);t[0]=yy(t[0]+e),t=Hu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function o4(n){if(!n)return;const e=Fu(n),t=e[0],i=Pc(e[1]),l=Pc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${Ri(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const Nc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Rc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function r4(){const n={},e=Object.keys(Rc),t=Object.keys(Nc);let i,l,s,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],l=0;l<t.length;l++)s=t[l],r=r.replace(s,Nc[s]);s=parseInt(Rc[o],16),n[r]=[s>>16&255,s>>8&255,s&255]}return n}let Lo;function a4(n){Lo||(Lo=r4(),Lo.transparent=[0,0,0,0]);const e=Lo[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const u4=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function f4(n){const e=u4.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Ms(o):Xi(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Ms(i):Xi(i,0,255)),l=255&(e[4]?Ms(l):Xi(l,0,255)),s=255&(e[6]?Ms(s):Xi(s,0,255)),{r:i,g:l,b:s,a:t}}}function c4(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ri(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ua=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Wl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function d4(n,e,t){const i=Wl(Ri(n.r)),l=Wl(Ri(n.g)),s=Wl(Ri(n.b));return{r:nl(ua(i+t*(Wl(Ri(e.r))-i))),g:nl(ua(l+t*(Wl(Ri(e.g))-l))),b:nl(ua(s+t*(Wl(Ri(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Ao(n,e,t){if(n){let i=Fu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Hu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ky(n,e){return n&&Object.assign(e||{},n)}function Fc(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=nl(n[3]))):(e=ky(n,{r:0,g:0,b:0,a:1}),e.a=nl(e.a)),e}function p4(n){return n.charAt(0)==="r"?f4(n):l4(n)}class Zs{constructor(e){if(e instanceof Zs)return e;const t=typeof e;let i;t==="object"?i=Fc(e):t==="string"&&(i=Z3(e)||a4(e)||p4(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=ky(this._rgb);return e&&(e.a=Ri(e.a)),e}set rgb(e){this._rgb=Fc(e)}rgbString(){return this._valid?c4(this._rgb):void 0}hexString(){return this._valid?X3(this._rgb):void 0}hslString(){return this._valid?o4(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=d4(this._rgb,e._rgb,t)),this}clone(){return new Zs(this.rgb)}alpha(e){return this._rgb.a=nl(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=po(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ao(this._rgb,2,e),this}darken(e){return Ao(this._rgb,2,-e),this}saturate(e){return Ao(this._rgb,1,e),this}desaturate(e){return Ao(this._rgb,1,-e),this}rotate(e){return s4(this._rgb,e),this}}/*!
  * Chart.js v4.4.7
  * https://www.chartjs.org
  * (c) 2024 Chart.js Contributors
  * Released under the MIT License
- */function Ai(){}const d4=(()=>{let n=0;return()=>n++})();function Gt(n){return n==null}function an(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function kt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function yn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return yn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const p4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(kt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function br(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 yr(n){if(an(n))return n.map(yr);if(kt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=yr(n[t[l]]);return e}return n}function ky(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function m4(n,e,t,i){if(!ky(n))return;const l=e[n],s=t[n];kt(l)&&kt(s)?Gs(l,s,i):e[n]=yr(s)}function Gs(n,e,t){const i=an(e)?e:[e],l=i.length;if(!kt(n))return n;t=t||{};const s=t.merger||m4;let o;for(let r=0;r<l;++r){if(o=i[r],!kt(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 Ps(n,e){return Gs(n,e,{merger:h4})}function h4(n,e,t){if(!ky(n))return;const i=e[n],l=t[n];kt(i)&&kt(l)?Ps(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=yr(l))}const Fc={"":n=>n,x:n=>n.x,y:n=>n.y};function _4(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 g4(n){const e=_4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function kr(n,e){return(Fc[e]||(Fc[e]=g4(e)))(n)}function Hu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const vr=n=>typeof n<"u",ll=n=>typeof n=="function",qc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function b4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const gn=Math.PI,Ti=2*gn,y4=Ti+gn,wr=Number.POSITIVE_INFINITY,k4=gn/180,ui=gn/2,bl=gn/4,Hc=gn*2/3,Ja=Math.log10,sl=Math.sign;function Ol(n,e,t){return Math.abs(n-e)<t}function jc(n){const e=Math.round(n);n=Ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ja(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function v4(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 Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function w4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function S4(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 Tl(n){return n*(gn/180)}function T4(n){return n*(180/gn)}function zc(n){if(!yn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function C4(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*gn&&(s+=Ti),{angle:s,distance:l}}function Za(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function $4(n,e){return(n-e+y4)%Ti-gn}function yi(n){return(n%Ti+Ti)%Ti}function vy(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 fi(n,e,t){return Math.max(e,Math.min(t,n))}function O4(n){return fi(n,-32768,32767)}function wy(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ju(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)=>ju(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),M4=(n,e,t)=>ju(n,t,i=>n[i][e]>=t);function E4(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 Sy=["push","pop","shift","splice","unshift"];function D4(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Sy.forEach(t=>{const i="_onData"+Hu(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 Uc(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)&&(Sy.forEach(s=>{delete n[s]}),delete n._chartjs)}function I4(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Ty=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Cy(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,Ty.call(window,()=>{i=!1,n.apply(e,t)}))}}function L4(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const A4=n=>n==="start"?"left":n==="end"?"right":"center",Vc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function P4(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=fi(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=fi(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 N4(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,Bc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Wc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ns={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*ui)+1,easeOutSine:n=>Math.sin(n*ui),easeInOutSine:n=>-.5*(Math.cos(gn*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:Bc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Wc(n,.075,.3),easeInOutElastic(n){return Po(n)?n:n<.5?.5*Bc(n*2,.1125,.45):.5+.5*Wc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ns.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function zu(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Yc(n){return zu(n)?n:new Zs(n)}function fa(n){return zu(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const R4=["x","y","borderWidth","radius","tension"],F4=["color","borderColor","backgroundColor"];function q4(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:F4},numbers:{type:"number",properties:R4}}),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 H4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Kc=new Map;function j4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Kc.get(t);return i||(i=new Intl.NumberFormat(n,e),Kc.set(t,i)),i}function $y(n,e,t){return j4(e,t).format(n)}const Oy={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=z4(n,t)}const o=Ja(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),$y(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ja(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?Oy.numeric.call(this,n,e,t):""}};function z4(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 My={formatters:Oy};function U4(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:My.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 Il=Object.create(null),Ga=Object.create(null);function Rs(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"?Gs(Rs(n,e),t):Gs(Rs(n,""),e)}class V4{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 Rs(this,e)}describe(e,t){return ca(Ga,e,t)}override(e,t){return ca(Il,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return kt(a)?Object.assign({},u,a):Mt(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var nn=new V4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[q4,H4,U4]);function B4(n){return!n||Gt(n.size)||Gt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Jc(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 yl(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 Zc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Xa(n,e,t,i){W4(n,e,t,i)}function W4(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)*k4;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),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Hc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+bl)*a,c=Math.cos(_+bl)*a,r=Math.sin(_+bl)*a,d=Math.sin(_+bl)*a,n.arc(t-c,i-r,u,_-gn,_-ui),n.arc(t+d,i-o,u,_-ui,_),n.arc(t+c,i+r,u,_,_+ui),n.arc(t-d,i+o,u,_+ui,_+gn),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}_+=bl;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":_+=bl;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),_+=bl,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 ls(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 Uu(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Vu(n){n.restore()}function Y4(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 K4(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 J4(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Gt(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 Z4(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 G4(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Gc(n,e,t,i,l,s={}){const o=an(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,J4(n,s),a=0;a<o.length;++a)u=o[a],s.backdrop&&G4(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Gt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(u,t,i,s.maxWidth)),n.fillText(u,t,i,s.maxWidth),Z4(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*gn,gn,!0),n.lineTo(t,i+s-o.bottomLeft),n.arc(t+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,gn,ui,!0),n.lineTo(t+l-o.bottomRight,i+s),n.arc(t+l-o.bottomRight,i+s-o.bottomRight,o.bottomRight,ui,0,!0),n.lineTo(t+l,i+o.topRight),n.arc(t+l-o.topRight,i+o.topRight,o.topRight,0,-ui,!0),n.lineTo(t+o.topLeft,i)}const X4=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Q4=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function x4(n,e){const t=(""+n).match(X4);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 eS=n=>+n||0;function Ey(n,e){const t={},i=kt(e),l=i?Object.keys(e):e,s=kt(n)?i?o=>Mt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=eS(s(o));return t}function tS(n){return Ey(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return Ey(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=tS(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=Mt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Mt(n.style,e.style);i&&!(""+i).match(Q4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Mt(n.family,e.family),lineHeight:x4(Mt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Mt(n.weight,e.weight),string:""};return l.string=B4(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 nS(n,e,t){const{min:i,max:l}=n,s=p4(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 Pl(n,e){return Object.assign(Object.create(n),e)}function Bu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Ay("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Bu([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 Iy(r,a,()=>fS(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return xc(r).includes(a)},ownKeys(r){return xc(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function ss(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Dy(n,i),setContext:s=>ss(n,s,t,i),override:s=>ss(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 Iy(s,o,()=>lS(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 Dy(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const iS=(n,e)=>n?n+Hu(e):e,Wu=(n,e)=>kt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Iy(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function lS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=sS(e,r,n,t)),an(r)&&r.length&&(r=oS(e,r,n,o.isIndexable)),Wu(e,r)&&(r=ss(r,l,s&&s[e],o)),r}function sS(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),Wu(n,a)&&(a=Yu(l._scopes,l,n,a)),a}function oS(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(kt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Yu(u,l,n,f);e.push(ss(c,s,o&&o[n],r))}}return e}function Ly(n,e,t){return ll(n)?n(e,t):n}const rS=(n,e)=>n===!0?e:typeof n=="string"?kr(e,n):void 0;function aS(n,e,t,i,l){for(const s of e){const o=rS(t,s);if(o){n.add(o);const r=Ly(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 Yu(n,e,t,i){const l=e._rootScopes,s=Ly(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Qc(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Qc(r,o,s,a,i),a===null)?!1:Bu(Array.from(r),[""],l,s,()=>uS(e,t,i))}function Qc(n,e,t,i,l){for(;t;)t=aS(n,e,t,i,l);return t}function uS(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&kt(t)?t:l||{}}function fS(n,e,t,i){let l;for(const s of e)if(l=Ay(iS(s,n),t),typeof l<"u")return Wu(n,l)?Yu(t,i,n,l):l}function Ay(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function xc(n){let e=n._keys;return e||(e=n._keys=cS(n._scopes)),e}function cS(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 dS=Number.EPSILON||1e-14,os=(n,e)=>e<n.length&&!n[e].skip&&n[e],Py=n=>n==="x"?"y":"x";function pS(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Za(s,l),a=Za(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 mS(n,e,t){const i=n.length;let l,s,o,r,a,u=os(n,0);for(let f=0;f<i-1;++f)if(a=u,u=os(n,f+1),!(!a||!u)){if(Ol(e[f],0,dS)){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 hS(n,e,t="x"){const i=Py(t),l=n.length;let s,o,r,a=os(n,0);for(let u=0;u<l;++u){if(o=r,r=a,a=os(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 _S(n,e="x"){const t=Py(e),i=n.length,l=Array(i).fill(0),s=Array(i);let o,r,a,u=os(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=os(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?sl(l[o-1])!==sl(l[o])?0:(l[o-1]+l[o])/2:l[o-1]:l[o]}mS(n,l,s),hS(n,s,e)}function Ro(n,e,t){return Math.max(Math.min(n,t),e)}function gS(n,e){let t,i,l,s,o,r=ls(n[0],e);for(t=0,i=n.length;t<i;++t)o=s,s=r,r=t<i-1&&ls(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 bS(n,e,t,i,l){let s,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")_S(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=pS(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&&gS(n,t)}function Ku(){return typeof window<"u"&&typeof document<"u"}function Ju(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Sr(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 yS(n,e){return jr(n).getPropertyValue(e)}const kS=["top","right","bottom","left"];function Ml(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=kS[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const vS=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function wS(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(vS(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=Ml(l,"padding"),r=Ml(l,"border","width"),{x:a,y:u,box:f}=wS(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 SS(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ju(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=Ml(r,"border","width"),u=Ml(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Sr(r.maxWidth,s,"clientWidth"),l=Sr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||wr,maxHeight:l||wr}}const Fo=n=>Math.round(n*10)/10;function TS(n,e,t,i){const l=jr(n),s=Ml(l,"margin"),o=Sr(l.maxWidth,n,"clientWidth")||wr,r=Sr(l.maxHeight,n,"clientHeight")||wr,a=SS(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=Ml(l,"border","width"),m=Ml(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 ed(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 CS=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ku()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function td(n,e){const t=yS(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function $S(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 OS(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=vl(n,l,t),r=vl(l,s,t),a=vl(s,e,t),u=vl(o,r,t),f=vl(r,a,t);return vl(u,f,t)}const MS=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}}},ES=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?MS(e,t):ES()}function DS(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 IS(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Ny(n){return n==="angle"?{between:vy,compare:$4,normalize:yi}:{between:wy,compare:(e,t)=>e-t,normalize:e=>e}}function nd({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 LS(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Ny(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 Ry(n,e,t){if(!t)return[n];const{property:i,start:l,end:s}=t,o=e.length,{compare:r,between:a,normalize:u}=Ny(i),{start:f,end:c,loop:d,style:m}=LS(n,e,t),h=[];let g=!1,_=null,y,S,C;const T=()=>a(l,C,y)&&r(l,C)!==0,O=()=>r(s,y)===0||a(s,C,y),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(y=u(S[i]),y!==C&&(g=a(y,l,s),_===null&&E()&&(_=r(y,l)===0?I:A),_!==null&&L()&&(h.push(nd({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,C=y));return _!==null&&h.push(nd({start:_,end:c,loop:d,count:o,style:m})),h}function Fy(n,e){const t=[],i=n.segments;for(let l=0;l<i.length;l++){const s=Ry(i[l],n.points,e);s.length&&t.push(...s)}return t}function AS(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 PS(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 NS(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=AS(t,l,s,i);if(i===!0)return id(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 id(n,PS(t,o,a,u),t,e)}function id(n,e,t,i){return!i||!i.setContext||!t?e:RS(n,e,t,i)}function RS(n,e,t,i){const l=n._chart.getContext(),s=ld(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];_=ld(i.setContext(Pl(l,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),FS(_,f)&&m(c,d-1,h.loop,f),g=y,f=_}c<d-1&&m(c,d-1,h.loop,f)}return u}function ld(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function FS(n,e){if(!e)return!1;const t=[],i=function(l,s){return zu(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
+ */function Ai(){}const m4=(()=>{let n=0;return()=>n++})();function Gt(n){return n==null}function an(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function kt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function yn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function _i(n,e){return yn(n)?n:e}function Mt(n,e){return typeof n>"u"?e:n}const h4=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ut(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function _t(n,e,t,i){let l,s,o;if(an(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(kt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function br(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 yr(n){if(an(n))return n.map(yr);if(kt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=yr(n[t[l]]);return e}return n}function vy(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function _4(n,e,t,i){if(!vy(n))return;const l=e[n],s=t[n];kt(l)&&kt(s)?Gs(l,s,i):e[n]=yr(s)}function Gs(n,e,t){const i=an(e)?e:[e],l=i.length;if(!kt(n))return n;t=t||{};const s=t.merger||_4;let o;for(let r=0;r<l;++r){if(o=i[r],!kt(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 Ps(n,e){return Gs(n,e,{merger:g4})}function g4(n,e,t){if(!vy(n))return;const i=e[n],l=t[n];kt(i)&&kt(l)?Ps(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=yr(l))}const qc={"":n=>n,x:n=>n.x,y:n=>n.y};function b4(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 y4(n){const e=b4(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function kr(n,e){return(qc[e]||(qc[e]=y4(e)))(n)}function ju(n){return n.charAt(0).toUpperCase()+n.slice(1)}const vr=n=>typeof n<"u",ll=n=>typeof n=="function",Hc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function k4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const gn=Math.PI,Ti=2*gn,v4=Ti+gn,wr=Number.POSITIVE_INFINITY,w4=gn/180,ui=gn/2,bl=gn/4,jc=gn*2/3,Za=Math.log10,sl=Math.sign;function Ol(n,e,t){return Math.abs(n-e)<t}function zc(n){const e=Math.round(n);n=Ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Za(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function S4(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 Xs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function T4(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function C4(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 Tl(n){return n*(gn/180)}function $4(n){return n*(180/gn)}function Uc(n){if(!yn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function O4(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*gn&&(s+=Ti),{angle:s,distance:l}}function Ga(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function M4(n,e){return(n-e+v4)%Ti-gn}function yi(n){return(n%Ti+Ti)%Ti}function wy(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 fi(n,e,t){return Math.max(e,Math.min(t,n))}function E4(n){return fi(n,-32768,32767)}function Sy(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function zu(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)=>zu(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),D4=(n,e,t)=>zu(n,t,i=>n[i][e]>=t);function I4(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 Ty=["push","pop","shift","splice","unshift"];function L4(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ty.forEach(t=>{const i="_onData"+ju(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 Vc(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)&&(Ty.forEach(s=>{delete n[s]}),delete n._chartjs)}function A4(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 $y(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,Cy.call(window,()=>{i=!1,n.apply(e,t)}))}}function P4(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const N4=n=>n==="start"?"left":n==="end"?"right":"center",Bc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function R4(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=fi(Math.min(Cl(r,a,u).lo,t?i:Cl(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?s=fi(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 F4(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,Wc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ti/t)),Yc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ti/t)+1,Ns={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*ui)+1,easeOutSine:n=>Math.sin(n*ui),easeInOutSine:n=>-.5*(Math.cos(gn*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:Wc(n,.075,.3),easeOutElastic:n=>Po(n)?n:Yc(n,.075,.3),easeInOutElastic(n){return Po(n)?n:n<.5?.5*Wc(n*2,.1125,.45):.5+.5*Yc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-Ns.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ns.easeInBounce(n*2)*.5:Ns.easeOutBounce(n*2-1)*.5+.5};function Uu(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Kc(n){return Uu(n)?n:new Zs(n)}function fa(n){return Uu(n)?n:new Zs(n).saturate(.5).darken(.1).hexString()}const q4=["x","y","borderWidth","radius","tension"],H4=["color","borderColor","backgroundColor"];function j4(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:H4},numbers:{type:"number",properties:q4}}),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 z4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Jc=new Map;function U4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Jc.get(t);return i||(i=new Intl.NumberFormat(n,e),Jc.set(t,i)),i}function Oy(n,e,t){return U4(e,t).format(n)}const My={values(n){return an(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=V4(n,t)}const o=Za(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),Oy(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Za(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?My.numeric.call(this,n,e,t):""}};function V4(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 Ey={formatters:My};function B4(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:Ey.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 Il=Object.create(null),Xa=Object.create(null);function Rs(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"?Gs(Rs(n,e),t):Gs(Rs(n,""),e)}class W4{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 Rs(this,e)}describe(e,t){return ca(Xa,e,t)}override(e,t){return ca(Il,e,t)}route(e,t,i,l){const s=Rs(this,e),o=Rs(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return kt(a)?Object.assign({},u,a):Mt(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var nn=new W4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[j4,z4,B4]);function Y4(n){return!n||Gt(n.size)||Gt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Zc(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 yl(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 Gc(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Qa(n,e,t,i){K4(n,e,t,i)}function K4(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)*w4;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),_+=jc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=jc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+bl)*a,c=Math.cos(_+bl)*a,r=Math.sin(_+bl)*a,d=Math.sin(_+bl)*a,n.arc(t-c,i-r,u,_-gn,_-ui),n.arc(t+d,i-o,u,_-ui,_),n.arc(t+c,i+r,u,_,_+ui),n.arc(t-d,i+o,u,_+ui,_+gn),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}_+=bl;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":_+=bl;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),_+=bl,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 ls(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 Vu(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Bu(n){n.restore()}function J4(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 Z4(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 G4(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Gt(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 X4(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 Q4(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Xc(n,e,t,i,l,s={}){const o=an(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,G4(n,s),a=0;a<o.length;++a)u=o[a],s.backdrop&&Q4(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Gt(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(u,t,i,s.maxWidth)),n.fillText(u,t,i,s.maxWidth),X4(n,t,i,u,s),i+=Number(l.lineHeight);n.restore()}function Qc(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*gn,gn,!0),n.lineTo(t,i+s-o.bottomLeft),n.arc(t+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,gn,ui,!0),n.lineTo(t+l-o.bottomRight,i+s),n.arc(t+l-o.bottomRight,i+s-o.bottomRight,o.bottomRight,ui,0,!0),n.lineTo(t+l,i+o.topRight),n.arc(t+l-o.topRight,i+o.topRight,o.topRight,0,-ui,!0),n.lineTo(t+o.topLeft,i)}const x4=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,eS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tS(n,e){const t=(""+n).match(x4);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 nS=n=>+n||0;function Dy(n,e){const t={},i=kt(e),l=i?Object.keys(e):e,s=kt(n)?i?o=>Mt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=nS(s(o));return t}function iS(n){return Dy(n,{top:"y",right:"x",bottom:"y",left:"x"})}function lr(n){return Dy(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ol(n){const e=iS(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=Mt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Mt(n.style,e.style);i&&!(""+i).match(eS)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:Mt(n.family,e.family),lineHeight:tS(Mt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Mt(n.weight,e.weight),string:""};return l.string=Y4(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 lS(n,e,t){const{min:i,max:l}=n,s=h4(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 Pl(n,e){return Object.assign(Object.create(n),e)}function Wu(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Py("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Wu([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 Ly(r,a,()=>dS(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return ed(r).includes(a)},ownKeys(r){return ed(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function ss(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Iy(n,i),setContext:s=>ss(n,s,t,i),override:s=>ss(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 Ly(s,o,()=>oS(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 Iy(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:ll(t)?t:()=>t,isIndexable:ll(i)?i:()=>i}}const sS=(n,e)=>n?n+ju(e):e,Yu=(n,e)=>kt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Ly(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function oS(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return ll(r)&&o.isScriptable(e)&&(r=rS(e,r,n,t)),an(r)&&r.length&&(r=aS(e,r,n,o.isIndexable)),Yu(e,r)&&(r=ss(r,l,s&&s[e],o)),r}function rS(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),Yu(n,a)&&(a=Ku(l._scopes,l,n,a)),a}function aS(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(kt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ku(u,l,n,f);e.push(ss(c,s,o&&o[n],r))}}return e}function Ay(n,e,t){return ll(n)?n(e,t):n}const uS=(n,e)=>n===!0?e:typeof n=="string"?kr(e,n):void 0;function fS(n,e,t,i,l){for(const s of e){const o=uS(t,s);if(o){n.add(o);const r=Ay(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 Ku(n,e,t,i){const l=e._rootScopes,s=Ay(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=xc(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=xc(r,o,s,a,i),a===null)?!1:Wu(Array.from(r),[""],l,s,()=>cS(e,t,i))}function xc(n,e,t,i,l){for(;t;)t=fS(n,e,t,i,l);return t}function cS(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return an(l)&&kt(t)?t:l||{}}function dS(n,e,t,i){let l;for(const s of e)if(l=Py(sS(s,n),t),typeof l<"u")return Yu(n,l)?Ku(t,i,n,l):l}function Py(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function ed(n){let e=n._keys;return e||(e=n._keys=pS(n._scopes)),e}function pS(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 mS=Number.EPSILON||1e-14,os=(n,e)=>e<n.length&&!n[e].skip&&n[e],Ny=n=>n==="x"?"y":"x";function hS(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=Ga(s,l),a=Ga(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 _S(n,e,t){const i=n.length;let l,s,o,r,a,u=os(n,0);for(let f=0;f<i-1;++f)if(a=u,u=os(n,f+1),!(!a||!u)){if(Ol(e[f],0,mS)){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 gS(n,e,t="x"){const i=Ny(t),l=n.length;let s,o,r,a=os(n,0);for(let u=0;u<l;++u){if(o=r,r=a,a=os(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 bS(n,e="x"){const t=Ny(e),i=n.length,l=Array(i).fill(0),s=Array(i);let o,r,a,u=os(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=os(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?sl(l[o-1])!==sl(l[o])?0:(l[o-1]+l[o])/2:l[o-1]:l[o]}_S(n,l,s),gS(n,s,e)}function Ro(n,e,t){return Math.max(Math.min(n,t),e)}function yS(n,e){let t,i,l,s,o,r=ls(n[0],e);for(t=0,i=n.length;t<i;++t)o=s,s=r,r=t<i-1&&ls(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 kS(n,e,t,i,l){let s,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")bS(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=hS(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&&yS(n,t)}function Ju(){return typeof window<"u"&&typeof document<"u"}function Zu(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Sr(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 vS(n,e){return jr(n).getPropertyValue(e)}const wS=["top","right","bottom","left"];function Ml(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=wS[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const SS=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function TS(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(SS(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=Ml(l,"padding"),r=Ml(l,"border","width"),{x:a,y:u,box:f}=TS(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 CS(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Zu(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=jr(s),a=Ml(r,"border","width"),u=Ml(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Sr(r.maxWidth,s,"clientWidth"),l=Sr(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||wr,maxHeight:l||wr}}const Fo=n=>Math.round(n*10)/10;function $S(n,e,t,i){const l=jr(n),s=Ml(l,"margin"),o=Sr(l.maxWidth,n,"clientWidth")||wr,r=Sr(l.maxHeight,n,"clientHeight")||wr,a=CS(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=Ml(l,"border","width"),m=Ml(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 td(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 OS=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Ju()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function nd(n,e){const t=vS(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function vl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function MS(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 ES(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=vl(n,l,t),r=vl(l,s,t),a=vl(s,e,t),u=vl(o,r,t),f=vl(r,a,t);return vl(u,f,t)}const DS=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}}},IS=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?DS(e,t):IS()}function LS(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 AS(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Ry(n){return n==="angle"?{between:wy,compare:M4,normalize:yi}:{between:Sy,compare:(e,t)=>e-t,normalize:e=>e}}function id({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 PS(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Ry(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 Fy(n,e,t){if(!t)return[n];const{property:i,start:l,end:s}=t,o=e.length,{compare:r,between:a,normalize:u}=Ry(i),{start:f,end:c,loop:d,style:m}=PS(n,e,t),h=[];let g=!1,_=null,y,S,C;const T=()=>a(l,C,y)&&r(l,C)!==0,O=()=>r(s,y)===0||a(s,C,y),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(y=u(S[i]),y!==C&&(g=a(y,l,s),_===null&&E()&&(_=r(y,l)===0?I:A),_!==null&&L()&&(h.push(id({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,C=y));return _!==null&&h.push(id({start:_,end:c,loop:d,count:o,style:m})),h}function qy(n,e){const t=[],i=n.segments;for(let l=0;l<i.length;l++){const s=Fy(i[l],n.points,e);s.length&&t.push(...s)}return t}function NS(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 RS(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 FS(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=NS(t,l,s,i);if(i===!0)return ld(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 ld(n,RS(t,o,a,u),t,e)}function ld(n,e,t,i){return!i||!i.setContext||!t?e:qS(n,e,t,i)}function qS(n,e,t,i){const l=n._chart.getContext(),s=sd(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];_=sd(i.setContext(Pl(l,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),HS(_,f)&&m(c,d-1,h.loop,f),g=y,f=_}c<d-1&&m(c,d-1,h.loop,f)}return u}function sd(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function HS(n,e){if(!e)return!1;const t=[],i=function(l,s){return Uu(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(e,i)}/*!
  * Chart.js v4.4.7
  * https://www.chartjs.org
  * (c) 2024 Chart.js Contributors
  * Released under the MIT License
- */class qS{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=Ty.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Pi=new qS;const sd="transparent",HS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Yc(n||sd),l=i.valid&&Yc(e||sd);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class jS{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||HS[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=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 qy{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!kt(e))return;const t=Object.keys(nn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!kt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=US(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&zS(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 jS(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function zS(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 US(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 od(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 VS(n,e,t){if(t===!1)return!1;const i=od(n,t),l=od(e,t);return{top:l.end,right:i.end,bottom:l.start,left:i.start}}function BS(n){let e,t,i,l;return kt(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 Hy(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 rd(n,e,t,i={}){const l=n.keys,s=i.mode==="single";let o,r,a,u;if(e===null)return;let f=!1;for(o=0,r=l.length;o<r;++o){if(a=+l[o],a===t){if(f=!0,i.all)continue;break}u=n.values[a],yn(u)&&(s||e===0||sl(e)===sl(u))&&(e+=u)}return!f&&!i.all?0:e}function WS(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 pa(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function YS(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function KS(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 JS(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function ad(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 ud(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=YS(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]=JS(l,f,g),d[r]=_,d._top=ad(d,o,!0,i.type),d._bottom=ad(d,o,!1,i.type);const S=d._visualValues||(d._visualValues={});S[r]=_}}function ma(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function ZS(n,e){return Pl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function GS(n,e,t){return Pl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ha=n=>n==="reset"||n==="none",fd=(n,e)=>e?n:Object.assign({},n),XS=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Hy(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=pa(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Mt(i.xAxisID,ma(e,"x")),o=t.yAxisID=Mt(i.yAxisID,ma(e,"y")),r=t.rAxisID=Mt(i.rAxisID,ma(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&&Uc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(kt(t)){const l=this._cachedMeta;this._data=WS(t,l)}else if(i!==t){if(i){Uc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&D4(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=pa(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(ud(this,t._parsed),t._stacked=pa(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):kt(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&&ud(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(kr(m,r),d),y:o.parse(kr(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:Hy(l,!0),values:t._stacks[e.axis]._visualValues};return rd(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=rd(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=XS(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=KS(r);let d,m;function h(){m=l[d];const g=m[r.axis];return!yn(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],yn(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=BS(Mt(this.options.clip,VS(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=GS(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=ZS(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&&vr(i);if(r)return fd(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(fd(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 qy(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||ha(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){ha(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ha(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&&vs(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])}}pt(Fs,"defaults",{}),pt(Fs,"datasetElementType",null),pt(Fs,"dataElementType",null);class sr extends Fs{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}=P4(t,l,o);this._drawStart=r,this._drawCount=a,N4(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,_=Xs(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||l==="none",S=t+i,C=e.length;let T=t>0&&this.getParsed(t-1);for(let O=0;O<C;++O){const E=e[O],L=y?E:{};if(O<t||O>=S){L.skip=!0;continue}const I=this.getParsed(O),A=Gt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],O);L.skip=isNaN(P)||isNaN(N)||A,L.stop=O>0&&Math.abs(I[d]-T[d])>_,g&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,E.active?"active":l)),y||this.updateElement(E,O,L,l),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(sr,"id","line"),pt(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function kl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zu{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(Zu.prototype,e)}init(){}formats(){return kl()}parse(){return kl()}format(){return kl()}add(){return kl()}diff(){return kl()}startOf(){return kl()}endOf(){return kl()}}var jy={_date:Zu};function QS(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?M4: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 mo(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}=QS(s[r],e,o,l);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function xS(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 _a(n,e,t,i,l){const s=[];return!l&&!n.isPointInArea(e)||mo(n,t,e,function(r,a,u){!l&&!ls(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&s.push({element:r,datasetIndex:a,index:u})},!0),s}function eT(n,e,t,i){let l=[];function s(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=C4(o,{x:e.x,y:e.y});vy(c,u,f)&&l.push({element:o,datasetIndex:r,index:a})}return mo(n,t,e,s),l}function tT(n,e,t,i,l,s){let o=[];const r=xS(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 mo(n,t,e,u),o}function ga(n,e,t,i,l,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!i?eT(n,e,t,l):tT(n,e,t,i,l,s)}function cd(n,e,t,i,l){const s=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return mo(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 nT={evaluateInteractionItems:mo,modes:{index(n,e,t,i){const l=ki(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?_a(n,l,s,i,o):ga(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?_a(n,l,s,i,o):ga(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 _a(n,l,s,i,o)},nearest(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return ga(n,l,s,t.intersect,i,o)},x(n,e,t,i){const l=ki(e,n);return cd(n,l,"x",t.intersect,i)},y(n,e,t,i){const l=ki(e,n);return cd(n,l,"y",t.intersect,i)}}};const zy=["left","top","right","bottom"];function ws(n,e){return n.filter(t=>t.pos===e)}function dd(n,e){return n.filter(t=>zy.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function iT(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;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 lT(n){const e={};for(const t of n){const{stack:i,pos:l,stackWeight:s}=t;if(!i||!zy.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 sT(n,e){const t=lT(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 oT(n){const e=iT(n),t=Ss(e.filter(u=>u.box.fullSize),!0),i=Ss(ws(e,"left"),!0),l=Ss(ws(e,"right")),s=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=dd(e,"x"),a=dd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function pd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Uy(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function rT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!kt(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&&Uy(o,s.getPadding());const r=Math.max(0,e.outerWidth-pd(o,n,"left","right")),a=Math.max(0,e.outerHeight-pd(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function aT(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function uT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s<o;++s){r=n[s],a=r.box,a.update(r.width||e.w,r.height||e.h,uT(r.horizontal,e));const{same:c,other:d}=rT(e,t,r,i);u|=c&&l.length,f=f||d,a.fullSize||l.push(r)}return u&&Es(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 md(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;vr(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;vr(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=ol(n.options.layout.padding),s=Math.max(e-l.width,0),o=Math.max(t-l.height,0),r=oT(n.boxes),a=r.vertical,u=r.horizontal;_t(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);Uy(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=sT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),aT(m),md(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,md(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Vy{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class fT extends Vy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",cT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hd=n=>n===null||n==="";function dT(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",hd(l)){const s=td(n,"width");s!==void 0&&(n.width=s)}if(hd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=td(n,"height");s!==void 0&&(n.height=s)}return n}const By=CS?{passive:!0}:!1;function pT(n,e,t){n&&n.addEventListener(e,t,By)}function mT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,By)}function hT(n,e){const t=cT[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 Tr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function _T(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.addedNodes,i),o=o&&!Tr(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function gT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.removedNodes,i),o=o&&!Tr(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const Qs=new Map;let _d=0;function Wy(){const n=window.devicePixelRatio;n!==_d&&(_d=n,Qs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function bT(n,e){Qs.size||window.addEventListener("resize",Wy),Qs.set(n,e)}function yT(n){Qs.delete(n),Qs.size||window.removeEventListener("resize",Wy)}function kT(n,e,t){const i=n.canvas,l=i&&Ju(i);if(!l)return;const s=Cy((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),bT(n,s),o}function ba(n,e,t){t&&t.disconnect(),e==="resize"&&yT(n)}function vT(n,e,t){const i=n.canvas,l=Cy(s=>{n.ctx!==null&&t(hT(s,n))},n);return pT(i,e,l),l}class wT extends Vy{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(dT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[or])return!1;const i=t[or].initial;["height","width"].forEach(s=>{const o=i[s];Gt(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:_T,detach:gT,resize:kT}[t]||vT;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ba,detach:ba,resize:ba}[t]||mT)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return TS(e,t,i,l)}isAttached(e){const t=e&&Ju(e);return!!(t&&t.isConnected)}}function ST(n){return!Ku()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?fT:wT}class Ll{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}pt(Ll,"defaults",{}),pt(Ll,"defaultRoutes");function TT(n,e){const t=n.options.ticks,i=CT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?OT(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return MT(e,u,s,o/l),u;const f=$T(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,Gt(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,Gt(m)?e.length:a+m),u}return jo(e,u,f),u}function CT(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 $T(n,e,t){const i=ET(n),l=e.length/t;if(!i)return Math.max(l,1);const s=v4(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 OT(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function MT(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=Mt(i,0),o=Math.min(Mt(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 ET(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 DT=n=>n==="left"?"right":n==="right"?"left":n,gd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,bd=(n,e)=>Math.min(e||n,n);function yd(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 IT(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 LT(n,e){_t(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 Ts(n){return n.drawTicks?n.tickLength:0}function kd(n,e){if(!n.display)return 0;const t=Si(n.font,e),i=ol(n.padding);return(an(n.text)?n.text.length:1)*t.lineHeight+i.height}function AT(n,e){return Pl(n,{scale:e,type:"scale"})}function PT(n,e,t){return Pl(n,{tick:t,index:e,type:"tick"})}function NT(n,e,t){let i=A4(n);return(t&&e!=="right"||!t&&e==="right")&&(i=DT(i)),i}function RT(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=Vc(i,s,r),kt(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=gd(n,t,e);d=r-s}else{if(kt(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=gd(n,t,e);h=Vc(i,o,l),c=t==="left"?-ui:ui}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class ho extends Ll{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:yn(e),maxDefined:yn(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(){ut(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=nS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?yd(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=TT(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(){ut(this.options.afterUpdate,[this])}beforeSetDimensions(){ut(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(){ut(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ut(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ut(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=ut(t.callback,[s.value,i,e],this)}afterTickToLabelConversion(){ut(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ut(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=bd(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=fi(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-Ts(e.grid)-t.padding-kd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=T4(Math.min(Math.asin(fi((f.highest.height+6)/r,-1,1)),Math.asin(fi(a/u,-1,1))-Math.asin(fi(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(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=kd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(s)+a):(e.height=this.maxHeight,e.width=Ts(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Tl(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(){ut(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++)Gt(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=yd(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/bd(t,i));let u=0,f=0,c,d,m,h,g,_,y,S,C,T,O;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,C=T=0,!Gt(h)&&!an(h))C=Jc(l,y.data,y.gc,C,h),T=S;else if(an(h))for(d=0,m=h.length;d<m;++d)O=h[d],!Gt(O)&&!an(O)&&(C=Jc(l,y.data,y.gc,C,O),T+=S);o.push(C),r.push(T),u=Math.max(C,u),f=Math.max(T,f)}LT(s,t);const E=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(E),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 O4(this._alignToPixels?yl(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=PT(this.getContext(),e,i))}return this.$context||(this.$context=AT(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Tl(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=Ts(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,y=function(J){return yl(i,J,g)};let S,C,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=y(this.bottom),L=this.bottom-d,A=S-_,N=y(e.top)+_,z=e.bottom;else if(o==="bottom")S=y(this.top),N=e.top,z=y(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=y(this.right),E=this.right-d,I=S-_,P=y(e.left)+_,R=e.right;else if(o==="right")S=y(this.left),P=e.left,R=y(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(kt(o)){const J=Object.keys(o)[0],V=o[J];S=y(this.chart.scales[J].getPixelForValue(V))}N=e.top,z=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(kt(o)){const J=Object.keys(o)[0],V=o[J];S=y(this.chart.scales[J].getPixelForValue(V))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Mt(l.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/F));for(C=0;C<c;C+=B){const J=this.getContext(C),V=s.setContext(J),Z=r.setContext(J),G=V.lineWidth,de=V.color,fe=Z.dash||[],ue=Z.dashOffset,Te=V.tickWidth,Ke=V.tickColor,Je=V.tickBorderDash||[],ft=V.tickBorderDashOffset;T=IT(this,C,a),T!==void 0&&(O=yl(i,T,G),u?E=I=P=R=O:L=A=N=z=O,m.push({tx1:E,ty1:L,tx2:I,ty2:A,x1:P,y1:N,x2:R,y2:z,width:G,color:de,borderDash:fe,borderDashOffset:ue,tickWidth:Te,tickColor:Ke,tickBorderDash:Je,tickBorderDashOffset:ft}))}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=Ts(i.grid),m=d+f,h=c?-f:m,g=-Tl(this.labelRotation),_=[];let y,S,C,T,O,E,L,I,A,P,N,R,z="middle";if(l==="top")E=this.bottom-h,L=this._getXAxisLabelAlignment();else if(l==="bottom")E=this.top+h,L=this._getXAxisLabelAlignment();else if(l==="left"){const B=this._getYAxisLabelAlignment(d);L=B.textAlign,O=B.x}else if(l==="right"){const B=this._getYAxisLabelAlignment(d);L=B.textAlign,O=B.x}else if(t==="x"){if(l==="center")E=(e.top+e.bottom)/2+m;else if(kt(l)){const B=Object.keys(l)[0],J=l[B];E=this.chart.scales[B].getPixelForValue(J)+m}L=this._getXAxisLabelAlignment()}else if(t==="y"){if(l==="center")O=(e.left+e.right)/2-m;else if(kt(l)){const B=Object.keys(l)[0],J=l[B];O=this.chart.scales[B].getPixelForValue(J)}L=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?z="top":a==="end"&&(z="bottom"));const F=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){C=r[y],T=C.label;const B=s.setContext(this.getContext(y));I=this.getPixelForTick(y)+s.labelOffset,A=this._resolveTickFontOptions(y),P=A.lineHeight,N=an(T)?T.length:1;const J=N/2,V=B.color,Z=B.textStrokeColor,G=B.textStrokeWidth;let de=L;o?(O=I,L==="inner"&&(y===S-1?de=this.options.reverse?"left":"right":y===0?de=this.options.reverse?"right":"left":de="center"),l==="top"?u==="near"||g!==0?R=-N*P+P/2:u==="center"?R=-F.highest.height/2-J*P+P:R=-F.highest.height+P/2:u==="near"||g!==0?R=P/2:u==="center"?R=F.highest.height/2-J*P:R=F.highest.height-N*P,c&&(R*=-1),g!==0&&!B.showLabelBackdrop&&(O+=P/2*Math.sin(g))):(E=I,R=(1-N)*P/2);let fe;if(B.showLabelBackdrop){const ue=ol(B.backdropPadding),Te=F.heights[y],Ke=F.widths[y];let Je=R-ue.top,ft=0-ue.left;switch(z){case"middle":Je-=Te/2;break;case"bottom":Je-=Te;break}switch(L){case"center":ft-=Ke/2;break;case"right":ft-=Ke;break;case"inner":y===S-1?ft-=Ke:y>0&&(ft-=Ke/2);break}fe={left:ft,top:Je,width:Ke+ue.width,height:Te+ue.height,color:B.backdropColor}}_.push({label:T,font:A,textOffset:R,options:{rotation:g,color:V,strokeColor:Z,strokeWidth:G,textAlign:de,textBaseline:z,translation:[O,E],backdrop:fe}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Tl(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=yl(e,this.left,o)-o/2,f=yl(e,this.right,r)+r/2,c=d=a):(c=yl(e,this.top,o)-o/2,d=yl(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&&Uu(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;Gc(i,u,0,f,a,r)}l&&Vu(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:l}}=this;if(!i.display)return;const s=Si(i.font),o=ol(i.padding),r=i.align;let a=s.lineHeight/2;t==="bottom"||t==="center"||kt(t)?(a+=o.bottom,an(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=RT(this,a,t,r);Gc(e,i.text,0,0,s,{color:i.color,maxWidth:c,rotation:d,textAlign:NT(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=Mt(e.grid&&e.grid.z,-1),l=Mt(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ho.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;HT(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,FT(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 Il[i])}}function FT(n,e,t){const i=Gs(Object.create(null),[t?nn.get(t):{},nn.get(e),n.defaults]);nn.set(e,i),n.defaultRoutes&&qT(e,n.defaultRoutes),n.descriptors&&nn.describe(e,n.descriptors)}function qT(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 HT(n){return"id"in n&&"defaults"in n}class jT{constructor(){this.controllers=new zo(Fs,"datasets",!0),this.elements=new zo(Ll,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(ho,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Hu(e);ut(i["before"+l],[],i),t[e](i),ut(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 jT;class zT{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(ut(r,a,o)===!1&&l.cancelable)return!1}return!0}invalidate(){Gt(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=Mt(i.options&&i.options.plugins,{}),s=UT(i);return l===!1&&!t?[]:BT(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 UT(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 VT(n,e){return!e&&n===!1?null:n===!0?{}:n}function BT(n,{plugins:e,localIds:t},i,l){const s=[],o=n.getContext();for(const r of e){const a=r.id,u=VT(i[a],l);u!==null&&s.push({plugin:r,options:WT(n.config,{plugin:r,local:t[a]},u,o)})}return s}function WT(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 Qa(n,e){const t=nn.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function YT(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function KT(n,e){return n===e?"_index_":"_value_"}function vd(n){if(n==="x"||n==="y"||n==="r")return n}function JT(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function xa(n,...e){if(vd(n))return n;for(const t of e){const i=t.axis||JT(t.position)||n.length>1&&vd(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function wd(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function ZT(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return wd(n,"x",t[0])||wd(n,"y",t[0])}return{}}function GT(n,e){const t=Il[n.type]||{scales:{}},i=e.scales||{},l=Qa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!kt(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=xa(o,r,ZT(o,n),nn.scales[r.type]),u=KT(a,l),f=t.scales||{};s[o]=Ps(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||Qa(r,e),f=(Il[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=YT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ps(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ps(r,[nn.scales[r.type],nn.scale])}),s}function Yy(n){const e=n.options||(n.options={});e.plugins=Mt(e.plugins,{}),e.scales=GT(n,e)}function Ky(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function XT(n){return n=n||{},n.data=Ky(n.data),Yy(n),n}const Sd=new Map,Jy=new Set;function Uo(n,e){let t=Sd.get(n);return t||(t=e(),Sd.set(n,t),Jy.add(t)),t}const Cs=(n,e,t)=>{const i=kr(e,t);i!==void 0&&n.add(i)};class QT{constructor(e){this._config=XT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ky(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(),Yy(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=>Cs(a,e,c))),f.forEach(c=>Cs(a,l,c)),f.forEach(c=>Cs(a,Il[s]||{},c)),f.forEach(c=>Cs(a,nn,c)),f.forEach(c=>Cs(a,Ga,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Jy.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Il[t]||{},nn.datasets[t]||{},{type:t},nn,Ga]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Td(this._resolverCache,e,l);let a=o;if(eC(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=ss(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Td(this._resolverCache,e,i);return kt(t)?ss(s,t,void 0,l):s}}function Td(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:Bu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const xT=n=>kt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function eC(n,e){const{isScriptable:t,isIndexable:i}=Dy(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||xT(r))||o&&an(r))return!0}return!1}var tC="4.4.7";const nC=["top","bottom","left","right","chartArea"];function Cd(n,e){return n==="top"||n==="bottom"||nC.indexOf(n)===-1&&e==="x"}function $d(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Od(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ut(t&&t.onComplete,[n],e)}function iC(n){const e=n.chart,t=e.options.animation;ut(t&&t.onProgress,[n],e)}function Zy(n){return Ku()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Md=n=>{const e=Zy(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function lC(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 sC(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 oC(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),Ed()}static unregister(...e){bi.remove(...e),Ed()}constructor(e,t){const i=this.config=new QT(t),l=Zy(e),s=Md(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ST(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=d4(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new zT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=L4(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}Pi.listen(this,"complete",Od),Pi.listen(this,"progress",iC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Gt(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():ed(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Zc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ed(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ut(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=xa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=xa(a,r),f=Mt(r.type,o.dtype);(r.position===void 0||Cd(r.position,u)!==Cd(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)}),_t(l,(o,r)=>{o||delete i[r]}),_t(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($d("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||Qa(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(){_t(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||_t(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort($d("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{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);(!qc(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;lC(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(!qc(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=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,ll(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&&(Pi.has(this)?this.attached&&!Pi.running(this)&&Pi.start(this):(this.draw(),Od({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=oC(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Uu(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&&Vu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ls(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=nT.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Pl(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);vr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Zc(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)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r<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}});!br(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=b4(e),u=sC(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ut(s.onHover,[e,r,this],this),a&&ut(s.onClick,[e,r,this],this));const f=!br(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)}}pt(vi,"defaults",nn),pt(vi,"instances",rr),pt(vi,"overrides",Il),pt(vi,"registry",bi),pt(vi,"version",tC),pt(vi,"getChart",Md);function Ed(){return _t(vi.instances,n=>n._plugins.invalidate())}function Gy(n,e,t=e){n.lineCap=Mt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Mt(t.borderDash,e.borderDash)),n.lineDashOffset=Mt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Mt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Mt(t.borderWidth,e.borderWidth),n.strokeStyle=Mt(t.borderColor,e.borderColor)}function rC(n,e,t){n.lineTo(t.x,t.y)}function aC(n){return n.stepped?Y4:n.tension||n.cubicInterpolationMode==="monotone"?K4:rC}function Xy(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 uC(n,e,t,i){const{points:l,options:s}=e,{count:o,start:r,loop:a,ilen:u}=Xy(l,t,i),f=aC(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 fC(n,e,t,i){const l=e.points,{count:s,start:o,ilen:r}=Xy(l,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,g,_,y;const S=T=>(o+(u?r-T:T))%s,C=()=>{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 T=m.x,O=m.y,E=T|0;E===h?(O<g?g=O:O>_&&(_=O),f=(c*f+T)/++c):(C(),n.lineTo(T,O),h=E,c=0,g=_=O),y=O}C()}function eu(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?fC:uC}function cC(n){return n.stepped?$S:n.tension||n.cubicInterpolationMode==="monotone"?OS:vl}function dC(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Gy(n,e.options),n.stroke(l)}function pC(n,e,t,i){const{segments:l,options:s}=e,o=eu(e);for(const r of l)Gy(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const mC=typeof Path2D=="function";function hC(n,e,t,i){mC&&!e.options.segment?dC(n,e,t,i):pC(n,e,t,i)}class Qi extends Ll{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;bS(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=NS(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=Fy(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=cC(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 eu(this)(e,this,t,i)}path(e,t,i){const l=this.segments,s=eu(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(),hC(e,this,i,l),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pt(Qi,"id","line"),pt(Qi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pt(Qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pt(Qi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Dd(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 Ll{constructor(t){super();pt(this,"parsed");pt(this,"skip");pt(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 Dd(this,t,"x",i)}inYRange(t,i){return Dd(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||!ls(this,i,this.size(l)/2)||(t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.fillStyle=l.backgroundColor,Xa(t,l,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}pt(ar,"id","point"),pt(ar,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pt(ar,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function _C(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=Gu(a,u,l);const f=tu(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=Fy(e,f);for(const d of c){const m=tu(t,s[d.start],s[d.end],d.loop),h=Ry(r,l,m);for(const g of h)o.push({source:g,target:d,start:{[t]:Id(f,m,"start",Math.max)},end:{[t]:Id(f,m,"end",Math.min)}})}}return o}function tu(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 gC(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Gu(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 Gu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Id(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Qy(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=gC(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ld(n){return n&&n.fill!==!1}function bC(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(!yn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function yC(n,e,t){const i=SC(n);if(kt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return yn(l)&&Math.floor(l)===l?kC(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function kC(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function vC(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:kt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function wC(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:kt(n)?i=n.value:i=e.getBaseValue(),i}function SC(n){const e=n.options,t=e.fill;let i=Mt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function TC(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=CC(e,t);r.push(Qy({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++)$C(l,o[f],r)}return new Qi({points:l,options:{}})}function CC(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 $C(n,e,t){const i=[];for(let l=0;l<t.length;l++){const s=t[l],{first:o,last:r,point:a}=OC(s,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function OC(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(wy(l,c,d)){r=l===c,a=l===d;break}}return{first:r,last:a,point:i}}class xy{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 MC(n){const{chart:e,fill:t,line:i}=n;if(yn(t))return EC(e,t);if(t==="stack")return TC(n);if(t==="shape")return!0;const l=DC(n);return l instanceof xy?l:Qy(l,i)}function EC(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function DC(n){return(n.scale||{}).getPointPositionForValue?LC(n):IC(n)}function IC(n){const{scale:e={},fill:t}=n,i=vC(t,e);if(yn(i)){const l=e.isHorizontal();return{x:l?i:null,y:l?null:i}}return null}function LC(n){const{scale:e,fill:t}=n,i=e.options,l=e.getLabels().length,s=i.reverse?e.max:e.min,o=wC(t,e,s),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,s);return new xy({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 ya(n,e,t){const i=MC(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&&(Uu(n,t),AC(n,{line:l,target:i,above:f,below:c,area:t,scale:s,axis:o}),Vu(n))}function AC(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&&(Ad(n,i,o.top),Pd(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore(),n.save(),Ad(n,i,o.bottom)),Pd(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore()}function Ad(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[Gu(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 Pd(n,e){const{line:t,target:i,property:l,color:s,scale:o}=e,r=_C(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,PC(n,o,m&&tu(l,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(m){h?n.closePath():Nd(n,i,c,l);const _=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&_,g||Nd(n,i,f,l)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function PC(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 Nd(n,e,t,i){const l=e.interpolate(t,i);l&&n.lineTo(l.x,l.y)}var NC={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 Qi&&(a={visible:n.isDatasetVisible(o),index:o,fill:yC(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=bC(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&&ya(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;Ld(s)&&ya(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Ld(i)||t.drawTime!=="beforeDatasetDraw"||ya(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ds={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=Za(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&&(an(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ni(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
+ */class jS{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 Pi=new jS;const od="transparent",zS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Kc(n||od),l=i.valid&&Kc(e||od);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class US{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||zS[e.type||typeof o],this._easing=Ns[e.easing]||Ns.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=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 Hy{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!kt(e))return;const t=Object.keys(nn.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!kt(s))return;const o={};for(const r of t)o[r]=s[r];(an(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=BS(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&VS(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 US(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Pi.add(this._chart,i),!0}}function VS(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 BS(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 rd(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 WS(n,e,t){if(t===!1)return!1;const i=rd(n,t),l=rd(e,t);return{top:l.end,right:i.end,bottom:l.start,left:i.start}}function YS(n){let e,t,i,l;return kt(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 jy(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 ad(n,e,t,i={}){const l=n.keys,s=i.mode==="single";let o,r,a,u;if(e===null)return;let f=!1;for(o=0,r=l.length;o<r;++o){if(a=+l[o],a===t){if(f=!0,i.all)continue;break}u=n.values[a],yn(u)&&(s||e===0||sl(e)===sl(u))&&(e+=u)}return!f&&!i.all?0:e}function KS(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 pa(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function JS(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function ZS(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 GS(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function ud(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 fd(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=JS(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]=GS(l,f,g),d[r]=_,d._top=ud(d,o,!0,i.type),d._bottom=ud(d,o,!1,i.type);const S=d._visualValues||(d._visualValues={});S[r]=_}}function ma(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function XS(n,e){return Pl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function QS(n,e,t){return Pl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const ha=n=>n==="reset"||n==="none",cd=(n,e)=>e?n:Object.assign({},n),xS=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:jy(t,!0),values:null};class Fs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=pa(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&vs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=Mt(i.xAxisID,ma(e,"x")),o=t.yAxisID=Mt(i.yAxisID,ma(e,"y")),r=t.rAxisID=Mt(i.rAxisID,ma(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&&Vc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(kt(t)){const l=this._cachedMeta;this._data=KS(t,l)}else if(i!==t){if(i){Vc(i,this);const l=this._cachedMeta;vs(l),l._parsed=[]}t&&Object.isExtensible(t)&&L4(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=pa(t.vScale,t),t.stack!==i.stack&&(l=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(fd(this,t._parsed),t._stacked=pa(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{an(l[e])?d=this.parseArrayData(i,l,e,t):kt(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&&fd(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(kr(m,r),d),y:o.parse(kr(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:jy(l,!0),values:t._stacks[e.axis]._visualValues};return ad(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=ad(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=xS(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=ZS(r);let d,m;function h(){m=l[d];const g=m[r.axis];return!yn(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],yn(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=YS(Mt(this.options.clip,WS(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=QS(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=XS(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&&vr(i);if(r)return cd(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(cd(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 Hy(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||ha(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){ha(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!ha(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&&vs(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])}}pt(Fs,"defaults",{}),pt(Fs,"datasetElementType",null),pt(Fs,"dataElementType",null);class sr extends Fs{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}=R4(t,l,o);this._drawStart=r,this._drawCount=a,F4(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,_=Xs(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||l==="none",S=t+i,C=e.length;let T=t>0&&this.getParsed(t-1);for(let O=0;O<C;++O){const E=e[O],L=y?E:{};if(O<t||O>=S){L.skip=!0;continue}const I=this.getParsed(O),A=Gt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=s||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],O);L.skip=isNaN(P)||isNaN(N)||A,L.stop=O>0&&Math.abs(I[d]-T[d])>_,g&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,E.active?"active":l)),y||this.updateElement(E,O,L,l),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(sr,"id","line"),pt(sr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(sr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function kl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gu{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(Gu.prototype,e)}init(){}formats(){return kl()}parse(){return kl()}format(){return kl()}add(){return kl()}diff(){return kl()}startOf(){return kl()}endOf(){return kl()}}var zy={_date:Gu};function eT(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?D4: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 mo(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}=eT(s[r],e,o,l);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function tT(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 _a(n,e,t,i,l){const s=[];return!l&&!n.isPointInArea(e)||mo(n,t,e,function(r,a,u){!l&&!ls(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&s.push({element:r,datasetIndex:a,index:u})},!0),s}function nT(n,e,t,i){let l=[];function s(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=O4(o,{x:e.x,y:e.y});wy(c,u,f)&&l.push({element:o,datasetIndex:r,index:a})}return mo(n,t,e,s),l}function iT(n,e,t,i,l,s){let o=[];const r=tT(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 mo(n,t,e,u),o}function ga(n,e,t,i,l,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!i?nT(n,e,t,l):iT(n,e,t,i,l,s)}function dd(n,e,t,i,l){const s=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return mo(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 lT={evaluateInteractionItems:mo,modes:{index(n,e,t,i){const l=ki(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?_a(n,l,s,i,o):ga(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?_a(n,l,s,i,o):ga(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 _a(n,l,s,i,o)},nearest(n,e,t,i){const l=ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return ga(n,l,s,t.intersect,i,o)},x(n,e,t,i){const l=ki(e,n);return dd(n,l,"x",t.intersect,i)},y(n,e,t,i){const l=ki(e,n);return dd(n,l,"y",t.intersect,i)}}};const Uy=["left","top","right","bottom"];function ws(n,e){return n.filter(t=>t.pos===e)}function pd(n,e){return n.filter(t=>Uy.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(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 sT(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 oT(n){const e={};for(const t of n){const{stack:i,pos:l,stackWeight:s}=t;if(!i||!Uy.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 rT(n,e){const t=oT(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 aT(n){const e=sT(n),t=Ss(e.filter(u=>u.box.fullSize),!0),i=Ss(ws(e,"left"),!0),l=Ss(ws(e,"right")),s=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=pd(e,"x"),a=pd(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function md(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Vy(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 uT(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!kt(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&&Vy(o,s.getPadding());const r=Math.max(0,e.outerWidth-md(o,n,"left","right")),a=Math.max(0,e.outerHeight-md(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 fT(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 cT(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Es(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s<o;++s){r=n[s],a=r.box,a.update(r.width||e.w,r.height||e.h,cT(r.horizontal,e));const{same:c,other:d}=uT(e,t,r,i);u|=c&&l.length,f=f||d,a.fullSize||l.push(r)}return u&&Es(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 hd(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;vr(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;vr(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=ol(n.options.layout.padding),s=Math.max(e-l.width,0),o=Math.max(t-l.height,0),r=aT(n.boxes),a=r.vertical,u=r.horizontal;_t(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);Vy(d,ol(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=rT(a.concat(u),c);Es(r.fullSize,m,c,h),Es(a,m,c,h),Es(u,m,c,h)&&Es(a,m,c,h),fT(m),hd(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,hd(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},_t(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class By{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 dT extends By{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const or="$chartjs",pT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_d=n=>n===null||n==="";function mT(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",_d(l)){const s=nd(n,"width");s!==void 0&&(n.width=s)}if(_d(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=nd(n,"height");s!==void 0&&(n.height=s)}return n}const Wy=OS?{passive:!0}:!1;function hT(n,e,t){n&&n.addEventListener(e,t,Wy)}function _T(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Wy)}function gT(n,e){const t=pT[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 Tr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function bT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.addedNodes,i),o=o&&!Tr(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function yT(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Tr(r.removedNodes,i),o=o&&!Tr(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const Qs=new Map;let gd=0;function Yy(){const n=window.devicePixelRatio;n!==gd&&(gd=n,Qs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function kT(n,e){Qs.size||window.addEventListener("resize",Yy),Qs.set(n,e)}function vT(n){Qs.delete(n),Qs.size||window.removeEventListener("resize",Yy)}function wT(n,e,t){const i=n.canvas,l=i&&Zu(i);if(!l)return;const s=$y((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),kT(n,s),o}function ba(n,e,t){t&&t.disconnect(),e==="resize"&&vT(n)}function ST(n,e,t){const i=n.canvas,l=$y(s=>{n.ctx!==null&&t(gT(s,n))},n);return hT(i,e,l),l}class TT extends By{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(mT(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];Gt(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:bT,detach:yT,resize:wT}[t]||ST;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:ba,detach:ba,resize:ba}[t]||_T)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return $S(e,t,i,l)}isAttached(e){const t=e&&Zu(e);return!!(t&&t.isConnected)}}function CT(n){return!Ju()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?dT:TT}class Ll{constructor(){pt(this,"x");pt(this,"y");pt(this,"active",!1);pt(this,"options");pt(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Xs(this.x)&&Xs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}pt(Ll,"defaults",{}),pt(Ll,"defaultRoutes");function $T(n,e){const t=n.options.ticks,i=OT(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?ET(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return DT(e,u,s,o/l),u;const f=MT(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,Gt(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,Gt(m)?e.length:a+m),u}return jo(e,u,f),u}function OT(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 MT(n,e,t){const i=IT(n),l=e.length/t;if(!i)return Math.max(l,1);const s=S4(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 ET(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function DT(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=Mt(i,0),o=Math.min(Mt(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 IT(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 LT=n=>n==="left"?"right":n==="right"?"left":n,bd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,yd=(n,e)=>Math.min(e||n,n);function kd(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 AT(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 PT(n,e){_t(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 Ts(n){return n.drawTicks?n.tickLength:0}function vd(n,e){if(!n.display)return 0;const t=Si(n.font,e),i=ol(n.padding);return(an(n.text)?n.text.length:1)*t.lineHeight+i.height}function NT(n,e){return Pl(n,{scale:e,type:"scale"})}function RT(n,e,t){return Pl(n,{tick:t,index:e,type:"tick"})}function FT(n,e,t){let i=N4(n);return(t&&e!=="right"||!t&&e==="right")&&(i=LT(i)),i}function qT(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=Bc(i,s,r),kt(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=bd(n,t,e);d=r-s}else{if(kt(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=bd(n,t,e);h=Bc(i,o,l),c=t==="left"?-ui:ui}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class ho extends Ll{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:yn(e),maxDefined:yn(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(){ut(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=lS(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?kd(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$T(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(){ut(this.options.afterUpdate,[this])}beforeSetDimensions(){ut(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(){ut(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ut(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ut(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=ut(t.callback,[s.value,i,e],this)}afterTickToLabelConversion(){ut(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ut(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=yd(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=fi(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-Ts(e.grid)-t.padding-vd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=$4(Math.min(Math.asin(fi((f.highest.height+6)/r,-1,1)),Math.asin(fi(a/u,-1,1))-Math.asin(fi(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(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=vd(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(s)+a):(e.height=this.maxHeight,e.width=Ts(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Tl(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(){ut(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++)Gt(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=kd(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/yd(t,i));let u=0,f=0,c,d,m,h,g,_,y,S,C,T,O;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,C=T=0,!Gt(h)&&!an(h))C=Zc(l,y.data,y.gc,C,h),T=S;else if(an(h))for(d=0,m=h.length;d<m;++d)O=h[d],!Gt(O)&&!an(O)&&(C=Zc(l,y.data,y.gc,C,O),T+=S);o.push(C),r.push(T),u=Math.max(C,u),f=Math.max(T,f)}PT(s,t);const E=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(E),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 E4(this._alignToPixels?yl(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=RT(this.getContext(),e,i))}return this.$context||(this.$context=NT(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Tl(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=Ts(s),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,y=function(J){return yl(i,J,g)};let S,C,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=y(this.bottom),L=this.bottom-d,A=S-_,N=y(e.top)+_,z=e.bottom;else if(o==="bottom")S=y(this.top),N=e.top,z=y(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=y(this.right),E=this.right-d,I=S-_,P=y(e.left)+_,R=e.right;else if(o==="right")S=y(this.left),P=e.left,R=y(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(kt(o)){const J=Object.keys(o)[0],V=o[J];S=y(this.chart.scales[J].getPixelForValue(V))}N=e.top,z=e.bottom,L=S+_,A=L+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(kt(o)){const J=Object.keys(o)[0],V=o[J];S=y(this.chart.scales[J].getPixelForValue(V))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Mt(l.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/F));for(C=0;C<c;C+=B){const J=this.getContext(C),V=s.setContext(J),Z=r.setContext(J),G=V.lineWidth,de=V.color,fe=Z.dash||[],ue=Z.dashOffset,Te=V.tickWidth,Ke=V.tickColor,Je=V.tickBorderDash||[],ft=V.tickBorderDashOffset;T=AT(this,C,a),T!==void 0&&(O=yl(i,T,G),u?E=I=P=R=O:L=A=N=z=O,m.push({tx1:E,ty1:L,tx2:I,ty2:A,x1:P,y1:N,x2:R,y2:z,width:G,color:de,borderDash:fe,borderDashOffset:ue,tickWidth:Te,tickColor:Ke,tickBorderDash:Je,tickBorderDashOffset:ft}))}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=Ts(i.grid),m=d+f,h=c?-f:m,g=-Tl(this.labelRotation),_=[];let y,S,C,T,O,E,L,I,A,P,N,R,z="middle";if(l==="top")E=this.bottom-h,L=this._getXAxisLabelAlignment();else if(l==="bottom")E=this.top+h,L=this._getXAxisLabelAlignment();else if(l==="left"){const B=this._getYAxisLabelAlignment(d);L=B.textAlign,O=B.x}else if(l==="right"){const B=this._getYAxisLabelAlignment(d);L=B.textAlign,O=B.x}else if(t==="x"){if(l==="center")E=(e.top+e.bottom)/2+m;else if(kt(l)){const B=Object.keys(l)[0],J=l[B];E=this.chart.scales[B].getPixelForValue(J)+m}L=this._getXAxisLabelAlignment()}else if(t==="y"){if(l==="center")O=(e.left+e.right)/2-m;else if(kt(l)){const B=Object.keys(l)[0],J=l[B];O=this.chart.scales[B].getPixelForValue(J)}L=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?z="top":a==="end"&&(z="bottom"));const F=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){C=r[y],T=C.label;const B=s.setContext(this.getContext(y));I=this.getPixelForTick(y)+s.labelOffset,A=this._resolveTickFontOptions(y),P=A.lineHeight,N=an(T)?T.length:1;const J=N/2,V=B.color,Z=B.textStrokeColor,G=B.textStrokeWidth;let de=L;o?(O=I,L==="inner"&&(y===S-1?de=this.options.reverse?"left":"right":y===0?de=this.options.reverse?"right":"left":de="center"),l==="top"?u==="near"||g!==0?R=-N*P+P/2:u==="center"?R=-F.highest.height/2-J*P+P:R=-F.highest.height+P/2:u==="near"||g!==0?R=P/2:u==="center"?R=F.highest.height/2-J*P:R=F.highest.height-N*P,c&&(R*=-1),g!==0&&!B.showLabelBackdrop&&(O+=P/2*Math.sin(g))):(E=I,R=(1-N)*P/2);let fe;if(B.showLabelBackdrop){const ue=ol(B.backdropPadding),Te=F.heights[y],Ke=F.widths[y];let Je=R-ue.top,ft=0-ue.left;switch(z){case"middle":Je-=Te/2;break;case"bottom":Je-=Te;break}switch(L){case"center":ft-=Ke/2;break;case"right":ft-=Ke;break;case"inner":y===S-1?ft-=Ke:y>0&&(ft-=Ke/2);break}fe={left:ft,top:Je,width:Ke+ue.width,height:Te+ue.height,color:B.backdropColor}}_.push({label:T,font:A,textOffset:R,options:{rotation:g,color:V,strokeColor:Z,strokeWidth:G,textAlign:de,textBaseline:z,translation:[O,E],backdrop:fe}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Tl(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=yl(e,this.left,o)-o/2,f=yl(e,this.right,r)+r/2,c=d=a):(c=yl(e,this.top,o)-o/2,d=yl(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&&Vu(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;Xc(i,u,0,f,a,r)}l&&Bu(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:l}}=this;if(!i.display)return;const s=Si(i.font),o=ol(i.padding),r=i.align;let a=s.lineHeight/2;t==="bottom"||t==="center"||kt(t)?(a+=o.bottom,an(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=qT(this,a,t,r);Xc(e,i.text,0,0,s,{color:i.color,maxWidth:c,rotation:d,textAlign:FT(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=Mt(e.grid&&e.grid.z,-1),l=Mt(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==ho.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;zT(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,HT(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 Il[i])}}function HT(n,e,t){const i=Gs(Object.create(null),[t?nn.get(t):{},nn.get(e),n.defaults]);nn.set(e,i),n.defaultRoutes&&jT(e,n.defaultRoutes),n.descriptors&&nn.describe(e,n.descriptors)}function jT(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 zT(n){return"id"in n&&"defaults"in n}class UT{constructor(){this.controllers=new zo(Fs,"datasets",!0),this.elements=new zo(Ll,"elements"),this.plugins=new zo(Object,"plugins"),this.scales=new zo(ho,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):_t(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=ju(e);ut(i["before"+l],[],i),t[e](i),ut(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 UT;class VT{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(ut(r,a,o)===!1&&l.cancelable)return!1}return!0}invalidate(){Gt(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=Mt(i.options&&i.options.plugins,{}),s=BT(i);return l===!1&&!t?[]:YT(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 BT(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 WT(n,e){return!e&&n===!1?null:n===!0?{}:n}function YT(n,{plugins:e,localIds:t},i,l){const s=[],o=n.getContext();for(const r of e){const a=r.id,u=WT(i[a],l);u!==null&&s.push({plugin:r,options:KT(n.config,{plugin:r,local:t[a]},u,o)})}return s}function KT(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 wd(n){if(n==="x"||n==="y"||n==="r")return n}function GT(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function eu(n,...e){if(wd(n))return n;for(const t of e){const i=t.axis||GT(t.position)||n.length>1&&wd(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Sd(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function XT(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 Sd(n,"x",t[0])||Sd(n,"y",t[0])}return{}}function QT(n,e){const t=Il[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(!kt(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=eu(o,r,XT(o,n),nn.scales[r.type]),u=ZT(a,l),f=t.scales||{};s[o]=Ps(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=(Il[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=JT(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),Ps(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];Ps(r,[nn.scales[r.type],nn.scale])}),s}function Ky(n){const e=n.options||(n.options={});e.plugins=Mt(e.plugins,{}),e.scales=QT(n,e)}function Jy(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function xT(n){return n=n||{},n.data=Jy(n.data),Ky(n),n}const Td=new Map,Zy=new Set;function Uo(n,e){let t=Td.get(n);return t||(t=e(),Td.set(n,t),Zy.add(t)),t}const Cs=(n,e,t)=>{const i=kr(e,t);i!==void 0&&n.add(i)};class eC{constructor(e){this._config=xT(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Jy(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(),Ky(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=>Cs(a,e,c))),f.forEach(c=>Cs(a,l,c)),f.forEach(c=>Cs(a,Il[s]||{},c)),f.forEach(c=>Cs(a,nn,c)),f.forEach(c=>Cs(a,Xa,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Zy.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Il[t]||{},nn.datasets[t]||{},{type:t},nn,Xa]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=Cd(this._resolverCache,e,l);let a=o;if(nC(o,t)){s.$shared=!1,i=ll(i)?i():i;const u=this.createResolver(e,i,r);a=ss(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=Cd(this._resolverCache,e,i);return kt(t)?ss(s,t,void 0,l):s}}function Cd(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:Wu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const tC=n=>kt(n)&&Object.getOwnPropertyNames(n).some(e=>ll(n[e]));function nC(n,e){const{isScriptable:t,isIndexable:i}=Iy(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(ll(r)||tC(r))||o&&an(r))return!0}return!1}var iC="4.4.7";const lC=["top","bottom","left","right","chartArea"];function $d(n,e){return n==="top"||n==="bottom"||lC.indexOf(n)===-1&&e==="x"}function Od(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Md(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ut(t&&t.onComplete,[n],e)}function sC(n){const e=n.chart,t=e.options.animation;ut(t&&t.onProgress,[n],e)}function Gy(n){return Ju()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const rr={},Ed=n=>{const e=Gy(n);return Object.values(rr).filter(t=>t.canvas===e).pop()};function oC(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 rC(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 aC(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),Dd()}static unregister(...e){bi.remove(...e),Dd()}constructor(e,t){const i=this.config=new eC(t),l=Gy(e),s=Ed(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||CT(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=m4(),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 VT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=P4(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}Pi.listen(this,"complete",Md),Pi.listen(this,"progress",sC),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Gt(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():td(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gc(this.canvas,this.ctx),this}stop(){return Pi.stop(this),this}resize(e,t){Pi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,td(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ut(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};_t(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=eu(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),_t(s,o=>{const r=o.options,a=r.id,u=eu(a,r),f=Mt(r.type,o.dtype);(r.position===void 0||$d(r.position,u)!==$d(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)}),_t(l,(o,r)=>{o||delete i[r]}),_t(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(Od("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(){_t(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||_t(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Od("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){_t(this.scales,e=>{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);(!Hc(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;oC(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(!Hc(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=[],_t(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,ll(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&&(Pi.has(this)?this.attached&&!Pi.running(this)&&Pi.start(this):(this.draw(),Md({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=aC(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Vu(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&&Bu(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ls(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=lT.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=Pl(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);vr(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Pi.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Gc(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)};_t(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){_t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},_t(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r<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}});!br(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=k4(e),u=rC(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ut(s.onHover,[e,r,this],this),a&&ut(s.onClick,[e,r,this],this));const f=!br(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)}}pt(vi,"defaults",nn),pt(vi,"instances",rr),pt(vi,"overrides",Il),pt(vi,"registry",bi),pt(vi,"version",iC),pt(vi,"getChart",Ed);function Dd(){return _t(vi.instances,n=>n._plugins.invalidate())}function Xy(n,e,t=e){n.lineCap=Mt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Mt(t.borderDash,e.borderDash)),n.lineDashOffset=Mt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Mt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Mt(t.borderWidth,e.borderWidth),n.strokeStyle=Mt(t.borderColor,e.borderColor)}function uC(n,e,t){n.lineTo(t.x,t.y)}function fC(n){return n.stepped?J4:n.tension||n.cubicInterpolationMode==="monotone"?Z4:uC}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 cC(n,e,t,i){const{points:l,options:s}=e,{count:o,start:r,loop:a,ilen:u}=Qy(l,t,i),f=fC(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 dC(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=T=>(o+(u?r-T:T))%s,C=()=>{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 T=m.x,O=m.y,E=T|0;E===h?(O<g?g=O:O>_&&(_=O),f=(c*f+T)/++c):(C(),n.lineTo(T,O),h=E,c=0,g=_=O),y=O}C()}function tu(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?dC:cC}function pC(n){return n.stepped?MS:n.tension||n.cubicInterpolationMode==="monotone"?ES:vl}function mC(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Xy(n,e.options),n.stroke(l)}function hC(n,e,t,i){const{segments:l,options:s}=e,o=tu(e);for(const r of l)Xy(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const _C=typeof Path2D=="function";function gC(n,e,t,i){_C&&!e.options.segment?mC(n,e,t,i):hC(n,e,t,i)}class Qi extends Ll{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;kS(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=FS(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=qy(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=pC(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 tu(this)(e,this,t,i)}path(e,t,i){const l=this.segments,s=tu(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(),gC(e,this,i,l),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}pt(Qi,"id","line"),pt(Qi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),pt(Qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),pt(Qi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Id(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 Ll{constructor(t){super();pt(this,"parsed");pt(this,"skip");pt(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 Id(this,t,"x",i)}inYRange(t,i){return Id(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||!ls(this,i,this.size(l)/2)||(t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.fillStyle=l.backgroundColor,Qa(t,l,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}pt(ar,"id","point"),pt(ar,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),pt(ar,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function bC(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=Xu(a,u,l);const f=nu(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=qy(e,f);for(const d of c){const m=nu(t,s[d.start],s[d.end],d.loop),h=Fy(r,l,m);for(const g of h)o.push({source:g,target:d,start:{[t]:Ld(f,m,"start",Math.max)},end:{[t]:Ld(f,m,"end",Math.min)}})}}return o}function nu(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 yC(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Xu(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 Xu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Ld(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function xy(n,e){let t=[],i=!1;return an(n)?(i=!0,t=n):t=yC(n,e),t.length?new Qi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function Ad(n){return n&&n.fill!==!1}function kC(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(!yn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function vC(n,e,t){const i=CC(n);if(kt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return yn(l)&&Math.floor(l)===l?wC(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function wC(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function SC(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:kt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function TC(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:kt(n)?i=n.value:i=e.getBaseValue(),i}function CC(n){const e=n.options,t=e.fill;let i=Mt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function $C(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=OC(e,t);r.push(xy({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++)MC(l,o[f],r)}return new Qi({points:l,options:{}})}function OC(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 MC(n,e,t){const i=[];for(let l=0;l<t.length;l++){const s=t[l],{first:o,last:r,point:a}=EC(s,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function EC(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(Sy(l,c,d)){r=l===c,a=l===d;break}}return{first:r,last:a,point:i}}class ek{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 DC(n){const{chart:e,fill:t,line:i}=n;if(yn(t))return IC(e,t);if(t==="stack")return $C(n);if(t==="shape")return!0;const l=LC(n);return l instanceof ek?l:xy(l,i)}function IC(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function LC(n){return(n.scale||{}).getPointPositionForValue?PC(n):AC(n)}function AC(n){const{scale:e={},fill:t}=n,i=SC(t,e);if(yn(i)){const l=e.isHorizontal();return{x:l?i:null,y:l?null:i}}return null}function PC(n){const{scale:e,fill:t}=n,i=e.options,l=e.getLabels().length,s=i.reverse?e.max:e.min,o=TC(t,e,s),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,s);return new ek({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 ya(n,e,t){const i=DC(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&&(Vu(n,t),NC(n,{line:l,target:i,above:f,below:c,area:t,scale:s,axis:o}),Bu(n))}function NC(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&&(Pd(n,i,o.top),Nd(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore(),n.save(),Pd(n,i,o.bottom)),Nd(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore()}function Pd(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[Xu(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 Nd(n,e){const{line:t,target:i,property:l,color:s,scale:o}=e,r=bC(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,RC(n,o,m&&nu(l,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(m){h?n.closePath():Rd(n,i,c,l);const _=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&_,g||Rd(n,i,f,l)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function RC(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 Rd(n,e,t,i){const l=e.interpolate(t,i);l&&n.lineTo(l.x,l.y)}var FC={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 Qi&&(a={visible:n.isDatasetVisible(o),index:o,fill:vC(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=kC(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&&ya(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;Ad(s)&&ya(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!Ad(i)||t.drawTime!=="beforeDatasetDraw"||ya(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ds={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=Ga(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&&(an(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function Ni(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
 `)>-1?n.split(`
-`):n}function RC(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 Rd(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=ol(e.padding);let g=h.height,_=0,y=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,C),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,C),_t(T.lines,C),_t(T.after,C)}),S=0,t.font=f.string,_t(n.footer,C),t.restore(),_+=h.width,{width:_,height:g}}function FC(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function qC(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 HC(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"),qC(u,n,e,t)&&(u="center"),u}function Fd(n,e,t){const i=t.yAlign||e.yAlign||FC(n,t);return{xAlign:t.xAlign||e.xAlign||HC(n,e,t,i),yAlign:i}}function jC(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function zC(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function qd(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=jC(e,r);const g=zC(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:fi(h,0,i.width-e.width),y:fi(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Hd(n){return gi([],Ni(n))}function UC(n,e,t){return Pl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function jd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const ek={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Ai,beforeBody:Ai,beforeLabel:Ai,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 Gt(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:Ai,afterBody:Ai,beforeFooter:Ai,footer:Ai,afterFooter:Ai};function In(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?ek[e].call(t,i):l}class nu extends Ll{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 qy(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=UC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}getBeforeBody(e,t){return Hd(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=jd(i,s);gi(o.before,Ni(In(r,"beforeLabel",this,s))),gi(o.lines,In(r,"label",this,s)),gi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return Hd(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(RC(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))),_t(r,f=>{const c=jd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ds[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=Rd(this,i),u=Object.assign({},r,a),f=Fd(this.chart,i,u),c=qd(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,C,T,O;return s==="center"?(T=m+g/2,l==="left"?(_=d,y=_-o,C=T+o,O=T-o):(_=d+h,y=_+o,C=T-o,O=T+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"?(C=m,T=C-o,_=y-o,S=y+o):(C=m+g,T=C+o,_=y+o,S=y-o),O=C),{x1:_,x2:y,x3:S,y1:C,y2:T,y3:O}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=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,Xa(e,g,_,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Xa(e,g,_,y)}else{e.lineWidth=kt(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,C,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T<E;++T){for(y=l[T],S=this.labelTextColors[T],t.fillStyle=S,_t(y.before,g),C=y.lines,r&&C.length&&(this._drawColorBox(t,e,T,h,i),d=Math.max(c.lineHeight,a)),O=0,L=C.length;O<L;++O)g(C[O]),d=c.lineHeight;_t(y.after,g)}m=0,d=c.lineHeight,_t(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=Ds[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Rd(this,e),a=Object.assign({},o,this._size),u=Fd(t,e,a),f=qd(e,a,u,t);(l._to!==f.x||s._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),DS(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),IS(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=!br(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||!br(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=Ds[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}pt(nu,"positioners",Ds);var VC={id:"tooltip",_element:nu,positioners:Ds,afterInit(n,e,t){t&&(n.tooltip=new nu({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:ek},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 BC(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=!Gt(o),S=!Gt(r),C=!Gt(u),T=(_-g)/(c+1);let O=jc((_-g)/h/m)*m,E,L,I,A;if(O<1e-14&&!y&&!S)return[{value:g},{value:_}];A=Math.ceil(_/O)-Math.floor(g/O),A>h&&(O=jc(A*O/h/m)*m),Gt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),l==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(_/O)*O):(L=g,I=_),y&&S&&s&&w4((r-o)/s,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):C?(L=y?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ol(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(zc(O),zc(L));E=Math.pow(10,Gt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(y&&(d&&L!==o?(t.push({value:o}),L<o&&N++,Ol(Math.round((L+N*O)*E)/E,o,zd(o,T,n))&&N++):L<o&&N++);N<A;++N){const R=Math.round((L+N*O)*E)/E;if(S&&R>r)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ol(t[t.length-1].value,r,zd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function zd(n,e,{horizontal:t,minRotation:i}){const l=Tl(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class WC extends ho{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 Gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=BC(l,s);return e.bounds==="ticks"&&S4(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 $y(e,this.chart.options.locale,this.options.ticks.format)}}class iu extends WC{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=yn(e)?e:0,this.max=yn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Tl(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}}pt(iu,"id","linear"),pt(iu,"defaults",{ticks:{callback:My.formatters.numeric}});const zr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(zr);function Ud(n,e){return n-e}function Vd(n,e){if(Gt(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)),yn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Bd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s<l-1;++s){const o=zr[Nn[s]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return Nn[s]}return Nn[l-1]}function YC(n,e,t,i,l){for(let s=Nn.length-1;s>=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function KC(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e<t;++e)if(zr[Nn[e]].common)return Nn[e]}function Wd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:l}=ju(t,e),s=t[i]>=e?t[i]:t[l];n[s]=!0}}function JC(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 Yd(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:JC(n,i,l,t)}class xs extends ho{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 jy._date(e.adapters.date);l.init(t),Ps(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:Vd(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=yn(l)&&!isNaN(l)?l:+t.startOf(Date.now(),i),s=yn(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=E4(l,s,o);return this._unit=t.unit||(i.autoSkip?Bd(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):YC(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:KC(this._unit),this.initOffsets(l),e.reverse&&r.reverse(),Yd(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=fi(t,0,o),i=fi(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||Bd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Mt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d<i;d=+e.add(d,r,o),m++)Wd(f,d,h);return(d===i||l.bounds==="ticks"||m===1)&&Wd(f,d,h),Object.keys(f).sort(Ud).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 ut(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=Tl(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,Yd(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(Vd(this,l[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return I4(e.sort(Ud))}}pt(xs,"id","time"),pt(xs,"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 Kd extends xs{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)}}pt(Kd,"id","timeseries"),pt(Kd,"defaults",xs.defaults);/*!
+`):n}function qC(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 Fd(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=ol(e.padding);let g=h.height,_=0,y=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,_t(n.title,C),t.font=a.string,_t(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,_t(i,T=>{_t(T.before,C),_t(T.lines,C),_t(T.after,C)}),S=0,t.font=f.string,_t(n.footer,C),t.restore(),_+=h.width,{width:_,height:g}}function HC(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function jC(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 zC(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"),jC(u,n,e,t)&&(u="center"),u}function qd(n,e,t){const i=t.yAlign||e.yAlign||HC(n,t);return{xAlign:t.xAlign||e.xAlign||zC(n,e,t,i),yAlign:i}}function UC(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function VC(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function Hd(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=UC(e,r);const g=VC(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:fi(h,0,i.width-e.width),y:fi(g,0,i.height-e.height)}}function Bo(n,e,t){const i=ol(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function jd(n){return gi([],Ni(n))}function BC(n,e,t){return Pl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function zd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const tk={beforeTitle:Ai,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:Ai,beforeBody:Ai,beforeLabel:Ai,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 Gt(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:Ai,afterBody:Ai,beforeFooter:Ai,footer:Ai,afterFooter:Ai};function In(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?tk[e].call(t,i):l}class iu extends Ll{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 Hy(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=BC(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=In(i,"beforeTitle",this,e),s=In(i,"title",this,e),o=In(i,"afterTitle",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}getBeforeBody(e,t){return jd(In(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return _t(e,s=>{const o={before:[],lines:[],after:[]},r=zd(i,s);gi(o.before,Ni(In(r,"beforeLabel",this,s))),gi(o.lines,In(r,"label",this,s)),gi(o.after,Ni(In(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return jd(In(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=In(i,"beforeFooter",this,e),s=In(i,"footer",this,e),o=In(i,"afterFooter",this,e);let r=[];return r=gi(r,Ni(l)),r=gi(r,Ni(s)),r=gi(r,Ni(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(qC(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))),_t(r,f=>{const c=zd(e.callbacks,f);l.push(In(c,"labelColor",this,f)),s.push(In(c,"labelPointStyle",this,f)),o.push(In(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ds[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=Fd(this,i),u=Object.assign({},r,a),f=qd(this.chart,i,u),c=Hd(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,C,T,O;return s==="center"?(T=m+g/2,l==="left"?(_=d,y=_-o,C=T+o,O=T-o):(_=d+h,y=_+o,C=T-o,O=T+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"?(C=m,T=C-o,_=y-o,S=y+o):(C=m+g,T=C+o,_=y+o,S=y-o),O=C),{x1:_,x2:y,x3:S,y1:C,y2:T,y3:O}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=da(i.rtl,this.x,this.width);for(e.x=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,Qa(e,g,_,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qa(e,g,_,y)}else{e.lineWidth=kt(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,Qc(e,{x:g,y:h,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Qc(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,C,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Bo(this,_,i),t.fillStyle=i.bodyColor,_t(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=l.length;T<E;++T){for(y=l[T],S=this.labelTextColors[T],t.fillStyle=S,_t(y.before,g),C=y.lines,r&&C.length&&(this._drawColorBox(t,e,T,h,i),d=Math.max(c.lineHeight,a)),O=0,L=C.length;O<L;++O)g(C[O]),d=c.lineHeight;_t(y.after,g)}m=0,d=c.lineHeight,_t(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=Ds[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Fd(this,e),a=Object.assign({},o,this._size),u=qd(t,e,a),f=Hd(e,a,u,t);(l._to!==f.x||s._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=ol(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),LS(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),AS(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=!br(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||!br(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=Ds[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}pt(iu,"positioners",Ds);var WC={id:"tooltip",_element:iu,positioners:Ds,afterInit(n,e,t){t&&(n.tooltip=new iu({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:tk},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 YC(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=!Gt(o),S=!Gt(r),C=!Gt(u),T=(_-g)/(c+1);let O=zc((_-g)/h/m)*m,E,L,I,A;if(O<1e-14&&!y&&!S)return[{value:g},{value:_}];A=Math.ceil(_/O)-Math.floor(g/O),A>h&&(O=zc(A*O/h/m)*m),Gt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),l==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(_/O)*O):(L=g,I=_),y&&S&&s&&T4((r-o)/s,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):C?(L=y?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ol(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Uc(O),Uc(L));E=Math.pow(10,Gt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(y&&(d&&L!==o?(t.push({value:o}),L<o&&N++,Ol(Math.round((L+N*O)*E)/E,o,Ud(o,T,n))&&N++):L<o&&N++);N<A;++N){const R=Math.round((L+N*O)*E)/E;if(S&&R>r)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ol(t[t.length-1].value,r,Ud(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function Ud(n,e,{horizontal:t,minRotation:i}){const l=Tl(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class KC extends ho{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 Gt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=sl(l),u=sl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=YC(l,s);return e.bounds==="ticks"&&C4(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 Oy(e,this.chart.options.locale,this.options.ticks.format)}}class lu extends KC{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=yn(e)?e:0,this.max=yn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Tl(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}}pt(lu,"id","linear"),pt(lu,"defaults",{ticks:{callback:Ey.formatters.numeric}});const zr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nn=Object.keys(zr);function Vd(n,e){return n-e}function Bd(n,e){if(Gt(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)),yn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Xs(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Wd(n,e,t,i){const l=Nn.length;for(let s=Nn.indexOf(n);s<l-1;++s){const o=zr[Nn[s]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return Nn[s]}return Nn[l-1]}function JC(n,e,t,i,l){for(let s=Nn.length-1;s>=Nn.indexOf(t);s--){const o=Nn[s];if(zr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return Nn[t?Nn.indexOf(t):0]}function ZC(n){for(let e=Nn.indexOf(n)+1,t=Nn.length;e<t;++e)if(zr[Nn[e]].common)return Nn[e]}function Yd(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:l}=zu(t,e),s=t[i]>=e?t[i]:t[l];n[s]=!0}}function GC(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 Kd(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:GC(n,i,l,t)}class xs extends ho{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 zy._date(e.adapters.date);l.init(t),Ps(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:Bd(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=yn(l)&&!isNaN(l)?l:+t.startOf(Date.now(),i),s=yn(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=I4(l,s,o);return this._unit=t.unit||(i.autoSkip?Wd(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):JC(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:ZC(this._unit),this.initOffsets(l),e.reverse&&r.reverse(),Kd(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=fi(t,0,o),i=fi(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||Wd(s.minUnit,t,i,this._getLabelCapacity(t)),r=Mt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Xs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d<i;d=+e.add(d,r,o),m++)Yd(f,d,h);return(d===i||l.bounds==="ticks"||m===1)&&Yd(f,d,h),Object.keys(f).sort(Vd).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 ut(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=Tl(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,Kd(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(Bd(this,l[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return A4(e.sort(Vd))}}pt(xs,"id","time"),pt(xs,"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 Jd extends xs{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)}}pt(Jd,"id","timeseries"),pt(Jd,"defaults",xs.defaults);/*!
  * chartjs-adapter-luxon v1.3.1
  * https://www.chartjs.org
  * (c) 2023 chartjs-adapter-luxon Contributors
  * Released under the MIT license
- */const ZC={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};jy._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return ZC},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function GC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tk={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
+ */const XC={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};zy._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return XC},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function QC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nk={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
  * http://hammerjs.github.io/
  *
  * Copyright (c) 2016 Jorik Tangelder;
  * Licensed under the MIT license */(function(n){(function(e,t,i,l){var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ne){return setTimeout(C(K,ne),Q)}function d(K,Q,ne){return Array.isArray(K)?(m(K,ne[Q],ne),!0):!1}function m(K,Q,ne){var me;if(K)if(K.forEach)K.forEach(Q,ne);else if(K.length!==l)for(me=0;me<K.length;)Q.call(ne,K[me],me,K),me++;else for(me in K)K.hasOwnProperty(me)&&Q.call(ne,K[me],me,K)}function h(K,Q,ne){var me="DEPRECATED METHOD: "+Q+`
 `+ne+` AT 
-`;return function(){var Ae=new Error("get-stack-trace"),Ze=Ae&&Ae.stack?Ae.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me<arguments.length;me++){var Ae=arguments[me];if(Ae!==l&&Ae!==null)for(var Ze in Ae)Ae.hasOwnProperty(Ze)&&(ne[Ze]=Ae[Ze])}return ne}:g=Object.assign;var _=h(function(Q,ne,me){for(var Ae=Object.keys(ne),Ze=0;Ze<Ae.length;)(!me||me&&Q[Ae[Ze]]===l)&&(Q[Ae[Ze]]=ne[Ae[Ze]]),Ze++;return Q},"extend","Use `assign`."),y=h(function(Q,ne){return _(Q,ne,!0)},"merge","Use `assign`.");function S(K,Q,ne){var me=Q.prototype,Ae;Ae=K.prototype=Object.create(me),Ae.constructor=K,Ae._super=me,ne&&g(Ae,ne)}function C(K,Q){return function(){return K.apply(Q,arguments)}}function T(K,Q){return typeof K==r?K.apply(Q&&Q[0]||l,Q):K}function O(K,Q){return K===l?Q:K}function E(K,Q,ne){m(P(Q),function(me){K.addEventListener(me,ne,!1)})}function L(K,Q,ne){m(P(Q),function(me){K.removeEventListener(me,ne,!1)})}function I(K,Q){for(;K;){if(K==Q)return!0;K=K.parentNode}return!1}function A(K,Q){return K.indexOf(Q)>-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;me<K.length;){if(ne&&K[me][ne]==Q||!ne&&K[me]===Q)return me;me++}return-1}function R(K){return Array.prototype.slice.call(K,0)}function z(K,Q,ne){for(var me=[],Ae=[],Ze=0;Ze<K.length;){var ht=K[Ze][Q];N(Ae,ht)<0&&me.push(K[Ze]),Ae[Ze]=ht,Ze++}return me=me.sort(function(cn,Tn){return cn[Q]>Tn[Q]}),me}function F(K,Q){for(var ne,me,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze<s.length;){if(ne=s[Ze],me=ne?ne+Ae:Q,me in K)return me;Ze++}return l}var B=1;function J(){return B++}function V(K){var Q=K.ownerDocument||K;return Q.defaultView||Q.parentWindow||e}var Z=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in e,de=F(e,"PointerEvent")!==l,fe=G&&Z.test(navigator.userAgent),ue="touch",Te="pen",Ke="mouse",Je="kinect",ft=25,et=1,xe=2,We=4,at=8,jt=1,Ve=2,Ee=4,st=8,De=16,Ye=Ve|Ee,ke=st|De,$e=Ye|ke,ct=["x","y"],Ht=["clientX","clientY"];function Le(K,Q){var ne=this;this.manager=K,this.callback=Q,this.element=K.element,this.target=K.options.inputTarget,this.domHandler=function(me){T(K.options.enable,[K])&&ne.handler(me)},this.init()}Le.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(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(V(this.element),this.evWin,this.domHandler)}};function ot(K){var Q,ne=K.options.inputClass;return ne?Q=ne:de?Q=cl:fe?Q=se:G?Q=Ge:Q=zi,new Q(K,on)}function on(K,Q,ne){var me=ne.pointers.length,Ae=ne.changedPointers.length,Ze=Q&et&&me-Ae===0,ht=Q&(We|at)&&me-Ae===0;ne.isFirst=!!Ze,ne.isFinal=!!ht,Ze&&(K.session={}),ne.eventType=Q,En(K,ne),K.emit("hammer.input",ne),K.recognize(ne),K.session.prevInput=ne}function En(K,Q){var ne=K.session,me=Q.pointers,Ae=me.length;ne.firstInput||(ne.firstInput=Yt(Q)),Ae>1&&!ne.firstMultiple?ne.firstMultiple=Yt(Q):Ae===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ze.center,cn=Q.center=vn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=bt(rn,cn),Q.distance=li(rn,cn),Re(ne,Q),Q.offsetDirection=Oi(Q.deltaX,Q.deltaY);var Tn=fn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Tn.x,Q.overallVelocityY=Tn.y,Q.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,Q.scale=ht?sn(ht.pointers,me):1,Q.rotation=ht?wn(ht.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,Ft(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=Q.srcEvent.target),Q.target=hi}function Re(K,Q){var ne=Q.center,me=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===We)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},me=K.offsetDelta={x:ne.x,y:ne.y}),Q.deltaX=Ae.x+(ne.x-me.x),Q.deltaY=Ae.y+(ne.y-me.y)}function Ft(K,Q){var ne=K.lastInterval||Q,me=Q.timeStamp-ne.timeStamp,Ae,Ze,ht,rn;if(Q.eventType!=at&&(me>ft||ne.velocity===l)){var cn=Q.deltaX-ne.deltaX,Tn=Q.deltaY-ne.deltaY,hi=fn(me,cn,Tn);Ze=hi.x,ht=hi.y,Ae=u(hi.x)>u(hi.y)?hi.x:hi.y,rn=Oi(cn,Tn),K.lastInterval=Q}else Ae=ne.velocity,Ze=ne.velocityX,ht=ne.velocityY,rn=ne.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=ht,Q.direction=rn}function Yt(K){for(var Q=[],ne=0;ne<K.pointers.length;)Q[ne]={clientX:a(K.pointers[ne].clientX),clientY:a(K.pointers[ne].clientY)},ne++;return{timeStamp:f(),pointers:Q,center:vn(Q),deltaX:K.deltaX,deltaY:K.deltaY}}function vn(K){var Q=K.length;if(Q===1)return{x:a(K[0].clientX),y:a(K[0].clientY)};for(var ne=0,me=0,Ae=0;Ae<Q;)ne+=K[Ae].clientX,me+=K[Ae].clientY,Ae++;return{x:a(ne/Q),y:a(me/Q)}}function fn(K,Q,ne){return{x:Q/K||0,y:ne/K||0}}function Oi(K,Q){return K===Q?jt:u(K)>=u(Q)?K<0?Ve:Ee:Q<0?st:De}function li(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.sqrt(me*me+Ae*Ae)}function bt(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.atan2(Ae,me)*180/Math.PI}function wn(K,Q){return bt(Q[1],Q[0],Ht)+bt(K[1],K[0],Ht)}function sn(K,Q){return li(Q[0],Q[1],Ht)/li(K[0],K[1],Ht)}var Dt={mousedown:et,mousemove:xe,mouseup:We},Mi="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Mi,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(Q){var ne=Dt[Q.type];ne&et&&Q.button===0&&(this.pressed=!0),ne&xe&&Q.which!==1&&(ne=We),this.pressed&&(ne&We&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[Q],changedPointers:[Q],pointerType:Ke,srcEvent:Q}))}});var Ui={pointerdown:et,pointermove:xe,pointerup:We,pointercancel:at,pointerout:at},fl={2:ue,3:Te,4:Ke,5:Je},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(Q){var ne=this.store,me=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Ui[Ae],ht=fl[Q.pointerType]||Q.pointerType,rn=ht==ue,cn=N(ne,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||rn)?cn<0&&(ne.push(Q),cn=ne.length-1):Ze&(We|at)&&(me=!0),!(cn<0)&&(ne[cn]=Q,this.callback(this.manager,Ze,{pointers:ne,changedPointers:[Q],pointerType:ht,srcEvent:Q}),me&&ne.splice(cn,1))}});var X={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},x="touchstart",le="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=x,this.evWin=le,this.started=!1,Le.apply(this,arguments)}S(ge,Le,{handler:function(Q){var ne=X[Q.type];if(ne===et&&(this.started=!0),!!this.started){var me=Fe.call(this,Q,ne);ne&(We|at)&&me[0].length-me[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}}});function Fe(K,Q){var ne=R(K.touches),me=R(K.changedTouches);return Q&(We|at)&&(ne=z(ne.concat(me),"identifier")),[ne,me]}var Be={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},rt="touchstart touchmove touchend touchcancel";function se(){this.evTarget=rt,this.targetIds={},Le.apply(this,arguments)}S(se,Le,{handler:function(Q){var ne=Be[Q.type],me=Oe.call(this,Q,ne);me&&this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}});function Oe(K,Q){var ne=R(K.touches),me=this.targetIds;if(Q&(et|xe)&&ne.length===1)return me[ne[0].identifier]=!0,[ne,ne];var Ae,Ze,ht=R(K.changedTouches),rn=[],cn=this.target;if(Ze=ne.filter(function(Tn){return I(Tn.target,cn)}),Q===et)for(Ae=0;Ae<Ze.length;)me[Ze[Ae].identifier]=!0,Ae++;for(Ae=0;Ae<ht.length;)me[ht[Ae].identifier]&&rn.push(ht[Ae]),Q&(We|at)&&delete me[ht[Ae].identifier],Ae++;if(rn.length)return[z(Ze.concat(rn),"identifier"),rn]}var Ne=2500,ze=25;function Ge(){Le.apply(this,arguments);var K=C(this.handler,this);this.touch=new se(this.manager,K),this.mouse=new zi(this.manager,K),this.primaryTouch=null,this.lastTouches=[]}S(Ge,Le,{handler:function(Q,ne,me){var Ae=me.pointerType==ue,Ze=me.pointerType==Ke;if(!(Ze&&me.sourceCapabilities&&me.sourceCapabilities.firesTouchEvents)){if(Ae)Qt.call(this,ne,me);else if(Ze&&Sn.call(this,me))return;this.callback(Q,ne,me)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Qt(K,Q){K&et?(this.primaryTouch=Q.changedPointers[0].identifier,qt.call(this,Q)):K&(We|at)&&qt.call(this,Q)}function qt(K){var Q=K.changedPointers[0];if(Q.identifier===this.primaryTouch){var ne={x:Q.clientX,y:Q.clientY};this.lastTouches.push(ne);var me=this.lastTouches,Ae=function(){var Ze=me.indexOf(ne);Ze>-1&&me.splice(Ze,1)};setTimeout(Ae,Ne)}}function Sn(K){for(var Q=K.srcEvent.clientX,ne=K.srcEvent.clientY,me=0;me<this.lastTouches.length;me++){var Ae=this.lastTouches[me],Ze=Math.abs(Q-Ae.x),ht=Math.abs(ne-Ae.y);if(Ze<=ze&&ht<=ze)return!0}return!1}var Ei=F(o.style,"touchAction"),go=Ei!==l,Fl="compute",bo="auto",_s="manipulation",Di="none",dl="pan-x",pl="pan-y",ql=Ck();function gs(K,Q){this.manager=K,this.set(Q)}gs.prototype={set:function(K){K==Fl&&(K=this.compute()),go&&this.manager.element.style&&ql[K]&&(this.manager.element.style[Ei]=K),this.actions=K.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var K=[];return m(this.manager.recognizers,function(Q){T(Q.options.enable,[Q])&&(K=K.concat(Q.getTouchAction()))}),Vr(K.join(" "))},preventDefaults:function(K){var Q=K.srcEvent,ne=K.offsetDirection;if(this.manager.session.prevented){Q.preventDefault();return}var me=this.actions,Ae=A(me,Di)&&!ql[Di],Ze=A(me,pl)&&!ql[pl],ht=A(me,dl)&&!ql[dl];if(Ae){var rn=K.pointers.length===1,cn=K.distance<2,Tn=K.deltaTime<250;if(rn&&cn&&Tn)return}if(!(ht&&Ze)&&(Ae||Ze&&ne&Ye||ht&&ne&ke))return this.preventSrc(Q)},preventSrc:function(K){this.manager.session.prevented=!0,K.preventDefault()}};function Vr(K){if(A(K,Di))return Di;var Q=A(K,dl),ne=A(K,pl);return Q&&ne?Di:Q||ne?Q?dl:pl:A(K,_s)?_s:bo}function Ck(){if(!go)return!1;var K={},Q=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ne){K[ne]=Q?e.CSS.supports("touch-action",ne):!0}),K}var yo=1,Kn=2,Hl=4,Vi=8,Ii=Vi,bs=16,mi=32;function Li(K){this.options=g({},this.defaults,K||{}),this.id=J(),this.manager=null,this.options.enable=O(this.options.enable,!0),this.state=yo,this.simultaneous={},this.requireFail=[]}Li.prototype={defaults:{},set:function(K){return g(this.options,K),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(K){if(d(K,"recognizeWith",this))return this;var Q=this.simultaneous;return K=ko(K,this),Q[K.id]||(Q[K.id]=K,K.recognizeWith(this)),this},dropRecognizeWith:function(K){return d(K,"dropRecognizeWith",this)?this:(K=ko(K,this),delete this.simultaneous[K.id],this)},requireFailure:function(K){if(d(K,"requireFailure",this))return this;var Q=this.requireFail;return K=ko(K,this),N(Q,K)===-1&&(Q.push(K),K.requireFailure(this)),this},dropRequireFailure:function(K){if(d(K,"dropRequireFailure",this))return this;K=ko(K,this);var Q=N(this.requireFail,K);return Q>-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(K){return!!this.simultaneous[K.id]},emit:function(K){var Q=this,ne=this.state;function me(Ae){Q.manager.emit(Ae,K)}ne<Vi&&me(Q.options.event+af(ne)),me(Q.options.event),K.additionalEvent&&me(K.additionalEvent),ne>=Vi&&me(Q.options.event+af(ne))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=mi},canEmit:function(){for(var K=0;K<this.requireFail.length;){if(!(this.requireFail[K].state&(mi|yo)))return!1;K++}return!0},recognize:function(K){var Q=g({},K);if(!T(this.options.enable,[this,Q])){this.reset(),this.state=mi;return}this.state&(Ii|bs|mi)&&(this.state=yo),this.state=this.process(Q),this.state&(Kn|Hl|Vi|bs)&&this.tryEmit(Q)},process:function(K){},getTouchAction:function(){},reset:function(){}};function af(K){return K&bs?"cancel":K&Vi?"end":K&Hl?"move":K&Kn?"start":""}function uf(K){return K==De?"down":K==st?"up":K==Ve?"left":K==Ee?"right":""}function ko(K,Q){var ne=Q.manager;return ne?ne.get(K):K}function si(){Li.apply(this,arguments)}S(si,Li,{defaults:{pointers:1},attrTest:function(K){var Q=this.options.pointers;return Q===0||K.pointers.length===Q},process:function(K){var Q=this.state,ne=K.eventType,me=Q&(Kn|Hl),Ae=this.attrTest(K);return me&&(ne&at||!Ae)?Q|bs:me||Ae?ne&We?Q|Vi:Q&Kn?Q|Hl:Kn:mi}});function vo(){si.apply(this,arguments),this.pX=null,this.pY=null}S(vo,si,{defaults:{event:"pan",threshold:10,pointers:1,direction:$e},getTouchAction:function(){var K=this.options.direction,Q=[];return K&Ye&&Q.push(pl),K&ke&&Q.push(dl),Q},directionTest:function(K){var Q=this.options,ne=!0,me=K.distance,Ae=K.direction,Ze=K.deltaX,ht=K.deltaY;return Ae&Q.direction||(Q.direction&Ye?(Ae=Ze===0?jt:Ze<0?Ve:Ee,ne=Ze!=this.pX,me=Math.abs(K.deltaX)):(Ae=ht===0?jt:ht<0?st:De,ne=ht!=this.pY,me=Math.abs(K.deltaY))),K.direction=Ae,ne&&me>Q.threshold&&Ae&Q.direction},attrTest:function(K){return si.prototype.attrTest.call(this,K)&&(this.state&Kn||!(this.state&Kn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=uf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){si.apply(this,arguments)}S(Br,si,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Kn)},emit:function(K){if(K.scale!==1){var Q=K.scale<1?"in":"out";K.additionalEvent=this.options.event+Q}this._super.emit.call(this,K)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distance<Q.threshold,Ae=K.deltaTime>Q.time;if(this._input=K,!me||!ne||K.eventType&(We|at)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.time,this);else if(K.eventType&We)return Ii;return mi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Ii&&(K&&K.eventType&We?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){si.apply(this,arguments)}S(Yr,si,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Kn)}});function Kr(){si.apply(this,arguments)}S(Kr,si,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ye|ke,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ne;return Q&(Ye|ke)?ne=K.overallVelocity:Q&Ye?ne=K.overallVelocityX:Q&ke&&(ne=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&K.eventType&We},emit:function(K){var Q=uf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_s]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distance<Q.threshold,Ae=K.deltaTime<Q.time;if(this.reset(),K.eventType&et&&this.count===0)return this.failTimeout();if(me&&Ae&&ne){if(K.eventType!=We)return this.failTimeout();var Ze=this.pTime?K.timeStamp-this.pTime<Q.interval:!0,ht=!this.pCenter||li(this.pCenter,K.center)<Q.posThreshold;this.pTime=K.timeStamp,this.pCenter=K.center,!ht||!Ze?this.count=1:this.count+=1,this._input=K;var rn=this.count%Q.taps;if(rn===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.interval,this),Kn):Ii}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==Ii&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Bi(K,Q){return Q=Q||{},Q.recognizers=O(Q.recognizers,Bi.defaults.preset),new Jr(K,Q)}Bi.VERSION="2.0.7",Bi.defaults={domEvents:!1,touchAction:Fl,enable:!0,inputTarget:null,inputClass:null,preset:[[Yr,{enable:!1}],[Br,{enable:!1},["rotate"]],[Kr,{direction:Ye}],[vo,{direction:Ye},["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 $k=1,ff=2;function Jr(K,Q){this.options=g({},Bi.defaults,Q||{}),this.options.inputTarget=this.options.inputTarget||K,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=K,this.input=ot(this),this.touchAction=new gs(this,this.options.touchAction),cf(this,!0),m(this.options.recognizers,function(ne){var me=this.add(new ne[0](ne[1]));ne[2]&&me.recognizeWith(ne[2]),ne[3]&&me.requireFailure(ne[3])},this)}Jr.prototype={set:function(K){return g(this.options,K),K.touchAction&&this.touchAction.update(),K.inputTarget&&(this.input.destroy(),this.input.target=K.inputTarget,this.input.init()),this},stop:function(K){this.session.stopped=K?ff:$k},recognize:function(K){var Q=this.session;if(!Q.stopped){this.touchAction.preventDefaults(K);var ne,me=this.recognizers,Ae=Q.curRecognizer;(!Ae||Ae&&Ae.state&Ii)&&(Ae=Q.curRecognizer=null);for(var Ze=0;Ze<me.length;)ne=me[Ze],Q.stopped!==ff&&(!Ae||ne==Ae||ne.canRecognizeWith(Ae))?ne.recognize(K):ne.reset(),!Ae&&ne.state&(Kn|Hl|Vi)&&(Ae=Q.curRecognizer=ne),Ze++}},get:function(K){if(K instanceof Li)return K;for(var Q=this.recognizers,ne=0;ne<Q.length;ne++)if(Q[ne].options.event==K)return Q[ne];return null},add:function(K){if(d(K,"add",this))return this;var Q=this.get(K.options.event);return Q&&this.remove(Q),this.recognizers.push(K),K.manager=this,this.touchAction.update(),K},remove:function(K){if(d(K,"remove",this))return this;if(K=this.get(K),K){var Q=this.recognizers,ne=N(Q,K);ne!==-1&&(Q.splice(ne,1),this.touchAction.update())}return this},on:function(K,Q){if(K!==l&&Q!==l){var ne=this.handlers;return m(P(K),function(me){ne[me]=ne[me]||[],ne[me].push(Q)}),this}},off:function(K,Q){if(K!==l){var ne=this.handlers;return m(P(K),function(me){Q?ne[me]&&ne[me].splice(N(ne[me],Q),1):delete ne[me]}),this}},emit:function(K,Q){this.options.domEvents&&Ok(K,Q);var ne=this.handlers[K]&&this.handlers[K].slice();if(!(!ne||!ne.length)){Q.type=K,Q.preventDefault=function(){Q.srcEvent.preventDefault()};for(var me=0;me<ne.length;)ne[me](Q),me++}},destroy:function(){this.element&&cf(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function cf(K,Q){var ne=K.element;if(ne.style){var me;m(K.options.cssProps,function(Ae,Ze){me=F(ne.style,Ze),Q?(K.oldCssProps[me]=ne.style[me],ne.style[me]=Ae):ne.style[me]=K.oldCssProps[me]||""}),Q||(K.oldCssProps={})}}function Ok(K,Q){var ne=t.createEvent("Event");ne.initEvent(K,!0,!0),ne.gesture=Q,Q.target.dispatchEvent(ne)}g(Bi,{INPUT_START:et,INPUT_MOVE:xe,INPUT_END:We,INPUT_CANCEL:at,STATE_POSSIBLE:yo,STATE_BEGAN:Kn,STATE_CHANGED:Hl,STATE_ENDED:Vi,STATE_RECOGNIZED:Ii,STATE_CANCELLED:bs,STATE_FAILED:mi,DIRECTION_NONE:jt,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:Ee,DIRECTION_UP:st,DIRECTION_DOWN:De,DIRECTION_HORIZONTAL:Ye,DIRECTION_VERTICAL:ke,DIRECTION_ALL:$e,Manager:Jr,Input:Le,TouchAction:gs,TouchInput:se,MouseInput:zi,PointerEventInput:cl,TouchMouseInput:Ge,SingleTouchInput:ge,Recognizer:Li,AttrRecognizer:si,Tap:wo,Pan:vo,Swipe:Kr,Pinch:Br,Rotate:Yr,Press:Wr,on:E,off:L,each:m,merge:y,extend:_,assign:g,inherit:S,bindFn:C,prefixed:F});var Mk=typeof e<"u"?e:typeof self<"u"?self:{};Mk.Hammer=Bi,n.exports?n.exports=Bi:e[i]=Bi})(window,document,"Hammer")})(tk);var XC=tk.exports;const qs=GC(XC);/*!
+`;return function(){var Ae=new Error("get-stack-trace"),Ze=Ae&&Ae.stack?Ae.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ht=e.console&&(e.console.warn||e.console.log);return ht&&ht.call(e.console,me,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===l||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ne=Object(Q),me=1;me<arguments.length;me++){var Ae=arguments[me];if(Ae!==l&&Ae!==null)for(var Ze in Ae)Ae.hasOwnProperty(Ze)&&(ne[Ze]=Ae[Ze])}return ne}:g=Object.assign;var _=h(function(Q,ne,me){for(var Ae=Object.keys(ne),Ze=0;Ze<Ae.length;)(!me||me&&Q[Ae[Ze]]===l)&&(Q[Ae[Ze]]=ne[Ae[Ze]]),Ze++;return Q},"extend","Use `assign`."),y=h(function(Q,ne){return _(Q,ne,!0)},"merge","Use `assign`.");function S(K,Q,ne){var me=Q.prototype,Ae;Ae=K.prototype=Object.create(me),Ae.constructor=K,Ae._super=me,ne&&g(Ae,ne)}function C(K,Q){return function(){return K.apply(Q,arguments)}}function T(K,Q){return typeof K==r?K.apply(Q&&Q[0]||l,Q):K}function O(K,Q){return K===l?Q:K}function E(K,Q,ne){m(P(Q),function(me){K.addEventListener(me,ne,!1)})}function L(K,Q,ne){m(P(Q),function(me){K.removeEventListener(me,ne,!1)})}function I(K,Q){for(;K;){if(K==Q)return!0;K=K.parentNode}return!1}function A(K,Q){return K.indexOf(Q)>-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ne){if(K.indexOf&&!ne)return K.indexOf(Q);for(var me=0;me<K.length;){if(ne&&K[me][ne]==Q||!ne&&K[me]===Q)return me;me++}return-1}function R(K){return Array.prototype.slice.call(K,0)}function z(K,Q,ne){for(var me=[],Ae=[],Ze=0;Ze<K.length;){var ht=K[Ze][Q];N(Ae,ht)<0&&me.push(K[Ze]),Ae[Ze]=ht,Ze++}return me=me.sort(function(cn,Tn){return cn[Q]>Tn[Q]}),me}function F(K,Q){for(var ne,me,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze<s.length;){if(ne=s[Ze],me=ne?ne+Ae:Q,me in K)return me;Ze++}return l}var B=1;function J(){return B++}function V(K){var Q=K.ownerDocument||K;return Q.defaultView||Q.parentWindow||e}var Z=/mobile|tablet|ip(ad|hone|od)|android/i,G="ontouchstart"in e,de=F(e,"PointerEvent")!==l,fe=G&&Z.test(navigator.userAgent),ue="touch",Te="pen",Ke="mouse",Je="kinect",ft=25,et=1,xe=2,We=4,at=8,jt=1,Ve=2,Ee=4,st=8,De=16,Ye=Ve|Ee,ke=st|De,$e=Ye|ke,ct=["x","y"],Ht=["clientX","clientY"];function Le(K,Q){var ne=this;this.manager=K,this.callback=Q,this.element=K.element,this.target=K.options.inputTarget,this.domHandler=function(me){T(K.options.enable,[K])&&ne.handler(me)},this.init()}Le.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(V(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(V(this.element),this.evWin,this.domHandler)}};function ot(K){var Q,ne=K.options.inputClass;return ne?Q=ne:de?Q=cl:fe?Q=se:G?Q=Ge:Q=zi,new Q(K,on)}function on(K,Q,ne){var me=ne.pointers.length,Ae=ne.changedPointers.length,Ze=Q&et&&me-Ae===0,ht=Q&(We|at)&&me-Ae===0;ne.isFirst=!!Ze,ne.isFinal=!!ht,Ze&&(K.session={}),ne.eventType=Q,En(K,ne),K.emit("hammer.input",ne),K.recognize(ne),K.session.prevInput=ne}function En(K,Q){var ne=K.session,me=Q.pointers,Ae=me.length;ne.firstInput||(ne.firstInput=Yt(Q)),Ae>1&&!ne.firstMultiple?ne.firstMultiple=Yt(Q):Ae===1&&(ne.firstMultiple=!1);var Ze=ne.firstInput,ht=ne.firstMultiple,rn=ht?ht.center:Ze.center,cn=Q.center=vn(me);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=bt(rn,cn),Q.distance=li(rn,cn),Re(ne,Q),Q.offsetDirection=Oi(Q.deltaX,Q.deltaY);var Tn=fn(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Tn.x,Q.overallVelocityY=Tn.y,Q.overallVelocity=u(Tn.x)>u(Tn.y)?Tn.x:Tn.y,Q.scale=ht?sn(ht.pointers,me):1,Q.rotation=ht?wn(ht.pointers,me):0,Q.maxPointers=ne.prevInput?Q.pointers.length>ne.prevInput.maxPointers?Q.pointers.length:ne.prevInput.maxPointers:Q.pointers.length,Ft(ne,Q);var hi=K.element;I(Q.srcEvent.target,hi)&&(hi=Q.srcEvent.target),Q.target=hi}function Re(K,Q){var ne=Q.center,me=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===We)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},me=K.offsetDelta={x:ne.x,y:ne.y}),Q.deltaX=Ae.x+(ne.x-me.x),Q.deltaY=Ae.y+(ne.y-me.y)}function Ft(K,Q){var ne=K.lastInterval||Q,me=Q.timeStamp-ne.timeStamp,Ae,Ze,ht,rn;if(Q.eventType!=at&&(me>ft||ne.velocity===l)){var cn=Q.deltaX-ne.deltaX,Tn=Q.deltaY-ne.deltaY,hi=fn(me,cn,Tn);Ze=hi.x,ht=hi.y,Ae=u(hi.x)>u(hi.y)?hi.x:hi.y,rn=Oi(cn,Tn),K.lastInterval=Q}else Ae=ne.velocity,Ze=ne.velocityX,ht=ne.velocityY,rn=ne.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=ht,Q.direction=rn}function Yt(K){for(var Q=[],ne=0;ne<K.pointers.length;)Q[ne]={clientX:a(K.pointers[ne].clientX),clientY:a(K.pointers[ne].clientY)},ne++;return{timeStamp:f(),pointers:Q,center:vn(Q),deltaX:K.deltaX,deltaY:K.deltaY}}function vn(K){var Q=K.length;if(Q===1)return{x:a(K[0].clientX),y:a(K[0].clientY)};for(var ne=0,me=0,Ae=0;Ae<Q;)ne+=K[Ae].clientX,me+=K[Ae].clientY,Ae++;return{x:a(ne/Q),y:a(me/Q)}}function fn(K,Q,ne){return{x:Q/K||0,y:ne/K||0}}function Oi(K,Q){return K===Q?jt:u(K)>=u(Q)?K<0?Ve:Ee:Q<0?st:De}function li(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.sqrt(me*me+Ae*Ae)}function bt(K,Q,ne){ne||(ne=ct);var me=Q[ne[0]]-K[ne[0]],Ae=Q[ne[1]]-K[ne[1]];return Math.atan2(Ae,me)*180/Math.PI}function wn(K,Q){return bt(Q[1],Q[0],Ht)+bt(K[1],K[0],Ht)}function sn(K,Q){return li(Q[0],Q[1],Ht)/li(K[0],K[1],Ht)}var Dt={mousedown:et,mousemove:xe,mouseup:We},Mi="mousedown",ul="mousemove mouseup";function zi(){this.evEl=Mi,this.evWin=ul,this.pressed=!1,Le.apply(this,arguments)}S(zi,Le,{handler:function(Q){var ne=Dt[Q.type];ne&et&&Q.button===0&&(this.pressed=!0),ne&xe&&Q.which!==1&&(ne=We),this.pressed&&(ne&We&&(this.pressed=!1),this.callback(this.manager,ne,{pointers:[Q],changedPointers:[Q],pointerType:Ke,srcEvent:Q}))}});var Ui={pointerdown:et,pointermove:xe,pointerup:We,pointercancel:at,pointerout:at},fl={2:ue,3:Te,4:Ke,5:Je},Dn="pointerdown",Rl="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Dn="MSPointerDown",Rl="MSPointerMove MSPointerUp MSPointerCancel");function cl(){this.evEl=Dn,this.evWin=Rl,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(cl,Le,{handler:function(Q){var ne=this.store,me=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Ui[Ae],ht=fl[Q.pointerType]||Q.pointerType,rn=ht==ue,cn=N(ne,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||rn)?cn<0&&(ne.push(Q),cn=ne.length-1):Ze&(We|at)&&(me=!0),!(cn<0)&&(ne[cn]=Q,this.callback(this.manager,Ze,{pointers:ne,changedPointers:[Q],pointerType:ht,srcEvent:Q}),me&&ne.splice(cn,1))}});var X={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},x="touchstart",le="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=x,this.evWin=le,this.started=!1,Le.apply(this,arguments)}S(ge,Le,{handler:function(Q){var ne=X[Q.type];if(ne===et&&(this.started=!0),!!this.started){var me=Fe.call(this,Q,ne);ne&(We|at)&&me[0].length-me[1].length===0&&(this.started=!1),this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}}});function Fe(K,Q){var ne=R(K.touches),me=R(K.changedTouches);return Q&(We|at)&&(ne=z(ne.concat(me),"identifier")),[ne,me]}var Be={touchstart:et,touchmove:xe,touchend:We,touchcancel:at},rt="touchstart touchmove touchend touchcancel";function se(){this.evTarget=rt,this.targetIds={},Le.apply(this,arguments)}S(se,Le,{handler:function(Q){var ne=Be[Q.type],me=Oe.call(this,Q,ne);me&&this.callback(this.manager,ne,{pointers:me[0],changedPointers:me[1],pointerType:ue,srcEvent:Q})}});function Oe(K,Q){var ne=R(K.touches),me=this.targetIds;if(Q&(et|xe)&&ne.length===1)return me[ne[0].identifier]=!0,[ne,ne];var Ae,Ze,ht=R(K.changedTouches),rn=[],cn=this.target;if(Ze=ne.filter(function(Tn){return I(Tn.target,cn)}),Q===et)for(Ae=0;Ae<Ze.length;)me[Ze[Ae].identifier]=!0,Ae++;for(Ae=0;Ae<ht.length;)me[ht[Ae].identifier]&&rn.push(ht[Ae]),Q&(We|at)&&delete me[ht[Ae].identifier],Ae++;if(rn.length)return[z(Ze.concat(rn),"identifier"),rn]}var Ne=2500,ze=25;function Ge(){Le.apply(this,arguments);var K=C(this.handler,this);this.touch=new se(this.manager,K),this.mouse=new zi(this.manager,K),this.primaryTouch=null,this.lastTouches=[]}S(Ge,Le,{handler:function(Q,ne,me){var Ae=me.pointerType==ue,Ze=me.pointerType==Ke;if(!(Ze&&me.sourceCapabilities&&me.sourceCapabilities.firesTouchEvents)){if(Ae)Qt.call(this,ne,me);else if(Ze&&Sn.call(this,me))return;this.callback(Q,ne,me)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Qt(K,Q){K&et?(this.primaryTouch=Q.changedPointers[0].identifier,qt.call(this,Q)):K&(We|at)&&qt.call(this,Q)}function qt(K){var Q=K.changedPointers[0];if(Q.identifier===this.primaryTouch){var ne={x:Q.clientX,y:Q.clientY};this.lastTouches.push(ne);var me=this.lastTouches,Ae=function(){var Ze=me.indexOf(ne);Ze>-1&&me.splice(Ze,1)};setTimeout(Ae,Ne)}}function Sn(K){for(var Q=K.srcEvent.clientX,ne=K.srcEvent.clientY,me=0;me<this.lastTouches.length;me++){var Ae=this.lastTouches[me],Ze=Math.abs(Q-Ae.x),ht=Math.abs(ne-Ae.y);if(Ze<=ze&&ht<=ze)return!0}return!1}var Ei=F(o.style,"touchAction"),go=Ei!==l,Fl="compute",bo="auto",_s="manipulation",Di="none",dl="pan-x",pl="pan-y",ql=$k();function gs(K,Q){this.manager=K,this.set(Q)}gs.prototype={set:function(K){K==Fl&&(K=this.compute()),go&&this.manager.element.style&&ql[K]&&(this.manager.element.style[Ei]=K),this.actions=K.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var K=[];return m(this.manager.recognizers,function(Q){T(Q.options.enable,[Q])&&(K=K.concat(Q.getTouchAction()))}),Vr(K.join(" "))},preventDefaults:function(K){var Q=K.srcEvent,ne=K.offsetDirection;if(this.manager.session.prevented){Q.preventDefault();return}var me=this.actions,Ae=A(me,Di)&&!ql[Di],Ze=A(me,pl)&&!ql[pl],ht=A(me,dl)&&!ql[dl];if(Ae){var rn=K.pointers.length===1,cn=K.distance<2,Tn=K.deltaTime<250;if(rn&&cn&&Tn)return}if(!(ht&&Ze)&&(Ae||Ze&&ne&Ye||ht&&ne&ke))return this.preventSrc(Q)},preventSrc:function(K){this.manager.session.prevented=!0,K.preventDefault()}};function Vr(K){if(A(K,Di))return Di;var Q=A(K,dl),ne=A(K,pl);return Q&&ne?Di:Q||ne?Q?dl:pl:A(K,_s)?_s:bo}function $k(){if(!go)return!1;var K={},Q=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(ne){K[ne]=Q?e.CSS.supports("touch-action",ne):!0}),K}var yo=1,Kn=2,Hl=4,Vi=8,Ii=Vi,bs=16,mi=32;function Li(K){this.options=g({},this.defaults,K||{}),this.id=J(),this.manager=null,this.options.enable=O(this.options.enable,!0),this.state=yo,this.simultaneous={},this.requireFail=[]}Li.prototype={defaults:{},set:function(K){return g(this.options,K),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(K){if(d(K,"recognizeWith",this))return this;var Q=this.simultaneous;return K=ko(K,this),Q[K.id]||(Q[K.id]=K,K.recognizeWith(this)),this},dropRecognizeWith:function(K){return d(K,"dropRecognizeWith",this)?this:(K=ko(K,this),delete this.simultaneous[K.id],this)},requireFailure:function(K){if(d(K,"requireFailure",this))return this;var Q=this.requireFail;return K=ko(K,this),N(Q,K)===-1&&(Q.push(K),K.requireFailure(this)),this},dropRequireFailure:function(K){if(d(K,"dropRequireFailure",this))return this;K=ko(K,this);var Q=N(this.requireFail,K);return Q>-1&&this.requireFail.splice(Q,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(K){return!!this.simultaneous[K.id]},emit:function(K){var Q=this,ne=this.state;function me(Ae){Q.manager.emit(Ae,K)}ne<Vi&&me(Q.options.event+uf(ne)),me(Q.options.event),K.additionalEvent&&me(K.additionalEvent),ne>=Vi&&me(Q.options.event+uf(ne))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=mi},canEmit:function(){for(var K=0;K<this.requireFail.length;){if(!(this.requireFail[K].state&(mi|yo)))return!1;K++}return!0},recognize:function(K){var Q=g({},K);if(!T(this.options.enable,[this,Q])){this.reset(),this.state=mi;return}this.state&(Ii|bs|mi)&&(this.state=yo),this.state=this.process(Q),this.state&(Kn|Hl|Vi|bs)&&this.tryEmit(Q)},process:function(K){},getTouchAction:function(){},reset:function(){}};function uf(K){return K&bs?"cancel":K&Vi?"end":K&Hl?"move":K&Kn?"start":""}function ff(K){return K==De?"down":K==st?"up":K==Ve?"left":K==Ee?"right":""}function ko(K,Q){var ne=Q.manager;return ne?ne.get(K):K}function si(){Li.apply(this,arguments)}S(si,Li,{defaults:{pointers:1},attrTest:function(K){var Q=this.options.pointers;return Q===0||K.pointers.length===Q},process:function(K){var Q=this.state,ne=K.eventType,me=Q&(Kn|Hl),Ae=this.attrTest(K);return me&&(ne&at||!Ae)?Q|bs:me||Ae?ne&We?Q|Vi:Q&Kn?Q|Hl:Kn:mi}});function vo(){si.apply(this,arguments),this.pX=null,this.pY=null}S(vo,si,{defaults:{event:"pan",threshold:10,pointers:1,direction:$e},getTouchAction:function(){var K=this.options.direction,Q=[];return K&Ye&&Q.push(pl),K&ke&&Q.push(dl),Q},directionTest:function(K){var Q=this.options,ne=!0,me=K.distance,Ae=K.direction,Ze=K.deltaX,ht=K.deltaY;return Ae&Q.direction||(Q.direction&Ye?(Ae=Ze===0?jt:Ze<0?Ve:Ee,ne=Ze!=this.pX,me=Math.abs(K.deltaX)):(Ae=ht===0?jt:ht<0?st:De,ne=ht!=this.pY,me=Math.abs(K.deltaY))),K.direction=Ae,ne&&me>Q.threshold&&Ae&Q.direction},attrTest:function(K){return si.prototype.attrTest.call(this,K)&&(this.state&Kn||!(this.state&Kn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=ff(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){si.apply(this,arguments)}S(Br,si,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Kn)},emit:function(K){if(K.scale!==1){var Q=K.scale<1?"in":"out";K.additionalEvent=this.options.event+Q}this._super.emit.call(this,K)}});function Wr(){Li.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Li,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distance<Q.threshold,Ae=K.deltaTime>Q.time;if(this._input=K,!me||!ne||K.eventType&(We|at)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.time,this);else if(K.eventType&We)return Ii;return mi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Ii&&(K&&K.eventType&We?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){si.apply(this,arguments)}S(Yr,si,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Di]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Kn)}});function Kr(){si.apply(this,arguments)}S(Kr,si,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ye|ke,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ne;return Q&(Ye|ke)?ne=K.overallVelocity:Q&Ye?ne=K.overallVelocityX:Q&ke&&(ne=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ne)>this.options.velocity&&K.eventType&We},emit:function(K){var Q=ff(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Li.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Li,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[_s]},process:function(K){var Q=this.options,ne=K.pointers.length===Q.pointers,me=K.distance<Q.threshold,Ae=K.deltaTime<Q.time;if(this.reset(),K.eventType&et&&this.count===0)return this.failTimeout();if(me&&Ae&&ne){if(K.eventType!=We)return this.failTimeout();var Ze=this.pTime?K.timeStamp-this.pTime<Q.interval:!0,ht=!this.pCenter||li(this.pCenter,K.center)<Q.posThreshold;this.pTime=K.timeStamp,this.pCenter=K.center,!ht||!Ze?this.count=1:this.count+=1,this._input=K;var rn=this.count%Q.taps;if(rn===0)return this.hasRequireFailures()?(this._timer=c(function(){this.state=Ii,this.tryEmit()},Q.interval,this),Kn):Ii}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==Ii&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Bi(K,Q){return Q=Q||{},Q.recognizers=O(Q.recognizers,Bi.defaults.preset),new Jr(K,Q)}Bi.VERSION="2.0.7",Bi.defaults={domEvents:!1,touchAction:Fl,enable:!0,inputTarget:null,inputClass:null,preset:[[Yr,{enable:!1}],[Br,{enable:!1},["rotate"]],[Kr,{direction:Ye}],[vo,{direction:Ye},["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 Ok=1,cf=2;function Jr(K,Q){this.options=g({},Bi.defaults,Q||{}),this.options.inputTarget=this.options.inputTarget||K,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=K,this.input=ot(this),this.touchAction=new gs(this,this.options.touchAction),df(this,!0),m(this.options.recognizers,function(ne){var me=this.add(new ne[0](ne[1]));ne[2]&&me.recognizeWith(ne[2]),ne[3]&&me.requireFailure(ne[3])},this)}Jr.prototype={set:function(K){return g(this.options,K),K.touchAction&&this.touchAction.update(),K.inputTarget&&(this.input.destroy(),this.input.target=K.inputTarget,this.input.init()),this},stop:function(K){this.session.stopped=K?cf:Ok},recognize:function(K){var Q=this.session;if(!Q.stopped){this.touchAction.preventDefaults(K);var ne,me=this.recognizers,Ae=Q.curRecognizer;(!Ae||Ae&&Ae.state&Ii)&&(Ae=Q.curRecognizer=null);for(var Ze=0;Ze<me.length;)ne=me[Ze],Q.stopped!==cf&&(!Ae||ne==Ae||ne.canRecognizeWith(Ae))?ne.recognize(K):ne.reset(),!Ae&&ne.state&(Kn|Hl|Vi)&&(Ae=Q.curRecognizer=ne),Ze++}},get:function(K){if(K instanceof Li)return K;for(var Q=this.recognizers,ne=0;ne<Q.length;ne++)if(Q[ne].options.event==K)return Q[ne];return null},add:function(K){if(d(K,"add",this))return this;var Q=this.get(K.options.event);return Q&&this.remove(Q),this.recognizers.push(K),K.manager=this,this.touchAction.update(),K},remove:function(K){if(d(K,"remove",this))return this;if(K=this.get(K),K){var Q=this.recognizers,ne=N(Q,K);ne!==-1&&(Q.splice(ne,1),this.touchAction.update())}return this},on:function(K,Q){if(K!==l&&Q!==l){var ne=this.handlers;return m(P(K),function(me){ne[me]=ne[me]||[],ne[me].push(Q)}),this}},off:function(K,Q){if(K!==l){var ne=this.handlers;return m(P(K),function(me){Q?ne[me]&&ne[me].splice(N(ne[me],Q),1):delete ne[me]}),this}},emit:function(K,Q){this.options.domEvents&&Mk(K,Q);var ne=this.handlers[K]&&this.handlers[K].slice();if(!(!ne||!ne.length)){Q.type=K,Q.preventDefault=function(){Q.srcEvent.preventDefault()};for(var me=0;me<ne.length;)ne[me](Q),me++}},destroy:function(){this.element&&df(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function df(K,Q){var ne=K.element;if(ne.style){var me;m(K.options.cssProps,function(Ae,Ze){me=F(ne.style,Ze),Q?(K.oldCssProps[me]=ne.style[me],ne.style[me]=Ae):ne.style[me]=K.oldCssProps[me]||""}),Q||(K.oldCssProps={})}}function Mk(K,Q){var ne=t.createEvent("Event");ne.initEvent(K,!0,!0),ne.gesture=Q,Q.target.dispatchEvent(ne)}g(Bi,{INPUT_START:et,INPUT_MOVE:xe,INPUT_END:We,INPUT_CANCEL:at,STATE_POSSIBLE:yo,STATE_BEGAN:Kn,STATE_CHANGED:Hl,STATE_ENDED:Vi,STATE_RECOGNIZED:Ii,STATE_CANCELLED:bs,STATE_FAILED:mi,DIRECTION_NONE:jt,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:Ee,DIRECTION_UP:st,DIRECTION_DOWN:De,DIRECTION_HORIZONTAL:Ye,DIRECTION_VERTICAL:ke,DIRECTION_ALL:$e,Manager:Jr,Input:Le,TouchAction:gs,TouchInput:se,MouseInput:zi,PointerEventInput:cl,TouchMouseInput:Ge,SingleTouchInput:ge,Recognizer:Li,AttrRecognizer:si,Tap:wo,Pan:vo,Swipe:Kr,Pinch:Br,Rotate:Yr,Press:Wr,on:E,off:L,each:m,merge:y,extend:_,assign:g,inherit:S,bindFn:C,prefixed:F});var Ek=typeof e<"u"?e:typeof self<"u"?self:{};Ek.Hammer=Bi,n.exports?n.exports=Bi:e[i]=Bi})(window,document,"Hammer")})(nk);var xC=nk.exports;const qs=QC(xC);/*!
 * chartjs-plugin-zoom v2.2.0
 * https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
  * (c) 2016-2024 chartjs-plugin-zoom Contributors
  * Released under the MIT License
- */const eo=n=>n&&n.enabled&&n.modifierKey,nk=(n,e)=>n&&e[n+"Key"],Xu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ka(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function QC(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function xC({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 ik(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=xC(e,t),r=ka(i,t),a=ka(l,t);if(s){const f=ka(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const lu=new WeakMap;function Vt(n){let e=lu.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},lu.set(n,e)),e}function e$(n){lu.delete(n)}function lk(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function sk(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function ok(n,e,t){const i=n.max-n.min,l=i*(e-1),s=sk(n,t);return lk(s,n.min,i,l)}function t$(n,e,t){const i=sk(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=lk(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function n$(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Jd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function i$(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function l$(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),e<i?(e=i,t=Math.min(i+n,l)):t>l&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,l=!1){const s=Vt(n.chart),{options:o}=n,r=n$(n,i),{minRange:a=0}=r,u=Jd(s,n,r,"min",-1/0),f=Jd(s,n,r,"max",1/0);if(l==="pan"&&(e<u||t>f))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=l$(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function s$(n,e,t,i){const l=ok(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Nl(n,s,i,!0)}function o$(n,e,t,i){const l=t$(n,e,t);return Nl(n,l,i,!0)}function r$(n,e,t,i){Nl(n,i$(n,e,t),i,!0)}const Zd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function a$(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function u$(n,e,t,i){const l=ok(n,e,t);n.min===n.max&&e<1&&a$(n);const s={min:n.min+Zd(l.min),max:n.max-Zd(l.max)};return Nl(n,s,i,!0)}function f$(n){return n.isHorizontal()?n.width:n.height}function c$(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(f$(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),Nl(n,{min:s,max:o},t)||f}const d$={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 rk(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=d$[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Gd(n,e,t){return rk(n,e,t,!0)}const su={category:u$,default:s$,logarithmic:o$},ou={default:r$},ru={category:c$,default:rk,logarithmic:Gd,timeseries:Gd};function p$(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 Xd(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){p$(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),Xd(i,t),Xd(l,t),i}function Qd(n,e,t,i){const l=su[n.type]||su.default;ut(l,[n,e,t,i])}function xd(n,e,t,i){const l=ou[n.type]||ou.default;ut(l,[n,e,t,i])}function m$(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Qu(n,e,t="none",i="api"){const{x:l=1,y:s=1,focalPoint:o=m$(n)}=typeof e=="number"?{x:e,y:e}:e,r=Vt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=l!==1,c=s!==1,d=ik(u,o,n);_t(d||n.scales,function(m){m.isHorizontal()&&f?Qd(m,l,o,a):!m.isHorizontal()&&c&&Qd(m,s,o,a)}),n.update(t),ut(u.onZoom,[{chart:n,trigger:i}])}function ak(n,e,t,i="none",l="api"){const s=Vt(n),{options:{limits:o,zoom:r}}=s,{mode:a="xy"}=r;ds(n,s);const u=rl(a,"x",n),f=rl(a,"y",n);_t(n.scales,function(c){c.isHorizontal()&&u?xd(c,e.x,t.x,o):!c.isHorizontal()&&f&&xd(c,e.y,t.y,o)}),n.update(i),ut(r.onZoom,[{chart:n,trigger:l}])}function h$(n,e,t,i="none",l="api"){var r;const s=Vt(n);ds(n,s);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ut((r=s.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:l}])}function _$(n,e="default"){const t=Vt(n),i=ds(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max),delete t.updatedScaleLimits[l.id]}),n.update(e),ut(t.options.zoom.onZoomComplete,[{chart:n}])}function g$(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Mt(l.options,l.scale)-Mt(i.options,i.scale)}function b$(n){const e=Vt(n);let t=1,i=1;return _t(n.scales,function(l){const s=g$(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 ep(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=ru[n.type]||ru.default;ut(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function uk(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Vt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?ep(d,l,a,o):!d.isHorizontal()&&c&&ep(d,s,a,o)}),n.update(i),ut(u,[{chart:n}])}function fk(n){const e=Vt(n);ds(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 y$(n){const e=Vt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function k$(n){const e=fk(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 tp(n){const e=Vt(n);return e.panning||e.dragging}const np=(n,e,t)=>Math.min(t,Math.max(e,n));function An(n,e){const{handlers:t}=Vt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Vt(n),o=l[t];if(o&&o.target===e)return;An(n,t),l[t]=a=>i(n,a,s),l[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,l[t],{passive:r})}function v$(n,e){const t=Vt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function w$(n,e){const t=Vt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function au(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return ki(n,e)}function ck(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=au(e,n);if(ut(i,[{chart:n,event:e,point:s}])===!1)return ut(l,[{chart:n,event:e}]),!1}}function S$(n,e){if(n.legend){const s=ki(e,n);if(ls(s,n.legend))return}const t=Vt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||nk(eo(i),e)||Xu(eo(l.drag),e))return ut(l.onZoomRejected,[{chart:n,event:e}]);ck(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",v$),Hs(n,window.document,"keydown",w$))}function T$({begin:n,end:e},t){let i=e.x-n.x,l=e.y-n.y;const s=Math.abs(i/l);s>t?i=Math.sign(i)*Math.abs(l*t):s<t&&(l=Math.sign(l)*Math.abs(i/t)),e.x=n.x+i,e.y=n.y+l}function ip(n,e,t,{min:i,max:l,prop:s}){n[i]=np(Math.min(t.begin[s],t.end[s]),e[i],e[l]),n[l]=np(Math.max(t.begin[s],t.end[s]),e[i],e[l])}function C$(n,e,t){const i={begin:au(e.dragStart,n),end:au(e.dragEnd,n)};if(t){const l=n.chartArea.width/n.chartArea.height;T$(i,l)}return i}function dk(n,e,t,i){const l=rl(e,"x",n),s=rl(e,"y",n),{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea,d={top:o,left:r,right:a,bottom:u},m=C$(n,t,i&&l&&s);l&&ip(d,n.chartArea,m,{min:"left",max:"right",prop:"x"}),s&&ip(d,n.chartArea,m,{min:"top",max:"bottom",prop:"y"});const h=d.right-d.left,g=d.bottom-d.top;return{...d,width:h,height:g,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&g?1+(c-g)/c:1}}function $$(n,e){const t=Vt(n);if(!t.dragStart)return;An(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0,maintainAspectRatio:o}}=t.options.zoom,r=dk(n,i,{dragStart:t.dragStart,dragEnd:e},o),a=rl(i,"x",n)?r.width:0,u=rl(i,"y",n)?r.height:0,f=Math.sqrt(a*a+u*u);if(t.dragStart=t.dragEnd=null,f<=s){t.dragging=!1,n.update("none");return}ak(n,{x:r.left,y:r.top},{x:r.right,y:r.bottom},"zoom","drag"),t.dragging=!1,t.filterNextClick=!0,ut(l,[{chart:n}])}function O$(n,e,t){if(Xu(eo(t.wheel),e)){ut(t.onZoomRejected,[{chart:n,event:e}]);return}if(ck(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function M$(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Vt(n);if(!O$(n,e,i))return;const l=e.target.getBoundingClientRect(),s=i.wheel.speed,o=e.deltaY>=0?2-1/(1-s):1+s,r={x:o,y:o,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};Qu(n,r,"zoom","wheel"),ut(t,[{chart:n}])}function E$(n,e,t,i){t&&(Vt(n).handlers[e]=QC(()=>ut(t,[{chart:n}]),i))}function D$(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",M$),E$(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",S$),Hs(n,t.ownerDocument,"mouseup",$$)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function I$(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function L$(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"&&(Xu(eo(l),o)||nk(eo(s.drag),o))?(ut(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function A$(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 pk(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=A$(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};Qu(n,u,"zoom","pinch"),e.scale=t.scale}}function P$(n,e,t){if(e.options.zoom.pinch.enabled){const i=ki(t,n);ut(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ut(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function N$(n,e,t){e.scale&&(pk(n,e,t),e.scale=null,ut(e.options.zoom.onZoomComplete,[{chart:n}]))}function mk(n,e,t){const i=e.delta;i&&(e.panning=!0,uk(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function R$(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(ut(l,[{chart:n,event:t,point:r}])===!1)return ut(s,[{chart:n,event:t}]);e.panScales=ik(e.options.pan,r,n),e.delta={x:0,y:0},mk(n,e,t)}function F$(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ut(e.options.pan.onPanComplete,[{chart:n}]))}const uu=new WeakMap;function lp(n,e){const t=Vt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>P$(n,t,r)),o.on("pinch",r=>pk(n,t,r)),o.on("pinchend",r=>N$(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:L$(n,t)})),o.on("panstart",r=>R$(n,t,r)),o.on("panmove",r=>mk(n,t,r)),o.on("panend",()=>F$(n,t))),uu.set(n,o)}function sp(n){const e=uu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),uu.delete(n))}function q$(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:l,zoom:s}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=s==null?void 0:s.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(l==null?void 0:l.enabled)||(t==null?void 0:t.threshold)!==(l==null?void 0:l.threshold)}var H$="2.2.0";function Yo(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Vt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=dk(n,t.zoom.mode,{dragStart:l,dragEnd:s},i.maintainAspectRatio),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 j$={id:"zoom",version:H$,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=Vt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&lp(n,t),n.pan=(l,s,o)=>uk(n,l,s,o),n.zoom=(l,s)=>Qu(n,l,s),n.zoomRect=(l,s,o)=>ak(n,l,s,o),n.zoomScale=(l,s,o)=>h$(n,l,s,o),n.resetZoom=l=>_$(n,l),n.getZoomLevel=()=>b$(n),n.getInitialScaleBounds=()=>fk(n),n.getZoomedScaleBounds=()=>y$(n),n.isZoomedOrPanned=()=>k$(n),n.isZoomingOrPanning=()=>tp(n)},beforeEvent(n,{event:e}){if(tp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Vt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Vt(n),l=i.options;i.options=t,q$(l,t)&&(sp(n),lp(n,t)),D$(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){I$(n),qs&&sp(n),e$(n)},panFunctions:ru,zoomFunctions:su,zoomRectFunctions:ou};function op(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&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,Ct,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function rp(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=Y(e,"click",n[4]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function z$(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&op(),g=n[3]&&rp(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),l=W(n[1]),s=$(),r=W(o),a=$(),h&&h.c(),u=$(),f=b("canvas"),c=$(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),ee(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=Y(f,"dblclick",n[4]),d=!0)},p(_,[y]){y&2&&oe(l,_[1]),y&2&&o!==(o=_[1]==1?"log":"logs")&&oe(r,o),y&4&&ee(t,"hidden",_[2]),_[2]?h?y&4&&M(h,1):(h=op(),h.c(),M(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,y):(g=rp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y&4&&ee(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&k(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function U$(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,U.normalizeLogsFilter(i)].filter(Boolean).map(y=>"("+y+")").join("&&");return _e.logs.getStats({filter:_}).then(y=>{m(),y=U.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),_e.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()}ln(()=>(vi.register(Qi,ar,sr,iu,xs,NC,VC),vi.register(j$),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=U.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=U.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 V$ extends Se{constructor(e){super(),we(this,e,U$,z$,ye,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function B$(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 W$(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 xu extends Se{constructor(e){super(),we(this,e,W$,B$,ye,{content:2,language:3,class:0})}}function Y$(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=qe.call(null,e,n[3]?void 0:n[0])),Y(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&&It(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,Ie(s)}}}function K$(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(){U.isEmpty(i)||(U.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return ln(()=>()=>{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 Ci extends Se{constructor(e){super(),we(this,e,K$,Y$,ye,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function ap(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=U.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function J$(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V;d=new Ci({props:{value:n[1].id}}),S=new _y({props:{level:n[1].level}}),O=new Ci({props:{value:n[1].level}}),N=new hy({props:{date:n[1].created}}),F=new Ci({props:{value:n[1].created}});let Z=!n[4]&&up(n),G=pe(n[5](n[1].data)),de=[];for(let ue=0;ue<G.length;ue+=1)de[ue]=cp(ap(n,G,ue));const fe=ue=>D(de[ue],1,1,()=>{de[ue]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=$(),o=b("td"),r=b("span"),u=W(a),f=$(),c=b("div"),j(d.$$.fragment),m=$(),h=b("tr"),g=b("td"),g.textContent="level",_=$(),y=b("td"),j(S.$$.fragment),C=$(),T=b("div"),j(O.$$.fragment),E=$(),L=b("tr"),I=b("td"),I.textContent="created",A=$(),P=b("td"),j(N.$$.fragment),R=$(),z=b("div"),j(F.$$.fragment),B=$(),Z&&Z.c(),J=$();for(let ue=0;ue<de.length;ue+=1)de[ue].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(T,"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(z,"class","copy-icon-wrapper svelte-1c23bpt"),p(P,"class","svelte-1c23bpt"),p(L,"class","svelte-1c23bpt"),p(e,"class","table-border")},m(ue,Te){v(ue,e,Te),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),q(d,c,null),w(t,m),w(t,h),w(h,g),w(h,_),w(h,y),q(S,y,null),w(y,C),w(y,T),q(O,T,null),w(t,E),w(t,L),w(L,I),w(L,A),w(L,P),q(N,P,null),w(P,R),w(P,z),q(F,z,null),w(t,B),Z&&Z.m(t,null),w(t,J);for(let Ke=0;Ke<de.length;Ke+=1)de[Ke]&&de[Ke].m(t,null);V=!0},p(ue,Te){(!V||Te&2)&&a!==(a=ue[1].id+"")&&oe(u,a);const Ke={};Te&2&&(Ke.value=ue[1].id),d.$set(Ke);const Je={};Te&2&&(Je.level=ue[1].level),S.$set(Je);const ft={};Te&2&&(ft.value=ue[1].level),O.$set(ft);const et={};Te&2&&(et.date=ue[1].created),N.$set(et);const xe={};if(Te&2&&(xe.value=ue[1].created),F.$set(xe),ue[4]?Z&&(re(),D(Z,1,1,()=>{Z=null}),ae()):Z?(Z.p(ue,Te),Te&16&&M(Z,1)):(Z=up(ue),Z.c(),M(Z,1),Z.m(t,J)),Te&50){G=pe(ue[5](ue[1].data));let We;for(We=0;We<G.length;We+=1){const at=ap(ue,G,We);de[We]?(de[We].p(at,Te),M(de[We],1)):(de[We]=cp(at),de[We].c(),M(de[We],1),de[We].m(t,null))}for(re(),We=G.length;We<de.length;We+=1)fe(We);ae()}},i(ue){if(!V){M(d.$$.fragment,ue),M(S.$$.fragment,ue),M(O.$$.fragment,ue),M(N.$$.fragment,ue),M(F.$$.fragment,ue),M(Z);for(let Te=0;Te<G.length;Te+=1)M(de[Te]);V=!0}},o(ue){D(d.$$.fragment,ue),D(S.$$.fragment,ue),D(O.$$.fragment,ue),D(N.$$.fragment,ue),D(F.$$.fragment,ue),D(Z),de=de.filter(Boolean);for(let Te=0;Te<de.length;Te+=1)D(de[Te]);V=!1},d(ue){ue&&k(e),H(d),H(S),H(O),H(N),H(F),Z&&Z.d(),dt(de,ue)}}}function Z$(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 up(n){let e,t,i,l,s,o,r;const a=[X$,G$],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=$(),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()),M(o,1),o.m(l,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&k(e),u[s].d()}}}function G$(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 X$(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new Ci({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),l=$(),s=b("div"),j(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),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&oe(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(l),k(s)),H(o)}}}function Q$(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=W(t),s=W(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:te,o:te,d(o){o&&k(e)}}}function x$(n){let e,t;return e=new xu({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function e6(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function t6(n){let e,t;return e=new xu({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n6(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 fp(n){let e,t,i;return t=new Ci({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function cp(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[n6,t6,e6,x$,Q$],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]&&fp(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),s=W(l),o=$(),r=b("td"),u.c(),f=$(),_&&_.c(),c=$(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),ee(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]+"")&&oe(s,l),(!d||S&34)&&ee(t,"v-align-top",y[19]);let C=a;a=g(y),a===C?h[a].p(y,S):(re(),D(h[C],1,1,()=>{h[C]=null}),ae(),u=h[a],u?u.p(y,S):(u=h[a]=m[a](y),u.c()),M(u,1),u.m(r,f)),y[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&2&&M(_,1)):(_=fp(y),_.c(),M(_,1),_.m(r,null))},i(y){d||(M(u),M(_),d=!0)},o(y){D(u),D(_),d=!1},d(y){y&&k(e),h[a].d(),_&&_.d()}}}function i6(n){let e,t,i,l;const s=[Z$,J$],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=ve()},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()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),~e&&o[e].d(a)}}}function l6(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 s6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',t=$(),i=b("button"),l=b("i"),s=$(),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=[Y(e,"click",n[9]),Y(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,Ie(a)}}}function o6(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[s6],header:[l6],default:[i6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const dp="log_view";function r6(n,e,t){let i;const l=yt();let s,o={},r=!1;function a(C){return f(C).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return _e.cancelRequest(dp),s==null?void 0:s.hide()}async function f(C){if(C&&typeof C!="string")return t(3,r=!1),C;t(3,r=!0);let T={};try{T=await _e.logs.getOne(C,{requestKey:dp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),$i(`Unable to load log with id "${C}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d(C){if(!C)return[];let T=[];for(let E of c)typeof C[E]<"u"&&T.push(E);const O=Object.keys(C);for(let E of O)T.includes(E)||T.push(E);return T}function m(){U.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(C){ie[C?"unshift":"push"](()=>{s=C,t(2,s)})}return n.$$.update=()=>{var C;n.$$.dirty&2&&t(4,i=((C=o.data)==null?void 0:C.type)=="request")},[u,o,s,r,i,d,m,g,a,_,y,S]}class a6 extends Se{constructor(e){super(),we(this,e,r6,o6,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function u6(n,e,t){const i=n.slice();return i[1]=e[t],i}function f6(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 c6(n){let e,t,i,l=pe(Q0),s=[];for(let o=0;o<l.length;o+=1)s[o]=f6(u6(n,l,o));return{c(){e=b("div"),t=W(`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),dt(s,o)}}}function d6(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class hk extends Se{constructor(e){super(),we(this,e,d6,c6,ye,{class:0})}}function p6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[h6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[_6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[b6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=Y(e,"submit",nt(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||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&k(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function m6(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 h6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),l=$(),s=b("input"),r=$(),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),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=Y(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&&gt(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function _6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new hk({}),{c(){e=b("label"),t=W("Min log level"),l=$(),s=b("input"),o=$(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=$(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=Y(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&gt(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(k(e),k(l),k(s),k(o),k(r)),H(f),d=!1,m()}}}function g6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 b6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 y6(n){let e,t,i,l;const s=[m6,p6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function k6(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 v6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=Y(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&&ee(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function w6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[v6],header:[k6],default:[y6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function S6(n,e,t){let i,l;const s=yt(),o="logs_settings_"+U.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(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};y(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(U.filterRedactedProps(c));y(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.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=gt(this.value),t(1,c)}function C(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function 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,C,T,O,E,L,I,A]}class T6 extends Se{constructor(e){super(),we(this,e,S6,w6,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function C6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 pp(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 V$({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function mp(n){let e,t,i,l;function s(a){n[15](a)}function o(a){n[16](a)}let r={presets:n[6]};return n[1]!==void 0&&(r.filter=n[1]),n[5]!==void 0&&(r.zoom=n[5]),e=new V3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],Ce(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],Ce(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function $6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T=n[4],O,E=n[4],L,I,A,P;u=new Pu({}),u.$on("refresh",n[11]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[C6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?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 hk({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=pp(n),R=mp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[7]),o=$(),r=b("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=$(),j(u.$$.fragment),f=$(),c=b("div"),d=$(),m=b("div"),j(h.$$.fragment),g=$(),j(_.$$.fragment),y=$(),j(S.$$.fragment),C=$(),N.c(),O=$(),R.c(),L=ve(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,y),q(S,e,null),w(e,C),N.m(e,null),v(z,O,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Me(qe.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),h.$set(B);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ye(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=pp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&ye(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=mp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(k(e),k(O),k(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function O6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[$6]},$$scope:{ctx:n}}});let r={};i=new a6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new T6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(k(t),k(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",hp="superuserRequests",_p="superuserLogRequests";function M6(n,e,t){var R;let i,l,s;Qe(n,Au,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(hp)||((R=window.localStorage)==null?void 0:R.getItem(_p)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[hp]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),y=()=>h();function S(){d=this.checked,t(2,d)}const C=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Ko]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,U.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;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),(z=window.localStorage)==null||z.setItem(_p,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,y,S,C,T,O,E,L,I,A,P,N]}class E6 extends Se{constructor(e){super(),we(this,e,M6,O6,ye,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function kp(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 D6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),l=$(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&k(e),s=!1,o()}}}function I6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=W(t),l=$(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Me(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&k(e),s=!1,o()}}}function vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&kp();function r(f,c){return f[15].disabled?I6:D6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ve(),o&&o.c(),l=$(),u.c(),s=ve(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=kp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(k(t),k(l),k(s)),o&&o.d(f),u.d(f)}}}function wp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:P6,then:A6,catch:L6,value:19,blocks:[,,,]};return mf(t=n[15].component,l),{c(){e=ve(),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)||Kk(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&k(e),l.block.d(s),l.token=null,l=null}}}function L6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function A6(n){bp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=$()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){bp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&k(t),H(e,l)}}}function P6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Sp(n,e){let t,i,l,s=e[5]===e[14]&&wp(e);return{key:n,first:null,c(){t=ve(),s&&s.c(),i=ve(),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&&M(s,1)):(s=wp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(k(t),k(i)),s&&s.d(o)}}}function N6(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 _=yp(n,c,g),y=d(_);s.set(y,l[g]=vp(y,_))}let m=pe(Object.entries(n[3]));const h=g=>g[14];for(let g=0;g<m.length;g+=1){let _=gp(n,m,g),y=h(_);u.set(y,a[g]=Sp(y,_))}return{c(){var g;e=b("div"),t=b("aside"),i=b("nav");for(let _=0;_<l.length;_+=1)l[_].c();o=$(),r=b("div");for(let _=0;_<a.length;_+=1)a[_].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),ee(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=vt(l,_,d,1,g,c,s,i,di,vp,null,yp)),(!f||_&4)&&ee(t,"compact",((y=g[2])==null?void 0:y.type)==="auth"),_&44&&(m=pe(Object.entries(g[3])),re(),a=vt(a,_,h,1,g,m,u,r,Bt,Sp,null,gp),ae())},i(g){if(!f){for(let _=0;_<m.length;_+=1)M(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 R6(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=Y(e,"click",n[8]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function F6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[R6],default:[N6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function q6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-D4zfzAhd.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-DsJmXTBN.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-C9nzLaaI.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-C65dej9I.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-CJmwjOMw.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-2osG30JV.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-DePxQqVe.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-CmjGo_HC.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-Cqv3HyrN.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-CJcj5RbS.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-CXeUQhkk.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-DcPt_azs.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-Whu5MtMJ.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-D6vfkA3g.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-5FSlIcs-.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)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class H6 extends Se{constructor(e){super(),we(this,e,q6,F6,ye,{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 j6=n=>({active:n&1}),Tp=n=>({active:n[0]});function Cp(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||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),o&&t&&t.end()}}}function z6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Tp);let f=n[0]&&Cp(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=$(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(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=[Y(t,"click",nt(n[17])),Y(t,"drop",nt(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",nt(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,j6):Nt(c[14]),Tp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=Cp(c),f.c(),M(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)&&ee(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function U6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();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 N of P)N.click()}}ln(()=>()=>clearTimeout(r));function C(P){Pe.call(this,n,P)}const T=()=>c&&y(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=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,C,T,O,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,U6,z6,ye,{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 $p(n,e,t){const i=n.slice();return i[25]=e[t],i}function Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Ep(Op(n,i,s));return{c(){e=b("div"),t=W(`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=Op(s,i,r);l[r]?l[r].p(a,o):(l[r]=Ep(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),dt(l,s)}}}function Ep(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[15](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function V6(n){var d;let e,t,i,l,s,o,r,a,u,f,c=((d=n[3])==null?void 0:d.length)>0&&Mp(n);return{c(){e=b("label"),t=W("Subject"),l=$(),s=b("input"),r=$(),c&&c.c(),a=ve(),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),he(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=Y(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&&he(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Mp(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 B6(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),he(e,n[0].body),i||(l=Y(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&he(e,s[0].body)},i:te,o:te,d(s){s&&k(e),i=!1,l()}}}function W6(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=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function Dp(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Ip($p(n,i,s));return{c(){e=b("div"),t=W(`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]=Ip(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),dt(l,s)}}}function Ip(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function Y6(n){var h;let e,t,i,l,s,o,r,a,u;const f=[W6,B6],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&&Dp(n);return{c(){e=b("label"),t=W("Body (HTML)"),l=$(),o.c(),r=$(),m&&m.c(),a=ve(),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()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Dp(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(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 K6(n){let e,t,i,l;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[V6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[Y6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function Lp(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function J6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Lp();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),s=W(n[2]),o=$(),r=b("div"),a=$(),f&&f.c(),u=ve(),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&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Lp(),f.c(),M(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 Z6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[J6],default:[K6]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new ji({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){j(e.$$.fragment)},m(s,o){q(e,s,o),t=!0},p(s,[o]){const r=o&512?wt(i,[Rt(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}let Ap;function G6(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=lt(e,l),o;Qe(n,kn,R=>t(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Ap,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 Tt(async()=>{const{default:R}=await import("./CodeEditor-8naseTA8.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Ap=d,t(6,m=!1))}function S(R){R=R.replace("*",""),U.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}y();function C(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!U.isEmpty(U.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,C,T,O,E,L,I,A,P,N]}class X6 extends Se{constructor(e){super(),we(this,e,G6,Z6,ye,{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 Q6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),s=$(),o=b("input"),a=$(),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"),ee(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),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(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&&gt(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(k(e),k(s),k(o),k(a),k(u)),c=!1,Ie(d)}}}function x6(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[Q6,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function e8(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=U.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 t8 extends Se{constructor(e){super(),we(this,e,e8,x6,ye,{key:2,label:3,duration:0,secret:1})}}function Pp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Np(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 t8({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=$(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,Ce(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,Ce(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&k(t),H(i)}}}function n8(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=Pp(n,s,r),u=o(a);i.set(u,t[r]=Np(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=vt(t,a,o,1,r,s,i,e,Bt,Np,null,Pp),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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 Rp(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function i8(n){let e,t,i,l,s,o=n[2]&&Rp();return{c(){e=b("div"),e.innerHTML='<i class="ri-key-2-line"></i> <span class="txt">Tokens options (invalidate, duration)</span>',t=$(),i=b("div"),l=$(),o&&o.c(),s=ve(),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&&M(o,1):(o=Rp(),o.c(),M(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 l8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[i8],default:[n8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function s8(n,e,t){let i,l,s;Qe(n,kn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(U.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 o8 extends Se{constructor(e){super(),we(this,e,s8,l8,ye,{collection:0})}}const r8=n=>({isSuperuserOnly:n&2048}),Fp=n=>({isSuperuserOnly:n[11]}),a8=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),u8=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]});function f8(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[d8,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function c8(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 jp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=$(),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=Y(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 zp(n){let e,t,i,l,s,o,r,a=!n[10]&&Up();return{c(){e=b("button"),a&&a.c(),t=$(),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=Y(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Up(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,Ct,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,Ct,{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 Up(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 d8(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,y,S,C,T,O;const E=n[15].beforeLabel,L=Lt(E,n,n[18],Hp),I=n[15].afterLabel,A=Lt(I,n,n[18],qp);let P=n[5]&&!n[11]&&jp(n);function N(V){n[17](V)}var R=n[8];function z(V,Z){let G={id:V[21],baseCollection:V[1],disabled:V[10]||V[11],placeholder:V[11]?"":V[6]};return V[0]!==void 0&&(G.value=V[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&zp(n);const B=n[15].default,J=Lt(B,n,n[18],Fp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=$(),l=b("span"),s=W(n[2]),o=$(),a=W(r),u=$(),A&&A.c(),f=$(),P&&P.c(),d=$(),m&&j(m.$$.fragment),g=$(),F&&F.c(),y=$(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(V,Z){v(V,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(V,y,Z),v(V,S,Z),J&&J.m(S,null),C=!0,T||(O=Me(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(V,Z){if(L&&L.p&&(!C||Z&264192)&&Pt(L,E,V,V[18],C?At(E,V[18],Z,u8):Nt(V[18]),Hp),(!C||Z&4)&&oe(s,V[2]),(!C||Z&2048)&&r!==(r=V[11]?"- Superusers only":"")&&oe(a,r),(!C||Z&2048)&&ee(l,"txt-hint",V[11]),A&&A.p&&(!C||Z&264192)&&Pt(A,I,V,V[18],C?At(I,V[18],Z,a8):Nt(V[18]),qp),V[5]&&!V[11]?P?P.p(V,Z):(P=jp(V),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!C||Z&2097152&&c!==(c=V[21]))&&p(t,"for",c),Z&256&&R!==(R=V[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(V)),V[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=V[21]),Z&2&&(G.baseCollection=V[1]),Z&3072&&(G.disabled=V[10]||V[11]),Z&2112&&(G.placeholder=V[11]?"":V[6]),!h&&Z&1&&(h=!0,G.value=V[0],Ce(()=>h=!1)),m.$set(G)}V[5]&&V[11]?F?(F.p(V,Z),Z&2080&&M(F,1)):(F=zp(V),F.c(),M(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,V[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!C||Z&264192)&&Pt(J,B,V,V[18],C?At(B,V[18],Z,r8):Nt(V[18]),Fp)},i(V){C||(M(L,V),M(A,V),m&&M(m.$$.fragment,V),M(F),M(J,V),C=!0)},o(V){D(L,V),D(A,V),m&&D(m.$$.fragment,V),D(F),D(J,V),C=!1},d(V){V&&(k(e),k(y),k(S)),L&&L.d(V),A&&A.d(V),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(V),T=!1,O()}}}function p8(n){let e,t,i,l;const s=[c8,f8],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}let Vp;function m8(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=Vp,S=!1;C();async function C(){y||S||(t(9,S=!0),t(8,y=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-DbGqmGAP.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Vp=y,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(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,T,O,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,m8,p8,ye,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function h8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),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=Y(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 _8(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=$(),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=$(),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 g8(n){let e,t,i,l,s,o,r,a,u;l=new ce({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[h8,({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:[_8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`<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
+ */const eo=n=>n&&n.enabled&&n.modifierKey,ik=(n,e)=>n&&e[n+"Key"],Qu=(n,e)=>n&&!e[n+"Key"];function rl(n,e,t){return n===void 0?!0:typeof n=="string"?n.indexOf(e)!==-1:typeof n=="function"?n({chart:t}).indexOf(e)!==-1:!1}function ka(n,e){return typeof n=="function"&&(n=n({chart:e})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function e$(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function t$({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 lk(n,e,t){const{mode:i="xy",scaleMode:l,overScaleMode:s}=n||{},o=t$(e,t),r=ka(i,t),a=ka(l,t);if(s){const f=ka(s,t);for(const c of["x","y"])f[c]&&(a[c]=r[c],r[c]=!1)}if(o&&a[o.axis])return[o];const u=[];return _t(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const su=new WeakMap;function Vt(n){let e=su.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},su.set(n,e)),e}function n$(n){su.delete(n)}function sk(n,e,t,i){const l=Math.max(0,Math.min(1,(n-e)/t||0)),s=1-l;return{min:i*l,max:i*s}}function ok(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function rk(n,e,t){const i=n.max-n.min,l=i*(e-1),s=ok(n,t);return sk(s,n.min,i,l)}function i$(n,e,t){const i=ok(n,t);if(i===void 0)return{min:n.min,max:n.max};const l=Math.log10(n.min),s=Math.log10(n.max),o=Math.log10(i),r=s-l,a=r*(e-1),u=sk(o,l,r,a);return{min:Math.pow(10,l+u.min),max:Math.pow(10,s-u.max)}}function l$(n,e){return e&&(e[n.id]||e[n.axis])||{}}function Zd(n,e,t,i,l){let s=t[i];if(s==="original"){const o=n.originalScaleLimits[e.id][i];s=Mt(o.options,o.scale)}return Mt(s,l)}function s$(n,e,t){const i=n.getValueForPixel(e),l=n.getValueForPixel(t);return{min:Math.min(i,l),max:Math.max(i,l)}}function o$(n,{min:e,max:t,minLimit:i,maxLimit:l},s){const o=(n-t+e)/2;e-=o,t+=o;const r=s.min.options??s.min.scale,a=s.max.options??s.max.scale,u=n/1e6;return Ol(e,r,u)&&(e=r),Ol(t,a,u)&&(t=a),e<i?(e=i,t=Math.min(i+n,l)):t>l&&(t=l,e=Math.max(l-n,i)),{min:e,max:t}}function Nl(n,{min:e,max:t},i,l=!1){const s=Vt(n.chart),{options:o}=n,r=l$(n,i),{minRange:a=0}=r,u=Zd(s,n,r,"min",-1/0),f=Zd(s,n,r,"max",1/0);if(l==="pan"&&(e<u||t>f))return!0;const c=n.max-n.min,d=l?Math.max(t-e,a):c;if(l&&d===a&&c<=a)return!0;const m=o$(d,{min:e,max:t,minLimit:u,maxLimit:f},s.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,s.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function r$(n,e,t,i){const l=rk(n,e,t),s={min:n.min+l.min,max:n.max-l.max};return Nl(n,s,i,!0)}function a$(n,e,t,i){const l=i$(n,e,t);return Nl(n,l,i,!0)}function u$(n,e,t,i){Nl(n,s$(n,e,t),i,!0)}const Gd=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function f$(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<t&&(n.max+=1)}function c$(n,e,t,i){const l=rk(n,e,t);n.min===n.max&&e<1&&f$(n);const s={min:n.min+Gd(l.min),max:n.max-Gd(l.max)};return Nl(n,s,i,!0)}function d$(n){return n.isHorizontal()?n.width:n.height}function p$(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(d$(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),Nl(n,{min:s,max:o},t)||f}const m$={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 ak(n,e,t,i=!1){const{min:l,max:s,options:o}=n,r=o.time&&o.time.round,a=m$[r]||0,u=n.getValueForPixel(n.getPixelForValue(l+a)-e),f=n.getValueForPixel(n.getPixelForValue(s+a)-e);return isNaN(u)||isNaN(f)?!0:Nl(n,{min:u,max:f},t,i?"pan":!1)}function Xd(n,e,t){return ak(n,e,t,!0)}const ou={category:c$,default:r$,logarithmic:a$},ru={default:u$},au={category:p$,default:ak,logarithmic:Xd,timeseries:Xd};function h$(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 Qd(n,e){_t(n,(t,i)=>{e[i]||delete n[i]})}function ds(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:l}=e;return _t(t,function(s){h$(s,i,l)&&(i[s.id]={min:{scale:s.min,options:s.options.min},max:{scale:s.max,options:s.options.max}})}),Qd(i,t),Qd(l,t),i}function xd(n,e,t,i){const l=ou[n.type]||ou.default;ut(l,[n,e,t,i])}function ep(n,e,t,i){const l=ru[n.type]||ru.default;ut(l,[n,e,t,i])}function _$(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function xu(n,e,t="none",i="api"){const{x:l=1,y:s=1,focalPoint:o=_$(n)}=typeof e=="number"?{x:e,y:e}:e,r=Vt(n),{options:{limits:a,zoom:u}}=r;ds(n,r);const f=l!==1,c=s!==1,d=lk(u,o,n);_t(d||n.scales,function(m){m.isHorizontal()&&f?xd(m,l,o,a):!m.isHorizontal()&&c&&xd(m,s,o,a)}),n.update(t),ut(u.onZoom,[{chart:n,trigger:i}])}function uk(n,e,t,i="none",l="api"){const s=Vt(n),{options:{limits:o,zoom:r}}=s,{mode:a="xy"}=r;ds(n,s);const u=rl(a,"x",n),f=rl(a,"y",n);_t(n.scales,function(c){c.isHorizontal()&&u?ep(c,e.x,t.x,o):!c.isHorizontal()&&f&&ep(c,e.y,t.y,o)}),n.update(i),ut(r.onZoom,[{chart:n,trigger:l}])}function g$(n,e,t,i="none",l="api"){var r;const s=Vt(n);ds(n,s);const o=n.scales[e];Nl(o,t,void 0,!0),n.update(i),ut((r=s.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:l}])}function b$(n,e="default"){const t=Vt(n),i=ds(n,t);_t(n.scales,function(l){const s=l.options;i[l.id]?(s.min=i[l.id].min.options,s.max=i[l.id].max.options):(delete s.min,delete s.max),delete t.updatedScaleLimits[l.id]}),n.update(e),ut(t.options.zoom.onZoomComplete,[{chart:n}])}function y$(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:l}=t;return Mt(l.options,l.scale)-Mt(i.options,i.scale)}function k$(n){const e=Vt(n);let t=1,i=1;return _t(n.scales,function(l){const s=y$(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 tp(n,e,t,i){const{panDelta:l}=i,s=l[n.id]||0;sl(s)===sl(e)&&(e+=s);const o=au[n.type]||au.default;ut(o,[n,e,t])?l[n.id]=0:l[n.id]=e}function fk(n,e,t,i="none"){const{x:l=0,y:s=0}=typeof e=="number"?{x:e,y:e}:e,o=Vt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ds(n,o);const f=l!==0,c=s!==0;_t(t||n.scales,function(d){d.isHorizontal()&&f?tp(d,l,a,o):!d.isHorizontal()&&c&&tp(d,s,a,o)}),n.update(i),ut(u,[{chart:n}])}function ck(n){const e=Vt(n);ds(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 v$(n){const e=Vt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function w$(n){const e=ck(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 np(n){const e=Vt(n);return e.panning||e.dragging}const ip=(n,e,t)=>Math.min(t,Math.max(e,n));function An(n,e){const{handlers:t}=Vt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:l,options:s}=Vt(n),o=l[t];if(o&&o.target===e)return;An(n,t),l[t]=a=>i(n,a,s),l[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,l[t],{passive:r})}function S$(n,e){const t=Vt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function T$(n,e){const t=Vt(n);!t.dragStart||e.key!=="Escape"||(An(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function uu(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return ki(n,e)}function dk(n,e,t){const{onZoomStart:i,onZoomRejected:l}=t;if(i){const s=uu(e,n);if(ut(i,[{chart:n,event:e,point:s}])===!1)return ut(l,[{chart:n,event:e}]),!1}}function C$(n,e){if(n.legend){const s=ki(e,n);if(ls(s,n.legend))return}const t=Vt(n),{pan:i,zoom:l={}}=t.options;if(e.button!==0||ik(eo(i),e)||Qu(eo(l.drag),e))return ut(l.onZoomRejected,[{chart:n,event:e}]);dk(n,e,l)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",S$),Hs(n,window.document,"keydown",T$))}function $$({begin:n,end:e},t){let i=e.x-n.x,l=e.y-n.y;const s=Math.abs(i/l);s>t?i=Math.sign(i)*Math.abs(l*t):s<t&&(l=Math.sign(l)*Math.abs(i/t)),e.x=n.x+i,e.y=n.y+l}function lp(n,e,t,{min:i,max:l,prop:s}){n[i]=ip(Math.min(t.begin[s],t.end[s]),e[i],e[l]),n[l]=ip(Math.max(t.begin[s],t.end[s]),e[i],e[l])}function O$(n,e,t){const i={begin:uu(e.dragStart,n),end:uu(e.dragEnd,n)};if(t){const l=n.chartArea.width/n.chartArea.height;$$(i,l)}return i}function pk(n,e,t,i){const l=rl(e,"x",n),s=rl(e,"y",n),{top:o,left:r,right:a,bottom:u,width:f,height:c}=n.chartArea,d={top:o,left:r,right:a,bottom:u},m=O$(n,t,i&&l&&s);l&&lp(d,n.chartArea,m,{min:"left",max:"right",prop:"x"}),s&&lp(d,n.chartArea,m,{min:"top",max:"bottom",prop:"y"});const h=d.right-d.left,g=d.bottom-d.top;return{...d,width:h,height:g,zoomX:l&&h?1+(f-h)/f:1,zoomY:s&&g?1+(c-g)/c:1}}function M$(n,e){const t=Vt(n);if(!t.dragStart)return;An(n,"mousemove");const{mode:i,onZoomComplete:l,drag:{threshold:s=0,maintainAspectRatio:o}}=t.options.zoom,r=pk(n,i,{dragStart:t.dragStart,dragEnd:e},o),a=rl(i,"x",n)?r.width:0,u=rl(i,"y",n)?r.height:0,f=Math.sqrt(a*a+u*u);if(t.dragStart=t.dragEnd=null,f<=s){t.dragging=!1,n.update("none");return}uk(n,{x:r.left,y:r.top},{x:r.right,y:r.bottom},"zoom","drag"),t.dragging=!1,t.filterNextClick=!0,ut(l,[{chart:n}])}function E$(n,e,t){if(Qu(eo(t.wheel),e)){ut(t.onZoomRejected,[{chart:n,event:e}]);return}if(dk(n,e,t)!==!1&&(e.cancelable&&e.preventDefault(),e.deltaY!==void 0))return!0}function D$(n,e){const{handlers:{onZoomComplete:t},options:{zoom:i}}=Vt(n);if(!E$(n,e,i))return;const l=e.target.getBoundingClientRect(),s=i.wheel.speed,o=e.deltaY>=0?2-1/(1-s):1+s,r={x:o,y:o,focalPoint:{x:e.clientX-l.left,y:e.clientY-l.top}};xu(n,r,"zoom","wheel"),ut(t,[{chart:n}])}function I$(n,e,t,i){t&&(Vt(n).handlers[e]=e$(()=>ut(t,[{chart:n}]),i))}function L$(n,e){const t=n.canvas,{wheel:i,drag:l,onZoomComplete:s}=e.zoom;i.enabled?(Hs(n,t,"wheel",D$),I$(n,"onZoomComplete",s,250)):An(n,"wheel"),l.enabled?(Hs(n,t,"mousedown",C$),Hs(n,t.ownerDocument,"mouseup",M$)):(An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"keydown"))}function A$(n){An(n,"mousedown"),An(n,"mousemove"),An(n,"mouseup"),An(n,"wheel"),An(n,"click"),An(n,"keydown")}function P$(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"&&(Qu(eo(l),o)||ik(eo(s.drag),o))?(ut(l.onPanRejected,[{chart:n,event:i}]),!1):!0}}function N$(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 mk(n,e,t){if(e.scale){const{center:i,pointers:l}=t,s=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=N$(l[0],l[1]),a=e.options.zoom.mode,u={x:r.x&&rl(a,"x",n)?s:1,y:r.y&&rl(a,"y",n)?s:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};xu(n,u,"zoom","pinch"),e.scale=t.scale}}function R$(n,e,t){if(e.options.zoom.pinch.enabled){const i=ki(t,n);ut(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ut(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function F$(n,e,t){e.scale&&(mk(n,e,t),e.scale=null,ut(e.options.zoom.onZoomComplete,[{chart:n}]))}function hk(n,e,t){const i=e.delta;i&&(e.panning=!0,fk(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function q$(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(ut(l,[{chart:n,event:t,point:r}])===!1)return ut(s,[{chart:n,event:t}]);e.panScales=lk(e.options.pan,r,n),e.delta={x:0,y:0},hk(n,e,t)}function H$(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ut(e.options.pan.onPanComplete,[{chart:n}]))}const fu=new WeakMap;function sp(n,e){const t=Vt(n),i=n.canvas,{pan:l,zoom:s}=e,o=new qs.Manager(i);s&&s.pinch.enabled&&(o.add(new qs.Pinch),o.on("pinchstart",r=>R$(n,t,r)),o.on("pinch",r=>mk(n,t,r)),o.on("pinchend",r=>F$(n,t,r))),l&&l.enabled&&(o.add(new qs.Pan({threshold:l.threshold,enable:P$(n,t)})),o.on("panstart",r=>q$(n,t,r)),o.on("panmove",r=>hk(n,t,r)),o.on("panend",()=>H$(n,t))),fu.set(n,o)}function op(n){const e=fu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),fu.delete(n))}function j$(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:l,zoom:s}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=s==null?void 0:s.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(l==null?void 0:l.enabled)||(t==null?void 0:t.threshold)!==(l==null?void 0:l.threshold)}var z$="2.2.0";function Yo(n,e,t){const i=t.zoom.drag,{dragStart:l,dragEnd:s}=Vt(n);if(i.drawTime!==e||!s)return;const{left:o,top:r,width:a,height:u}=pk(n,t.zoom.mode,{dragStart:l,dragEnd:s},i.maintainAspectRatio),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 U$={id:"zoom",version:z$,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=Vt(n);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(t.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),qs&&sp(n,t),n.pan=(l,s,o)=>fk(n,l,s,o),n.zoom=(l,s)=>xu(n,l,s),n.zoomRect=(l,s,o)=>uk(n,l,s,o),n.zoomScale=(l,s,o)=>g$(n,l,s,o),n.resetZoom=l=>b$(n,l),n.getZoomLevel=()=>k$(n),n.getInitialScaleBounds=()=>ck(n),n.getZoomedScaleBounds=()=>v$(n),n.isZoomedOrPanned=()=>w$(n),n.isZoomingOrPanning=()=>np(n)},beforeEvent(n,{event:e}){if(np(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Vt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Vt(n),l=i.options;i.options=t,j$(l,t)&&(op(n),sp(n,t)),L$(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){A$(n),qs&&op(n),n$(n)},panFunctions:au,zoomFunctions:ou,zoomRectFunctions:ru};function rp(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&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=He(e,Ct,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&k(e),l&&t&&t.end()}}}function ap(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=Y(e,"click",n[4]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function V$(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&rp(),g=n[3]&&ap(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),l=W(n[1]),s=$(),r=W(o),a=$(),h&&h.c(),u=$(),f=b("canvas"),c=$(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),ee(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=Y(f,"dblclick",n[4]),d=!0)},p(_,[y]){y&2&&oe(l,_[1]),y&2&&o!==(o=_[1]==1?"log":"logs")&&oe(r,o),y&4&&ee(t,"hidden",_[2]),_[2]?h?y&4&&M(h,1):(h=rp(),h.c(),M(h,1),h.m(e,u)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),_[3]?g?g.p(_,y):(g=ap(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y&4&&ee(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&k(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function B$(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,U.normalizeLogsFilter(i)].filter(Boolean).map(y=>"("+y+")").join("&&");return _e.logs.getStats({filter:_}).then(y=>{m(),y=U.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),_e.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()}ln(()=>(vi.register(Qi,ar,sr,lu,xs,FC,WC),vi.register(U$),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=U.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",l),t(5,l.max=U.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 W$ extends Se{constructor(e){super(),we(this,e,B$,V$,ye,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function Y$(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 K$(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 ef extends Se{constructor(e){super(),we(this,e,K$,Y$,ye,{content:2,language:3,class:0})}}function J$(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=qe.call(null,e,n[3]?void 0:n[0])),Y(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&&It(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,Ie(s)}}}function Z$(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(){U.isEmpty(i)||(U.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return ln(()=>()=>{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 Ci extends Se{constructor(e){super(),we(this,e,Z$,J$,ye,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function up(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=U.isEmpty(i[17]);i[18]=s;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function G$(n){let e,t,i,l,s,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V;d=new Ci({props:{value:n[1].id}}),S=new gy({props:{level:n[1].level}}),O=new Ci({props:{value:n[1].level}}),N=new _y({props:{date:n[1].created}}),F=new Ci({props:{value:n[1].created}});let Z=!n[4]&&fp(n),G=pe(n[5](n[1].data)),de=[];for(let ue=0;ue<G.length;ue+=1)de[ue]=dp(up(n,G,ue));const fe=ue=>D(de[ue],1,1,()=>{de[ue]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=$(),o=b("td"),r=b("span"),u=W(a),f=$(),c=b("div"),j(d.$$.fragment),m=$(),h=b("tr"),g=b("td"),g.textContent="level",_=$(),y=b("td"),j(S.$$.fragment),C=$(),T=b("div"),j(O.$$.fragment),E=$(),L=b("tr"),I=b("td"),I.textContent="created",A=$(),P=b("td"),j(N.$$.fragment),R=$(),z=b("div"),j(F.$$.fragment),B=$(),Z&&Z.c(),J=$();for(let ue=0;ue<de.length;ue+=1)de[ue].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(T,"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(z,"class","copy-icon-wrapper svelte-1c23bpt"),p(P,"class","svelte-1c23bpt"),p(L,"class","svelte-1c23bpt"),p(e,"class","table-border")},m(ue,Te){v(ue,e,Te),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),q(d,c,null),w(t,m),w(t,h),w(h,g),w(h,_),w(h,y),q(S,y,null),w(y,C),w(y,T),q(O,T,null),w(t,E),w(t,L),w(L,I),w(L,A),w(L,P),q(N,P,null),w(P,R),w(P,z),q(F,z,null),w(t,B),Z&&Z.m(t,null),w(t,J);for(let Ke=0;Ke<de.length;Ke+=1)de[Ke]&&de[Ke].m(t,null);V=!0},p(ue,Te){(!V||Te&2)&&a!==(a=ue[1].id+"")&&oe(u,a);const Ke={};Te&2&&(Ke.value=ue[1].id),d.$set(Ke);const Je={};Te&2&&(Je.level=ue[1].level),S.$set(Je);const ft={};Te&2&&(ft.value=ue[1].level),O.$set(ft);const et={};Te&2&&(et.date=ue[1].created),N.$set(et);const xe={};if(Te&2&&(xe.value=ue[1].created),F.$set(xe),ue[4]?Z&&(re(),D(Z,1,1,()=>{Z=null}),ae()):Z?(Z.p(ue,Te),Te&16&&M(Z,1)):(Z=fp(ue),Z.c(),M(Z,1),Z.m(t,J)),Te&50){G=pe(ue[5](ue[1].data));let We;for(We=0;We<G.length;We+=1){const at=up(ue,G,We);de[We]?(de[We].p(at,Te),M(de[We],1)):(de[We]=dp(at),de[We].c(),M(de[We],1),de[We].m(t,null))}for(re(),We=G.length;We<de.length;We+=1)fe(We);ae()}},i(ue){if(!V){M(d.$$.fragment,ue),M(S.$$.fragment,ue),M(O.$$.fragment,ue),M(N.$$.fragment,ue),M(F.$$.fragment,ue),M(Z);for(let Te=0;Te<G.length;Te+=1)M(de[Te]);V=!0}},o(ue){D(d.$$.fragment,ue),D(S.$$.fragment,ue),D(O.$$.fragment,ue),D(N.$$.fragment,ue),D(F.$$.fragment,ue),D(Z),de=de.filter(Boolean);for(let Te=0;Te<de.length;Te+=1)D(de[Te]);V=!1},d(ue){ue&&k(e),H(d),H(S),H(O),H(N),H(F),Z&&Z.d(),dt(de,ue)}}}function X$(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 fp(n){let e,t,i,l,s,o,r;const a=[x$,Q$],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=$(),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()),M(o,1),o.m(l,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&k(e),u[s].d()}}}function Q$(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 x$(n){let e,t=n[1].message+"",i,l,s,o,r;return o=new Ci({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),l=$(),s=b("div"),j(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),q(o,s,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&oe(i,t);const f={};u&2&&(f.value=a[1].message),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(l),k(s)),H(o)}}}function e6(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=W(t),s=W(l),p(e,"class","txt")},m(o,r){v(o,e,r),w(e,i),w(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&oe(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&oe(s,l)},i:te,o:te,d(o){o&&k(e)}}}function t6(n){let e,t;return e=new ef({props:{content:n[17],language:"html"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n6(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label label-danger log-error-label svelte-1c23bpt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function i6(n){let e,t;return e=new ef({props:{content:JSON.stringify(n[17],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function l6(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 cp(n){let e,t,i;return t=new Ci({props:{value:n[17]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.value=l[17]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function dp(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[l6,i6,n6,t6,e6],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]&&cp(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),s=W(l),o=$(),r=b("td"),u.c(),f=$(),_&&_.c(),c=$(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),ee(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]+"")&&oe(s,l),(!d||S&34)&&ee(t,"v-align-top",y[19]);let C=a;a=g(y),a===C?h[a].p(y,S):(re(),D(h[C],1,1,()=>{h[C]=null}),ae(),u=h[a],u?u.p(y,S):(u=h[a]=m[a](y),u.c()),M(u,1),u.m(r,f)),y[18]?_&&(re(),D(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&2&&M(_,1)):(_=cp(y),_.c(),M(_,1),_.m(r,null))},i(y){d||(M(u),M(_),d=!0)},o(y){D(u),D(_),d=!1},d(y){y&&k(e),h[a].d(),_&&_.d()}}}function s6(n){let e,t,i,l;const s=[X$,G$],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=ve()},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()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),~e&&o[e].d(a)}}}function o6(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 r6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',t=$(),i=b("button"),l=b("i"),s=$(),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=[Y(e,"click",n[9]),Y(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,Ie(a)}}}function a6(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[r6],header:[o6],default:[s6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194330&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}const pp="log_view";function u6(n,e,t){let i;const l=yt();let s,o={},r=!1;function a(C){return f(C).then(T=>{t(1,o=T),h()}),s==null?void 0:s.show()}function u(){return _e.cancelRequest(pp),s==null?void 0:s.hide()}async function f(C){if(C&&typeof C!="string")return t(3,r=!1),C;t(3,r=!0);let T={};try{T=await _e.logs.getOne(C,{requestKey:pp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),$i(`Unable to load log with id "${C}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d(C){if(!C)return[];let T=[];for(let E of c)typeof C[E]<"u"&&T.push(E);const O=Object.keys(C);for(let E of O)T.includes(E)||T.push(E);return T}function m(){U.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(C){ie[C?"unshift":"push"](()=>{s=C,t(2,s)})}return n.$$.update=()=>{var C;n.$$.dirty&2&&t(4,i=((C=o.data)==null?void 0:C.type)=="request")},[u,o,s,r,i,d,m,g,a,_,y,S]}class f6 extends Se{constructor(e){super(),we(this,e,u6,a6,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function c6(n,e,t){const i=n.slice();return i[1]=e[t],i}function d6(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 p6(n){let e,t,i,l=pe(x0),s=[];for(let o=0;o<l.length;o+=1)s[o]=d6(c6(n,l,o));return{c(){e=b("div"),t=W(`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),dt(s,o)}}}function m6(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class _k extends Se{constructor(e){super(),we(this,e,m6,p6,ye,{class:0})}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[g6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[b6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[y6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[k6,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){v(d,e,m),q(t,e,null),w(e,i),q(l,e,null),w(e,s),q(o,e,null),w(e,r),q(a,e,null),u=!0,f||(c=Y(e,"submit",nt(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||(M(t.$$.fragment,d),M(l.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(l.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&k(e),H(t),H(l),H(o),H(a),f=!1,c()}}}function _6(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 g6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),l=$(),s=b("input"),r=$(),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),he(s,n[1].logs.maxDays),v(c,r,d),v(c,a,d),u||(f=Y(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&&gt(s.value)!==c[1].logs.maxDays&&he(s,c[1].logs.maxDays)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function b6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new _k({}),{c(){e=b("label"),t=W("Min log level"),l=$(),s=b("input"),o=$(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=$(),j(f.$$.fragment),p(e,"for",i=n[23]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[1].logs.minLevel),v(h,o,g),v(h,r,g),w(r,a),w(r,u),q(f,r,null),c=!0,d||(m=Y(s,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&gt(s.value)!==h[1].logs.minLevel&&he(s,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(k(e),k(l),k(s),k(o),k(r)),H(f),d=!1,m()}}}function y6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logIP,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 k6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[1].logs.logAuthId,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 v6(n){let e,t,i,l;const s=[_6,h6],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function w6(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 S6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=Y(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&&ee(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function T6(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[S6],header:[w6],default:[v6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[15]),s&16777274&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function C6(n,e,t){let i,l;const s=yt(),o="logs_settings_"+U.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(){Ut(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await _e.settings.getAll()||{};y(P)}catch(P){_e.error(P)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const P=await _e.settings.update(U.filterRedactedProps(c));y(P),t(3,a=!1),m(),tn("Successfully saved logs settings."),s("save",P)}catch(P){t(3,a=!1),_e.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=gt(this.value),t(1,c)}function C(){c.logs.minLevel=gt(this.value),t(1,c)}function T(){c.logs.logIP=this.checked,t(1,c)}function O(){c.logs.logAuthId=this.checked,t(1,c)}const E=()=>!a;function 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,C,T,O,E,L,I,A]}class $6 extends Se{constructor(e){super(),we(this,e,C6,T6,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function O6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"for",o=n[25])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 mp(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 W$({props:s}),ie.push(()=>be(e,"zoom",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2&&(a.filter=o[1]),r&64&&(a.presets=o[6]),!t&&r&32&&(t=!0,a.zoom=o[5],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function hp(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 W3({props:r}),ie.push(()=>be(e,"filter",s)),ie.push(()=>be(e,"zoom",o)),e.$on("select",n[17]),{c(){j(e.$$.fragment)},m(a,u){q(e,a,u),l=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],Ce(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],Ce(()=>i=!1)),e.$set(f)},i(a){l||(M(e.$$.fragment,a),l=!0)},o(a){D(e.$$.fragment,a),l=!1},d(a){H(e,a)}}}function M6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T=n[4],O,E=n[4],L,I,A,P;u=new Nu({}),u.$on("refresh",n[11]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[O6,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?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 _k({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=mp(n),R=hp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=W(n[7]),o=$(),r=b("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=$(),j(u.$$.fragment),f=$(),c=b("div"),d=$(),m=b("div"),j(h.$$.fragment),g=$(),j(_.$$.fragment),y=$(),j(S.$$.fragment),C=$(),N.c(),O=$(),R.c(),L=ve(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(z,F){v(z,e,F),w(e,t),w(t,i),w(i,l),w(l,s),w(t,o),w(t,r),w(t,a),q(u,t,null),w(t,f),w(t,c),w(t,d),w(t,m),q(h,m,null),w(e,g),q(_,e,null),w(e,y),q(S,e,null),w(e,C),N.m(e,null),v(z,O,F),R.m(z,F),v(z,L,F),I=!0,A||(P=[Me(qe.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&oe(s,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),h.$set(B);const J={};F&2&&(J.value=z[1]),_.$set(J),F&16&&ye(T,T=z[4])?(re(),D(N,1,1,te),ae(),N=mp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&ye(E,E=z[4])?(re(),D(R,1,1,te),ae(),R=hp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(h.$$.fragment,z),M(_.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(h.$$.fragment,z),D(_.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(k(e),k(O),k(L)),H(u),H(h),H(_),H(S),N.d(z),R.d(z),A=!1,Ie(P)}}}function E6(n){let e,t,i,l,s,o;e=new pi({props:{$$slots:{default:[M6]},$$scope:{ctx:n}}});let r={};i=new f6({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return s=new $6({props:a}),n[21](s),s.$on("save",n[8]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(u,f){q(e,u,f),v(u,t,f),q(i,u,f),v(u,l,f),q(s,u,f),o=!0},p(u,[f]){const c={};f&67109119&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(s.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(s.$$.fragment,u),o=!1},d(u){u&&(k(t),k(l)),H(e,u),n[18](null),H(i,u),n[21](null),H(s,u)}}}const Ko="logId",_p="superuserRequests",gp="superuserLogRequests";function D6(n,e,t){var R;let i,l,s;Qe(n,Pu,z=>t(22,l=z)),Qe(n,un,z=>t(7,s=z)),Rn(un,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(_p)||((R=window.localStorage)==null?void 0:R.getItem(gp)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[_p]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),y=()=>h();function S(){d=this.checked,t(2,d)}const C=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ie[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Ko]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Ko]=null,U.replaceHashQueryParams(z)};function N(z){ie[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;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),(z=window.localStorage)==null||z.setItem(gp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,s,h,m,_,y,S,C,T,O,E,L,I,A,P,N]}class I6 extends Se{constructor(e){super(),we(this,e,D6,E6,ye,{})}}function bp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function yp(n){n[18]=n[19].default}function kp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function vp(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 L6(n){let e,t=n[15].label+"",i,l,s,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),l=$(),p(e,"type","button"),p(e,"class","sidebar-item"),ee(e,"active",n[5]===n[14])},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&oe(i,t),u&40&&ee(e,"active",n[5]===n[14])},d(a){a&&k(e),s=!1,o()}}}function A6(n){let e,t=n[15].label+"",i,l,s,o;return{c(){e=b("div"),i=W(t),l=$(),p(e,"class","sidebar-item disabled")},m(r,a){v(r,e,a),w(e,i),w(e,l),s||(o=Me(qe.call(null,e,{position:"left",text:"Not enabled for the collection"})),s=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&oe(i,t)},d(r){r&&k(e),s=!1,o()}}}function wp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=i&&vp();function r(f,c){return f[15].disabled?A6:L6}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ve(),o&&o.c(),l=$(),u.c(),s=ve(),this.first=t},m(f,c){v(f,t,c),o&&o.m(f,c),v(f,l,c),u.m(f,c),v(f,s,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=vp(),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null),a===(a=r(e))&&u?u.p(e,c):(u.d(1),u=a(e),u&&(u.c(),u.m(s.parentNode,s)))},d(f){f&&(k(t),k(l),k(s)),o&&o.d(f),u.d(f)}}}function Sp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:R6,then:N6,catch:P6,value:19,blocks:[,,,]};return hf(t=n[15].component,l),{c(){e=ve(),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)&&hf(t,l)||Jk(l,n,o)},i(s){i||(M(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];D(r)}i=!1},d(s){s&&k(e),l.block.d(s),l.token=null,l=null}}}function P6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function N6(n){yp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){j(e.$$.fragment),t=$()},m(l,s){q(e,l,s),v(l,t,s),i=!0},p(l,s){yp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(M(e.$$.fragment,l),i=!0)},o(l){D(e.$$.fragment,l),i=!1},d(l){l&&k(t),H(e,l)}}}function R6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Tp(n,e){let t,i,l,s=e[5]===e[14]&&Sp(e);return{key:n,first:null,c(){t=ve(),s&&s.c(),i=ve(),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&&M(s,1)):(s=Sp(e),s.c(),M(s,1),s.m(i.parentNode,i)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(o){l||(M(s),l=!0)},o(o){D(s),l=!1},d(o){o&&(k(t),k(i)),s&&s.d(o)}}}function F6(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 _=kp(n,c,g),y=d(_);s.set(y,l[g]=wp(y,_))}let m=pe(Object.entries(n[3]));const h=g=>g[14];for(let g=0;g<m.length;g+=1){let _=bp(n,m,g),y=h(_);u.set(y,a[g]=Tp(y,_))}return{c(){var g;e=b("div"),t=b("aside"),i=b("nav");for(let _=0;_<l.length;_+=1)l[_].c();o=$(),r=b("div");for(let _=0;_<a.length;_+=1)a[_].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),ee(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=vt(l,_,d,1,g,c,s,i,di,wp,null,kp)),(!f||_&4)&&ee(t,"compact",((y=g[2])==null?void 0:y.type)==="auth"),_&44&&(m=pe(Object.entries(g[3])),re(),a=vt(a,_,h,1,g,m,u,r,Bt,Tp,null,bp),ae())},i(g){if(!f){for(let _=0;_<m.length;_+=1)M(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 q6(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=Y(e,"click",n[8]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function H6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[q6],default:[F6]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function j6(n,e,t){const i={list:{label:"List/Search",component:Tt(()=>import("./ListApiDocs-GWn-CPMs.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:Tt(()=>import("./ViewApiDocs-CWljd9ob.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:Tt(()=>import("./CreateApiDocs-dx3XBFzI.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:Tt(()=>import("./UpdateApiDocs-XHS3RD1Q.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:Tt(()=>import("./DeleteApiDocs-Dwxzpd42.js"),[],import.meta.url)},realtime:{label:"Realtime",component:Tt(()=>import("./RealtimeApiDocs-BZWtgnO2.js"),[],import.meta.url)},batch:{label:"Batch",component:Tt(()=>import("./BatchApiDocs-CI-AGdP4.js"),[],import.meta.url)}},l={"list-auth-methods":{label:"List auth methods",component:Tt(()=>import("./AuthMethodsDocs-DubXYrz3.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:Tt(()=>import("./AuthWithPasswordDocs-CepW6s1g.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:Tt(()=>import("./AuthWithOAuth2Docs-C6WI1jtR.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:Tt(()=>import("./AuthWithOtpDocs-BwTrTztG.js"),[],import.meta.url)},refresh:{label:"Auth refresh",component:Tt(()=>import("./AuthRefreshDocs-Bv2HZYxd.js"),__vite__mapDeps([11,3]),import.meta.url)},verification:{label:"Verification",component:Tt(()=>import("./VerificationDocs-Cnw3YmXh.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:Tt(()=>import("./PasswordResetDocs-C2FJxDCy.js"),[],import.meta.url)},"email-change":{label:"Email change",component:Tt(()=>import("./EmailChangeDocs-M95lizJx.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)),t(3,a["auth-with-password"].disabled=!o.passwordAuth.enabled,a),t(3,a["auth-with-oauth2"].disabled=!o.oauth2.enabled,a),t(3,a["auth-with-otp"].disabled=!o.otp.enabled,a)):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime,delete a.batch):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,g,_]}class z6 extends Se{constructor(e){super(),we(this,e,j6,H6,ye,{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 U6=n=>({active:n&1}),Cp=n=>({active:n[0]});function $p(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||(M(s,o),o&&tt(()=>{i&&(t||(t=He(e,mt,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(s,o),o&&(t||(t=He(e,mt,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),s&&s.d(o),o&&t&&t.end()}}}function V6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=Lt(a,n,n[14],Cp);let f=n[0]&&$p(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=$(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(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=[Y(t,"click",nt(n[17])),Y(t,"drop",nt(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",nt(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,U6):Nt(c[14]),Cp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=$p(c),f.c(),M(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)&&ee(e,"active",c[0])},i(c){s||(M(u,c),M(f),s=!0)},o(c){D(u,c),D(f),s=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function B6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();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 N of P)N.click()}}ln(()=>()=>clearTimeout(r));function C(P){Pe.call(this,n,P)}const T=()=>c&&y(),O=P=>{u&&(t(7,m=!1),S(),s("drop",P))},E=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,C,T,O,E,L,I,A]}class ji extends Se{constructor(e){super(),we(this,e,B6,V6,ye,{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 Op(n,e,t){const i=n.slice();return i[25]=e[t],i}function Mp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Ep(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Dp(Mp(n,i,s));return{c(){e=b("div"),t=W(`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=Mp(s,i,r);l[r]?l[r].p(a,o):(l[r]=Dp(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),dt(l,s)}}}function Dp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[15](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function W6(n){var d;let e,t,i,l,s,o,r,a,u,f,c=((d=n[3])==null?void 0:d.length)>0&&Ep(n);return{c(){e=b("label"),t=W("Subject"),l=$(),s=b("input"),r=$(),c&&c.c(),a=ve(),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),he(s,n[0].subject),v(m,r,h),c&&c.m(m,h),v(m,a,h),u||(f=Y(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&&he(s,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Ep(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 Y6(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),he(e,n[0].body),i||(l=Y(e,"input",n[17]),i=!0)},p(s,o){o&16777216&&t!==(t=s[24])&&p(e,"id",t),o&1&&he(e,s[0].body)},i:te,o:te,d(s){s&&k(e),i=!1,l()}}}function K6(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=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&16777216&&(f.id=a[24]),!t&&u&1&&(t=!0,f.value=a[0].body,Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function Ip(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Lp(Op(n,i,s));return{c(){e=b("div"),t=W(`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=Op(s,i,r);l[r]?l[r].p(a,o):(l[r]=Lp(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),dt(l,s)}}}function Lp(n){let e,t="{"+n[25]+"}",i,l,s,o;function r(){return n[18](n[25])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&8&&t!==(t="{"+n[25]+"}")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function J6(n){var h;let e,t,i,l,s,o,r,a,u;const f=[K6,Y6],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&&Ip(n);return{c(){e=b("label"),t=W("Body (HTML)"),l=$(),o.c(),r=$(),m&&m.c(),a=ve(),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()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,_):(m=Ip(g),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},i(g){u||(M(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 Z6(n){let e,t,i,l;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[W6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[J6,({uniqueId:s})=>({24:s}),({uniqueId:s})=>s?16777216:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name=s[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function Ap(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function G6(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&Ap();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),s=W(n[2]),o=$(),r=b("div"),a=$(),f&&f.c(),u=ve(),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&&oe(s,c[2]),c[7]?f?d&128&&M(f,1):(f=Ap(),f.c(),M(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 X6(n){let e,t;const i=[n[9]];let l={$$slots:{header:[G6],default:[Z6]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new ji({props:l}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){j(e.$$.fragment)},m(s,o){q(e,s,o),t=!0},p(s,[o]){const r=o&512?wt(i,[Rt(s[9])]):{};o&1073742063&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}let Pp;function Q6(n,e,t){let i;const l=["key","title","config","placeholders","expand","collapse","collapseSiblings"];let s=lt(e,l),o;Qe(n,kn,R=>t(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=Pp,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 Tt(async()=>{const{default:R}=await import("./CodeEditor-kYUfoxD0.js");return{default:R}},__vite__mapDeps([12,1]),import.meta.url)).default),Pp=d,t(6,m=!1))}function S(R){R=R.replace("*",""),U.copyToClipboard(R),Ks(`Copied ${R} to clipboard`,2e3)}y();function C(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ie[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Pe.call(this,n,R)}function P(R){Pe.call(this,n,R)}function N(R){Pe.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Wt(R)),t(9,s=lt(e,l)),"key"in R&&t(1,r=R.key),"title"in R&&t(2,a=R.title),"config"in R&&t(0,u=R.config),"placeholders"in R&&t(3,f=R.placeholders)},n.$$.update=()=>{n.$$.dirty&8194&&t(7,i=!U.isEmpty(U.getNestedVal(o,r))),n.$$.dirty&3&&(u.enabled||Yn(r))},[u,r,a,f,c,d,m,i,S,s,h,g,_,o,C,T,O,E,L,I,A,P,N]}class x6 extends Se{constructor(e){super(),we(this,e,Q6,X6,ye,{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 e8(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),s=$(),o=b("input"),a=$(),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"),ee(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),he(o,n[0]),v(m,a,h),v(m,u,h),w(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,h){h&8&&oe(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&&gt(o.value)!==m[0]&&he(o,m[0]),h&2&&ee(f,"txt-success",!!m[1])},d(m){m&&(k(e),k(s),k(o),k(a),k(u)),c=!1,Ie(d)}}}function t8(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[e8,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n8(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=gt(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=U.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 i8 extends Se{constructor(e){super(),we(this,e,n8,t8,ye,{key:2,label:3,duration:0,secret:1})}}function Np(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function Rp(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 i8({props:f}),ie.push(()=>be(i,"duration",a)),ie.push(()=>be(i,"secret",u)),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),o=$(),p(t,"class","col-sm-6"),this.first=t},m(c,d){v(c,t,d),q(i,t,null),w(t,o),r=!0},p(c,d){e=c;const m={};d&2&&(m.key=e[8].key),d&2&&(m.label=e[8].label),!l&&d&3&&(l=!0,m.duration=e[0][e[8].key].duration,Ce(()=>l=!1)),!s&&d&3&&(s=!0,m.secret=e[0][e[8].key].secret,Ce(()=>s=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&k(t),H(i)}}}function l8(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=Np(n,s,r),u=o(a);i.set(u,t[r]=Rp(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=vt(t,a,o,1,r,s,i,e,Bt,Rp,null,Np),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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 Fp(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function s8(n){let e,t,i,l,s,o=n[2]&&Fp();return{c(){e=b("div"),e.innerHTML='<i class="ri-key-2-line"></i> <span class="txt">Tokens options (invalidate, duration)</span>',t=$(),i=b("div"),l=$(),o&&o.c(),s=ve(),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&&M(o,1):(o=Fp(),o.c(),M(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 o8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[s8],default:[l8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2055&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function r8(n,e,t){let i,l,s;Qe(n,kn,c=>t(4,s=c));let{collection:o}=e,r=[];function a(c){if(U.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 a8 extends Se{constructor(e){super(),we(this,e,r8,o8,ye,{collection:0})}}const u8=n=>({isSuperuserOnly:n&2048}),qp=n=>({isSuperuserOnly:n[11]}),f8=n=>({isSuperuserOnly:n&2048}),Hp=n=>({isSuperuserOnly:n[11]}),c8=n=>({isSuperuserOnly:n&2048}),jp=n=>({isSuperuserOnly:n[11]});function d8(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[m8,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2064&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),l&8&&(s.name=i[3]),l&2362855&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function p8(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 zp(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),i=$(),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=Y(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 Up(n){let e,t,i,l,s,o,r,a=!n[10]&&Vp();return{c(){e=b("button"),a&&a.c(),t=$(),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=Y(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Vp(),a.c(),a.m(e,t)),(!s||f&1024)&&(e.disabled=u[10]),(!s||f&1024)&&p(e,"aria-hidden",u[10])},i(u){s||(u&&tt(()=>{s&&(l||(l=He(e,Ct,{duration:150,start:.98},!0)),l.run(1))}),s=!0)},o(u){u&&(l||(l=He(e,Ct,{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 Vp(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 m8(n){let e,t,i,l,s,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,y,S,C,T,O;const E=n[15].beforeLabel,L=Lt(E,n,n[18],jp),I=n[15].afterLabel,A=Lt(I,n,n[18],Hp);let P=n[5]&&!n[11]&&zp(n);function N(V){n[17](V)}var R=n[8];function z(V,Z){let G={id:V[21],baseCollection:V[1],disabled:V[10]||V[11],placeholder:V[11]?"":V[6]};return V[0]!==void 0&&(G.value=V[0]),{props:G}}R&&(m=zt(R,z(n)),n[16](m),ie.push(()=>be(m,"value",N)));let F=n[5]&&n[11]&&Up(n);const B=n[15].default,J=Lt(B,n,n[18],qp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=$(),l=b("span"),s=W(n[2]),o=$(),a=W(r),u=$(),A&&A.c(),f=$(),P&&P.c(),d=$(),m&&j(m.$$.fragment),g=$(),F&&F.c(),y=$(),S=b("div"),J&&J.c(),p(l,"class","txt"),ee(l,"txt-hint",n[11]),p(t,"for",c=n[21]),p(e,"class","input-wrapper svelte-dnx4io"),p(S,"class","help-block")},m(V,Z){v(V,e,Z),w(e,t),L&&L.m(t,null),w(t,i),w(t,l),w(l,s),w(l,o),w(l,a),w(t,u),A&&A.m(t,null),w(t,f),P&&P.m(t,null),w(e,d),m&&q(m,e,null),w(e,g),F&&F.m(e,null),v(V,y,Z),v(V,S,Z),J&&J.m(S,null),C=!0,T||(O=Me(_=qe.call(null,e,n[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0)),T=!0)},p(V,Z){if(L&&L.p&&(!C||Z&264192)&&Pt(L,E,V,V[18],C?At(E,V[18],Z,c8):Nt(V[18]),jp),(!C||Z&4)&&oe(s,V[2]),(!C||Z&2048)&&r!==(r=V[11]?"- Superusers only":"")&&oe(a,r),(!C||Z&2048)&&ee(l,"txt-hint",V[11]),A&&A.p&&(!C||Z&264192)&&Pt(A,I,V,V[18],C?At(I,V[18],Z,f8):Nt(V[18]),Hp),V[5]&&!V[11]?P?P.p(V,Z):(P=zp(V),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!C||Z&2097152&&c!==(c=V[21]))&&p(t,"for",c),Z&256&&R!==(R=V[8])){if(m){re();const G=m;D(G.$$.fragment,1,0,()=>{H(G,1)}),ae()}R?(m=zt(R,z(V)),V[16](m),ie.push(()=>be(m,"value",N)),j(m.$$.fragment),M(m.$$.fragment,1),q(m,e,g)):m=null}else if(R){const G={};Z&2097152&&(G.id=V[21]),Z&2&&(G.baseCollection=V[1]),Z&3072&&(G.disabled=V[10]||V[11]),Z&2112&&(G.placeholder=V[11]?"":V[6]),!h&&Z&1&&(h=!0,G.value=V[0],Ce(()=>h=!1)),m.$set(G)}V[5]&&V[11]?F?(F.p(V,Z),Z&2080&&M(F,1)):(F=Up(V),F.c(),M(F,1),F.m(e,null)):F&&(re(),D(F,1,1,()=>{F=null}),ae()),_&&It(_.update)&&Z&2&&_.update.call(null,V[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!C||Z&264192)&&Pt(J,B,V,V[18],C?At(B,V[18],Z,u8):Nt(V[18]),qp)},i(V){C||(M(L,V),M(A,V),m&&M(m.$$.fragment,V),M(F),M(J,V),C=!0)},o(V){D(L,V),D(A,V),m&&D(m.$$.fragment,V),D(F),D(J,V),C=!1},d(V){V&&(k(e),k(y),k(S)),L&&L.d(V),A&&A.d(V),P&&P.d(),n[16](null),m&&H(m),F&&F.d(),J&&J.d(V),T=!1,O()}}}function h8(n){let e,t,i,l;const s=[p8,d8],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}let Bp;function _8(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=Bp,S=!1;C();async function C(){y||S||(t(9,S=!0),t(8,y=(await Tt(async()=>{const{default:I}=await import("./FilterAutocompleteInput-CXrfVJaY.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Bp=y,t(9,S=!1))}async function T(){t(0,a=_||""),await dn(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(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,T,O,d,s,E,L,o]}class il extends Se{constructor(e){super(),we(this,e,_8,h8,ye,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function g8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),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=Y(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 b8(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=$(),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=$(),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 y8(n){let e,t,i,l,s,o,r,a,u;l=new ce({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[g8,({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:[b8]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new il({props:c}),ie.push(()=>be(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`<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/authentication/#multi-factor-authentication" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=$(),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(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),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const 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,Ce(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(k(e),k(t),k(i)),H(l),H(r)}}}function b8(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 y8(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 Bp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function k8(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?y8:b8}let a=r(n),u=a(n),f=n[1]&&Bp();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=Bp(),f.c(),M(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 v8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[k8],default:[g8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function w8(n,e,t){let i,l;Qe(n,kn,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=!U.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class S8 extends Se{constructor(e){super(),we(this,e,w8,v8,ye,{collection:0})}}const T8=n=>({}),Wp=n=>({});function Yp(n,e,t){const i=n.slice();return i[50]=e[t],i}const C8=n=>({}),Kp=n=>({});function Jp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Zp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=$(),p(e,"class","block txt-placeholder"),ee(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&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&k(e)}}}function $8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(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]+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function O8(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,wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]))),{props:u}}return s&&(e=zt(s,o(n))),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Gp(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(qe.call(null,e,"Clear")),Y(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function Xp(n){let e,t,i,l,s,o;const r=[O8,$8],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])&&Gp(n);return{c(){e=b("div"),i.c(),l=$(),f&&f.c(),s=$(),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()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Gp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function Qp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[D8]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function xp(n){let e,t,i,l,s,o,r,a,u=n[17].length&&em(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='<i class="ri-search-line"></i>',l=$(),s=b("input"),o=$(),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),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=Y(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=em(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 em(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=Y(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function tm(n){let e,t=n[1]&&nm(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=nm(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function nm(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&k(e)}}}function M8(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&k(t)}}}function E8(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,wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]))),{props:u}}return s&&(e=zt(s,o(n))),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function im(n){let e,t,i,l,s,o,r;const a=[E8,M8],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=$(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(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=[Y(e,"click",c),Y(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()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&k(e),u[t].d(),o=!1,Ie(r)}}}function D8(n){let e,t,i,l,s,o=n[14]&&xp(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Kp);let u=pe(n[22]),f=[];for(let g=0;g<u.length;g+=1)f[g]=im(Yp(n,u,g));const c=g=>D(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=tm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Wp);return{c(){o&&o.c(),e=$(),a&&a.c(),t=$(),i=b("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),l=$(),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],_,C8):Nt(g[45]),Kp),_[0]&56635906){u=pe(g[22]);let y;for(y=0;y<u.length;y+=1){const S=Yp(g,u,y);f[y]?(f[y].p(S,_),M(f[y],1)):(f[y]=im(S),f[y].c(),M(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=tm(g),d.c(),d.m(i,null))}h&&h.p&&(!s||_[1]&16384)&&Pt(h,m,g,g[45],s?At(m,g[45],_,T8):Nt(g[45]),Wp)},i(g){if(!s){M(a,g);for(let _=0;_<u.length;_+=1)M(f[_]);M(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),dt(f,g),d&&d.d(),h&&h.d(g)}}}function I8(n){let e,t,i,l,s,o,r=pe(U.toArray(n[0])),a=[];for(let d=0;d<r.length;d+=1)a[d]=Xp(Jp(n,r,d));const u=d=>D(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Zp(n));let c=!n[5]&&!n[6]&&Qp(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(),p(t,"tabindex",i=n[5]||n[6]?"-1":"0"),p(t,"class","selected-container"),p(t,"role","button"),ee(t,"disabled",n[5]),ee(t,"readonly",n[6]),p(e,"class",s="select "+n[15]),ee(e,"upside",n[7]),ee(e,"multiple",n[4]),ee(e,"disabled",n[5]),ee(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(U.toArray(d[0]));let h;for(h=0;h<r.length;h+=1){const g=Jp(d,r,h);a[h]?(a[h].p(g,m),M(a[h],1)):(a[h]=Xp(g),a[h].c(),M(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=Zp(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)&&ee(t,"disabled",d[5]),(!o||m[0]&64)&&ee(t,"readonly",d[6]),!d[5]&&!d[6]?c?(c.p(d,m),m[0]&96&&M(c,1)):(c=Qp(d),c.c(),M(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)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;m<r.length;m+=1)M(a[m]);M(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),dt(a,d),f&&f.d(),n[38](null),c&&c.d(),n[44](null)}}}function L8(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 A8(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:C=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=yt();let{class:N=""}=e,R,z="",F,B;function J(ke){if(U.isEmpty(y))return;let $e=U.toArray(y);U.inArray($e,ke)&&(U.removeByValue($e,ke),t(0,y=d?$e:($e==null?void 0:$e[0])||_())),P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function V(ke){if(d){let $e=U.toArray(y);U.inArray($e,ke)||t(0,y=[...$e,ke])}else t(0,y=ke);P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function Z(ke){return l(ke)?J(ke):V(ke)}function G(){t(0,y=_()),P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function de(){R!=null&&R.show&&(R==null||R.show())}function fe(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(U.isEmpty(y)||U.isEmpty(c))return;let ke=U.toArray(y),$e=[];for(const ct of ke)U.inArray(c,ct)||$e.push(ct);if($e.length){for(const ct of $e)U.removeByValue(ke,ct);t(0,y=d?ke:ke[0])}}function Te(){t(17,z="")}function Ke(ke,$e){ke=ke||[];const ct=A||L8;return ke.filter(Ht=>ct(Ht,$e))||[]}function Je(ke,$e){ke.preventDefault(),S&&d?Z($e):V($e)}function ft(ke,$e){(ke.code==="Enter"||ke.code==="Space")&&(Je(ke,$e),C&&fe())}function et(){Te(),setTimeout(()=>{const ke=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ke&&(ke.focus(),ke.scrollIntoView({block:"nearest"}))},0)}function xe(ke){ke.stopPropagation(),!h&&!m&&(R==null||R.toggle())}ln(()=>{const ke=document.querySelectorAll(`label[for="${r}"]`);for(const $e of ke)$e.addEventListener("click",xe);return()=>{for(const $e of ke)$e.removeEventListener("click",xe)}});const We=ke=>J(ke);function at(ke){ie[ke?"unshift":"push"](()=>{B=ke,t(20,B)})}function jt(){z=this.value,t(17,z)}const Ve=(ke,$e)=>Je($e,ke),Ee=(ke,$e)=>ft($e,ke);function st(ke){ie[ke?"unshift":"push"](()=>{R=ke,t(18,R)})}function De(ke){Pe.call(this,n,ke)}function Ye(ke){ie[ke?"unshift":"push"](()=>{F=ke,t(19,F)})}return n.$$set=ke=>{"id"in ke&&t(27,r=ke.id),"noOptionsText"in ke&&t(1,a=ke.noOptionsText),"selectPlaceholder"in ke&&t(2,u=ke.selectPlaceholder),"searchPlaceholder"in ke&&t(3,f=ke.searchPlaceholder),"items"in ke&&t(28,c=ke.items),"multiple"in ke&&t(4,d=ke.multiple),"disabled"in ke&&t(5,m=ke.disabled),"readonly"in ke&&t(6,h=ke.readonly),"upside"in ke&&t(7,g=ke.upside),"zeroFunc"in ke&&t(29,_=ke.zeroFunc),"selected"in ke&&t(0,y=ke.selected),"toggle"in ke&&t(8,S=ke.toggle),"closable"in ke&&t(9,C=ke.closable),"labelComponent"in ke&&t(10,T=ke.labelComponent),"labelComponentProps"in ke&&t(11,O=ke.labelComponentProps),"optionComponent"in ke&&t(12,E=ke.optionComponent),"optionComponentProps"in ke&&t(13,L=ke.optionComponentProps),"searchable"in ke&&t(14,I=ke.searchable),"searchFunc"in ke&&t(30,A=ke.searchFunc),"class"in ke&&t(15,N=ke.class),"$$scope"in ke&&t(45,o=ke.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ke){const $e=U.toArray(y);return U.inArray($e,ke)})},[y,a,u,f,d,m,h,g,S,C,T,O,E,L,I,N,J,z,R,F,B,l,i,Te,Je,ft,et,r,c,_,A,V,Z,G,de,fe,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,A8,I8,ye,{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 P8(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"),ei(e,s)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),he(e,n[0]),t||(i=Y(e,"input",n[6]),t=!0)},p(o,r){ei(e,s=wt(l,[{type:"password"},{autocomplete:"new-password"},r&16&&o[4]])),r&1&&e.value!==o[0]&&he(e,o[0])},d(o){o&&k(e),n[5](null),t=!1,i()}}}function N8(n){let e,t,i,l,s,o,r=[{disabled:!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=$(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(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(qe.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(k(e),k(i),k(l)),s=!1,Ie(o)}}}function R8(n){let e;function t(s,o){return s[1]?N8:P8}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 F8(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class ef extends Se{constructor(e){super(),we(this,e,F8,R8,ye,{value:0,mask:1})}}function q8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=$(),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),he(s,n[1].clientId),r||(a=Y(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&&he(s,u[1].clientId)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function H8(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 ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Client secret"),l=$(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Ce(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function lm(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,wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]))),u[1]!==void 0&&(c.config=u[1]),{props:c}}return r&&(t=zt(r,a(n)),ie.push(()=>be(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(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,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],Ce(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&k(e),t&&H(t)}}}function j8(n){let e,t,i,l,s,o,r,a;t=new ce({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[q8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[H8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&lm(n);return{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=Y(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=lm(f),u.c(),M(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&k(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function z8(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 U8(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 V8(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?U8:z8}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=$(),i=b("h4"),s=W(l),o=$(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){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+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(k(e),k(t),k(i)),h.d()}}}function sm(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=$(),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(qe.call(null,e,{text:"Remove provider",position:"right"})),Y(e,"click",n[10])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function B8(n){let e,t,i,l,s,o,r,a,u=!n[4]&&sm(n);return{c(){u&&u.c(),e=$(),t=b("button"),t.textContent="Cancel",i=$(),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=Y(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=sm(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 W8(n){let e,t,i={btnClose:!1,$$slots:{footer:[B8],header:[V8],default:[j8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function Y8(n,e,t){let i,l;const s=yt(),o="provider_popup_"+U.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=U.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function y(){_n(`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 C(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();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,C,T,O,E,L,I,A]}class K8 extends Se{constructor(e){super(),we(this,e,Y8,W8,ye,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function J8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=$(),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),he(s,n[2]),r||(a=Y(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]&&he(s,u[2])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function Z8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Team ID"),l=$(),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),he(s,n[3]),r||(a=Y(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]&&he(s,u[3])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function G8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Key ID"),l=$(),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),he(s,n[4]),r||(a=Y(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]&&he(s,u[4])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function X8(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=$(),l=b("i"),o=$(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","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),he(r,n[6]),u||(f=[Me(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),Y(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&&gt(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function Q8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),l=$(),s=b("textarea"),r=$(),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/authentication/#multi-factor-authentication" target="_blank" rel="noopener noreferrer" class="txt-sm link-hint" title="Learn more"><em>(Learn more)</em> </a>.</p>`,t=$(),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),ee(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),q(l,i,null),w(i,s),w(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const 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,Ce(()=>a=!1)),r.$set(g),(!u||m&1)&&ee(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(l.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(l.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(k(e),k(t),k(i)),H(l),H(r)}}}function k8(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 Wp(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function w8(n){let e,t,i,l,s,o;function r(c,d){return c[0].mfa.enabled?v8:k8}let a=r(n),u=a(n),f=n[1]&&Wp();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-check-line"></i> <span class="txt">Multi-factor authentication (MFA)</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=Wp(),f.c(),M(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 S8(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[w8],default:[y8]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&67&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function T8(n,e,t){let i,l;Qe(n,kn,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=!U.isEmpty(l==null?void 0:l.mfa))},[s,i,l,o,r]}class C8 extends Se{constructor(e){super(),we(this,e,T8,S8,ye,{collection:0})}}const $8=n=>({}),Yp=n=>({});function Kp(n,e,t){const i=n.slice();return i[50]=e[t],i}const O8=n=>({}),Jp=n=>({});function Zp(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function Gp(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=$(),p(e,"class","block txt-placeholder"),ee(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&&oe(t,l[2]),s[0]&96&&ee(e,"link-hint",!l[5]&&!l[6])},d(l){l&&k(e)}}}function M8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(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]+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function E8(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,wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]))),{props:u}}return s&&(e=zt(s,o(n))),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?wt(l,[a[0]&1&&{item:r[50]},a[0]&2048&&Rt(r[11])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function Xp(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(qe.call(null,e,"Clear")),Y(e,"click",On(nt(l)))],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function Qp(n){let e,t,i,l,s,o;const r=[E8,M8],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])&&Xp(n);return{c(){e=b("div"),i.c(),l=$(),f&&f.c(),s=$(),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()),M(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Xp(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function xp(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[L8]},$$scope:{ctx:n}};return e=new jn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&16384&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[42](null),H(e,l)}}}function em(n){let e,t,i,l,s,o,r,a,u=n[17].length&&tm(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='<i class="ri-search-line"></i>',l=$(),s=b("input"),o=$(),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),he(s,n[17]),w(t,o),u&&u.m(t,null),s.focus(),r||(a=Y(s,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&he(s,f[17]),f[17].length?u?u.p(f,c):(u=tm(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 tm(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=Y(t,"click",On(nt(n[23]))),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function nm(n){let e,t=n[1]&&im(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=im(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function im(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&2&&oe(t,i[1])},d(i){i&&k(e)}}}function D8(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[50]+"")&&oe(t,e)},i:te,o:te,d(i){i&&k(t)}}}function I8(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,wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]))),{props:u}}return s&&(e=zt(s,o(n))),{c(){e&&j(e.$$.fragment),t=ve()},m(r,a){e&&q(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,()=>{H(u,1)}),ae()}s?(e=zt(s,o(r,a)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?wt(l,[a[0]&4194304&&{item:r[50]},a[0]&8192&&Rt(r[13])]):{};e.$set(u)}},i(r){i||(e&&M(e.$$.fragment,r),i=!0)},o(r){e&&D(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&H(e,r)}}}function lm(n){let e,t,i,l,s,o,r;const a=[I8,D8],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=$(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),ee(e,"closable",n[9]),ee(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=[Y(e,"click",c),Y(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()),M(i,1),i.m(e,l)),(!s||h[0]&512)&&ee(e,"closable",n[9]),(!s||h[0]&6291456)&&ee(e,"selected",n[21](n[50]))},i(m){s||(M(i),s=!0)},o(m){D(i),s=!1},d(m){m&&k(e),u[t].d(),o=!1,Ie(r)}}}function L8(n){let e,t,i,l,s,o=n[14]&&em(n);const r=n[36].beforeOptions,a=Lt(r,n,n[45],Jp);let u=pe(n[22]),f=[];for(let g=0;g<u.length;g+=1)f[g]=lm(Kp(n,u,g));const c=g=>D(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=nm(n));const m=n[36].afterOptions,h=Lt(m,n,n[45],Yp);return{c(){o&&o.c(),e=$(),a&&a.c(),t=$(),i=b("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),l=$(),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=em(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],_,O8):Nt(g[45]),Jp),_[0]&56635906){u=pe(g[22]);let y;for(y=0;y<u.length;y+=1){const S=Kp(g,u,y);f[y]?(f[y].p(S,_),M(f[y],1)):(f[y]=lm(S),f[y].c(),M(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=nm(g),d.c(),d.m(i,null))}h&&h.p&&(!s||_[1]&16384)&&Pt(h,m,g,g[45],s?At(m,g[45],_,$8):Nt(g[45]),Yp)},i(g){if(!s){M(a,g);for(let _=0;_<u.length;_+=1)M(f[_]);M(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),dt(f,g),d&&d.d(),h&&h.d(g)}}}function A8(n){let e,t,i,l,s,o,r=pe(U.toArray(n[0])),a=[];for(let d=0;d<r.length;d+=1)a[d]=Qp(Zp(n,r,d));const u=d=>D(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Gp(n));let c=!n[5]&&!n[6]&&xp(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(),p(t,"tabindex",i=n[5]||n[6]?"-1":"0"),p(t,"class","selected-container"),p(t,"role","button"),ee(t,"disabled",n[5]),ee(t,"readonly",n[6]),p(e,"class",s="select "+n[15]),ee(e,"upside",n[7]),ee(e,"multiple",n[4]),ee(e,"disabled",n[5]),ee(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(U.toArray(d[0]));let h;for(h=0;h<r.length;h+=1){const g=Zp(d,r,h);a[h]?(a[h].p(g,m),M(a[h],1)):(a[h]=Qp(g),a[h].c(),M(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=Gp(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)&&ee(t,"disabled",d[5]),(!o||m[0]&64)&&ee(t,"readonly",d[6]),!d[5]&&!d[6]?c?(c.p(d,m),m[0]&96&&M(c,1)):(c=xp(d),c.c(),M(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)&&ee(e,"upside",d[7]),(!o||m[0]&32784)&&ee(e,"multiple",d[4]),(!o||m[0]&32800)&&ee(e,"disabled",d[5]),(!o||m[0]&32832)&&ee(e,"readonly",d[6])},i(d){if(!o){for(let m=0;m<r.length;m+=1)M(a[m]);M(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),dt(a,d),f&&f.d(),n[38](null),c&&c.d(),n[44](null)}}}function P8(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 N8(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:C=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:O={}}=e,{optionComponent:E=void 0}=e,{optionComponentProps:L={}}=e,{searchable:I=!1}=e,{searchFunc:A=void 0}=e;const P=yt();let{class:N=""}=e,R,z="",F,B;function J(ke){if(U.isEmpty(y))return;let $e=U.toArray(y);U.inArray($e,ke)&&(U.removeByValue($e,ke),t(0,y=d?$e:($e==null?void 0:$e[0])||_())),P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function V(ke){if(d){let $e=U.toArray(y);U.inArray($e,ke)||t(0,y=[...$e,ke])}else t(0,y=ke);P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function Z(ke){return l(ke)?J(ke):V(ke)}function G(){t(0,y=_()),P("change",{selected:y}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:y,bubbles:!0}))}function de(){R!=null&&R.show&&(R==null||R.show())}function fe(){R!=null&&R.hide&&(R==null||R.hide())}function ue(){if(U.isEmpty(y)||U.isEmpty(c))return;let ke=U.toArray(y),$e=[];for(const ct of ke)U.inArray(c,ct)||$e.push(ct);if($e.length){for(const ct of $e)U.removeByValue(ke,ct);t(0,y=d?ke:ke[0])}}function Te(){t(17,z="")}function Ke(ke,$e){ke=ke||[];const ct=A||P8;return ke.filter(Ht=>ct(Ht,$e))||[]}function Je(ke,$e){ke.preventDefault(),S&&d?Z($e):V($e)}function ft(ke,$e){(ke.code==="Enter"||ke.code==="Space")&&(Je(ke,$e),C&&fe())}function et(){Te(),setTimeout(()=>{const ke=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ke&&(ke.focus(),ke.scrollIntoView({block:"nearest"}))},0)}function xe(ke){ke.stopPropagation(),!h&&!m&&(R==null||R.toggle())}ln(()=>{const ke=document.querySelectorAll(`label[for="${r}"]`);for(const $e of ke)$e.addEventListener("click",xe);return()=>{for(const $e of ke)$e.removeEventListener("click",xe)}});const We=ke=>J(ke);function at(ke){ie[ke?"unshift":"push"](()=>{B=ke,t(20,B)})}function jt(){z=this.value,t(17,z)}const Ve=(ke,$e)=>Je($e,ke),Ee=(ke,$e)=>ft($e,ke);function st(ke){ie[ke?"unshift":"push"](()=>{R=ke,t(18,R)})}function De(ke){Pe.call(this,n,ke)}function Ye(ke){ie[ke?"unshift":"push"](()=>{F=ke,t(19,F)})}return n.$$set=ke=>{"id"in ke&&t(27,r=ke.id),"noOptionsText"in ke&&t(1,a=ke.noOptionsText),"selectPlaceholder"in ke&&t(2,u=ke.selectPlaceholder),"searchPlaceholder"in ke&&t(3,f=ke.searchPlaceholder),"items"in ke&&t(28,c=ke.items),"multiple"in ke&&t(4,d=ke.multiple),"disabled"in ke&&t(5,m=ke.disabled),"readonly"in ke&&t(6,h=ke.readonly),"upside"in ke&&t(7,g=ke.upside),"zeroFunc"in ke&&t(29,_=ke.zeroFunc),"selected"in ke&&t(0,y=ke.selected),"toggle"in ke&&t(8,S=ke.toggle),"closable"in ke&&t(9,C=ke.closable),"labelComponent"in ke&&t(10,T=ke.labelComponent),"labelComponentProps"in ke&&t(11,O=ke.labelComponentProps),"optionComponent"in ke&&t(12,E=ke.optionComponent),"optionComponentProps"in ke&&t(13,L=ke.optionComponentProps),"searchable"in ke&&t(14,I=ke.searchable),"searchFunc"in ke&&t(30,A=ke.searchFunc),"class"in ke&&t(15,N=ke.class),"$$scope"in ke&&t(45,o=ke.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ue(),Te()),n.$$.dirty[0]&268566528&&t(22,i=Ke(c,z)),n.$$.dirty[0]&1&&t(21,l=function(ke){const $e=U.toArray(y);return U.inArray($e,ke)})},[y,a,u,f,d,m,h,g,S,C,T,O,E,L,I,N,J,z,R,F,B,l,i,Te,Je,ft,et,r,c,_,A,V,Z,G,de,fe,s,We,at,jt,Ve,Ee,st,De,Ye,o]}class ps extends Se{constructor(e){super(),we(this,e,N8,A8,ye,{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 R8(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"),ei(e,s)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),he(e,n[0]),t||(i=Y(e,"input",n[6]),t=!0)},p(o,r){ei(e,s=wt(l,[{type:"password"},{autocomplete:"new-password"},r&16&&o[4]])),r&1&&e.value!==o[0]&&he(e,o[0])},d(o){o&&k(e),n[5](null),t=!1,i()}}}function F8(n){let e,t,i,l,s,o,r=[{disabled:!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=$(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ei(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(qe.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",nt(n[3]))],s=!0)},p(u,f){ei(l,a=wt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(k(e),k(i),k(l)),s=!1,Ie(o)}}}function q8(n){let e;function t(s,o){return s[1]?F8:R8}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 H8(n,e,t){const i=["value","mask"];let l=lt(e,i),{value:s=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,s=""),t(1,o=!1),await dn(),r==null||r.focus()}function u(c){ie[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){s=this.value,t(0,s)}return n.$$set=c=>{e=je(je({},e),Wt(c)),t(4,l=lt(e,i)),"value"in c&&t(0,s=c.value),"mask"in c&&t(1,o=c.mask)},[s,o,r,a,l,u,f]}class tf extends Se{constructor(e){super(),we(this,e,H8,q8,ye,{value:0,mask:1})}}function j8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=$(),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),he(s,n[1].clientId),r||(a=Y(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&&he(s,u[1].clientId)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function z8(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 tf({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Client secret"),l=$(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Ce(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function sm(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,wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]))),u[1]!==void 0&&(c.config=u[1]),{props:c}}return r&&(t=zt(r,a(n)),ie.push(()=>be(t,"config",o))),{c(){e=b("div"),t&&j(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){v(u,e,f),t&&q(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,()=>{H(c,1)}),ae()}r?(t=zt(r,a(u,f)),ie.push(()=>be(t,"config",o)),j(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?wt(s,[f&64&&{key:u[6]},f&8&&Rt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],Ce(()=>i=!1)),t.$set(c)}},i(u){l||(t&&M(t.$$.fragment,u),l=!0)},o(u){t&&D(t.$$.fragment,u),l=!1},d(u){u&&k(e),t&&H(t)}}}function U8(n){let e,t,i,l,s,o,r,a;t=new ce({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[j8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[z8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&sm(n);return{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){v(f,e,c),q(t,e,null),w(e,i),q(l,e,null),w(e,s),u&&u.m(e,null),o=!0,r||(a=Y(e,"submit",nt(n[18])),r=!0)},p(f,c){const d={};c&64&&(d.name=f[6]+".clientId"),c&25165826&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&64&&(m.name=f[6]+".clientSecret"),c&25165858&&(m.$$scope={dirty:c,ctx:f}),l.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=sm(f),u.c(),M(u,1),u.m(e,null)):u&&(re(),D(u,1,1,()=>{u=null}),ae())},i(f){o||(M(t.$$.fragment,f),M(l.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(l.$$.fragment,f),D(u),o=!1},d(f){f&&k(e),H(t),H(l),u&&u.d(),r=!1,a()}}}function V8(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 B8(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 W8(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?B8:V8}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=$(),i=b("h4"),s=W(l),o=$(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){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+"")&&oe(s,l),_&8&&u!==(u=g[3].key+"")&&oe(f,u)},d(g){g&&(k(e),k(t),k(i)),h.d()}}}function om(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=$(),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(qe.call(null,e,{text:"Remove provider",position:"right"})),Y(e,"click",n[10])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function Y8(n){let e,t,i,l,s,o,r,a,u=!n[4]&&om(n);return{c(){u&&u.c(),e=$(),t=b("button"),t.textContent="Cancel",i=$(),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=Y(t,"click",n[0]),r=!0)},p(f,c){f[4]?u&&(u.d(1),u=null):u?u.p(f,c):(u=om(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 K8(n){let e,t,i={btnClose:!1,$$slots:{footer:[Y8],header:[W8],default:[U8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16777466&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}function J8(n,e,t){let i,l;const s=yt(),o="provider_popup_"+U.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function h(P,N,R){t(13,m=R||0),t(4,f=U.isEmpty(N)),t(3,a=Object.assign({},P)),t(1,u=Object.assign({},N)),t(5,d=!!u.clientId),t(12,c=JSON.stringify(u)),r==null||r.show()}function g(){Yn(l),r==null||r.hide()}async function _(){s("submit",{uiOptions:a,config:u}),g()}async function y(){_n(`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 C(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();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,C,T,O,E,L,I,A]}class Z8 extends Se{constructor(e){super(),we(this,e,J8,K8,ye,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function G8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Client ID"),l=$(),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),he(s,n[2]),r||(a=Y(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]&&he(s,u[2])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function X8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Team ID"),l=$(),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),he(s,n[3]),r||(a=Y(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]&&he(s,u[3])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function Q8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Key ID"),l=$(),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),he(s,n[4]),r||(a=Y(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]&&he(s,u[4])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function x8(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=$(),l=b("i"),o=$(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","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),he(r,n[6]),u||(f=[Me(qe.call(null,l,{text:`Max ${ur} seconds (~${ur/(60*60*24*30)<<0} months).`,position:"top"})),Y(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&&gt(r.value)!==c[6]&&he(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function e5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),l=$(),s=b("textarea"),r=$(),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),he(s,n[5]),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[5])},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function x8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[J8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[Z8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[G8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[X8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Q8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),h=$(),j(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(C,T){v(C,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,y||(S=Y(e,"submit",nt(n[17])),y=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:C}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:C}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:C}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:C}),g.$set(A)},i(C){_||(M(l.$$.fragment,C),M(r.$$.fragment,C),M(f.$$.fragment,C),M(m.$$.fragment,C),M(g.$$.fragment,C),_=!0)},o(C){D(l.$$.fragment,C),D(r.$$.fragment,C),D(f.$$.fragment,C),D(m.$$.fragment,C),D(g.$$.fragment,C),_=!1},d(C){C&&k(e),H(l),H(r),H(f),H(m),H(g),y=!1,S()}}}function e5(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 t5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=$(),l=b("button"),s=b("i"),o=$(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(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=Y(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&&ee(l,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function n5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[t5],header:[e5],default:[x8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function i5(n,e,t){let i;const l=yt(),s="apple_secret_"+U.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),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.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){_e.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 C(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!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,C,T,O,E,L,I,A]}class l5 extends Se{constructor(e){super(),we(this,e,i5,n5,ye,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function s5(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new l5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=$(),l=b("span"),l.textContent="Generate secret",o=$(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),H(r,d),u=!1,f()}}}function o5(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 r5 extends Se{constructor(e){super(),we(this,e,o5,s5,ye,{key:1,config:0})}}function a5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),l=$(),s=b("input"),r=$(),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),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[0].authURL)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function u5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),l=$(),s=b("input"),r=$(),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),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[0].tokenURL)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function f5(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[a5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[u5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l)),H(i,r),H(s,r)}}}function c5(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 d5 extends Se{constructor(e){super(),we(this,e,c5,f5,ye,{key:1,config:0})}}function om(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 p5(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&&om(n);return{c(){s&&s.c(),e=$(),t=b("span"),l=W(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=om(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)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(k(e),k(t)),s&&s.d(o)}}}function m5(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class rm extends Se{constructor(e){super(),we(this,e,m5,p5,ye,{item:0})}}const h5=n=>({}),am=n=>({});function _5(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],am);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,h5):Nt(l[13]),am)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function g5(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:[_5]},$$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 ps({props:o}),ie.push(()=>be(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function b5(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=rm}=e,{optionComponent:c=rm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=U.toArray(T,!0);let O=[];for(let E of T){const L=U.findByKey(r,d,E);L&&O.push(L)}T.length&&!O.length||t(0,u=a?O:O[0])}async function g(T){let O=U.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?O:O[0])}function _(T){u=T,t(0,u)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(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(13,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,C,o]}class zn extends Se{constructor(e){super(),we(this,e,b5,g5,ye,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function y5(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"),ei(e,o)},m(r,a){v(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(l=Y(e,"input",n[6]),i=!0)},p(r,[a]){ei(e,o=wt(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 k5(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=U.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(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=U.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,k5,y5,ye,{value:0,separator:1,readonly:2,disabled:3})}}function v5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Display name"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=Y(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function w5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=Y(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function S5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=Y(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function T5(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),l=$(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function C5(n){let e,t,i,l,s,o,r,a;return l=new ce({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[O5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[M5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`<em>Both fields are considered optional because the parsed <code>id_token</code>
-                    is a direct result of the trusted server code-&gt;token exchange response.</em>`,i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),H(l),H(o),u&&r&&r.end()}}}function $5(n){let e,t,i,l;return t=new ce({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[E5,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&k(e),H(t),s&&i&&i.end()}}}function O5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=$(),l=b("i"),o=$(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Me(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function M5(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=$(),l=b("i"),o=$(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Me(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(k(e),k(o)),H(r,h),f=!1,c()}}}function E5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=Y(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function D5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){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=[Y(e,"change",n[11]),Me(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(k(e),k(i),k(l)),u=!1,Ie(f)}}}function I5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new ce({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[v5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[w5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[S5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field m-b-xs",$$slots:{default:[T5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const y=[$5,C5],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),g=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[D5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),i.textContent="Endpoints",l=$(),j(s.$$.fragment),o=$(),j(r.$$.fragment),a=$(),j(u.$$.fragment),f=$(),c=b("div"),m.c(),h=$(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),v(T,t,O),v(T,i,O),v(T,l,O),q(s,T,O),v(T,o,O),q(r,T,O),v(T,a,O),q(u,T,O),v(T,f,O),v(T,c,O),S[d].m(c,null),v(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=C(T),d===P?S[d].p(T,O):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(k(t),k(i),k(l),k(o),k(a),k(f),k(c),k(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function L5(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;U.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,L5,I5,ye,{key:1,config:0})}}function A5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=$(),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),he(s,n[0].authURL),r||(a=Y(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&&he(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function P5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=$(),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),he(s,n[0].tokenURL),r||(a=Y(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&&he(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function N5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=$(),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),he(s,n[0].userInfoURL),r||(a=Y(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&&he(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[A5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[P5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[N5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(s),k(r)),H(l,f),H(o,f),H(a,f)}}}function F5(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 wa extends Se{constructor(e){super(),we(this,e,F5,R5,ye,{key:1,config:0,required:4,title:2})}}const tf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:r5},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:d5},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,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:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function um(n,e,t){const i=n.slice();return i[16]=e[t],i}function fm(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=Y(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function q5(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&fm(n);return{c(){e=b("label"),t=b("i"),l=$(),s=b("input"),r=$(),c&&c.c(),a=ve(),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),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=Y(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]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=fm(d),c.c(),M(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 cm(n){let e,t,i,l,s=n[1]!=""&&dm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=$(),s&&s.c(),l=$(),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=dm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function dm(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=Y(e,"click",n[5]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 mm(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&&pm(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=$(),o=b("div"),r=b("div"),u=W(a),f=$(),c=b("em"),m=W(d),h=$(),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-6"),this.first=t},m(C,T){v(C,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||(_=Y(i,"click",S),g=!0)},p(C,T){e=C,e[16].logo?y?y.p(e,T):(y=pm(e),y.c(),y.m(l,null)):y&&(y.d(1),y=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d(C){C&&k(t),y&&y.d(),g=!1,_()}}}function H5(n){let e,t,i,l=[],s=new Map,o;e=new ce({props:{class:"searchbar m-b-sm",$$slots:{default:[q5,({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=um(n,r,f),d=a(c);s.set(d,l[f]=mm(d,c))}let u=null;return r.length||(u=cm(n)),{c(){j(e.$$.fragment),t=$(),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){q(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=vt(l,c,a,1,f,r,s,i,di,mm,null,um),!r.length&&u?u.p(f,c):r.length?u&&(u.d(1),u=null):(u=cm(f),u.c(),u.m(i,null)))},i(f){o||(M(e.$$.fragment,f),o=!0)},o(f){D(e.$$.fragment,f),o=!1},d(f){f&&(k(t),k(i)),H(e,f);for(let c=0;c<l.length;c+=1)l[c].d();u&&u.d()}}}function j5(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 z5(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=Y(e,"click",n[0]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function U5(n){let e,t,i={btnClose:!1,$$slots:{footer:[z5],header:[j5],default:[H5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&1048586&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function V5(n,e,t){const i=yt();let{disabled:l=[]}=e,s,o="",r=[];function a(){d(),s==null||s.show()}function u(){return s==null?void 0:s.hide()}function f(C){i("select",C),u()}function c(){const C=(o||"").toLowerCase();return tf.filter(T=>!l.includes(T.key)&&(C==""||T.key.toLowerCase().includes(C)||T.title.toLowerCase().includes(C)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=C=>f(C);function _(C){ie[C?"unshift":"push"](()=>{s=C,t(2,s)})}function y(C){Pe.call(this,n,C)}function S(C){Pe.call(this,n,C)}return n.$$set=C=>{"disabled"in C&&t(6,l=C.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 B5 extends Se{constructor(e){super(),we(this,e,V5,U5,ye,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function hm(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 W5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 Y5(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 K5(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 _m(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(qe.call(null,e,{text:"Edit config",position:"left"})),Y(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function gm(n,e){var C;let t,i,l,s,o,r,a=(e[28].displayName||((C=e[29])==null?void 0:C.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?K5:Y5}let _=g(e),y=_(e),S=e[29]&&_m(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),y.c(),s=$(),o=b("div"),r=b("div"),u=W(a),f=$(),c=b("em"),m=W(d),h=$(),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"),ee(i,"error",!U.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){v(T,t,O),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(T,O){var E,L,I,A;e=T,_===(_=g(e))&&y?y.p(e,O):(y.d(1),y=_(e),y&&(y.c(),y.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),O[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,O):(S=_m(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&ee(i,"error",!U.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&k(t),y.d(),S&&S.d()}}}function J5(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 Z5(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 bm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[G5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[X5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[Q5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[x5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,y){v(_,e,y),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,y){const S={};y[0]&134217761|y[1]&2&&(S.$$scope={dirty:y,ctx:_}),l.$set(S);const C={};y[0]&134217793|y[1]&2&&(C.$$scope={dirty:y,ctx:_}),r.$set(C);const T={};y[0]&134217761|y[1]&2&&(T.$$scope={dirty:y,ctx:_}),f.$set(T);const O={};y[0]&134217761|y[1]&2&&(O.$$scope={dirty:y,ctx:_}),m.$set(O)},i(_){g||(M(l.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&k(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function G5(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:sO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function X5(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:oO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function Q5(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:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function x5(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:aO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function eO(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,y,S,C,T,O,E;e=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[W5,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=pe(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z<L.length;z+=1){let F=hm(n,L,z),B=I(F);s.set(B,l[z]=gm(B,F))}function A(z,F){return z[4]?Z5:J5}let P=A(n),N=P(n),R=n[4]&&bm(n);return{c(){j(e.$$.fragment),t=$(),i=b("div");for(let z=0;z<l.length;z+=1)l[z].c();o=$(),r=b("div"),a=b("button"),a.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add provider</span>',u=$(),f=b("button"),c=b("strong"),d=W("Optional "),h=W(m),g=W(" create fields map"),_=$(),N.c(),S=$(),R&&R.c(),C=ve(),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(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let B=0;B<l.length;B+=1)l[B]&&l[B].m(i,null);w(i,o),w(i,r),w(r,a),v(z,u,F),v(z,f,F),w(f,c),w(c,d),w(c,h),w(c,g),w(f,_),N.m(f,null),v(z,S,F),R&&R.m(z,F),v(z,C,F),T=!0,O||(E=[Y(a,"click",n[12]),Y(f,"click",n[13])],O=!0)},p(z,F){const B={};F[0]&134217729|F[1]&2&&(B.$$scope={dirty:F,ctx:z}),e.$set(B),F[0]&523&&(L=pe(z[0].oauth2.providers),l=vt(l,F,I,1,z,L,s,i,di,gm,o,hm)),(!T||F[0]&1)&&m!==(m=z[0].name+"")&&oe(h,m),P!==(P=A(z))&&(N.d(1),N=P(z),N&&(N.c(),N.m(f,null))),(!T||F[0]&16&&y!==(y="m-t-25 btn btn-sm "+(z[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(f,"class",y),z[4]?R?(R.p(z,F),F[0]&16&&M(R,1)):(R=bm(z),R.c(),M(R,1),R.m(C.parentNode,C)):R&&(re(),D(R,1,1,()=>{R=null}),ae())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(k(t),k(i),k(u),k(f),k(S),k(C)),H(e,z);for(let F=0;F<l.length;F+=1)l[F].d();N.d(),R&&R.d(z),O=!1,Ie(E)}}}function tO(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 nO(n){let e,t,i,l=n[7]==1?"provider":"providers",s,o,r;return{c(){e=b("span"),t=W(n[7]),i=$(),s=W(l),o=$(),r=b("span"),r.textContent="Enabled",p(e,"class","label"),ee(e,"label-warning",!n[7]),ee(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&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(k(e),k(o),k(r))}}}function ym(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function iO(n){let e,t,i,l,s,o;function r(c,d){return c[0].oauth2.enabled?nO:tO}let a=r(n),u=a(n),f=n[8]&&ym();return{c(){e=b("div"),e.innerHTML='<i class="ri-pass-expired-line"></i> <span class="txt">OAuth2</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=ym(),f.c(),M(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 lO(n){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[iO],default:[eO]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(km))||[]};i=new B5({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new K8({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(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(km))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(k(t),k(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const sO=()=>"",oO=()=>"",rO=()=>"",aO=()=>"",km=n=>n.name;function uO(n,e,t){let i,l,s;Qe(n,kn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var B,J;t(5,m=((B=F==null?void 0:F.filter(V=>a.includes(V.type)&&!r.includes(V.name)))==null?void 0:B.map(V=>V.name))||[]),t(6,h=((J=F==null?void 0:F.filter(V=>u.includes(V.type)&&!r.includes(V.name)))==null?void 0:J.map(V=>V.name))||[])}function _(F){for(let B of tf)if(B.key==F)return B;return null}function y(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,B,J)=>{c==null||c.show(F,B,J)},C=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var B,J;c.show(F.detail,{},((J=(B=o.oauth2)==null?void 0:B.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const B=F.detail.uiOptions;U.removeByKey(o.oauth2.providers,"name",B.key),t(0,o)},z=F=>{const B=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),U.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:B.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,B;n.$$.dirty[0]&1&&U.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=!U.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((B=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:B.length)||0)},[o,s,f,c,d,m,h,l,i,_,y,S,C,T,O,E,L,I,A,P,N,R,z]}class fO extends Se{constructor(e){super(),we(this,e,uO,lO,ye,{collection:0},null,[-1,-1])}}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(qe.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 cO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&vm();return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),r=$(),c&&c.c(),a=ve(),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=[Y(e,"change",n[4]),Y(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=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,Ie(f)}}}function dO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),l=$(),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),he(s,n[0].otp.duration),r||(a=Y(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&&gt(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function pO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),l=$(),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),he(s,n[0].otp.length),r||(a=Y(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&&gt(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function mO(n){let e,t,i,l,s,o,r,a,u;return e=new ce({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[pO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div"),j(s.$$.fragment),o=$(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(t),k(i)),H(e,f),H(s),H(a)}}}function hO(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 _O(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function gO(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?_O:hO}let a=r(n),u=a(n),f=n[1]&&wm();return{c(){e=b("div"),e.innerHTML='<i class="ri-time-line"></i> <span class="txt">One-time password (OTP)</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=wm(),f.c(),M(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 bO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[gO],default:[mO]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yO(n,e,t){let i,l,s;Qe(n,kn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.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=!U.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class kO extends Se{constructor(e){super(),we(this,e,yO,bO,ye,{collection:0})}}function Sm(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(qe.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 vO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Sm();return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),r=$(),c&&c.c(),a=ve(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},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=Y(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Sm(),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 wO(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=$(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function SO(n){let e,t,i,l;return e=new ce({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[vO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[wO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function TO(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 CO(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 Tm(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function $O(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?CO:TO}let a=r(n),u=a(n),f=n[2]&&Tm();return{c(){e=b("div"),e.innerHTML='<i class="ri-lock-password-line"></i> <span class="txt">Identity/Password</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=Tm(),f.c(),M(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 ji({props:{single:!0,$$slots:{header:[$O],default:[SO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function MO(n,e,t){let i,l,s;Qe(n,kn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const y=U.parseIndex(_);if(!y.unique||y.columns.length!=1||y.columns[0].name=="email")continue;const S=h.find(C=>!C.hidden&&C.name.toLowerCase()==y.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!U.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class EO extends Se{constructor(e){super(),we(this,e,MO,OO,ye,{collection:0})}}function Cm(n,e,t){const i=n.slice();return i[22]=e[t],i}function $m(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Rk(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=$(),o=b("label"),a=W(r),f=$(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(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=Y(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 DO(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=Cm(n,l,o),a=s(r);t.set(a,e[o]=$m(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,$m,i,Cm))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function IO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("To email address"),l=$(),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),he(s,n[1]),s.focus(),r||(a=Y(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]&&he(s,u[1])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function LO(n){let e,t,i,l,s,o,r;return t=new ce({props:{class:"form-field required",name:"template",$$slots:{default:[DO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[IO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=Y(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&k(e),H(t),H(l),o=!1,r()}}}function AO(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=W("Close"),i=$(),l=b("button"),s=b("i"),o=$(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(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=Y(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&&ee(l,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function NO(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:[AO],default:[LO]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Om="email_test_request";function RO(n,e,t){let i;const l=yt(),s="email_test_"+U.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(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),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(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Om),$i("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Om}),tn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function y(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const C=()=>g(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(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,C,T,O,E,L]}class _k extends Se{constructor(e){super(),we(this,e,RO,NO,ye,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function FO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 Em(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new fO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Dm(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 X6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,Ce(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&k(t),H(i,u)}}}function qO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P=[],N=new Map,R,z,F,B,J,V,Z,G,de,fe,ue;o=new ce({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[FO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new EO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Em(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new kO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new S8({props:We}),ie.push(()=>be(_,"collection",xe));let at=pe(n[2]);const jt=De=>De[18].key;for(let De=0;De<at.length;De+=1){let Ye=Mm(n,at,De),ke=jt(Ye);N.set(ke,P[De]=Dm(ke,Ye))}function Ve(De){n[16](De)}let Ee={};n[0]!==void 0&&(Ee.collection=n[0]),J=new o8({props:Ee}),ie.push(()=>be(J,"collection",Ve));let st={};return G=new _k({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),c=$(),Je&&Je.c(),d=$(),j(m.$$.fragment),g=$(),j(_.$$.fragment),S=$(),C=b("h4"),T=b("span"),T.textContent="Mail templates",O=$(),E=b("button"),E.textContent="Send test email",L=$(),I=b("div"),A=b("div");for(let De=0;De<P.length;De+=1)P[De].c();R=$(),z=b("h4"),z.textContent="Other",F=$(),B=b("div"),j(J.$$.fragment),Z=$(),j(G.$$.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(T,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-xs m-l-auto btn-secondary"),p(C,"class","section-title"),p(A,"class","accordions"),p(I,"class","accordions m-b-35"),p(z,"class","section-title"),p(B,"class","accordions m-b-base")},m(De,Ye){v(De,e,Ye),w(e,t),w(t,i),w(t,l),w(t,s),q(o,s,null),v(De,r,Ye),v(De,a,Ye),q(u,a,null),w(a,c),Je&&Je.m(a,null),w(a,d),q(m,a,null),w(a,g),q(_,a,null),v(De,S,Ye),v(De,C,Ye),w(C,T),w(C,O),w(C,E),v(De,L,Ye),v(De,I,Ye),w(I,A);for(let ke=0;ke<P.length;ke+=1)P[ke]&&P[ke].m(A,null);v(De,R,Ye),v(De,z,Ye),v(De,F,Ye),v(De,B,Ye),q(J,B,null),v(De,Z,Ye),q(G,De,Ye),de=!0,fe||(ue=Y(E,"click",n[14]),fe=!0)},p(De,[Ye]){const ke={};Ye&6291457&&(ke.$$scope={dirty:Ye,ctx:De}),o.$set(ke);const $e={};!f&&Ye&1&&(f=!0,$e.collection=De[0],Ce(()=>f=!1)),u.$set($e),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&M(Je,1)):(Je=Em(De),Je.c(),M(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],Ce(()=>h=!1)),m.$set(ct);const Ht={};!y&&Ye&1&&(y=!0,Ht.collection=De[0],Ce(()=>y=!1)),_.$set(Ht),Ye&4&&(at=pe(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Dm,null,Mm),ae());const Le={};!V&&Ye&1&&(V=!0,Le.collection=De[0],Ce(()=>V=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!de){M(o.$$.fragment,De),M(u.$$.fragment,De),M(Je),M(m.$$.fragment,De),M(_.$$.fragment,De);for(let Ye=0;Ye<at.length;Ye+=1)M(P[Ye]);M(J.$$.fragment,De),M(G.$$.fragment,De),de=!0}},o(De){D(o.$$.fragment,De),D(u.$$.fragment,De),D(Je),D(m.$$.fragment,De),D(_.$$.fragment,De);for(let Ye=0;Ye<P.length;Ye+=1)D(P[Ye]);D(J.$$.fragment,De),D(G.$$.fragment,De),de=!1},d(De){De&&(k(e),k(r),k(a),k(S),k(C),k(L),k(I),k(R),k(z),k(F),k(B),k(Z)),H(o),H(u),Je&&Je.d(),H(m),H(_);for(let Ye=0;Ye<P.length;Ye+=1)P[Ye].d();H(J),n[17](null),H(G,De),fe=!1,ue()}}}function HO(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(O){u=O,t(0,u)}function h(O){u=O,t(0,u)}function g(O){u=O,t(0,u)}function _(O){u=O,t(0,u)}const y=()=>c==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function C(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,y,S,C,T]}class jO extends Se{constructor(e){super(),we(this,e,HO,qO,ye,{collection:0})}}const zO=n=>({dragging:n&4,dragover:n&8}),Im=n=>({dragging:n[2],dragover:n[3]});function UO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Im);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[Y(e,"dragover",nt(n[11])),Y(e,"dragleave",nt(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(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,zO):Nt(a[9]),Im),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,Ie(s)}}}function VO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L<O?(r.splice(O+1,0,r[L]),r.splice(L,1)):(r.splice(O,0,r[L]),r.splice(L+1,1)),t(6,r),s("sort",{oldIndex:L,newIndex:O,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),C=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,y,S,C]}class _o extends Se{constructor(e){super(),we(this,e,VO,UO,ye,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function BO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function WO(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=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],Ce(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function YO(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 KO(n){let e,t,i,l;const s=[YO,WO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function Am(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Pm(Lm(n,l,o));return{c(){e=b("div"),t=b("span"),t.textContent="Presets",i=$();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=Lm(o,l,a);s[a]?s[a].p(u,r):(s[a]=Pm(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),dt(s,o)}}}function Pm(n){let e,t=n[27]+"",i,l,s,o;function r(){return n[21](n[27])}return{c(){e=b("button"),i=W(t),l=$(),p(e,"type","button"),p(e,"class","label link-primary"),ee(e,"label-info",n[9].includes(n[27]))},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&oe(i,t),u[0]&1536&&ee(e,"label-info",n[9].includes(n[27]))},d(a){a&&k(e),s=!1,o()}}}function JO(n){let e,t,i,l,s,o;e=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[BO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[KO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Am(n);return{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),r&&r.c(),s=ve()},m(a,u){q(e,a,u),v(a,t,u),q(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=Am(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l),k(s)),H(e,a),H(i,a),r&&r.d(a)}}}function ZO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=W(t),l=W(" index")},m(s,o){v(s,e,o),w(e,i),w(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&oe(i,t)},d(s){s&&k(e)}}}function Nm(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(qe.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function GO(n){let e,t,i,l,s,o,r=n[5]!=""&&Nm(n);return{c(){r&&r.c(),e=$(),t=b("button"),t.innerHTML='<span class="txt">Cancel</span>',i=$(),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"),ee(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=[Y(t,"click",n[17]),Y(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(l)),r&&r.d(a),s=!1,Ie(o)}}}function XO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[GO],header:[ZO],default:[JO]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new Xt({props:l}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){j(e.$$.fragment)},m(s,o){q(e,s,o),t=!0},p(s,o){const r=o[0]&16384?wt(i,[i[0],Rt(s[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[22](null),H(e,s)}}}function QO(n,e,t){let i,l,s;const o=["collection","show","hide"];let r=lt(e,o);const a=yt();let{collection:u}=e,f,c="",d="",m="",h,g=!1;function _(B,J){return t(6,m=U.isEmpty(J)?"":J),t(5,c=B||S()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function S(){const B=U.parseIndex("");return B.tableName=(u==null?void 0:u.name)||"",U.buildIndex(B)}function C(){a("remove",c),y()}function T(){s.length&&(a("submit",{old:c,new:d}),y())}function O(B){const J=U.clone(l),V=J.columns.find(Z=>Z.name==B);V?U.removeByValue(J.columns,V):U.pushUnique(J.columns,{name:B}),t(2,d=U.buildIndex(J))}ln(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:B}=await import("./CodeEditor-8naseTA8.js");return{default:B}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const E=()=>C(),L=()=>y(),I=()=>T(),A=B=>{t(3,l.unique=B.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=U.buildIndex(l))};function P(B){d=B,t(2,d)}const N=B=>O(B);function R(B){ie[B?"unshift":"push"](()=>{f=B,t(4,f)})}function z(B){Pe.call(this,n,B)}function F(B){Pe.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),Wt(B)),t(14,r=lt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,J,V;n.$$.dirty[0]&1&&t(10,i=((J=(B=u==null?void 0:u.fields)==null?void 0:B.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=U.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((V=l.columns)==null?void 0:V.map(Z=>Z.name))||[])},[u,y,d,l,f,c,m,h,g,s,i,C,T,O,r,_,E,L,I,A,P,N,R,z,F]}class xO extends Se{constructor(e){super(),we(this,e,QO,XO,ye,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Rm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=U.parseIndex(i[10]);return i[11]=l,i}function Fm(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){var u;v(r,e,a),l=!0,s||(o=Me(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,Ct,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,Ct,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function qm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function Hm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(jm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&qm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=$(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Me(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(m,h){var g,_,y,S,C;n=m,n[11].unique?f||(f=qm(),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(jm).join(", "))+"")&&oe(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&&It(r.update)&&h&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(m){m&&k(e),f&&f.d(),a=!1,Ie(u)}}}function eM(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Fm(n),y=pe(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;P<y.length;P+=1)S[P]=Hm(Rm(n,y,P));function C(P){n[7](P)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new xO({props:T}),n[6](c),ie.push(()=>be(c,"collection",C)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),l=W(i),s=W(`)
-    `),_&&_.c(),o=$(),r=b("div");for(let P=0;P<S.length;P+=1)S[P].c();a=$(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=$(),j(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){v(P,e,N),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(P,o,N),v(P,r,N);for(let R=0;R<S.length;R+=1)S[R]&&S[R].m(r,null);w(r,a),w(r,u),v(P,f,N),q(c,P,N),m=!0,h||(g=Y(u,"click",n[5]),h=!0)},p(P,[N]){var z,F,B,J,V;if((!m||N&1)&&i!==(i=(((F=(z=P[0])==null?void 0:z.indexes)==null?void 0:F.length)||0)+"")&&oe(l,i),(J=(B=P[2])==null?void 0:B.indexes)!=null&&J.message?_?(_.p(P,N),N&4&&M(_,1)):(_=Fm(P),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),N&7){y=pe(((V=P[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Z<y.length;Z+=1){const G=Rm(P,y,Z);S[Z]?S[Z].p(G,N):(S[Z]=Hm(G),S[Z].c(),S[Z].m(r,a))}for(;Z<S.length;Z+=1)S[Z].d(1);S.length=y.length}const R={};!d&&N&1&&(d=!0,R.collection=P[0],Ce(()=>d=!1)),c.$set(R)},i(P){m||(M(_),M(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(k(e),k(o),k(r),k(f)),_&&_.d(),dt(S,P),n[6](null),H(c,P),h=!1,g()}}}const jm=n=>n.name;function tM(n,e,t){let i;Qe(n,kn,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),Yn("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),Yn("indexes."+h);break}t(0,l)},d=m=>{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),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 nM extends Se{constructor(e){super(),we(this,e,tM,eM,ye,{collection:0})}}function zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Um(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=$(),l=b("span"),l.textContent=`${n[5].label}`,s=$(),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=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&k(e),o=!1,r()}}}function iM(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Um(zm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=zm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Um(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),dt(i,l)}}}function lM(n){let e,t,i,l,s,o,r,a;return o=new jn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[iM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=$(),l=b("div"),l.textContent="New field",s=$(),j(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),q(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||(M(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&k(e),H(o)}}}function sM(n,e,t){let{class:i=""}=e;const l=yt(),s=[{label:"Plain text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:U.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Autodate",value:"autodate",icon:U.getFieldTypeIcon("autodate")},{label:"Select",value:"select",icon:U.getFieldTypeIcon("select")},{label:"File",value:"file",icon:U.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:U.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:U.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 oM extends Se{constructor(e){super(),we(this,e,sM,lM,ye,{class:0})}}const rM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Vm=n=>({interactive:n[7],hasErrors:n[6]}),aM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),uM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]});function Ym(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 Km(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&oe(t,i[5])},d(i){i&&k(e)}}}function Jm(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 fM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Km(n),g=n[0].hidden&&Jm();return{c(){e=b("div"),h&&h.c(),t=$(),g&&g.c(),i=$(),l=b("div"),s=b("i"),a=$(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=U.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),ee(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=qe.call(null,l,n[0].type+(n[0].system?" (system)":""))),Y(l,"click",n[21]),Y(u,"input",n[23])],d=!0)},p(_,y){_[0].required?h?h.p(_,y):(h=Km(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Jm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y[0]&1&&o!==(o=U.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&It(r.update)&&y[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),y[0]&129&&ee(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,Ie(m)}}}function cM(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 dM(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]),ee(e,"btn-hint",!n[4]&&!n[6]),ee(e,"btn-danger",n[6])},m(r,a){v(r,e,a),w(e,t),s||(o=Y(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&&ee(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&ee(e,"btn-danger",r[6])},d(r){r&&k(e),s=!1,o()}}}function pM(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(qe.call(null,e,"Restore")),Y(e,"click",n[14])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function Zm(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],Bm);let _=s&&Gm(n),y=r&&Xm(n),S=u&&Qm(n);const C=n[20].optionsFooter,T=Lt(C,n,n[28],Vm);let O=!n[0]._toDelete&&!n[0].primaryKey&&xm(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=$(),l=b("div"),_&&_.c(),o=$(),y&&y.c(),a=$(),S&&S.c(),f=$(),T&&T.c(),c=$(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){v(E,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),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,E,E[28],m?At(h,E[28],L,aM):Nt(E[28]),Bm),L[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=Gm(E),_.c(),M(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?y?(y.p(E,L),L[0]&257&&M(y,1)):(y=Xm(E),y.c(),M(y,1),y.m(l,a)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&M(S,1)):(S=Qm(E),S.c(),M(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),T&&T.p&&(!m||L[0]&268435648)&&Pt(T,C,E,E[28],m?At(C,E[28],L,rM):Nt(E[28]),Vm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=xm(E),O.c(),M(O,1),O.m(l,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae())},i(E){m||(M(g,E),M(_),M(y),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=He(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(y),D(S),D(T,E),D(O),E&&(d||(d=He(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&k(e),g&&g.d(E),_&&_.d(),y&&y.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Gm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[mM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),o=W(n[5]),r=$(),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=[Y(e,"change",n[24]),Me(u=qe.call(null,a,{text:`Requires the field value NOT to be ${U.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&&oe(o,m[5]),u&&It(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${U.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,Ie(d)}}}function Xm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[hM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function hM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Hidden",o=$(),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=[Y(e,"change",n[25]),Y(e,"change",n[26]),Me(qe.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,Ie(f)}}}function Qm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[_M,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _M(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=$(),s=b("label"),o=b("span"),o.textContent="Presentable",r=$(),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=[Y(e,"change",n[27]),Me(qe.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,Ie(d)}}}function xm(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[gM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(o)}}}function eh(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=Y(e,"click",nt(n[13])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function gM(n){let e,t,i,l,s,o=!n[0].system&&eh(n);return{c(){e=b("button"),e.innerHTML='<span class="txt">Duplicate</span>',t=$(),o&&o.c(),i=ve(),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=Y(e,"click",nt(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=eh(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 bM(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Ym();l=new ce({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[fM]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Wm),m=d||cM();function h(S,C){if(S[0]._toDelete)return pM;if(S[7])return dM}let g=h(n),_=g&&g(n),y=n[7]&&n[4]&&Zm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=$(),j(l.$$.fragment),s=$(),m&&m.c(),o=$(),_&&_.c(),r=$(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),ee(e,"required",n[0].required),ee(e,"expanded",n[7]&&n[4]),ee(e,"deleted",n[0]._toDelete)},m(S,C){v(S,e,C),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),y&&y.m(e,null),u=!0},p(S,C){S[7]&&S[2]?f||(f=Ym(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),C[0]&2&&(T.name="fields."+S[1]+".name"),C[0]&268435625&&(T.$$scope={dirty:C,ctx:S}),l.$set(T),d&&d.p&&(!u||C[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],C,uM):Nt(S[28]),Wm),g===(g=h(S))&&_?_.p(S,C):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?y?(y.p(S,C),C[0]&144&&M(y,1)):(y=Zm(S),y.c(),M(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),(!u||C[0]&1)&&ee(e,"required",S[0].required),(!u||C[0]&144)&&ee(e,"expanded",S[7]&&S[4]),(!u||C[0]&1)&&ee(e,"deleted",S[0]._toDelete)},i(S){u||(M(l.$$.fragment,S),M(m,S),M(y),S&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(y),S&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),H(l),m&&m.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Ta=[];function yM(n,e,t){let i,l,s,o,r;Qe(n,kn,fe=>t(19,r=fe));let{$$slots:a={},$$scope:u}=e;const f="f_"+U.randomString(8),c=yt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:y=U.initSchemaField()}=e,{draggable:S=!0}=e,{collection:C={}}=e,T,O=!1;function E(){y.id?t(0,y._toDelete=!0,y):(N(),c("remove"))}function L(){t(0,y._toDelete=!1,y),Ut({})}function I(){y._toDelete||(N(),c("duplicate"))}function A(fe){return U.slugify(fe)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let fe of Ta)fe.id!=f&&fe.collapse()}ln(()=>(Ta.push({id:f,collapse:N}),y.onMountSelect&&(t(0,y.onMountSelect=!1,y),T==null||T.select()),()=>{U.removeByKey(Ta,"id",f)}));const F=()=>T==null?void 0:T.focus();function B(fe){ie[fe?"unshift":"push"](()=>{T=fe,t(3,T)})}const J=fe=>{const ue=y.name;t(0,y.name=A(fe.target.value),y),fe.target.value=y.name,c("rename",{oldName:ue,newName:y.name})};function V(){y.required=this.checked,t(0,y)}function Z(){y.hidden=this.checked,t(0,y)}const G=fe=>{fe.target.checked&&t(0,y.presentable=!1,y)};function de(){y.presentable=this.checked,t(0,y)}return n.$$set=fe=>{"key"in fe&&t(1,_=fe.key),"field"in fe&&t(0,y=fe.field),"draggable"in fe&&t(2,S=fe.draggable),"collection"in fe&&t(18,C=fe.collection),"$$scope"in fe&&t(28,u=fe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=(C==null?void 0:C.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=!U.isEmpty(U.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[y==null?void 0:y.type]||"Nonempty")},[y,_,S,T,O,o,s,l,i,c,m,h,g,E,L,I,A,R,C,r,a,F,B,J,V,Z,G,de,u]}class ni extends Se{constructor(e){super(),we(this,e,yM,bM,ye,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function kM(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 zn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Me(qe.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],Ce(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),H(t),s=!1,o()}}}function vM(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[kM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(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||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),H(i,r)}}}function wM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[vM,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const Ca=1,$a=2,Oa=3;function SM(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:Ca},{label:"Update",value:$a},{label:"Create/Update",value:Oa}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Oa:o.onUpdate?$a:Ca}function f(_){switch(_){case Ca: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 Oa: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),Wt(_)),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 TM extends Se{constructor(e){super(),we(this,e,SM,wM,ye,{field:0,key:1})}}function CM(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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function $M(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;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),Wt(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 OM extends Se{constructor(e){super(),we(this,e,$M,CM,ye,{field:0,key:1})}}var Ma=["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},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Gn=function(n){return n===!0?1:0};function th(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 Cn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ot(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 gk(n,e){if(e(n))return n;if(n.parentNode)return gk(n.parentNode,e)}function Zo(n,e){var t=Ot("div","numInputWrapper"),i=Ot("input","numInput "+n),l=Ot("span","arrowUp"),s=Ot("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 Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Da=function(){},Cr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},MM={D:Da,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*Gn(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:Da,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:Da,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return Cr(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Gn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},bk=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},fu=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to: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 C=d[_],T=C==="\\",O=d[_-1]==="\\"||T;if(wl[C]&&!O){S+=wl[C];var E=new RegExp(S).exec(s);E&&(h=!0)&&g[C!=="Y"?"push":"unshift"]({fn:MM[C],val:E[++y]})}else T||(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 Vn(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 EM=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Ia=function(n,e,t){return n*3600+e*60+t},DM=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},IM={DAY:864e5};function La(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 mn=function(){return mn=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},mn.apply(this,arguments)},nh=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},LM=300;function AM(n,e){var t={config:mn(mn({},es),en.defaultConfig),l10n:to};t.parseDate=fu({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=ct,t.changeMonth=fe,t.changeYear=et,t.clear=ue,t.close=Te,t.onMouseOver=Ve,t._createElement=Ot,t.createDay=E,t.destroy=Ke,t.isEnabled=xe,t.jumpToDate=S,t.updateValue=Dn,t.open=st,t.redraw=ot,t.set=Ft,t.setDate=vn,t.toggle=sn;function i(){t.utils={getDaysInMonth:function(X,x){return X===void 0&&(X=t.currentMonth),x===void 0&&(x=t.currentYear),X===1&&(x%4===0&&x%100!==0||x%400===0)?29:t.l10n.daysInMonth[X]}}}function l(){t.element=t.input=n,t.isOpen=!1,Ye(),$e(),li(),Oi(),i(),t.isMobile||O(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Dn(!1)),r();var X=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&X&&ct(),Dt("onReady")}function s(){var X;return((X=t.calendarContainer)===null||X===void 0?void 0:X.getRootNode()).activeElement||document.activeElement}function o(X){return X.bind(t)}function r(){var X=t.config;X.weekNumbers===!1&&X.showMonths===1||X.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 x=(t.days.offsetWidth+1)*X.showMonths;t.daysContainer.style.width=x+"px",t.calendarContainer.style.width=x+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(X){if(t.selectedDates.length===0){var x=t.config.minDate===void 0||Vn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),le=La(t.config);x.setHours(le.hours,le.minutes,le.seconds,x.getMilliseconds()),t.selectedDates=[x],t.latestSelectedDateObj=x}X!==void 0&&X.type!=="blur"&&cl(X);var ge=t._input.value;c(),Dn(),t._input.value!==ge&&t._debouncedChange()}function u(X,x){return X%12+12*Gn(x===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,x=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var ge=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Vn(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 Be=Ia(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ia(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),se=Ia(X,x,le);if(se>rt&&se<Be){var Oe=DM(Be);X=Oe[0],x=Oe[1],le=Oe[2]}}else{if(Fe){var Ne=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;X=Math.min(X,Ne.getHours()),X===Ne.getHours()&&(x=Math.min(x,Ne.getMinutes())),x===Ne.getMinutes()&&(le=Math.min(le,Ne.getSeconds()))}if(ge){var ze=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;X=Math.max(X,ze.getHours()),X===ze.getHours()&&x<ze.getMinutes()&&(x=ze.getMinutes()),x===ze.getMinutes()&&(le=Math.max(le,ze.getSeconds()))}}m(X,x,le)}}function d(X){var x=X||t.latestSelectedDateObj;x&&x instanceof Date&&m(x.getHours(),x.getMinutes(),x.getSeconds())}function m(X,x,le){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(X%24,x,le||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Ln(t.config.time_24hr?X:(12+X)%12+12*Gn(X%12===0)),t.minuteElement.value=Ln(x),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Gn(X>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(le)))}function h(X){var x=Un(X),le=parseInt(x.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,x,le,ge){if(x instanceof Array)return x.forEach(function(Fe){return g(X,Fe,le,ge)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,x,le,ge)});X.addEventListener(x,le,ge),t._handlers.push({remove:function(){return X.removeEventListener(x,le,ge)}})}function _(){Dt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(ge){return g(ge,"click",t[le])})}),t.isMobile){wn();return}var X=th(Ee,50);if(t._debouncedChange=th(_,LM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ve(Un(le))}),g(t._input,"keydown",jt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",jt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ft):g(window.document,"mousedown",ft),g(window.document,"focus",ft,{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",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var x=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",C),g([t.hourElement,t.minuteElement],["focus","click"],x),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",at)}function S(X,x){var le=X!==void 0?t.parseDate(X):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),ge=t.currentYear,Fe=t.currentMonth;try{le!==void 0&&(t.currentYear=le.getFullYear(),t.currentMonth=le.getMonth())}catch(Be){Be.message="Invalid date supplied: "+le,t.config.errorHandler(Be)}x&&t.currentYear!==ge&&(Dt("onYearChange"),z()),x&&(t.currentYear!==ge||t.currentMonth!==Fe)&&Dt("onMonthChange"),t.redraw()}function C(X){var x=Un(X);~x.className.indexOf("arrow")&&T(X,x.classList.contains("arrowUp")?1:-1)}function T(X,x,le){var ge=X&&Un(X),Fe=le||ge&&ge.parentNode&&ge.parentNode.firstChild,Be=Mi("increment");Be.delta=x,Fe&&Fe.dispatchEvent(Be)}function O(){var X=window.document.createDocumentFragment();if(t.calendarContainer=Ot("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(X.appendChild(J()),t.innerContainer=Ot("div","flatpickr-innerContainer"),t.config.weekNumbers){var x=de(),le=x.weekWrapper,ge=x.weekNumbers;t.innerContainer.appendChild(le),t.weekNumbers=ge,t.weekWrapper=le}t.rContainer=Ot("div","flatpickr-rContainer"),t.rContainer.appendChild(Z()),t.daysContainer||(t.daysContainer=Ot("div","flatpickr-days"),t.daysContainer.tabIndex=-1),R(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),X.appendChild(t.innerContainer)}t.config.enableTime&&X.appendChild(V()),Cn(t.calendarContainer,"rangeMode",t.config.mode==="range"),Cn(t.calendarContainer,"animate",t.config.animate===!0),Cn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(X);var Fe=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&&(!Fe&&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 Be=Ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Be,t.element),Be.appendChild(t.element),t.altInput&&Be.appendChild(t.altInput),Be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,x,le,ge){var Fe=xe(x,!0),Be=Ot("span",X,x.getDate().toString());return Be.dateObj=x,Be.$i=ge,Be.setAttribute("aria-label",t.formatDate(x,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(x,t.now)===0&&(t.todayDateElem=Be,Be.classList.add("today"),Be.setAttribute("aria-current","date")),Fe?(Be.tabIndex=-1,ul(x)&&(Be.classList.add("selected"),t.selectedDateElem=Be,t.config.mode==="range"&&(Cn(Be,"startRange",t.selectedDates[0]&&Vn(x,t.selectedDates[0],!0)===0),Cn(Be,"endRange",t.selectedDates[1]&&Vn(x,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Be.classList.add("inRange")))):Be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(x)&&!ul(x)&&Be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&ge%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(x)+"</span>"),Dt("onDayCreate",Be),Be}function L(X){X.focus(),t.config.mode==="range"&&Ve(X)}function I(X){for(var x=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,ge=x;ge!=le;ge+=X)for(var Fe=t.daysContainer.children[ge],Be=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,se=Be;se!=rt;se+=X){var Oe=Fe.children[se];if(Oe.className.indexOf("hidden")===-1&&xe(Oe.dateObj))return Oe}}function A(X,x){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,ge=x>0?t.config.showMonths:-1,Fe=x>0?1:-1,Be=le-t.currentMonth;Be!=ge;Be+=Fe)for(var rt=t.daysContainer.children[Be],se=le-t.currentMonth===Be?X.$i+x:x<0?rt.children.length-1:0,Oe=rt.children.length,Ne=se;Ne>=0&&Ne<Oe&&Ne!=(x>0?Oe:-1);Ne+=Fe){var ze=rt.children[Ne];if(ze.className.indexOf("hidden")===-1&&xe(ze.dateObj)&&Math.abs(X.$i-Ne)>=Math.abs(x))return L(ze)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,x){var le=s(),ge=We(le||document.body),Fe=X!==void 0?X:ge?le:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:I(x>0?1:-1);Fe===void 0?t._input.focus():ge?A(Fe,x):L(Fe)}function N(X,x){for(var le=(new Date(X,x,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ge=t.utils.getDaysInMonth((x-1+12)%12,X),Fe=t.utils.getDaysInMonth(x,X),Be=window.document.createDocumentFragment(),rt=t.config.showMonths>1,se=rt?"prevMonthDay hidden":"prevMonthDay",Oe=rt?"nextMonthDay hidden":"nextMonthDay",Ne=ge+1-le,ze=0;Ne<=ge;Ne++,ze++)Be.appendChild(E("flatpickr-day "+se,new Date(X,x-1,Ne),Ne,ze));for(Ne=1;Ne<=Fe;Ne++,ze++)Be.appendChild(E("flatpickr-day",new Date(X,x,Ne),Ne,ze));for(var Ge=Fe+1;Ge<=42-le&&(t.config.showMonths===1||ze%7!==0);Ge++,ze++)Be.appendChild(E("flatpickr-day "+Oe,new Date(X,x+1,Ge%Fe),Ge,ze));var Qt=Ot("div","dayContainer");return Qt.appendChild(Be),Qt}function R(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var X=document.createDocumentFragment(),x=0;x<t.config.showMonths;x++){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),X.appendChild(N(le.getFullYear(),le.getMonth()))}t.daysContainer.appendChild(X),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ve()}}function z(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var X=function(ge){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ge<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&ge>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(X(x)){var le=Ot("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,x).getMonth().toString(),le.textContent=Cr(x,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===x&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Ot("div","flatpickr-month"),x=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Ot("span","cur-month"):(t.monthsDropdownContainer=Ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var se=Un(rt),Oe=parseInt(se.value,10);t.changeMonth(Oe-t.currentMonth),Dt("onMonthChange")}),z(),le=t.monthsDropdownContainer);var ge=Zo("cur-year",{tabindex:"-1"}),Fe=ge.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Be=Ot("div","flatpickr-current-month");return Be.appendChild(le),Be.appendChild(ge),x.appendChild(Be),X.appendChild(x),{container:X,yearElement:Fe,monthElement:le}}function B(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var x=F();t.yearElements.push(x.yearElement),t.monthElements.push(x.monthElement),t.monthNav.appendChild(x.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&(Cn(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&(Cn(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function V(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=La(t.config);t.timeContainer=Ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var x=Ot("span","flatpickr-time-separator",":"),le=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var ge=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ge.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.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(le),t.timeContainer.appendChild(x),t.timeContainer.appendChild(ge),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Zo("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.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(Ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Ot("span","flatpickr-am-pm",t.l10n.amPM[Gn((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 Z(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=Ot("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var x=Ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(x)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,x=nh(t.l10n.weekdays.shorthand);X>0&&X<x.length&&(x=nh(x.splice(X,x.length),x.splice(0,X)));for(var le=t.config.showMonths;le--;)t.weekdayContainer.children[le].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),he(s,n[5]),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[5])},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function t5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[G8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[X8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[Q8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[x8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[e5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),h=$(),j(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(C,T){v(C,e,T),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(t,h),q(g,t,null),_=!0,y||(S=Y(e,"submit",nt(n[17])),y=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),l.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:C}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:C}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:C}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:C}),g.$set(A)},i(C){_||(M(l.$$.fragment,C),M(r.$$.fragment,C),M(f.$$.fragment,C),M(m.$$.fragment,C),M(g.$$.fragment,C),_=!0)},o(C){D(l.$$.fragment,C),D(r.$$.fragment,C),D(f.$$.fragment,C),D(m.$$.fragment,C),D(g.$$.fragment,C),_=!1},d(C){C&&k(e),H(l),H(r),H(f),H(m),H(g),y=!1,S()}}}function n5(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 i5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=$(),l=b("button"),s=b("i"),o=$(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],ee(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=Y(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&&ee(l,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function l5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[i5],header:[n5],default:[t5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[19](null),H(e,l)}}}const ur=15777e3;function s5(n,e,t){let i;const l=yt(),s="apple_secret_"+U.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),Ut({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await _e.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){_e.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 C(){c=gt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!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,C,T,O,E,L,I,A]}class o5 extends Se{constructor(e){super(),we(this,e,s5,l5,ye,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function r5(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new o5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=$(),l=b("span"),l.textContent="Generate secret",o=$(),j(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){v(d,e,m),w(e,t),w(e,i),w(e,l),v(d,o,m),q(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),H(r,d),u=!1,f()}}}function a5(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 u5 extends Se{constructor(e){super(),we(this,e,a5,r5,ye,{key:1,config:0})}}function f5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),l=$(),s=b("input"),r=$(),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),he(s,n[0].authURL),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[0].authURL)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function c5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),l=$(),s=b("input"),r=$(),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),he(s,n[0].tokenURL),v(c,r,d),v(c,a,d),u||(f=Y(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&&he(s,c[0].tokenURL)},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function d5(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[f5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[c5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment),p(e,"class","section-title")},m(r,a){v(r,e,a),v(r,t,a),q(i,r,a),v(r,l,a),q(s,r,a),o=!0},p(r,[a]){const u={};a&2&&(u.name=r[1]+".authURL"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&2&&(f.name=r[1]+".tokenURL"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(i.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l)),H(i,r),H(s,r)}}}function p5(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 m5 extends Se{constructor(e){super(),we(this,e,p5,d5,ye,{key:1,config:0})}}function rm(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 h5(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&&rm(n);return{c(){s&&s.c(),e=$(),t=b("span"),l=W(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=rm(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)+"")&&oe(l,i)},i:te,o:te,d(o){o&&(k(e),k(t)),s&&s.d(o)}}}function _5(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class am extends Se{constructor(e){super(),we(this,e,_5,h5,ye,{item:0})}}const g5=n=>({}),um=n=>({});function b5(n){let e;const t=n[8].afterOptions,i=Lt(t,n,n[13],um);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&8192)&&Pt(i,t,l,l[13],e?At(t,l[13],s,g5):Nt(l[13]),um)},i(l){e||(M(i,l),e=!0)},o(l){D(i,l),e=!1},d(l){i&&i.d(l)}}}function y5(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:[b5]},$$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 ps({props:o}),ie.push(()=>be(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?wt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Rt(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function k5(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=am}=e,{optionComponent:c=am}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=U.toArray(T,!0);let O=[];for(let E of T){const L=U.findByKey(r,d,E);L&&O.push(L)}T.length&&!O.length||t(0,u=a?O:O[0])}async function g(T){let O=U.toArray(T,!0).map(E=>E[d]);r.length&&t(6,m=a?O:O[0])}function _(T){u=T,t(0,u)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(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(13,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,C,o]}class zn extends Se{constructor(e){super(),we(this,e,k5,y5,ye,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function v5(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"),ei(e,o)},m(r,a){v(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(l=Y(e,"input",n[6]),i=!0)},p(r,[a]){ei(e,o=wt(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 w5(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=U.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Wt(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=U.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class ms extends Se{constructor(e){super(),we(this,e,w5,v5,ye,{value:0,separator:1,readonly:2,disabled:3})}}function S5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Display name"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","text"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].displayName),r||(a=Y(s,"input",n[4]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].displayName&&he(s,u[0].displayName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function T5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].authURL),r||(a=Y(s,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].authURL&&he(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function C5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].tokenURL),r||(a=Y(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].tokenURL&&he(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function $5(n){let e,t,i,l,s,o,r;function a(f){n[7](f)}let u={id:n[13],items:n[3]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),l=$(),j(s.$$.fragment),p(e,"for",i=n[13])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&8192&&i!==(i=f[13]))&&p(e,"for",i);const d={};c&8192&&(d.id=f[13]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function O5(n){let e,t,i,l,s,o,r,a;return l=new ce({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[E5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[D5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`<em>Both fields are considered optional because the parsed <code>id_token</code>
+                    is a direct result of the trusted server code-&gt;token exchange response.</em>`,i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){v(u,e,f),w(e,t),w(e,i),q(l,e,null),w(e,s),q(o,e,null),a=!0},p(u,f){const c={};f&2&&(c.name=u[1]+".extra.jwksURL"),f&24577&&(c.$$scope={dirty:f,ctx:u}),l.$set(c);const d={};f&2&&(d.name=u[1]+".extra.issuers"),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(M(l.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=He(e,mt,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(l.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=He(e,mt,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),H(l),H(o),u&&r&&r.end()}}}function M5(n){let e,t,i,l;return t=new ce({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[I5,({uniqueId:s})=>({13:s}),({uniqueId:s})=>s?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","content")},m(s,o){v(s,e,o),q(t,e,null),l=!0},p(s,o){const r={};o&2&&(r.name=s[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:s}),t.$set(r)},i(s){l||(M(t.$$.fragment,s),s&&tt(()=>{l&&(i||(i=He(e,mt,{delay:10,duration:150},!0)),i.run(1))}),l=!0)},o(s){D(t.$$.fragment,s),s&&(i||(i=He(e,mt,{delay:10,duration:150},!1)),i.run(0)),l=!1},d(s){s&&k(e),H(t),s&&i&&i.end()}}}function E5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=$(),l=b("i"),o=$(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){v(c,e,d),w(e,t),w(e,i),w(e,l),v(c,o,d),v(c,r,d),he(r,n[0].extra.jwksURL),u||(f=[Me(qe.call(null,l,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&he(r,c[0].extra.jwksURL)},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function D5(n){let e,t,i,l,s,o,r,a,u,f,c;function d(h){n[10](h)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new ms({props:m}),ie.push(()=>be(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=$(),l=b("i"),o=$(),j(r.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13])},m(h,g){v(h,e,g),w(e,t),w(e,i),w(e,l),v(h,o,g),q(r,h,g),u=!0,f||(c=Me(qe.call(null,l,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&s!==(s=h[13]))&&p(e,"for",s);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(k(e),k(o)),H(r,h),f=!1,c()}}}function I5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=$(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","url"),p(s,"id",o=n[13]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[0].userInfoURL),r||(a=Y(s,"input",n[8]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&s.value!==u[0].userInfoURL&&he(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function L5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[13])},m(c,d){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=[Y(e,"change",n[11]),Me(qe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(k(e),k(i),k(l)),u=!1,Ie(f)}}}function A5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;e=new ce({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[S5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[T5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[C5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field m-b-xs",$$slots:{default:[$5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const y=[M5,O5],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),g=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[L5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),i.textContent="Endpoints",l=$(),j(s.$$.fragment),o=$(),j(r.$$.fragment),a=$(),j(u.$$.fragment),f=$(),c=b("div"),m.c(),h=$(),j(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),v(T,t,O),v(T,i,O),v(T,l,O),q(s,T,O),v(T,o,O),q(r,T,O),v(T,a,O),q(u,T,O),v(T,f,O),v(T,c,O),S[d].m(c,null),v(T,h,O),q(g,T,O),_=!0},p(T,[O]){const E={};O&2&&(E.name=T[1]+".displayName"),O&24577&&(E.$$scope={dirty:O,ctx:T}),e.$set(E);const L={};O&2&&(L.name=T[1]+".authURL"),O&24577&&(L.$$scope={dirty:O,ctx:T}),s.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=C(T),d===P?S[d].p(T,O):(re(),D(S[P],1,1,()=>{S[P]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(s.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(s.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(k(t),k(i),k(l),k(o),k(a),k(f),k(c),k(h)),H(e,T),H(s,T),H(r,T),H(u,T),S[d].d(),H(g,T)}}}function P5(n,e,t){let{key:i=""}=e,{config:l={}}=e;const s=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!l.userInfoURL;U.isEmpty(l.pkce)&&(l.pkce=!0),l.displayName||(l.displayName="OIDC"),l.extra||(l.extra={},o=!0);function r(){o?t(0,l.extra={},l):(t(0,l.userInfoURL="",l),t(0,l.extra=l.extra||{},l))}function a(){l.displayName=this.value,t(0,l)}function u(){l.authURL=this.value,t(0,l)}function f(){l.tokenURL=this.value,t(0,l)}function c(_){o=_,t(2,o)}function d(){l.userInfoURL=this.value,t(0,l)}function m(){l.extra.jwksURL=this.value,t(0,l)}function h(_){n.$$.not_equal(l.extra.issuers,_)&&(l.extra.issuers=_,t(0,l))}function g(){l.pkce=this.checked,t(0,l)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,l=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[l,i,o,s,a,u,f,c,d,m,h,g]}class va extends Se{constructor(e){super(),we(this,e,P5,A5,ye,{key:1,config:0})}}function N5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),l=$(),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),he(s,n[0].authURL),r||(a=Y(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&&he(s,u[0].authURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function R5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Token URL"),l=$(),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),he(s,n[0].tokenURL),r||(a=Y(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&&he(s,u[0].tokenURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function F5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("User info URL"),l=$(),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),he(s,n[0].userInfoURL),r||(a=Y(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&&he(s,u[0].userInfoURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function q5(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[N5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[R5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[F5,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),p(e,"class","section-title")},m(f,c){v(f,e,c),w(e,t),v(f,i,c),q(l,f,c),v(f,s,c),q(o,f,c),v(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&oe(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authURL"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenURL"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userInfoURL"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(l.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(l.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(s),k(r)),H(l,f),H(o,f),H(a,f)}}}function H5(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 wa extends Se{constructor(e){super(),we(this,e,H5,q5,ye,{key:1,config:0,required:4,title:2})}}const nf=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:u5},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:m5},{key:"yandex",title:"Yandex",logo:"yandex.svg"},{key:"facebook",title:"Facebook",logo:"facebook.svg"},{key:"instagram2",title:"Instagram",logo:"instagram.svg"},{key:"github",title:"GitHub",logo:"github.svg"},{key:"gitlab",title:"GitLab",logo:"gitlab.svg",optionsComponent:wa,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:wa,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"twitch",title:"Twitch",logo:"twitch.svg"},{key:"patreon",title:"Patreon (v2)",logo:"patreon.svg"},{key:"strava",title:"Strava",logo:"strava.svg"},{key:"wakatime",title:"WakaTime",logo:"wakatime.svg"},{key:"livechat",title:"LiveChat",logo:"livechat.svg"},{key:"mailcow",title:"mailcow",logo:"mailcow.svg",optionsComponent:wa,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:va},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:va}];function fm(n,e,t){const i=n.slice();return i[16]=e[t],i}function cm(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=Y(e,"click",n[9]),l=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,qn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,qn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function j5(n){let e,t,i,l,s,o,r,a,u,f,c=n[1]!=""&&cm(n);return{c(){e=b("label"),t=b("i"),l=$(),s=b("input"),r=$(),c&&c.c(),a=ve(),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),he(s,n[1]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=Y(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]&&he(s,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=cm(d),c.c(),M(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 dm(n){let e,t,i,l,s=n[1]!=""&&pm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=$(),s&&s.c(),l=$(),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=pm(o),s.c(),s.m(e,l)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function pm(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=Y(e,"click",n[5]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function mm(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 hm(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&&mm(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=$(),o=b("div"),r=b("div"),u=W(a),f=$(),c=b("em"),m=W(d),h=$(),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-6"),this.first=t},m(C,T){v(C,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||(_=Y(i,"click",S),g=!0)},p(C,T){e=C,e[16].logo?y?y.p(e,T):(y=mm(e),y.c(),y.m(l,null)):y&&(y.d(1),y=null),T&8&&a!==(a=e[16].title+"")&&oe(u,a),T&8&&d!==(d=e[16].key+"")&&oe(m,d)},d(C){C&&k(t),y&&y.d(),g=!1,_()}}}function z5(n){let e,t,i,l=[],s=new Map,o;e=new ce({props:{class:"searchbar m-b-sm",$$slots:{default:[j5,({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=fm(n,r,f),d=a(c);s.set(d,l[f]=hm(d,c))}let u=null;return r.length||(u=dm(n)),{c(){j(e.$$.fragment),t=$(),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){q(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=vt(l,c,a,1,f,r,s,i,di,hm,null,fm),!r.length&&u?u.p(f,c):r.length?u&&(u.d(1),u=null):(u=dm(f),u.c(),u.m(i,null)))},i(f){o||(M(e.$$.fragment,f),o=!0)},o(f){D(e.$$.fragment,f),o=!1},d(f){f&&(k(t),k(i)),H(e,f);for(let c=0;c<l.length;c+=1)l[c].d();u&&u.d()}}}function U5(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 V5(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=Y(e,"click",n[0]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function B5(n){let e,t,i={btnClose:!1,$$slots:{footer:[V5],header:[U5],default:[z5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&1048586&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function W5(n,e,t){const i=yt();let{disabled:l=[]}=e,s,o="",r=[];function a(){d(),s==null||s.show()}function u(){return s==null?void 0:s.hide()}function f(C){i("select",C),u()}function c(){const C=(o||"").toLowerCase();return nf.filter(T=>!l.includes(T.key)&&(C==""||T.key.toLowerCase().includes(C)||T.title.toLowerCase().includes(C)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=C=>f(C);function _(C){ie[C?"unshift":"push"](()=>{s=C,t(2,s)})}function y(C){Pe.call(this,n,C)}function S(C){Pe.call(this,n,C)}return n.$$set=C=>{"disabled"in C&&t(6,l=C.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 Y5 extends Se{constructor(e){super(),we(this,e,W5,B5,ye,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function _m(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 K5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(l,"for",o=n[27])},m(u,f){v(u,e,f),e.checked=n[0].oauth2.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 J5(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 Z5(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 gm(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(qe.call(null,e,{text:"Edit config",position:"left"})),Y(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function bm(n,e){var C;let t,i,l,s,o,r,a=(e[28].displayName||((C=e[29])==null?void 0:C.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?Z5:J5}let _=g(e),y=_(e),S=e[29]&&gm(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),l=b("figure"),y.c(),s=$(),o=b("div"),r=b("div"),u=W(a),f=$(),c=b("em"),m=W(d),h=$(),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"),ee(i,"error",!U.isEmpty((E=(O=(T=e[1])==null?void 0:T.oauth2)==null?void 0:O.providers)==null?void 0:E[e[31]])),p(t,"class","col-lg-6"),this.first=t},m(T,O){v(T,t,O),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(T,O){var E,L,I,A;e=T,_===(_=g(e))&&y?y.p(e,O):(y.d(1),y=_(e),y&&(y.c(),y.m(l,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&oe(u,a),O[0]&1&&d!==(d=e[28].name+"")&&oe(m,d),e[29]?S?S.p(e,O):(S=gm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&ee(i,"error",!U.isEmpty((A=(I=(L=e[1])==null?void 0:L.oauth2)==null?void 0:I.providers)==null?void 0:A[e[31]]))},d(T){T&&k(t),y.d(),S&&S.d()}}}function G5(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 X5(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 ym(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;return l=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[Q5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[x5,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[eO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[tO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,y){v(_,e,y),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),g=!0},p(_,y){const S={};y[0]&134217761|y[1]&2&&(S.$$scope={dirty:y,ctx:_}),l.$set(S);const C={};y[0]&134217793|y[1]&2&&(C.$$scope={dirty:y,ctx:_}),r.$set(C);const T={};y[0]&134217761|y[1]&2&&(T.$$scope={dirty:y,ctx:_}),f.$set(T);const O={};y[0]&134217761|y[1]&2&&(O.$$scope={dirty:y,ctx:_}),m.$set(O)},i(_){g||(M(l.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=He(e,mt,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(l.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=He(e,mt,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&k(e),H(l),H(r),H(f),H(m),_&&h&&h.end()}}}function Q5(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:rO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function x5(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:aO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function eO(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:uO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function tO(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:fO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),s=new ps({props:u}),ie.push(()=>be(s,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),l=$(),j(s.$$.fragment),p(e,"for",i=n[27])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function nO(n){let e,t,i,l=[],s=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,y,S,C,T,O,E;e=new ce({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[K5,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=pe(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z<L.length;z+=1){let F=_m(n,L,z),B=I(F);s.set(B,l[z]=bm(B,F))}function A(z,F){return z[4]?X5:G5}let P=A(n),N=P(n),R=n[4]&&ym(n);return{c(){j(e.$$.fragment),t=$(),i=b("div");for(let z=0;z<l.length;z+=1)l[z].c();o=$(),r=b("div"),a=b("button"),a.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add provider</span>',u=$(),f=b("button"),c=b("strong"),d=W("Optional "),h=W(m),g=W(" create fields map"),_=$(),N.c(),S=$(),R&&R.c(),C=ve(),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(z,F){q(e,z,F),v(z,t,F),v(z,i,F);for(let B=0;B<l.length;B+=1)l[B]&&l[B].m(i,null);w(i,o),w(i,r),w(r,a),v(z,u,F),v(z,f,F),w(f,c),w(c,d),w(c,h),w(c,g),w(f,_),N.m(f,null),v(z,S,F),R&&R.m(z,F),v(z,C,F),T=!0,O||(E=[Y(a,"click",n[12]),Y(f,"click",n[13])],O=!0)},p(z,F){const B={};F[0]&134217729|F[1]&2&&(B.$$scope={dirty:F,ctx:z}),e.$set(B),F[0]&523&&(L=pe(z[0].oauth2.providers),l=vt(l,F,I,1,z,L,s,i,di,bm,o,_m)),(!T||F[0]&1)&&m!==(m=z[0].name+"")&&oe(h,m),P!==(P=A(z))&&(N.d(1),N=P(z),N&&(N.c(),N.m(f,null))),(!T||F[0]&16&&y!==(y="m-t-25 btn btn-sm "+(z[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(f,"class",y),z[4]?R?(R.p(z,F),F[0]&16&&M(R,1)):(R=ym(z),R.c(),M(R,1),R.m(C.parentNode,C)):R&&(re(),D(R,1,1,()=>{R=null}),ae())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(k(t),k(i),k(u),k(f),k(S),k(C)),H(e,z);for(let F=0;F<l.length;F+=1)l[F].d();N.d(),R&&R.d(z),O=!1,Ie(E)}}}function iO(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 lO(n){let e,t,i,l=n[7]==1?"provider":"providers",s,o,r;return{c(){e=b("span"),t=W(n[7]),i=$(),s=W(l),o=$(),r=b("span"),r.textContent="Enabled",p(e,"class","label"),ee(e,"label-warning",!n[7]),ee(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&&oe(t,a[7]),u[0]&128&&l!==(l=a[7]==1?"provider":"providers")&&oe(s,l),u[0]&128&&ee(e,"label-warning",!a[7]),u[0]&128&&ee(e,"label-info",a[7]>0)},d(a){a&&(k(e),k(o),k(r))}}}function km(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{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].oauth2.enabled?lO:iO}let a=r(n),u=a(n),f=n[8]&&km();return{c(){e=b("div"),e.innerHTML='<i class="ri-pass-expired-line"></i> <span class="txt">OAuth2</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=km(),f.c(),M(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){var u,f;let e,t,i,l,s,o;e=new ji({props:{single:!0,$$slots:{header:[sO],default:[nO]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(vm))||[]};i=new Y5({props:r}),n[18](i),i.$on("select",n[19]);let a={};return s=new Z8({props:a}),n[20](s),s.$on("remove",n[21]),s.$on("submit",n[22]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(c,d){q(e,c,d),v(c,t,d),q(i,c,d),v(c,l,d),q(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(vm))||[]),i.$set(h);const g={};s.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(s.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(s.$$.fragment,c),o=!1},d(c){c&&(k(t),k(l)),H(e,c),n[18](null),H(i,c),n[20](null),H(s,c)}}}const rO=()=>"",aO=()=>"",uO=()=>"",fO=()=>"",vm=n=>n.name;function cO(n,e,t){let i,l,s;Qe(n,kn,F=>t(1,s=F));let{collection:o}=e;const r=["id","email","emailVisibility","verified","tokenKey","password"],a=["text","editor","url","email","json"],u=a.concat("file");let f,c,d=!1,m=[],h=[];function g(F=[]){var B,J;t(5,m=((B=F==null?void 0:F.filter(V=>a.includes(V.type)&&!r.includes(V.name)))==null?void 0:B.map(V=>V.name))||[]),t(6,h=((J=F==null?void 0:F.filter(V=>u.includes(V.type)&&!r.includes(V.name)))==null?void 0:J.map(V=>V.name))||[])}function _(F){for(let B of nf)if(B.key==F)return B;return null}function y(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,B,J)=>{c==null||c.show(F,B,J)},C=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function L(F){n.$$.not_equal(o.oauth2.mappedFields.id,F)&&(o.oauth2.mappedFields.id=F,t(0,o))}function I(F){n.$$.not_equal(o.oauth2.mappedFields.username,F)&&(o.oauth2.mappedFields.username=F,t(0,o))}function A(F){ie[F?"unshift":"push"](()=>{f=F,t(2,f)})}const P=F=>{var B,J;c.show(F.detail,{},((J=(B=o.oauth2)==null?void 0:B.providers)==null?void 0:J.length)||0)};function N(F){ie[F?"unshift":"push"](()=>{c=F,t(3,c)})}const R=F=>{const B=F.detail.uiOptions;U.removeByKey(o.oauth2.providers,"name",B.key),t(0,o)},z=F=>{const B=F.detail.uiOptions,J=F.detail.config;t(0,o.oauth2.providers=o.oauth2.providers||[],o),U.pushOrReplaceByKey(o.oauth2.providers,Object.assign({name:B.key},J),"name"),t(0,o)};return n.$$set=F=>{"collection"in F&&t(0,o=F.collection)},n.$$.update=()=>{var F,B;n.$$.dirty[0]&1&&U.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=!U.isEmpty(s==null?void 0:s.oauth2)),n.$$.dirty[0]&1&&t(7,l=((B=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:B.length)||0)},[o,s,f,c,d,m,h,l,i,_,y,S,C,T,O,E,L,I,A,P,N,R,z]}class dO extends Se{constructor(e){super(),we(this,e,cO,oO,ye,{collection:0},null,[-1,-1])}}function wm(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(qe.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 pO(n){let e,t,i,l,s,o,r,a,u,f,c=n[2]&&wm();return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),r=$(),c&&c.c(),a=ve(),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=[Y(e,"change",n[4]),Y(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=wm(),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,Ie(f)}}}function mO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),l=$(),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),he(s,n[0].otp.duration),r||(a=Y(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&&gt(s.value)!==u[0].otp.duration&&he(s,u[0].otp.duration)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function hO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),l=$(),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),he(s,n[0].otp.length),r||(a=Y(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&&gt(s.value)!==u[0].otp.length&&he(s,u[0].otp.length)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function _O(n){let e,t,i,l,s,o,r,a,u;return e=new ce({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[pO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[mO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[hO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div"),j(s.$$.fragment),o=$(),r=b("div"),j(a.$$.fragment),p(l,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),v(f,t,c),v(f,i,c),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),u=!0},p(f,c){const d={};c&773&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const m={};c&769&&(m.$$scope={dirty:c,ctx:f}),s.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(s.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(k(t),k(i)),H(e,f),H(s),H(a)}}}function gO(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 bO(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 Sm(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function yO(n){let e,t,i,l,s,o;function r(c,d){return c[0].otp.enabled?bO:gO}let a=r(n),u=a(n),f=n[1]&&Sm();return{c(){e=b("div"),e.innerHTML='<i class="ri-time-line"></i> <span class="txt">One-time password (OTP)</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=Sm(),f.c(),M(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 kO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[yO],default:[_O]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vO(n,e,t){let i,l,s;Qe(n,kn,c=>t(3,s=c));let{collection:o}=e;function r(){o.otp.enabled=this.checked,t(0,o)}const a=c=>{i&&t(0,o.mfa.enabled=c.target.checked,o)};function u(){o.otp.duration=gt(this.value),t(0,o)}function f(){o.otp.length=gt(this.value),t(0,o)}return n.$$set=c=>{"collection"in c&&t(0,o=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.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=!U.isEmpty(s==null?void 0:s.otp))},[o,l,i,s,r,a,u,f]}class wO extends Se{constructor(e){super(),we(this,e,vO,kO,ye,{collection:0})}}function Tm(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(qe.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 SO(n){let e,t,i,l,s,o,r,a,u,f,c=n[3]&&Tm();return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable"),r=$(),c&&c.c(),a=ve(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(l,"for",o=n[9])},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=Y(e,"change",n[6]),u=!0)},p(d,m){m&512&&t!==(t=d[9])&&p(e,"id",t),m&8&&(e.disabled=d[3]),m&1&&(e.checked=d[0].passwordAuth.enabled),m&512&&o!==(o=d[9])&&p(l,"for",o),d[3]?c||(c=Tm(),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[7](f)}let u={items:n[1],multiple:!0};return n[0].passwordAuth.identityFields!==void 0&&(u.keyOfSelected=n[0].passwordAuth.identityFields),s=new zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",l=$(),j(s.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&2&&(d.items=f[1]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].passwordAuth.identityFields,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function CO(n){let e,t,i,l;return e=new ce({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[SO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[TO,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function $O(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function OO(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 Cm(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function MO(n){let e,t,i,l,s,o;function r(c,d){return c[0].passwordAuth.enabled?OO:$O}let a=r(n),u=a(n),f=n[2]&&Cm();return{c(){e=b("div"),e.innerHTML='<i class="ri-lock-password-line"></i> <span class="txt">Identity/Password</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=Cm(),f.c(),M(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 EO(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[MO],default:[CO]},$$scope:{ctx:n}}}),e.$on("expand",n[8]),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1039&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function DO(n,e,t){let i,l,s;Qe(n,kn,d=>t(5,s=d));let{collection:o}=e,r=[];function a(d){const m=[{value:"email"}],h=(d==null?void 0:d.fields)||[],g=(d==null?void 0:d.indexes)||[];for(let _ of g){const y=U.parseIndex(_);if(!y.unique||y.columns.length!=1||y.columns[0].name=="email")continue;const S=h.find(C=>!C.hidden&&C.name.toLowerCase()==y.columns[0].name.toLowerCase());S&&m.push({value:S.name})}return m}function u(){o.passwordAuth.enabled=this.checked,t(0,o)}function f(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,o))}const c=()=>{t(1,r=a(o))};return n.$$set=d=>{"collection"in d&&t(0,o=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(o==null?void 0:o.passwordAuth)&&t(0,o.passwordAuth={enabled:!0,identityFields:["email"]},o),n.$$.dirty&1&&t(3,i=(o==null?void 0:o.system)&&(o==null?void 0:o.name)==="_superusers"),n.$$.dirty&32&&t(2,l=!U.isEmpty(s==null?void 0:s.passwordAuth))},[o,r,l,i,a,s,u,f,c]}class IO extends Se{constructor(e){super(),we(this,e,DO,EO,ye,{collection:0})}}function $m(n,e,t){const i=n.slice();return i[22]=e[t],i}function Om(n,e){let t,i,l,s,o,r=e[22].label+"",a,u,f,c,d,m;return c=Fk(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=$(),o=b("label"),a=W(r),f=$(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[21]+e[22].value),i.__value=e[22].value,he(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=Y(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 LO(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=$m(n,l,o),a=s(r);t.set(a,e[o]=Om(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,Om,i,$m))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function AO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("To email address"),l=$(),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),he(s,n[1]),s.focus(),r||(a=Y(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]&&he(s,u[1])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function PO(n){let e,t,i,l,s,o,r;return t=new ce({props:{class:"form-field required",name:"template",$$slots:{default:[LO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[AO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),q(l,e,null),s=!0,o||(r=Y(e,"submit",nt(n[13])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(M(t.$$.fragment,a),M(l.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),D(l.$$.fragment,a),s=!1},d(a){a&&k(e),H(t),H(l),o=!1,r()}}}function NO(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 RO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=$(),l=b("button"),s=b("i"),o=$(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],ee(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=Y(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&&ee(l,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(l)),u=!1,f()}}}function FO(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:[RO],header:[NO],default:[PO]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&33554486&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[15](null),H(e,l)}}}const Sa="last_email_test",Mm="email_test_request";function qO(n,e,t){let i;const l=yt(),s="email_test_"+U.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(Sa),f=o[0].value,c=!1,d=null;function m(I="",A="",P=""){a=I||"_superusers",t(1,u=A||localStorage.getItem(Sa)),t(2,f=P||o[0].value),Ut({}),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(Sa,u),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Mm),$i("Test email send timeout.")},3e4);try{await _e.settings.testEmail(a,u,f,{$cancelKey:Mm}),tn("Successfully sent test email."),l("submit"),t(4,c=!1),await dn(),h()}catch(I){t(4,c=!1),_e.error(I)}clearTimeout(d)}}const _=[[]];function y(){f=this.__value,t(2,f)}function S(){u=this.value,t(1,u)}const C=()=>g(),T=()=>!c;function O(I){ie[I?"unshift":"push"](()=>{r=I,t(3,r)})}function E(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,C,T,O,E,L]}class gk extends Se{constructor(e){super(),we(this,e,qO,FO,ye,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Em(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function HO(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"for",o=n[21])},m(u,f){v(u,e,f),e.checked=n[0].authAlert.enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 Dm(n){let e,t,i;function l(o){n[11](o)}let s={};return n[0]!==void 0&&(s.collection=n[0]),e=new dO({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r&1&&(t=!0,a.collection=o[0],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Im(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 x6({props:r}),ie.push(()=>be(i,"config",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(u,f){v(u,t,f),q(i,u,f),s=!0},p(u,f){var d;e=u;const c={};f&4&&(c.key=e[18].key),f&4&&(c.title=e[18].label),f&4&&(c.placeholders=(d=e[18])==null?void 0:d.placeholders),!l&&f&4&&(l=!0,c.config=e[18].config,Ce(()=>l=!1)),i.$set(c)},i(u){s||(M(i.$$.fragment,u),s=!0)},o(u){D(i.$$.fragment,u),s=!1},d(u){u&&k(t),H(i,u)}}}function jO(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P=[],N=new Map,R,z,F,B,J,V,Z,G,de,fe,ue;o=new ce({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[HO,({uniqueId:De})=>({21:De}),({uniqueId:De})=>De?2097152:0]},$$scope:{ctx:n}}});function Te(De){n[10](De)}let Ke={};n[0]!==void 0&&(Ke.collection=n[0]),u=new IO({props:Ke}),ie.push(()=>be(u,"collection",Te));let Je=!n[1]&&Dm(n);function ft(De){n[12](De)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new wO({props:et}),ie.push(()=>be(m,"collection",ft));function xe(De){n[13](De)}let We={};n[0]!==void 0&&(We.collection=n[0]),_=new C8({props:We}),ie.push(()=>be(_,"collection",xe));let at=pe(n[2]);const jt=De=>De[18].key;for(let De=0;De<at.length;De+=1){let Ye=Em(n,at,De),ke=jt(Ye);N.set(ke,P[De]=Im(ke,Ye))}function Ve(De){n[16](De)}let Ee={};n[0]!==void 0&&(Ee.collection=n[0]),J=new a8({props:Ee}),ie.push(()=>be(J,"collection",Ve));let st={};return G=new gk({props:st}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),c=$(),Je&&Je.c(),d=$(),j(m.$$.fragment),g=$(),j(_.$$.fragment),S=$(),C=b("h4"),T=b("span"),T.textContent="Mail templates",O=$(),E=b("button"),E.textContent="Send test email",L=$(),I=b("div"),A=b("div");for(let De=0;De<P.length;De+=1)P[De].c();R=$(),z=b("h4"),z.textContent="Other",F=$(),B=b("div"),j(J.$$.fragment),Z=$(),j(G.$$.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(T,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-xs m-l-auto btn-secondary"),p(C,"class","section-title"),p(A,"class","accordions"),p(I,"class","accordions m-b-35"),p(z,"class","section-title"),p(B,"class","accordions m-b-base")},m(De,Ye){v(De,e,Ye),w(e,t),w(t,i),w(t,l),w(t,s),q(o,s,null),v(De,r,Ye),v(De,a,Ye),q(u,a,null),w(a,c),Je&&Je.m(a,null),w(a,d),q(m,a,null),w(a,g),q(_,a,null),v(De,S,Ye),v(De,C,Ye),w(C,T),w(C,O),w(C,E),v(De,L,Ye),v(De,I,Ye),w(I,A);for(let ke=0;ke<P.length;ke+=1)P[ke]&&P[ke].m(A,null);v(De,R,Ye),v(De,z,Ye),v(De,F,Ye),v(De,B,Ye),q(J,B,null),v(De,Z,Ye),q(G,De,Ye),de=!0,fe||(ue=Y(E,"click",n[14]),fe=!0)},p(De,[Ye]){const ke={};Ye&6291457&&(ke.$$scope={dirty:Ye,ctx:De}),o.$set(ke);const $e={};!f&&Ye&1&&(f=!0,$e.collection=De[0],Ce(()=>f=!1)),u.$set($e),De[1]?Je&&(re(),D(Je,1,1,()=>{Je=null}),ae()):Je?(Je.p(De,Ye),Ye&2&&M(Je,1)):(Je=Dm(De),Je.c(),M(Je,1),Je.m(a,d));const ct={};!h&&Ye&1&&(h=!0,ct.collection=De[0],Ce(()=>h=!1)),m.$set(ct);const Ht={};!y&&Ye&1&&(y=!0,Ht.collection=De[0],Ce(()=>y=!1)),_.$set(Ht),Ye&4&&(at=pe(De[2]),re(),P=vt(P,Ye,jt,1,De,at,N,A,Bt,Im,null,Em),ae());const Le={};!V&&Ye&1&&(V=!0,Le.collection=De[0],Ce(()=>V=!1)),J.$set(Le);const ot={};G.$set(ot)},i(De){if(!de){M(o.$$.fragment,De),M(u.$$.fragment,De),M(Je),M(m.$$.fragment,De),M(_.$$.fragment,De);for(let Ye=0;Ye<at.length;Ye+=1)M(P[Ye]);M(J.$$.fragment,De),M(G.$$.fragment,De),de=!0}},o(De){D(o.$$.fragment,De),D(u.$$.fragment,De),D(Je),D(m.$$.fragment,De),D(_.$$.fragment,De);for(let Ye=0;Ye<P.length;Ye+=1)D(P[Ye]);D(J.$$.fragment,De),D(G.$$.fragment,De),de=!1},d(De){De&&(k(e),k(r),k(a),k(S),k(C),k(L),k(I),k(R),k(z),k(F),k(B),k(Z)),H(o),H(u),Je&&Je.d(),H(m),H(_);for(let Ye=0;Ye<P.length;Ye+=1)P[Ye].d();H(J),n[17](null),H(G,De),fe=!1,ue()}}}function zO(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(O){u=O,t(0,u)}function h(O){u=O,t(0,u)}function g(O){u=O,t(0,u)}function _(O){u=O,t(0,u)}const y=()=>c==null?void 0:c.show(u.id);function S(O,E){n.$$.not_equal(E.config,O)&&(E.config=O,t(2,f),t(1,i),t(7,l),t(5,r),t(4,a),t(8,s),t(6,o),t(0,u))}function C(O){u=O,t(0,u)}function T(O){ie[O?"unshift":"push"](()=>{c=O,t(3,c)})}return n.$$set=O=>{"collection"in O&&t(0,u=O.collection)},n.$$.update=()=>{var O,E;n.$$.dirty&1&&typeof((O=u.otp)==null?void 0:O.emailTemplate)>"u"&&(t(0,u.otp=u.otp||{},u),t(0,u.otp.emailTemplate={},u)),n.$$.dirty&1&&typeof((E=u.authAlert)==null?void 0:E.emailTemplate)>"u"&&(t(0,u.authAlert=u.authAlert||{},u),t(0,u.authAlert.emailTemplate={},u)),n.$$.dirty&1&&t(1,i=u.system&&u.name==="_superusers"),n.$$.dirty&1&&t(7,l={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,s={key:"verificationTemplate",label:"Default Verification email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.verificationTemplate}),n.$$.dirty&1&&t(6,o={key:"confirmEmailChangeTemplate",label:"Default Confirm email change email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.confirmEmailChangeTemplate}),n.$$.dirty&1&&t(5,r={key:"otp.emailTemplate",label:"Default OTP email template",placeholders:["APP_NAME","APP_URL","RECORD:*","OTP","OTP_ID"],config:u.otp.emailTemplate}),n.$$.dirty&1&&t(4,a={key:"authAlert.emailTemplate",label:"Default Login alert email template",placeholders:["APP_NAME","APP_URL","RECORD:*"],config:u.authAlert.emailTemplate}),n.$$.dirty&498&&t(2,f=i?[l,r,a]:[s,l,o,r,a])},[u,i,f,c,a,r,o,l,s,d,m,h,g,_,y,S,C,T]}class UO extends Se{constructor(e){super(),we(this,e,zO,jO,ye,{collection:0})}}const VO=n=>({dragging:n&4,dragover:n&8}),Lm=n=>({dragging:n[2],dragover:n[3]});function BO(n){let e,t,i,l,s;const o=n[10].default,r=Lt(o,n,n[9],Lm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),ee(e,"dragging",n[2]),ee(e,"dragover",n[3])},m(a,u){v(a,e,u),r&&r.m(e,null),i=!0,l||(s=[Y(e,"dragover",nt(n[11])),Y(e,"dragleave",nt(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(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,VO):Nt(a[9]),Lm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&ee(e,"dragging",a[2]),(!i||u&8)&&ee(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),l=!1,Ie(s)}}}function WO(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=yt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,O){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:O,group:a})),s("drag",T)}}function h(T,O){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let E={};try{E=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(E.group!=a)return;const L=E.index<<0;L<O?(r.splice(O+1,0,r[L]),r.splice(L,1)):(r.splice(O,0,r[L]),r.splice(L+1,1)),t(6,r),s("sort",{oldIndex:L,newIndex:O,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),C=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,g,_,y,S,C]}class _o extends Se{constructor(e){super(),we(this,e,WO,BO,ye,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Am(n,e,t){const i=n.slice();return i[27]=e[t],i}function YO(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){v(f,e,c),v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function KO(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=zt(o,r(n)),ie.push(()=>be(e,"value",s))),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(c,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],Ce(()=>t=!1)),e.$set(c)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function JO(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){v(t,e,i)},p:te,i:te,o:te,d(t){t&&k(e)}}}function ZO(n){let e,t,i,l;const s=[JO,KO],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function Pm(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Nm(Am(n,l,o));return{c(){e=b("div"),t=b("span"),t.textContent="Presets",i=$();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=Am(o,l,a);s[a]?s[a].p(u,r):(s[a]=Nm(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),dt(s,o)}}}function Nm(n){let e,t=n[27]+"",i,l,s,o;function r(){return n[21](n[27])}return{c(){e=b("button"),i=W(t),l=$(),p(e,"type","button"),p(e,"class","label link-primary"),ee(e,"label-info",n[9].includes(n[27]))},m(a,u){v(a,e,u),w(e,i),w(e,l),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&oe(i,t),u[0]&1536&&ee(e,"label-info",n[9].includes(n[27]))},d(a){a&&k(e),s=!1,o()}}}function GO(n){let e,t,i,l,s,o;e=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[YO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[ZO,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Pm(n);return{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),r&&r.c(),s=ve()},m(a,u){q(e,a,u),v(a,t,u),q(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=Pm(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l),k(s)),H(e,a),H(i,a),r&&r.d(a)}}}function XO(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=W(t),l=W(" 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")&&oe(i,t)},d(s){s&&k(e)}}}function Rm(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(qe.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function QO(n){let e,t,i,l,s,o,r=n[5]!=""&&Rm(n);return{c(){r&&r.c(),e=$(),t=b("button"),t.innerHTML='<span class="txt">Cancel</span>',i=$(),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"),ee(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=[Y(t,"click",n[17]),Y(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Rm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&ee(l,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(l)),r&&r.d(a),s=!1,Ie(o)}}}function xO(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[QO],header:[XO],default:[GO]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=je(l,i[s]);return e=new Xt({props:l}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){j(e.$$.fragment)},m(s,o){q(e,s,o),t=!0},p(s,o){const r=o[0]&16384?wt(i,[i[0],Rt(s[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[22](null),H(e,s)}}}function eM(n,e,t){let i,l,s;const o=["collection","show","hide"];let r=lt(e,o);const a=yt();let{collection:u}=e,f,c="",d="",m="",h,g=!1;function _(B,J){return t(6,m=U.isEmpty(J)?"":J),t(5,c=B||S()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function S(){const B=U.parseIndex("");return B.tableName=(u==null?void 0:u.name)||"",U.buildIndex(B)}function C(){a("remove",c),y()}function T(){s.length&&(a("submit",{old:c,new:d}),y())}function O(B){const J=U.clone(l),V=J.columns.find(Z=>Z.name==B);V?U.removeByValue(J.columns,V):U.pushUnique(J.columns,{name:B}),t(2,d=U.buildIndex(J))}ln(async()=>{t(8,g=!0);try{t(7,h=(await Tt(async()=>{const{default:B}=await import("./CodeEditor-kYUfoxD0.js");return{default:B}},__vite__mapDeps([12,1]),import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const E=()=>C(),L=()=>y(),I=()=>T(),A=B=>{t(3,l.unique=B.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=U.buildIndex(l))};function P(B){d=B,t(2,d)}const N=B=>O(B);function R(B){ie[B?"unshift":"push"](()=>{f=B,t(4,f)})}function z(B){Pe.call(this,n,B)}function F(B){Pe.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),Wt(B)),t(14,r=lt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,J,V;n.$$.dirty[0]&1&&t(10,i=((J=(B=u==null?void 0:u.fields)==null?void 0:B.filter(Z=>!Z.toDelete&&Z.name!="id"))==null?void 0:J.map(Z=>Z.name))||[]),n.$$.dirty[0]&4&&t(3,l=U.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((V=l.columns)==null?void 0:V.map(Z=>Z.name))||[])},[u,y,d,l,f,c,m,h,g,s,i,C,T,O,r,_,E,L,I,A,P,N,R,z,F]}class tM extends Se{constructor(e){super(),we(this,e,eM,xO,ye,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Fm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=U.parseIndex(i[10]);return i[11]=l,i}function qm(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){var u;v(r,e,a),l=!0,s||(o=Me(t=qe.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),s=!0)},p(r,a){var u;t&&It(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,Ct,{duration:150},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,Ct,{duration:150},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function Hm(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function jm(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(zm).join(", "))+"",s,o,r,a,u,f=n[11].unique&&Hm();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=$(),i=b("span"),s=W(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;v(m,e,h),f&&f.m(e,null),w(e,t),w(e,i),w(i,s),a||(u=[Me(r=qe.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(m,h){var g,_,y,S,C;n=m,n[11].unique?f||(f=Hm(),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(zm).join(", "))+"")&&oe(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&&It(r.update)&&h&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(m){m&&k(e),f&&f.d(),a=!1,Ie(u)}}}function nM(n){var O,E,L,I,A;let e,t,i=(((E=(O=n[0])==null?void 0:O.indexes)==null?void 0:E.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&qm(n),y=pe(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;P<y.length;P+=1)S[P]=jm(Fm(n,y,P));function C(P){n[7](P)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new tM({props:T}),n[6](c),ie.push(()=>be(c,"collection",C)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),l=W(i),s=W(`)
+    `),_&&_.c(),o=$(),r=b("div");for(let P=0;P<S.length;P+=1)S[P].c();a=$(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=$(),j(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){v(P,e,N),w(e,t),w(e,l),w(e,s),_&&_.m(e,null),v(P,o,N),v(P,r,N);for(let R=0;R<S.length;R+=1)S[R]&&S[R].m(r,null);w(r,a),w(r,u),v(P,f,N),q(c,P,N),m=!0,h||(g=Y(u,"click",n[5]),h=!0)},p(P,[N]){var z,F,B,J,V;if((!m||N&1)&&i!==(i=(((F=(z=P[0])==null?void 0:z.indexes)==null?void 0:F.length)||0)+"")&&oe(l,i),(J=(B=P[2])==null?void 0:B.indexes)!=null&&J.message?_?(_.p(P,N),N&4&&M(_,1)):(_=qm(P),_.c(),M(_,1),_.m(e,null)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),N&7){y=pe(((V=P[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Z<y.length;Z+=1){const G=Fm(P,y,Z);S[Z]?S[Z].p(G,N):(S[Z]=jm(G),S[Z].c(),S[Z].m(r,a))}for(;Z<S.length;Z+=1)S[Z].d(1);S.length=y.length}const R={};!d&&N&1&&(d=!0,R.collection=P[0],Ce(()=>d=!1)),c.$set(R)},i(P){m||(M(_),M(c.$$.fragment,P),m=!0)},o(P){D(_),D(c.$$.fragment,P),m=!1},d(P){P&&(k(e),k(o),k(r),k(f)),_&&_.d(),dt(S,P),n[6](null),H(c,P),h=!1,g()}}}const zm=n=>n.name;function iM(n,e,t){let i;Qe(n,kn,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),Yn("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),Yn("indexes."+h);break}t(0,l)},d=m=>{var h;(h=i.indexes)!=null&&h.message&&Yn("indexes"),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 lM extends Se{constructor(e){super(),we(this,e,iM,nM,ye,{collection:0})}}function Um(n,e,t){const i=n.slice();return i[5]=e[t],i}function Vm(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=$(),l=b("span"),l.textContent=`${n[5].label}`,s=$(),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=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&k(e),o=!1,r()}}}function sM(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=Vm(Um(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=Um(l,t,o);i[o]?i[o].p(r,s):(i[o]=Vm(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),dt(i,l)}}}function oM(n){let e,t,i,l,s,o,r,a;return o=new jn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[sM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=$(),l=b("div"),l.textContent="New field",s=$(),j(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),q(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||(M(o.$$.fragment,u),a=!0)},o(u){D(o.$$.fragment,u),a=!1},d(u){u&&k(e),H(o)}}}function rM(n,e,t){let{class:i=""}=e;const l=yt(),s=[{label:"Plain text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:U.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"URL",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Autodate",value:"autodate",icon:U.getFieldTypeIcon("autodate")},{label:"Select",value:"select",icon:U.getFieldTypeIcon("select")},{label:"File",value:"file",icon:U.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:U.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:U.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 aM extends Se{constructor(e){super(),we(this,e,rM,oM,ye,{class:0})}}const uM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Bm=n=>({interactive:n[7],hasErrors:n[6]}),fM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Wm=n=>({interactive:n[7],hasErrors:n[6]}),cM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Ym=n=>({interactive:n[7],hasErrors:n[6]});function Km(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 Jm(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&32&&oe(t,i[5])},d(i){i&&k(e)}}}function Zm(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 dM(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=n[0].required&&Jm(n),g=n[0].hidden&&Zm();return{c(){e=b("div"),h&&h.c(),t=$(),g&&g.c(),i=$(),l=b("div"),s=b("i"),a=$(),u=b("input"),p(e,"class","field-labels"),p(s,"class",o=U.getFieldTypeIcon(n[0].type)),p(l,"class","form-field-addon prefix field-type-icon"),ee(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=qe.call(null,l,n[0].type+(n[0].system?" (system)":""))),Y(l,"click",n[21]),Y(u,"input",n[23])],d=!0)},p(_,y){_[0].required?h?h.p(_,y):(h=Jm(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=Zm(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),y[0]&1&&o!==(o=U.getFieldTypeIcon(_[0].type))&&p(s,"class",o),r&&It(r.update)&&y[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),y[0]&129&&ee(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,Ie(m)}}}function pM(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 mM(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]),ee(e,"btn-hint",!n[4]&&!n[6]),ee(e,"btn-danger",n[6])},m(r,a){v(r,e,a),w(e,t),s||(o=Y(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&&ee(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&ee(e,"btn-danger",r[6])},d(r){r&&k(e),s=!1,o()}}}function hM(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(qe.call(null,e,"Restore")),Y(e,"click",n[14])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function Gm(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],Wm);let _=s&&Xm(n),y=r&&Qm(n),S=u&&xm(n);const C=n[20].optionsFooter,T=Lt(C,n,n[28],Bm);let O=!n[0]._toDelete&&!n[0].primaryKey&&eh(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=$(),l=b("div"),_&&_.c(),o=$(),y&&y.c(),a=$(),S&&S.c(),f=$(),T&&T.c(),c=$(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){v(E,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),T&&T.m(l,null),w(l,c),O&&O.m(l,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Pt(g,h,E,E[28],m?At(h,E[28],L,fM):Nt(E[28]),Wm),L[0]&257&&(s=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),s?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=Xm(E),_.c(),M(_,1),_.m(l,o)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?y?(y.p(E,L),L[0]&257&&M(y,1)):(y=Qm(E),y.c(),M(y,1),y.m(l,a)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),L[0]&257&&(u=!E[8]||!E[12].includes(E[0].name)),u?S?(S.p(E,L),L[0]&257&&M(S,1)):(S=xm(E),S.c(),M(S,1),S.m(l,f)):S&&(re(),D(S,1,1,()=>{S=null}),ae()),T&&T.p&&(!m||L[0]&268435648)&&Pt(T,C,E,E[28],m?At(C,E[28],L,uM):Nt(E[28]),Bm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=eh(E),O.c(),M(O,1),O.m(l,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae())},i(E){m||(M(g,E),M(_),M(y),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=He(e,mt,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(y),D(S),D(T,E),D(O),E&&(d||(d=He(e,mt,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&k(e),g&&g.d(E),_&&_.d(),y&&y.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function Xm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[_M,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435489|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _M(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),o=W(n[5]),r=$(),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=[Y(e,"change",n[24]),Me(u=qe.call(null,a,{text:`Requires the field value NOT to be ${U.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&&oe(o,m[5]),u&&It(u.update)&&h[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${U.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,Ie(d)}}}function Qm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[gM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Hidden",o=$(),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=[Y(e,"change",n[25]),Y(e,"change",n[26]),Me(qe.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,Ie(f)}}}function xm(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[bM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&268435457|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bM(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),l=$(),s=b("label"),o=b("span"),o.textContent="Presentable",r=$(),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=[Y(e,"change",n[27]),Me(qe.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,Ie(d)}}}function eh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[yM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"title","More field options"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){v(a,e,u),w(e,t),w(t,i),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&268435457&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(o)}}}function th(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=Y(e,"click",nt(n[13])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function yM(n){let e,t,i,l,s,o=!n[0].system&&th(n);return{c(){e=b("button"),e.innerHTML='<span class="txt">Duplicate</span>',t=$(),o&&o.c(),i=ve(),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=Y(e,"click",nt(n[15])),l=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=th(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 kM(n){let e,t,i,l,s,o,r,a,u,f=n[7]&&n[2]&&Km();l=new ce({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[dM]},$$scope:{ctx:n}}});const c=n[20].default,d=Lt(c,n,n[28],Ym),m=d||pM();function h(S,C){if(S[0]._toDelete)return hM;if(S[7])return mM}let g=h(n),_=g&&g(n),y=n[7]&&n[4]&&Gm(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=$(),j(l.$$.fragment),s=$(),m&&m.c(),o=$(),_&&_.c(),r=$(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),ee(e,"required",n[0].required),ee(e,"expanded",n[7]&&n[4]),ee(e,"deleted",n[0]._toDelete)},m(S,C){v(S,e,C),w(e,t),f&&f.m(t,null),w(t,i),q(l,t,null),w(t,s),m&&m.m(t,null),w(t,o),_&&_.m(t,null),w(e,r),y&&y.m(e,null),u=!0},p(S,C){S[7]&&S[2]?f||(f=Km(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),C[0]&2&&(T.name="fields."+S[1]+".name"),C[0]&268435625&&(T.$$scope={dirty:C,ctx:S}),l.$set(T),d&&d.p&&(!u||C[0]&268435648)&&Pt(d,c,S,S[28],u?At(c,S[28],C,cM):Nt(S[28]),Ym),g===(g=h(S))&&_?_.p(S,C):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?y?(y.p(S,C),C[0]&144&&M(y,1)):(y=Gm(S),y.c(),M(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae()),(!u||C[0]&1)&&ee(e,"required",S[0].required),(!u||C[0]&144)&&ee(e,"expanded",S[7]&&S[4]),(!u||C[0]&1)&&ee(e,"deleted",S[0]._toDelete)},i(S){u||(M(l.$$.fragment,S),M(m,S),M(y),S&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(l.$$.fragment,S),D(m,S),D(y),S&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),H(l),m&&m.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Ta=[];function vM(n,e,t){let i,l,s,o,r;Qe(n,kn,fe=>t(19,r=fe));let{$$slots:a={},$$scope:u}=e;const f="f_"+U.randomString(8),c=yt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:y=U.initSchemaField()}=e,{draggable:S=!0}=e,{collection:C={}}=e,T,O=!1;function E(){y.id?t(0,y._toDelete=!0,y):(N(),c("remove"))}function L(){t(0,y._toDelete=!1,y),Ut({})}function I(){y._toDelete||(N(),c("duplicate"))}function A(fe){return U.slugify(fe)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let fe of Ta)fe.id!=f&&fe.collapse()}ln(()=>(Ta.push({id:f,collapse:N}),y.onMountSelect&&(t(0,y.onMountSelect=!1,y),T==null||T.select()),()=>{U.removeByKey(Ta,"id",f)}));const F=()=>T==null?void 0:T.focus();function B(fe){ie[fe?"unshift":"push"](()=>{T=fe,t(3,T)})}const J=fe=>{const ue=y.name;t(0,y.name=A(fe.target.value),y),fe.target.value=y.name,c("rename",{oldName:ue,newName:y.name})};function V(){y.required=this.checked,t(0,y)}function Z(){y.hidden=this.checked,t(0,y)}const G=fe=>{fe.target.checked&&t(0,y.presentable=!1,y)};function de(){y.presentable=this.checked,t(0,y)}return n.$$set=fe=>{"key"in fe&&t(1,_=fe.key),"field"in fe&&t(0,y=fe.field),"draggable"in fe&&t(2,S=fe.draggable),"collection"in fe&&t(18,C=fe.collection),"$$scope"in fe&&t(28,u=fe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=(C==null?void 0:C.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=!U.isEmpty(U.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[y==null?void 0:y.type]||"Nonempty")},[y,_,S,T,O,o,s,l,i,c,m,h,g,E,L,I,A,R,C,r,a,F,B,J,V,Z,G,de,u]}class ni extends Se{constructor(e){super(),we(this,e,vM,kM,ye,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function wM(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 zn({props:a}),ie.push(()=>be(t,"keyOfSelected",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Me(qe.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],Ce(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),H(t),s=!1,o()}}}function SM(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[wM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(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||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),H(i,r)}}}function TM(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[6](r)}let o={$$slots:{default:[SM,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}const Ca=1,$a=2,Oa=3;function CM(n,e,t){const i=["field","key"];let l=lt(e,i);const s=[{label:"Create",value:Ca},{label:"Update",value:$a},{label:"Create/Update",value:Oa}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Oa:o.onUpdate?$a:Ca}function f(_){switch(_){case Ca: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 Oa: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),Wt(_)),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 $M extends Se{constructor(e){super(),we(this,e,CM,TM,ye,{field:0,key:1})}}function OM(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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function MM(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),Wt(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 EM extends Se{constructor(e){super(),we(this,e,MM,OM,ye,{field:0,key:1})}}var Ma=["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},to={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ln=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Gn=function(n){return n===!0?1:0};function nh(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 Cn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Ot(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 bk(n,e){if(e(n))return n;if(n.parentNode)return bk(n.parentNode,e)}function Zo(n,e){var t=Ot("div","numInputWrapper"),i=Ot("input","numInput "+n),l=Ot("span","arrowUp"),s=Ot("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 Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Da=function(){},Cr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},DM={D:Da,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*Gn(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:Da,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:Da,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},wl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},js={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[js.w(n,e,t)]},F:function(n,e,t){return Cr(js.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Ln(js.h(n,e,t))},H:function(n){return Ln(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Gn(n.getHours()>11)]},M:function(n,e){return Cr(n.getMonth(),!0,e)},S:function(n){return Ln(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Ln(n.getFullYear(),4)},d:function(n){return Ln(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Ln(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Ln(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},yk=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return js[c]&&m[d-1]!=="\\"?js[c](r,f,t):c!=="\\"?c:""}).join("")}},cu=function(n){var e=n.config,t=e===void 0?es:e,i=n.l10n,l=i===void 0?to: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 C=d[_],T=C==="\\",O=d[_-1]==="\\"||T;if(wl[C]&&!O){S+=wl[C];var E=new RegExp(S).exec(s);E&&(h=!0)&&g[C!=="Y"?"push":"unshift"]({fn:DM[C],val:E[++y]})}else T||(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 Vn(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 IM=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Ia=function(n,e,t){return n*3600+e*60+t},LM=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},AM={DAY:864e5};function La(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 mn=function(){return mn=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},mn.apply(this,arguments)},ih=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},PM=300;function NM(n,e){var t={config:mn(mn({},es),en.defaultConfig),l10n:to};t.parseDate=cu({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=ct,t.changeMonth=fe,t.changeYear=et,t.clear=ue,t.close=Te,t.onMouseOver=Ve,t._createElement=Ot,t.createDay=E,t.destroy=Ke,t.isEnabled=xe,t.jumpToDate=S,t.updateValue=Dn,t.open=st,t.redraw=ot,t.set=Ft,t.setDate=vn,t.toggle=sn;function i(){t.utils={getDaysInMonth:function(X,x){return X===void 0&&(X=t.currentMonth),x===void 0&&(x=t.currentYear),X===1&&(x%4===0&&x%100!==0||x%400===0)?29:t.l10n.daysInMonth[X]}}}function l(){t.element=t.input=n,t.isOpen=!1,Ye(),$e(),li(),Oi(),i(),t.isMobile||O(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Dn(!1)),r();var X=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&X&&ct(),Dt("onReady")}function s(){var X;return((X=t.calendarContainer)===null||X===void 0?void 0:X.getRootNode()).activeElement||document.activeElement}function o(X){return X.bind(t)}function r(){var X=t.config;X.weekNumbers===!1&&X.showMonths===1||X.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 x=(t.days.offsetWidth+1)*X.showMonths;t.daysContainer.style.width=x+"px",t.calendarContainer.style.width=x+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(X){if(t.selectedDates.length===0){var x=t.config.minDate===void 0||Vn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),le=La(t.config);x.setHours(le.hours,le.minutes,le.seconds,x.getMilliseconds()),t.selectedDates=[x],t.latestSelectedDateObj=x}X!==void 0&&X.type!=="blur"&&cl(X);var ge=t._input.value;c(),Dn(),t._input.value!==ge&&t._debouncedChange()}function u(X,x){return X%12+12*Gn(x===t.l10n.amPM[1])}function f(X){switch(X%24){case 0:case 12:return 12;default:return X%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var X=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,x=(parseInt(t.minuteElement.value,10)||0)%60,le=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(X=u(X,t.amPM.textContent));var ge=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Fe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Vn(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 Be=Ia(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Ia(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),se=Ia(X,x,le);if(se>rt&&se<Be){var Oe=LM(Be);X=Oe[0],x=Oe[1],le=Oe[2]}}else{if(Fe){var Ne=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;X=Math.min(X,Ne.getHours()),X===Ne.getHours()&&(x=Math.min(x,Ne.getMinutes())),x===Ne.getMinutes()&&(le=Math.min(le,Ne.getSeconds()))}if(ge){var ze=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;X=Math.max(X,ze.getHours()),X===ze.getHours()&&x<ze.getMinutes()&&(x=ze.getMinutes()),x===ze.getMinutes()&&(le=Math.max(le,ze.getSeconds()))}}m(X,x,le)}}function d(X){var x=X||t.latestSelectedDateObj;x&&x instanceof Date&&m(x.getHours(),x.getMinutes(),x.getSeconds())}function m(X,x,le){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(X%24,x,le||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=Ln(t.config.time_24hr?X:(12+X)%12+12*Gn(X%12===0)),t.minuteElement.value=Ln(x),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Gn(X>=12)]),t.secondElement!==void 0&&(t.secondElement.value=Ln(le)))}function h(X){var x=Un(X),le=parseInt(x.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,x,le,ge){if(x instanceof Array)return x.forEach(function(Fe){return g(X,Fe,le,ge)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,x,le,ge)});X.addEventListener(x,le,ge),t._handlers.push({remove:function(){return X.removeEventListener(x,le,ge)}})}function _(){Dt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(ge){return g(ge,"click",t[le])})}),t.isMobile){wn();return}var X=nh(Ee,50);if(t._debouncedChange=nh(_,PM),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ve(Un(le))}),g(t._input,"keydown",jt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",jt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ft):g(window.document,"mousedown",ft),g(window.document,"focus",ft,{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",En)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var x=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",C),g([t.hourElement,t.minuteElement],["focus","click"],x),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(le){a(le)})}t.config.allowInput&&g(t._input,"blur",at)}function S(X,x){var le=X!==void 0?t.parseDate(X):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),ge=t.currentYear,Fe=t.currentMonth;try{le!==void 0&&(t.currentYear=le.getFullYear(),t.currentMonth=le.getMonth())}catch(Be){Be.message="Invalid date supplied: "+le,t.config.errorHandler(Be)}x&&t.currentYear!==ge&&(Dt("onYearChange"),z()),x&&(t.currentYear!==ge||t.currentMonth!==Fe)&&Dt("onMonthChange"),t.redraw()}function C(X){var x=Un(X);~x.className.indexOf("arrow")&&T(X,x.classList.contains("arrowUp")?1:-1)}function T(X,x,le){var ge=X&&Un(X),Fe=le||ge&&ge.parentNode&&ge.parentNode.firstChild,Be=Mi("increment");Be.delta=x,Fe&&Fe.dispatchEvent(Be)}function O(){var X=window.document.createDocumentFragment();if(t.calendarContainer=Ot("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(X.appendChild(J()),t.innerContainer=Ot("div","flatpickr-innerContainer"),t.config.weekNumbers){var x=de(),le=x.weekWrapper,ge=x.weekNumbers;t.innerContainer.appendChild(le),t.weekNumbers=ge,t.weekWrapper=le}t.rContainer=Ot("div","flatpickr-rContainer"),t.rContainer.appendChild(Z()),t.daysContainer||(t.daysContainer=Ot("div","flatpickr-days"),t.daysContainer.tabIndex=-1),R(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),X.appendChild(t.innerContainer)}t.config.enableTime&&X.appendChild(V()),Cn(t.calendarContainer,"rangeMode",t.config.mode==="range"),Cn(t.calendarContainer,"animate",t.config.animate===!0),Cn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(X);var Fe=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&&(!Fe&&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 Be=Ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Be,t.element),Be.appendChild(t.element),t.altInput&&Be.appendChild(t.altInput),Be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function E(X,x,le,ge){var Fe=xe(x,!0),Be=Ot("span",X,x.getDate().toString());return Be.dateObj=x,Be.$i=ge,Be.setAttribute("aria-label",t.formatDate(x,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(x,t.now)===0&&(t.todayDateElem=Be,Be.classList.add("today"),Be.setAttribute("aria-current","date")),Fe?(Be.tabIndex=-1,ul(x)&&(Be.classList.add("selected"),t.selectedDateElem=Be,t.config.mode==="range"&&(Cn(Be,"startRange",t.selectedDates[0]&&Vn(x,t.selectedDates[0],!0)===0),Cn(Be,"endRange",t.selectedDates[1]&&Vn(x,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Be.classList.add("inRange")))):Be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&zi(x)&&!ul(x)&&Be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&ge%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(x)+"</span>"),Dt("onDayCreate",Be),Be}function L(X){X.focus(),t.config.mode==="range"&&Ve(X)}function I(X){for(var x=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,ge=x;ge!=le;ge+=X)for(var Fe=t.daysContainer.children[ge],Be=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,se=Be;se!=rt;se+=X){var Oe=Fe.children[se];if(Oe.className.indexOf("hidden")===-1&&xe(Oe.dateObj))return Oe}}function A(X,x){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,ge=x>0?t.config.showMonths:-1,Fe=x>0?1:-1,Be=le-t.currentMonth;Be!=ge;Be+=Fe)for(var rt=t.daysContainer.children[Be],se=le-t.currentMonth===Be?X.$i+x:x<0?rt.children.length-1:0,Oe=rt.children.length,Ne=se;Ne>=0&&Ne<Oe&&Ne!=(x>0?Oe:-1);Ne+=Fe){var ze=rt.children[Ne];if(ze.className.indexOf("hidden")===-1&&xe(ze.dateObj)&&Math.abs(X.$i-Ne)>=Math.abs(x))return L(ze)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,x){var le=s(),ge=We(le||document.body),Fe=X!==void 0?X:ge?le:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:I(x>0?1:-1);Fe===void 0?t._input.focus():ge?A(Fe,x):L(Fe)}function N(X,x){for(var le=(new Date(X,x,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ge=t.utils.getDaysInMonth((x-1+12)%12,X),Fe=t.utils.getDaysInMonth(x,X),Be=window.document.createDocumentFragment(),rt=t.config.showMonths>1,se=rt?"prevMonthDay hidden":"prevMonthDay",Oe=rt?"nextMonthDay hidden":"nextMonthDay",Ne=ge+1-le,ze=0;Ne<=ge;Ne++,ze++)Be.appendChild(E("flatpickr-day "+se,new Date(X,x-1,Ne),Ne,ze));for(Ne=1;Ne<=Fe;Ne++,ze++)Be.appendChild(E("flatpickr-day",new Date(X,x,Ne),Ne,ze));for(var Ge=Fe+1;Ge<=42-le&&(t.config.showMonths===1||ze%7!==0);Ge++,ze++)Be.appendChild(E("flatpickr-day "+Oe,new Date(X,x+1,Ge%Fe),Ge,ze));var Qt=Ot("div","dayContainer");return Qt.appendChild(Be),Qt}function R(){if(t.daysContainer!==void 0){Jo(t.daysContainer),t.weekNumbers&&Jo(t.weekNumbers);for(var X=document.createDocumentFragment(),x=0;x<t.config.showMonths;x++){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),X.appendChild(N(le.getFullYear(),le.getMonth()))}t.daysContainer.appendChild(X),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ve()}}function z(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var X=function(ge){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ge<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&ge>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(X(x)){var le=Ot("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,x).getMonth().toString(),le.textContent=Cr(x,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===x&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Ot("div","flatpickr-month"),x=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Ot("span","cur-month"):(t.monthsDropdownContainer=Ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var se=Un(rt),Oe=parseInt(se.value,10);t.changeMonth(Oe-t.currentMonth),Dt("onMonthChange")}),z(),le=t.monthsDropdownContainer);var ge=Zo("cur-year",{tabindex:"-1"}),Fe=ge.getElementsByTagName("input")[0];Fe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Fe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Fe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Fe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Be=Ot("div","flatpickr-current-month");return Be.appendChild(le),Be.appendChild(ge),x.appendChild(Be),X.appendChild(x),{container:X,yearElement:Fe,monthElement:le}}function B(){Jo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var x=F();t.yearElements.push(x.yearElement),t.monthElements.push(x.monthElement),t.monthNav.appendChild(x.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(X){t.__hidePrevMonthArrow!==X&&(Cn(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&(Cn(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Ui(),t.monthNav}function V(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=La(t.config);t.timeContainer=Ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var x=Ot("span","flatpickr-time-separator",":"),le=Zo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var ge=Zo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ge.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():X.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(le),t.timeContainer.appendChild(x),t.timeContainer.appendChild(ge),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Zo("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Ln(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():X.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(Ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Ot("span","flatpickr-am-pm",t.l10n.amPM[Gn((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 Z(){t.weekdayContainer?Jo(t.weekdayContainer):t.weekdayContainer=Ot("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var x=Ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(x)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,x=ih(t.l10n.weekdays.shorthand);X>0&&X<x.length&&(x=ih(x.splice(X,x.length),x.splice(0,X)));for(var le=t.config.showMonths;le--;)t.weekdayContainer.children[le].innerHTML=`
       <span class='flatpickr-weekday'>
         `+x.join("</span><span class='flatpickr-weekday'>")+`
       </span>
-      `}}function de(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var x=Ot("div","flatpickr-weeks");return X.appendChild(x),{weekWrapper:X,weekNumbers:x}}function fe(X,x){x===void 0&&(x=!0);var le=x?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ue(X,x){if(X===void 0&&(X=!0),x===void 0&&(x=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,x===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=La(t.config),ge=le.hours,Fe=le.minutes,Be=le.seconds;m(ge,Fe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var x=t.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var x=Un(X),le=Je(x),ge=x===t.input||x===t.altInput||t.element.contains(x)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!ge&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(x)});Fe&&Be&&(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 et(X){if(!(!X||t.config.minDate&&X<t.config.minDate.getFullYear()||t.config.maxDate&&X>t.config.maxDate.getFullYear())){var x=X,le=t.currentYear!==x;t.currentYear=x||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),Dt("onYearChange"),z())}}function xe(X,x){var le;x===void 0&&(x=!0);var ge=t.parseDate(X,void 0,x);if(t.config.minDate&&ge&&Vn(ge,t.config.minDate,x!==void 0?x:!t.minDateHasTime)<0||t.config.maxDate&&ge&&Vn(ge,t.config.maxDate,x!==void 0?x:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ge===void 0)return!1;for(var Fe=!!t.config.enable,Be=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,se=void 0;rt<Be.length;rt++){if(se=Be[rt],typeof se=="function"&&se(ge))return Fe;if(se instanceof Date&&ge!==void 0&&se.getTime()===ge.getTime())return Fe;if(typeof se=="string"){var Oe=t.parseDate(se,void 0,!0);return Oe&&Oe.getTime()===ge.getTime()?Fe:!Fe}else if(typeof se=="object"&&ge!==void 0&&se.from&&se.to&&ge.getTime()>=se.from.getTime()&&ge.getTime()<=se.to.getTime())return Fe}return!Fe}function We(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function at(X){var x=X.target===t._input,le=t._input.value.trimEnd()!==fl();x&&le&&!(X.relatedTarget&&Je(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function jt(X){var x=Un(X),le=t.config.wrap?n.contains(x):x===t._input,ge=t.config.allowInput,Fe=t.isOpen&&(!ge||!le),Be=t.config.inline&&le&&!ge;if(X.keyCode===13&&le){if(ge)return t.setDate(t._input.value,!0,x===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),x.blur();t.open()}else if(Je(x)||Fe||Be){var rt=!!t.timeContainer&&t.timeContainer.contains(x);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),on()):En(X);break;case 27:X.preventDefault(),on();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var se=s();if(t.daysContainer!==void 0&&(ge===!1||se&&We(se))){var Oe=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),fe(Oe),P(I(1),0)):P(void 0,Oe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var Ne=X.keyCode===40?1:-1;t.daysContainer&&x.$i!==void 0||x===t.input||x===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-Ne),P(I(1),0)):rt||P(void 0,Ne*7):x===t.currentYearElement?et(t.currentYear-Ne):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var ze=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),Ge=ze.indexOf(x);if(Ge!==-1){var Qt=ze[Ge+(X.shiftKey?-1:1)];X.preventDefault(),(Qt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(x)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&x===t.amPM)switch(X.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(le||Je(x))&&Dt("onKeyDown",X)}function Ve(X,x){if(x===void 0&&(x="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(x)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ge=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Be=Math.max(le,t.selectedDates[0].getTime()),rt=!1,se=0,Oe=0,Ne=Fe;Ne<Be;Ne+=IM.DAY)xe(new Date(Ne),!0)||(rt=rt||Ne>Fe&&Ne<Be,Ne<ge&&(!se||Ne>se)?se=Ne:Ne>ge&&(!Oe||Ne<Oe)&&(Oe=Ne));var ze=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+x));ze.forEach(function(Ge){var Qt=Ge.dateObj,qt=Qt.getTime(),Sn=se>0&&qt<se||Oe>0&&qt>Oe;if(Sn){Ge.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Ei){Ge.classList.remove(Ei)});return}else if(rt&&!Sn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Ei){Ge.classList.remove(Ei)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),ge<le&&qt===ge?Ge.classList.add("startRange"):ge>le&&qt===ge&&Ge.classList.add("endRange"),qt>=se&&(Oe===0||qt<=Oe)&&EM(qt,ge,le)&&Ge.classList.add("inRange"))})}}function Ee(){t.isOpen&&!t.config.static&&!t.config.inline&&ct()}function st(X,x){if(x===void 0&&(x=t._positionElement),t.isMobile===!0){if(X){X.preventDefault();var le=Un(X);le&&le.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ge=t.isOpen;t.isOpen=!0,ge||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ct(x)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(X===void 0||!t.timeContainer.contains(X.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(X){return function(x){var le=t.config["_"+X+"Date"]=t.parseDate(x,t.config.dateFormat),ge=t.config["_"+(X==="min"?"max":"min")+"Date"];le!==void 0&&(t[X==="min"?"minDateHasTime":"maxDateHasTime"]=le.getHours()>0||le.getMinutes()>0||le.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Fe){return xe(Fe)}),!t.selectedDates.length&&X==="min"&&d(le),Dn()),t.daysContainer&&(ot(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!ge&&le!==void 0&&ge.getFullYear()===le.getFullYear())}}function Ye(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],x=mn(mn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=x.parseDate,t.config.formatDate=x.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(ze){t.config._enable=fn(ze)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(ze){t.config._disable=fn(ze)}});var ge=x.mode==="time";if(!x.dateFormat&&(x.enableTime||ge)){var Fe=en.defaultConfig.dateFormat||es.dateFormat;le.dateFormat=x.noCalendar||ge?"H:i"+(x.enableSeconds?":S":""):Fe+" H:i"+(x.enableSeconds?":S":"")}if(x.altInput&&(x.enableTime||ge)&&!x.altFormat){var Be=en.defaultConfig.altFormat||es.altFormat;le.altFormat=x.noCalendar||ge?"h:i"+(x.enableSeconds?":S K":" K"):Be+(" h:i"+(x.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var rt=function(ze){return function(Ge){t.config[ze==="min"?"_minTime":"_maxTime"]=t.parseDate(Ge,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:rt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:rt("max")}),x.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,x);for(var se=0;se<X.length;se++)t.config[X[se]]=t.config[X[se]]===!0||t.config[X[se]]==="true";Ma.filter(function(ze){return t.config[ze]!==void 0}).forEach(function(ze){t.config[ze]=Ea(t.config[ze]||[]).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 se=0;se<t.config.plugins.length;se++){var Oe=t.config.plugins[se](t)||{};for(var Ne in Oe)Ma.indexOf(Ne)>-1?t.config[Ne]=Ea(Oe[Ne]).map(o).concat(t.config[Ne]):typeof x[Ne]>"u"&&(t.config[Ne]=Oe[Ne])}x.altInputClass||(t.config.altInputClass=ke().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ke(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){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=mn(mn({},en.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?en.l10ns[t.config.locale]:void 0),wl.D="("+t.l10n.weekdays.shorthand.join("|")+")",wl.l="("+t.l10n.weekdays.longhand.join("|")+")",wl.M="("+t.l10n.months.shorthand.join("|")+")",wl.F="("+t.l10n.months.longhand.join("|")+")",wl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=mn(mn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&en.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=bk(t),t.parseDate=fu({config:t.config,l10n:t.l10n})}function ct(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var x=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),ge=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Be=Fe[0],rt=Fe.length>1?Fe[1]:null,se=x.getBoundingClientRect(),Oe=window.innerHeight-se.bottom,Ne=Be==="above"||Be!=="below"&&Oe<le&&se.top>le,ze=window.pageYOffset+se.top+(Ne?-le-2:x.offsetHeight+2);if(Cn(t.calendarContainer,"arrowTop",!Ne),Cn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var Ge=window.pageXOffset+se.left,Qt=!1,qt=!1;rt==="center"?(Ge-=(ge-se.width)/2,Qt=!0):rt==="right"&&(Ge-=ge-se.width,qt=!0),Cn(t.calendarContainer,"arrowLeft",!Qt&&!qt),Cn(t.calendarContainer,"arrowCenter",Qt),Cn(t.calendarContainer,"arrowRight",qt);var Sn=window.document.body.offsetWidth-(window.pageXOffset+se.right),Ei=Ge+ge>window.document.body.offsetWidth,go=Sn+ge>window.document.body.offsetWidth;if(Cn(t.calendarContainer,"rightMost",Ei),!t.config.static)if(t.calendarContainer.style.top=ze+"px",!Ei)t.calendarContainer.style.left=Ge+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Sn+"px";else{var Fl=Ht();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-ge/2),Di=".flatpickr-calendar.centerMost:before",dl=".flatpickr-calendar.centerMost:after",pl=Fl.cssRules.length,ql="{left:"+se.left+"px;right:auto;}";Cn(t.calendarContainer,"rightMost",!1),Cn(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+dl+ql,pl),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ht(){for(var X=null,x=0;x<document.styleSheets.length;x++){var le=document.styleSheets[x];if(le.cssRules){try{le.cssRules}catch{continue}X=le;break}}return X??Le()}function Le(){var X=document.createElement("style");return document.head.appendChild(X),X.sheet}function ot(){t.config.noCalendar||t.isMobile||(z(),Ui(),R())}function on(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function En(X){X.preventDefault(),X.stopPropagation();var x=function(ze){return ze.classList&&ze.classList.contains("flatpickr-day")&&!ze.classList.contains("flatpickr-disabled")&&!ze.classList.contains("notAllowed")},le=gk(Un(X),x);if(le!==void 0){var ge=le,Fe=t.latestSelectedDateObj=new Date(ge.dateObj.getTime()),Be=(Fe.getMonth()<t.currentMonth||Fe.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ge,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=ul(Fe);rt?t.selectedDates.splice(parseInt(rt),1):t.selectedDates.push(Fe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Fe,t.selectedDates.push(Fe),Vn(Fe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(ze,Ge){return ze.getTime()-Ge.getTime()}));if(c(),Be){var se=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),se&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!Be&&t.config.mode!=="range"&&t.config.showMonths===1?L(ge):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 Oe=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Oe||Ne)&&on()}_()}}var Re={locale:[$e,G],showMonths:[B,r,Z],minDate:[S],maxDate:[S],positionElement:[bt],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 Ft(X,x){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Re[le]!==void 0&&Re[le].forEach(function(ge){return ge()})}else t.config[X]=x,Re[X]!==void 0?Re[X].forEach(function(ge){return ge()}):Ma.indexOf(X)>-1&&(t.config[X]=Ea(x));t.redraw(),Dn(!0)}function Yt(X,x){var le=[];if(X instanceof Array)le=X.map(function(ge){return t.parseDate(ge,x)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,x)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,x)];break;case"multiple":le=X.split(t.config.conjunction).map(function(ge){return t.parseDate(ge,x)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(ge){return t.parseDate(ge,x)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(ge){return ge instanceof Date&&xe(ge,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ge,Fe){return ge.getTime()-Fe.getTime()})}function vn(X,x,le){if(x===void 0&&(x=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(x);Yt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,x),d(),t.selectedDates.length===0&&t.clear(!1),Dn(x),x&&Dt("onChange")}function fn(X){return X.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?t.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:t.parseDate(x.from,void 0),to:t.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var X=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);X&&Yt(X,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 li(){if(t.input=ke(),!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=Ot(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"),bt()}function bt(){t._positionElement=t.config.positionElement||t._input}function wn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ot("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=X,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=X==="datetime-local"?"Y-m-d\\TH:i:S":X==="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(x){t.setDate(Un(x).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function sn(X){if(t.isOpen===!0)return t.close();t.open(X)}function Dt(X,x){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var ge=0;le[ge]&&ge<le.length;ge++)le[ge](t.selectedDates,t.input.value,t,x);X==="onChange"&&(t.input.dispatchEvent(Mi("change")),t.input.dispatchEvent(Mi("input")))}}function Mi(X){var x=document.createEvent("Event");return x.initEvent(X,!0,!0),x}function ul(X){for(var x=0;x<t.selectedDates.length;x++){var le=t.selectedDates[x];if(le instanceof Date&&Vn(le,X)===0)return""+x}return!1}function zi(X){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Vn(X,t.selectedDates[0])>=0&&Vn(X,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,x){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[x].textContent=Cr(le.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=le.getMonth().toString(),X.value=le.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(X){var x=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,x)}).filter(function(le,ge,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===ge}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(X){X===void 0&&(X=!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)),X!==!1&&Dt("onValueUpdate")}function Rl(X){var x=Un(X),le=t.prevMonthNav.contains(x),ge=t.nextMonthNav.contains(x);le||ge?fe(le?-1:1):t.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):x.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(X){X.preventDefault();var x=X.type==="keydown",le=Un(X),ge=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(ge.getAttribute("min")),Be=parseFloat(ge.getAttribute("max")),rt=parseFloat(ge.getAttribute("step")),se=parseInt(ge.value,10),Oe=X.delta||(x?X.which===38?1:-1:0),Ne=se+rt*Oe;if(typeof ge.value<"u"&&ge.value.length===2){var ze=ge===t.hourElement,Ge=ge===t.minuteElement;Ne<Fe?(Ne=Be+Ne+Gn(!ze)+(Gn(ze)&&Gn(!t.amPM)),Ge&&T(void 0,-1,t.hourElement)):Ne>Be&&(Ne=ge===t.hourElement?Ne-Be-Gn(!t.amPM):Fe,Ge&&T(void 0,1,t.hourElement)),t.amPM&&ze&&(rt===1?Ne+se===23:Math.abs(Ne-se)>rt)&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]),ge.value=Ln(Ne)}}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=AM(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:mn({},to),default:mn({},to)};en.localize=function(n){en.l10ns.default=mn(mn({},en.l10ns.default),n)};en.setDefaults=function(n){en.defaultConfig=mn(mn({},en.defaultConfig),n)};en.parseDate=fu({});en.formatDate=bk({});en.compareDates=Vn;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 PM(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"),ei(e,i)},m(l,s){v(l,e,s),e.autofocus&&e.focus(),n[11](e)},p(l,s){ei(e,i=wt(t,[s&2&&l[1]]))},d(l){l&&k(e),n[11](null)}}}function NM(n){let e;const t=n[10].default,i=Lt(t,n,n[9],null),l=i||PM(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||(M(l,s),e=!0)},o(s){D(l,s),e=!1},d(s){l&&l.d(s)}}}function RM(n){return n.charAt(2).toLowerCase()+n.substring(3)}function ih(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function lh(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 FM(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;ln(()=>{const T=f??h,O=y(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),dn().then(()=>{t(8,m=!0)})}),t(3,g=en(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=yt();function y(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{_(RM(O),[L,I,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(E)):T[O]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,E){const L=ih(E,T);!lh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function C(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(lh(a,ih(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(y(d)))g.set(T,O)},[h,l,a,g,u,f,c,d,m,o,s,C]}class nf extends Se{constructor(e){super(),we(this,e,FM,NM,ye,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function qM(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:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),l=$(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function HM(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:U.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new nf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),l=$(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function jM(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[qM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[HM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function zM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[jM]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function UM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,s[O]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const g=T=>u(T,"max");function _(T){s=T,t(0,s)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,g,_,y,S,C]}class VM extends Se{constructor(e){super(),we(this,e,UM,zM,ye,{field:0,key:1})}}function BM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=$(),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=Y(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 WM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){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=[Y(e,"change",n[4]),Me(qe.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,Ie(f)}}}function YM(n){let e,t,i,l;return e=new ce({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[BM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[WM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function KM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[YM]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function JM(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),Wt(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 ZM extends Se{constructor(e){super(),we(this,e,JM,KM,ye,{field:0,key:1})}}function GM(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:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),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),q(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(qe.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=!U.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,m()}}}function XM(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:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),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),q(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(qe.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=!U.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,m()}}}function QM(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[GM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[XM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function xM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[QM]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function eE(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),Wt(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 yk extends Se{constructor(e){super(),we(this,e,eE,xM,ye,{field:0,key:1})}}function tE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=$(),s=b("small"),r=W(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")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(k(e),k(l),k(s))}}}function nE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class sh extends Se{constructor(e){super(),we(this,e,nE,tE,ye,{item:0})}}const iE=[{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 lE(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function sE(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[lE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(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||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),H(i,r)}}}function oE(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=$(),i=b("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',l=$(),s=b("button"),s.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=$(),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=[Y(e,"click",n[8]),Y(i,"click",n[9]),Y(s,"click",n[10]),Y(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,Ie(u)}}}function rE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:sh,optionComponent:sh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new zn({props:O}),ie.push(()=>be(r,"keyOfSelected",T)),_=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[oE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=$(),h=b("i"),g=$(),j(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){v(E,e,L),w(e,t),w(e,i),w(e,l),v(E,o,L),q(r,E,L),v(E,u,L),v(E,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,g),q(_,c,null),y=!0,S||(C=Me(qe.call(null,l,{text:`Allow files ONLY with the listed mime types. 
- Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!y||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,Ce(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){y||(M(r.$$.fragment,E),M(_.$$.fragment,E),y=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),y=!1},d(E){E&&(k(e),k(o),k(u),k(f)),H(r,E),H(_),S=!1,C()}}}function aE(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
+      `}}function de(){t.calendarContainer.classList.add("hasWeeks");var X=Ot("div","flatpickr-weekwrapper");X.appendChild(Ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var x=Ot("div","flatpickr-weeks");return X.appendChild(x),{weekWrapper:X,weekNumbers:x}}function fe(X,x){x===void 0&&(x=!0);var le=x?X:X-t.currentMonth;le<0&&t._hidePrevMonthArrow===!0||le>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=le,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Dt("onYearChange"),z()),R(),Dt("onMonthChange"),Ui())}function ue(X,x){if(X===void 0&&(X=!0),x===void 0&&(x=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,x===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=La(t.config),ge=le.hours,Fe=le.minutes,Be=le.seconds;m(ge,Fe,Be)}t.redraw(),X&&Dt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Dt("onClose")}function Ke(){t.config!==void 0&&Dt("onDestroy");for(var X=t._handlers.length;X--;)t._handlers[X].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var x=t.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Je(X){return t.calendarContainer.contains(X)}function ft(X){if(t.isOpen&&!t.config.inline){var x=Un(X),le=Je(x),ge=x===t.input||x===t.altInput||t.element.contains(x)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!ge&&!le&&!Je(X.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(x)});Fe&&Be&&(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 et(X){if(!(!X||t.config.minDate&&X<t.config.minDate.getFullYear()||t.config.maxDate&&X>t.config.maxDate.getFullYear())){var x=X,le=t.currentYear!==x;t.currentYear=x||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),Dt("onYearChange"),z())}}function xe(X,x){var le;x===void 0&&(x=!0);var ge=t.parseDate(X,void 0,x);if(t.config.minDate&&ge&&Vn(ge,t.config.minDate,x!==void 0?x:!t.minDateHasTime)<0||t.config.maxDate&&ge&&Vn(ge,t.config.maxDate,x!==void 0?x:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ge===void 0)return!1;for(var Fe=!!t.config.enable,Be=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,se=void 0;rt<Be.length;rt++){if(se=Be[rt],typeof se=="function"&&se(ge))return Fe;if(se instanceof Date&&ge!==void 0&&se.getTime()===ge.getTime())return Fe;if(typeof se=="string"){var Oe=t.parseDate(se,void 0,!0);return Oe&&Oe.getTime()===ge.getTime()?Fe:!Fe}else if(typeof se=="object"&&ge!==void 0&&se.from&&se.to&&ge.getTime()>=se.from.getTime()&&ge.getTime()<=se.to.getTime())return Fe}return!Fe}function We(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function at(X){var x=X.target===t._input,le=t._input.value.trimEnd()!==fl();x&&le&&!(X.relatedTarget&&Je(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function jt(X){var x=Un(X),le=t.config.wrap?n.contains(x):x===t._input,ge=t.config.allowInput,Fe=t.isOpen&&(!ge||!le),Be=t.config.inline&&le&&!ge;if(X.keyCode===13&&le){if(ge)return t.setDate(t._input.value,!0,x===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),x.blur();t.open()}else if(Je(x)||Fe||Be){var rt=!!t.timeContainer&&t.timeContainer.contains(x);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),on()):En(X);break;case 27:X.preventDefault(),on();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var se=s();if(t.daysContainer!==void 0&&(ge===!1||se&&We(se))){var Oe=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),fe(Oe),P(I(1),0)):P(void 0,Oe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var Ne=X.keyCode===40?1:-1;t.daysContainer&&x.$i!==void 0||x===t.input||x===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-Ne),P(I(1),0)):rt||P(void 0,Ne*7):x===t.currentYearElement?et(t.currentYear-Ne):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var ze=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(qt){return qt}),Ge=ze.indexOf(x);if(Ge!==-1){var Qt=ze[Ge+(X.shiftKey?-1:1)];X.preventDefault(),(Qt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(x)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&x===t.amPM)switch(X.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Dn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Dn();break}(le||Je(x))&&Dt("onKeyDown",X)}function Ve(X,x){if(x===void 0&&(x="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(x)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ge=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Be=Math.max(le,t.selectedDates[0].getTime()),rt=!1,se=0,Oe=0,Ne=Fe;Ne<Be;Ne+=AM.DAY)xe(new Date(Ne),!0)||(rt=rt||Ne>Fe&&Ne<Be,Ne<ge&&(!se||Ne>se)?se=Ne:Ne>ge&&(!Oe||Ne<Oe)&&(Oe=Ne));var ze=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+x));ze.forEach(function(Ge){var Qt=Ge.dateObj,qt=Qt.getTime(),Sn=se>0&&qt<se||Oe>0&&qt>Oe;if(Sn){Ge.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Ei){Ge.classList.remove(Ei)});return}else if(rt&&!Sn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Ei){Ge.classList.remove(Ei)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),ge<le&&qt===ge?Ge.classList.add("startRange"):ge>le&&qt===ge&&Ge.classList.add("endRange"),qt>=se&&(Oe===0||qt<=Oe)&&IM(qt,ge,le)&&Ge.classList.add("inRange"))})}}function Ee(){t.isOpen&&!t.config.static&&!t.config.inline&&ct()}function st(X,x){if(x===void 0&&(x=t._positionElement),t.isMobile===!0){if(X){X.preventDefault();var le=Un(X);le&&le.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Dt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ge=t.isOpen;t.isOpen=!0,ge||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Dt("onOpen"),ct(x)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(X===void 0||!t.timeContainer.contains(X.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function De(X){return function(x){var le=t.config["_"+X+"Date"]=t.parseDate(x,t.config.dateFormat),ge=t.config["_"+(X==="min"?"max":"min")+"Date"];le!==void 0&&(t[X==="min"?"minDateHasTime":"maxDateHasTime"]=le.getHours()>0||le.getMinutes()>0||le.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Fe){return xe(Fe)}),!t.selectedDates.length&&X==="min"&&d(le),Dn()),t.daysContainer&&(ot(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!ge&&le!==void 0&&ge.getFullYear()===le.getFullYear())}}function Ye(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],x=mn(mn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=x.parseDate,t.config.formatDate=x.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(ze){t.config._enable=fn(ze)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(ze){t.config._disable=fn(ze)}});var ge=x.mode==="time";if(!x.dateFormat&&(x.enableTime||ge)){var Fe=en.defaultConfig.dateFormat||es.dateFormat;le.dateFormat=x.noCalendar||ge?"H:i"+(x.enableSeconds?":S":""):Fe+" H:i"+(x.enableSeconds?":S":"")}if(x.altInput&&(x.enableTime||ge)&&!x.altFormat){var Be=en.defaultConfig.altFormat||es.altFormat;le.altFormat=x.noCalendar||ge?"h:i"+(x.enableSeconds?":S K":" K"):Be+(" h:i"+(x.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:De("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:De("max")});var rt=function(ze){return function(Ge){t.config[ze==="min"?"_minTime":"_maxTime"]=t.parseDate(Ge,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:rt("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:rt("max")}),x.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,x);for(var se=0;se<X.length;se++)t.config[X[se]]=t.config[X[se]]===!0||t.config[X[se]]==="true";Ma.filter(function(ze){return t.config[ze]!==void 0}).forEach(function(ze){t.config[ze]=Ea(t.config[ze]||[]).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 se=0;se<t.config.plugins.length;se++){var Oe=t.config.plugins[se](t)||{};for(var Ne in Oe)Ma.indexOf(Ne)>-1?t.config[Ne]=Ea(Oe[Ne]).map(o).concat(t.config[Ne]):typeof x[Ne]>"u"&&(t.config[Ne]=Oe[Ne])}x.altInputClass||(t.config.altInputClass=ke().className+" "+t.config.altInputClass),Dt("onParseConfig")}function ke(){return t.config.wrap?n.querySelector("[data-input]"):n}function $e(){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=mn(mn({},en.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?en.l10ns[t.config.locale]:void 0),wl.D="("+t.l10n.weekdays.shorthand.join("|")+")",wl.l="("+t.l10n.weekdays.longhand.join("|")+")",wl.M="("+t.l10n.months.shorthand.join("|")+")",wl.F="("+t.l10n.months.longhand.join("|")+")",wl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=mn(mn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&en.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=yk(t),t.parseDate=cu({config:t.config,l10n:t.l10n})}function ct(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){Dt("onPreCalendarPosition");var x=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),ge=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Be=Fe[0],rt=Fe.length>1?Fe[1]:null,se=x.getBoundingClientRect(),Oe=window.innerHeight-se.bottom,Ne=Be==="above"||Be!=="below"&&Oe<le&&se.top>le,ze=window.pageYOffset+se.top+(Ne?-le-2:x.offsetHeight+2);if(Cn(t.calendarContainer,"arrowTop",!Ne),Cn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var Ge=window.pageXOffset+se.left,Qt=!1,qt=!1;rt==="center"?(Ge-=(ge-se.width)/2,Qt=!0):rt==="right"&&(Ge-=ge-se.width,qt=!0),Cn(t.calendarContainer,"arrowLeft",!Qt&&!qt),Cn(t.calendarContainer,"arrowCenter",Qt),Cn(t.calendarContainer,"arrowRight",qt);var Sn=window.document.body.offsetWidth-(window.pageXOffset+se.right),Ei=Ge+ge>window.document.body.offsetWidth,go=Sn+ge>window.document.body.offsetWidth;if(Cn(t.calendarContainer,"rightMost",Ei),!t.config.static)if(t.calendarContainer.style.top=ze+"px",!Ei)t.calendarContainer.style.left=Ge+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Sn+"px";else{var Fl=Ht();if(Fl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-ge/2),Di=".flatpickr-calendar.centerMost:before",dl=".flatpickr-calendar.centerMost:after",pl=Fl.cssRules.length,ql="{left:"+se.left+"px;right:auto;}";Cn(t.calendarContainer,"rightMost",!1),Cn(t.calendarContainer,"centerMost",!0),Fl.insertRule(Di+","+dl+ql,pl),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ht(){for(var X=null,x=0;x<document.styleSheets.length;x++){var le=document.styleSheets[x];if(le.cssRules){try{le.cssRules}catch{continue}X=le;break}}return X??Le()}function Le(){var X=document.createElement("style");return document.head.appendChild(X),X.sheet}function ot(){t.config.noCalendar||t.isMobile||(z(),Ui(),R())}function on(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function En(X){X.preventDefault(),X.stopPropagation();var x=function(ze){return ze.classList&&ze.classList.contains("flatpickr-day")&&!ze.classList.contains("flatpickr-disabled")&&!ze.classList.contains("notAllowed")},le=bk(Un(X),x);if(le!==void 0){var ge=le,Fe=t.latestSelectedDateObj=new Date(ge.dateObj.getTime()),Be=(Fe.getMonth()<t.currentMonth||Fe.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ge,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=ul(Fe);rt?t.selectedDates.splice(parseInt(rt),1):t.selectedDates.push(Fe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Fe,t.selectedDates.push(Fe),Vn(Fe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(ze,Ge){return ze.getTime()-Ge.getTime()}));if(c(),Be){var se=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),se&&(Dt("onYearChange"),z()),Dt("onMonthChange")}if(Ui(),R(),Dn(),!Be&&t.config.mode!=="range"&&t.config.showMonths===1?L(ge):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 Oe=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Oe||Ne)&&on()}_()}}var Re={locale:[$e,G],showMonths:[B,r,Z],minDate:[S],maxDate:[S],positionElement:[bt],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 Ft(X,x){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Re[le]!==void 0&&Re[le].forEach(function(ge){return ge()})}else t.config[X]=x,Re[X]!==void 0?Re[X].forEach(function(ge){return ge()}):Ma.indexOf(X)>-1&&(t.config[X]=Ea(x));t.redraw(),Dn(!0)}function Yt(X,x){var le=[];if(X instanceof Array)le=X.map(function(ge){return t.parseDate(ge,x)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,x)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,x)];break;case"multiple":le=X.split(t.config.conjunction).map(function(ge){return t.parseDate(ge,x)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(ge){return t.parseDate(ge,x)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(ge){return ge instanceof Date&&xe(ge,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ge,Fe){return ge.getTime()-Fe.getTime()})}function vn(X,x,le){if(x===void 0&&(x=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(x);Yt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,x),d(),t.selectedDates.length===0&&t.clear(!1),Dn(x),x&&Dt("onChange")}function fn(X){return X.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?t.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:t.parseDate(x.from,void 0),to:t.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var X=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);X&&Yt(X,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 li(){if(t.input=ke(),!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=Ot(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"),bt()}function bt(){t._positionElement=t.config.positionElement||t._input}function wn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Ot("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=X,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=X==="datetime-local"?"Y-m-d\\TH:i:S":X==="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(x){t.setDate(Un(x).value,!1,t.mobileFormatStr),Dt("onChange"),Dt("onClose")})}function sn(X){if(t.isOpen===!0)return t.close();t.open(X)}function Dt(X,x){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var ge=0;le[ge]&&ge<le.length;ge++)le[ge](t.selectedDates,t.input.value,t,x);X==="onChange"&&(t.input.dispatchEvent(Mi("change")),t.input.dispatchEvent(Mi("input")))}}function Mi(X){var x=document.createEvent("Event");return x.initEvent(X,!0,!0),x}function ul(X){for(var x=0;x<t.selectedDates.length;x++){var le=t.selectedDates[x];if(le instanceof Date&&Vn(le,X)===0)return""+x}return!1}function zi(X){return t.config.mode!=="range"||t.selectedDates.length<2?!1:Vn(X,t.selectedDates[0])>=0&&Vn(X,t.selectedDates[1])<=0}function Ui(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,x){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+x),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[x].textContent=Cr(le.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=le.getMonth().toString(),X.value=le.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(X){var x=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,x)}).filter(function(le,ge,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===ge}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Dn(X){X===void 0&&(X=!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)),X!==!1&&Dt("onValueUpdate")}function Rl(X){var x=Un(X),le=t.prevMonthNav.contains(x),ge=t.nextMonthNav.contains(x);le||ge?fe(le?-1:1):t.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):x.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function cl(X){X.preventDefault();var x=X.type==="keydown",le=Un(X),ge=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(ge.getAttribute("min")),Be=parseFloat(ge.getAttribute("max")),rt=parseFloat(ge.getAttribute("step")),se=parseInt(ge.value,10),Oe=X.delta||(x?X.which===38?1:-1:0),Ne=se+rt*Oe;if(typeof ge.value<"u"&&ge.value.length===2){var ze=ge===t.hourElement,Ge=ge===t.minuteElement;Ne<Fe?(Ne=Be+Ne+Gn(!ze)+(Gn(ze)&&Gn(!t.amPM)),Ge&&T(void 0,-1,t.hourElement)):Ne>Be&&(Ne=ge===t.hourElement?Ne-Be-Gn(!t.amPM):Fe,Ge&&T(void 0,1,t.hourElement)),t.amPM&&ze&&(rt===1?Ne+se===23:Math.abs(Ne-se)>rt)&&(t.amPM.textContent=t.l10n.amPM[Gn(t.amPM.textContent===t.l10n.amPM[0])]),ge.value=Ln(Ne)}}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=NM(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:mn({},to),default:mn({},to)};en.localize=function(n){en.l10ns.default=mn(mn({},en.l10ns.default),n)};en.setDefaults=function(n){en.defaultConfig=mn(mn({},en.defaultConfig),n)};en.parseDate=cu({});en.formatDate=yk({});en.compareDates=Vn;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 RM(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"),ei(e,i)},m(l,s){v(l,e,s),e.autofocus&&e.focus(),n[11](e)},p(l,s){ei(e,i=wt(t,[s&2&&l[1]]))},d(l){l&&k(e),n[11](null)}}}function FM(n){let e;const t=n[10].default,i=Lt(t,n,n[9],null),l=i||RM(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||(M(l,s),e=!0)},o(s){D(l,s),e=!1},d(s){l&&l.d(s)}}}function qM(n){return n.charAt(2).toLowerCase()+n.substring(3)}function lh(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function sh(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 HM(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;ln(()=>{const T=f??h,O=y(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),dn().then(()=>{t(8,m=!0)})}),t(3,g=en(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=yt();function y(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{_(qM(O),[L,I,A])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(E)):T[O]=[E]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,O,E){const L=lh(E,T);!sh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function C(T){ie[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(1,l=lt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(sh(a,lh(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(y(d)))g.set(T,O)},[h,l,a,g,u,f,c,d,m,o,s,C]}class lf extends Se{constructor(e){super(),we(this,e,HM,FM,ye,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function jM(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:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),s=new lf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),l=$(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function zM(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:U.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),s=new lf({props:c}),ie.push(()=>be(s,"value",u)),ie.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),l=$(),j(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function UM(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[jM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[zM,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function VM(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[UM]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function BM(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e,r=s==null?void 0:s.min,a=s==null?void 0:s.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,s[O]=T.detail[1],s)}function f(T){r=T,t(2,r),t(0,s)}function c(T){n.$$.not_equal(s.min,T)&&(s.min=T,t(0,s))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,s)}function h(T){n.$$.not_equal(s.max,T)&&(s.max=T,t(0,s))}const g=T=>u(T,"max");function _(T){s=T,t(0,s)}function y(T){Pe.call(this,n,T)}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Wt(T)),t(5,l=lt(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(s==null?void 0:s.min)&&t(2,r=s==null?void 0:s.min),n.$$.dirty&9&&a!=(s==null?void 0:s.max)&&t(3,a=s==null?void 0:s.max)},[s,o,r,a,u,l,f,c,d,m,h,g,_,y,S,C]}class WM extends Se{constructor(e){super(),we(this,e,BM,VM,ye,{field:0,key:1})}}function YM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=$(),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=Y(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 KM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){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=[Y(e,"change",n[4]),Me(qe.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,Ie(f)}}}function JM(n){let e,t,i,l;return e=new ce({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[YM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[KM,({uniqueId:s})=>({9:s}),({uniqueId:s})=>s?512:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o&2&&(r.name="fields."+s[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:s}),e.$set(r);const a={};o&2&&(a.name="fields."+s[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:s}),i.$set(a)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function ZM(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[JM]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function GM(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),Wt(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 XM extends Se{constructor(e){super(),we(this,e,GM,ZM,ye,{field:0,key:1})}}function QM(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:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),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),q(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(qe.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=!U.isEmpty(_[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].exceptDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,m()}}}function xM(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:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new ms({props:g}),ie.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),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),q(r,_,y),v(_,u,y),v(_,f,y),c=!0,d||(m=Me(qe.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=!U.isEmpty(_[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].onlyDomains,Ce(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,m()}}}function eE(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[QM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[xM,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function tE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[eE]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function 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),Wt(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 kk extends Se{constructor(e){super(),we(this,e,nE,tE,ye,{field:0,key:1})}}function iE(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),l=$(),s=b("small"),r=W(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")+"")&&oe(i,t),u&1&&o!==(o=a[0].mimeType+"")&&oe(r,o)},i:te,o:te,d(a){a&&(k(e),k(l),k(s))}}}function lE(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class oh extends Se{constructor(e){super(),we(this,e,lE,iE,ye,{item:0})}}const sE=[{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 oE(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function rE(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[oE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){v(r,e,a),v(r,t,a),q(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||(M(i.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(l),k(s)),H(i,r)}}}function aE(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=$(),i=b("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',l=$(),s=b("button"),s.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=$(),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=[Y(e,"click",n[8]),Y(i,"click",n[9]),Y(s,"click",n[10]),Y(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,Ie(u)}}}function uE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:oh,optionComponent:oh};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new zn({props:O}),ie.push(()=>be(r,"keyOfSelected",T)),_=new jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[aE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=$(),h=b("i"),g=$(),j(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){v(E,e,L),w(e,t),w(e,i),w(e,l),v(E,o,L),q(r,E,L),v(E,u,L),v(E,f,L),w(f,c),w(c,d),w(c,m),w(c,h),w(c,g),q(_,c,null),y=!0,S||(C=Me(qe.call(null,l,{text:`Allow files ONLY with the listed mime types. 
+ Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!y||L&8388608&&s!==(s=E[23]))&&p(e,"for",s);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,Ce(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){y||(M(r.$$.fragment,E),M(_.$$.fragment,E),y=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),y=!1},d(E){E&&(k(e),k(o),k(u),k(f)),H(r,E),H(_),S=!1,C()}}}function fE(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
                                         (e.g. 100x50) - crop to WxH viewbox (from center)</li> <li><strong>WxHt</strong>
                                         (e.g. 100x50t) - crop to WxH viewbox (from top)</li> <li><strong>WxHb</strong>
                                         (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 uE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O;function E(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 ms({props:L}),ie.push(()=>be(r,"value",E)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[aE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=$(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=$(),_=b("i"),y=$(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"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),q(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),q(S,m,null),C=!0,T||(O=Me(qe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!C||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,Ce(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){C||(M(r.$$.fragment,I),M(S.$$.fragment,I),C=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),C=!1},d(I){I&&(k(e),k(o),k(u),k(f)),H(r,I),H(S),T=!1,O()}}}function fE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),l=$(),s=b("input"),a=$(),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=Y(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 oh(n){let e,t,i;return t=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[cE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function cE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),r||(a=Y(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&&gt(s.value)!==u[0].maxSelect&&he(s,u[0].maxSelect)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function dE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Protected",r=$(),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=Y(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 pE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new ce({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[rE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[uE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[fE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&oh(n);return h=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[dE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),d=$(),_&&_.c(),m=$(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(y,S){v(y,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),q(h,e,null),g=!0},p(y,S){const C={};S&2&&(C.name="fields."+y[1]+".mimeTypes"),S&41943049&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.name="fields."+y[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),(!g||S&4&&r!==(r=y[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+y[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:y}),f.$set(O),(!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&&M(_,1)):(_=oh(y),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+y[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:y}),h.$set(E)},i(y){g||(M(i.$$.fragment,y),M(o.$$.fragment,y),M(f.$$.fragment,y),M(_),M(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),H(i),H(o),H(f),_&&_.d(),H(h)}}}function mE(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[pE],default:[sE,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function hE(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=iE.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(U.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},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(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const C=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function O(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Wt(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,g,_,y,S,C,T,O,E,L,I,A,P]}class _E extends Se{constructor(e){super(),we(this,e,hE,mE,ye,{field:0,key:1})}}function gE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=$(),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=Y(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 bE(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 yE(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 rh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,B,J,V,Z,G,de;return{c(){e=b("div"),t=b("div"),i=b("div"),l=W("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=W(` and
+                                        (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 cE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O;function E(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 ms({props:L}),ie.push(()=>be(r,"value",E)),S=new jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[fE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=$(),l=b("i"),o=$(),j(r.$$.fragment),u=$(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=$(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=$(),_=b("i"),y=$(),j(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(_,"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),q(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),q(S,m,null),C=!0,T||(O=Me(qe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!C||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,Ce(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){C||(M(r.$$.fragment,I),M(S.$$.fragment,I),C=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),C=!1},d(I){I&&(k(e),k(o),k(u),k(f)),H(r,I),H(S),T=!1,O()}}}function dE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),l=$(),s=b("input"),a=$(),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=Y(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 rh(n){let e,t,i;return t=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[pE,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="fields."+l[1]+".maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function pE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),r||(a=Y(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&&gt(s.value)!==u[0].maxSelect&&he(s,u[0].maxSelect)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function mE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Protected",r=$(),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=Y(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 hE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;i=new ce({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 ce({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[cE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[dE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&rh(n);return h=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[mE,({uniqueId:y})=>({23:y}),({uniqueId:y})=>y?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),d=$(),_&&_.c(),m=$(),j(h.$$.fragment),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(y,S){v(y,e,S),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,a),w(e,u),q(f,u,null),w(e,d),_&&_.m(e,null),w(e,m),q(h,e,null),g=!0},p(y,S){const C={};S&2&&(C.name="fields."+y[1]+".mimeTypes"),S&41943049&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.name="fields."+y[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),(!g||S&4&&r!==(r=y[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const O={};S&2&&(O.name="fields."+y[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:y}),f.$set(O),(!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&&M(_,1)):(_=rh(y),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+y[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:y}),h.$set(E)},i(y){g||(M(i.$$.fragment,y),M(o.$$.fragment,y),M(f.$$.fragment,y),M(_),M(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),H(i),H(o),H(f),_&&_.d(),H(h)}}}function _E(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{options:[hE],default:[rE,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?wt(l,[a&2&&{key:r[1]},a&32&&Rt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function 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=sE.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(U.isEmpty(s.mimeTypes))return;const N=[];for(const R of s.mimeTypes)a.find(z=>z.mimeType===R)||N.push({mimeType:R});N.length&&t(3,a=a.concat(N))}function m(N){n.$$.not_equal(s.mimeTypes,N)&&(s.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},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(N){n.$$.not_equal(s.thumbs,N)&&(s.thumbs=N,t(0,s),t(6,f),t(2,u))}const C=N=>t(0,s.maxSize=N.target.value<<0,s);function T(){s.maxSelect=gt(this.value),t(0,s),t(6,f),t(2,u)}function O(){s.protected=this.checked,t(0,s),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Pe.call(this,n,N)}function A(N){Pe.call(this,n,N)}function P(N){Pe.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Wt(N)),t(5,l=lt(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,s.maxSelect=1,s):t(0,s.maxSelect=99,s)),n.$$.dirty&1&&(typeof s.maxSelect>"u"?c():d())},[s,o,u,a,r,l,f,m,h,g,_,y,S,C,T,O,E,L,I,A,P]}class bE extends Se{constructor(e){super(),we(this,e,gE,_E,ye,{field:0,key:1})}}function yE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",s=$(),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=Y(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 kE(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 vE(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 ah(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L='"{"a":1,"b":2}"',I,A,P,N,R,z,F,B,J,V,Z,G,de;return{c(){e=b("div"),t=b("div"),i=b("div"),l=W("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=W(` and
                         `),r=b("code"),r.textContent="multipart/form-data",a=W(`
                         requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=W(` field
                         is a
                         `),c=b("strong"),c.textContent="plain string",d=W(`:
                         `),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=$(),_=b("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=$(),S=b("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=$(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=$(),E=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=$(),R=b("li"),R.textContent="numeric strings are converted to json number",z=$(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=$(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(`
                         Alternatively, if you want to avoid the string value normalizations, you can wrap your
-                        data inside an object, eg.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(fe,ue){v(fe,e,ue),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,C),w(m,T),w(m,O),w(m,E),w(E,I),w(E,A),w(E,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,B),w(m,J),w(i,V),w(i,Z),de=!0},i(fe){de||(fe&&tt(()=>{de&&(G||(G=He(e,mt,{duration:150},!0)),G.run(1))}),de=!0)},o(fe){fe&&(G||(G=He(e,mt,{duration:150},!1)),G.run(0)),de=!1},d(fe){fe&&k(e),fe&&G&&G.end()}}}function kE(n){let e,t,i,l,s,o,r,a,u,f,c;e=new ce({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[gE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,y){return _[2]?yE:bE}let m=d(n),h=m(n),g=n[2]&&rh();return{c(){j(e.$$.fragment),t=$(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=$(),h.c(),r=$(),g&&g.c(),a=ve(),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){q(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=Y(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&&M(g,1):(g=rh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(k(t),k(i),k(r),k(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function vE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[kE]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function wE(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),Wt(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 SE extends Se{constructor(e){super(),we(this,e,wE,vE,ye,{field:0,key:1})}}function TE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=$(),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),he(s,n[0].min),r||(a=Y(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&&gt(s.value)!==u[0].min&&he(s,u[0].min)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function CE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max"),l=$(),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),he(s,n[0].max),a||(u=Y(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&&gt(s.value)!==f[0].max&&he(s,f[0].max)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function $E(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[TE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[CE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function OE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="No decimals",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){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=[Y(e,"change",n[3]),Me(qe.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,Ie(f)}}}function ME(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[OE,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function EE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[ME],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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function DE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){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),Wt(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 IE extends Se{constructor(e){super(),we(this,e,DE,EE,ye,{field:0,key:1})}}function LE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),l=$(),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=Y(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 AE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),l=$(),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=Y(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 PE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),l=$(),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=Y(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 NE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),l=$(),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),he(s,n[0].pattern),r||(a=Y(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&&he(s,u[0].pattern)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function RE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[LE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[AE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[PE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[NE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,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 C={};g&2&&(C.name="fields."+h[1]+".pattern"),g&12289&&(C.$$scope={dirty:g,ctx:h}),d.$set(C)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&k(e),H(i),H(o),H(u),H(d)}}}function FE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[RE]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function qE(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),Wt(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class HE extends Se{constructor(e){super(),we(this,e,qE,FE,ye,{field:0,key:1})}}function jE(n){let e,t,i,l,s;return{c(){e=b("hr"),t=$(),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=Y(i,"click",n[14]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function zE(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:[jE]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UE(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VE(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[zE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[UE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),o=$(),j(r.$$.fragment),a=$(),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),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(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||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function ah(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[BE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[WE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),q(t,e,null),v(r,i,a),v(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(t.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(l)),H(t),H(s)}}}function BE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),l=$(),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=Y(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 WE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),a||(u=Y(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&&gt(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function YE(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 zn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=$(),l=b("i"),r=$(),j(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,_),q(a,g,_),f=!0,c||(d=Me(s=qe.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.`),Z=b("code"),Z.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(fe,ue){v(fe,e,ue),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,C),w(m,T),w(m,O),w(m,E),w(E,I),w(E,A),w(E,P),w(m,N),w(m,R),w(m,z),w(m,F),w(m,B),w(m,J),w(i,V),w(i,Z),de=!0},i(fe){de||(fe&&tt(()=>{de&&(G||(G=He(e,mt,{duration:150},!0)),G.run(1))}),de=!0)},o(fe){fe&&(G||(G=He(e,mt,{duration:150},!1)),G.run(0)),de=!1},d(fe){fe&&k(e),fe&&G&&G.end()}}}function wE(n){let e,t,i,l,s,o,r,a,u,f,c;e=new ce({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[yE,({uniqueId:_})=>({10:_}),({uniqueId:_})=>_?1024:0]},$$scope:{ctx:n}}});function d(_,y){return _[2]?vE:kE}let m=d(n),h=m(n),g=n[2]&&ah();return{c(){j(e.$$.fragment),t=$(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=$(),h.c(),r=$(),g&&g.c(),a=ve(),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){q(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=Y(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&&M(g,1):(g=ah(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(k(t),k(i),k(r),k(a)),H(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function SE(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[wE]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?wt(l,[a&2&&{key:r[1]},a&8&&Rt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function TE(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),Wt(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 CE extends Se{constructor(e){super(),we(this,e,TE,SE,ye,{field:0,key:1})}}function $E(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Min"),l=$(),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),he(s,n[0].min),r||(a=Y(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&&gt(s.value)!==u[0].min&&he(s,u[0].min)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function OE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max"),l=$(),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),he(s,n[0].max),a||(u=Y(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&&gt(s.value)!==f[0].max&&he(s,f[0].max)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function ME(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[$E,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[OE,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){v(a,e,u),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="fields."+a[1]+".min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="fields."+a[1]+".max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(M(i.$$.fragment,a),M(o.$$.fragment,a),r=!0)},o(a){D(i.$$.fragment,a),D(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function EE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="No decimals",o=$(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){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=[Y(e,"change",n[3]),Me(qe.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,Ie(f)}}}function DE(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[EE,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".onlyInt"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[DE],options:[ME]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function LE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){s.onlyInt=this.checked,t(0,s)}function a(){s.min=gt(this.value),t(0,s)}function u(){s.max=gt(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){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),Wt(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 AE extends Se{constructor(e){super(),we(this,e,LE,IE,ye,{field:0,key:1})}}function PE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),l=$(),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=Y(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 NE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),l=$(),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=Y(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 RE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),l=$(),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=Y(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 FE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),l=$(),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),he(s,n[0].pattern),r||(a=Y(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&&he(s,u[0].pattern)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function qE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[PE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[NE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[RE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[FE,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,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 C={};g&2&&(C.name="fields."+h[1]+".pattern"),g&12289&&(C.$$scope={dirty:g,ctx:h}),d.$set(C)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&k(e),H(i),H(o),H(u),H(d)}}}function HE(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[qE]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function jE(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;function r(){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),Wt(_)),t(2,l=lt(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s.id)&&r()},[s,o,l,a,u,f,c,d,m,h,g]}class zE extends Se{constructor(e){super(),we(this,e,jE,HE,ye,{field:0,key:1})}}function UE(n){let e,t,i,l,s;return{c(){e=b("hr"),t=$(),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=Y(i,"click",n[14]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function VE(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:[UE]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(s.keyOfSelected=n[0].collectionId),e=new zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].collectionId,Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BE(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WE(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[VE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[BE,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),o=$(),j(r.$$.fragment),a=$(),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),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(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||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function uh(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[YE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[KE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("div"),j(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){v(r,e,a),q(t,e,null),v(r,i,a),v(r,l,a),q(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="fields."+r[1]+".minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="fields."+r[1]+".maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(M(t.$$.fragment,r),M(s.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(s.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(l)),H(t),H(s)}}}function YE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),l=$(),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=Y(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 KE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),a||(u=Y(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&&gt(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function JE(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 zn({props:h}),ie.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=$(),l=b("i"),r=$(),j(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,_),q(a,g,_),f=!0,c||(d=Me(s=qe.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,C;s&&It(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 ${((C=g[4])==null?void 0:C.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,Ce(()=>u=!1)),a.$set(y)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(k(e),k(r)),H(a,g),c=!1,d()}}}function KE(n){let e,t,i,l,s,o=!n[2]&&ah(n);return l=new ce({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[YE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=$(),i=b("div"),j(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),q(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&&M(o,1)):(o=ah(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&k(e),o&&o.d(),H(l)}}}function JE(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[KE],default:[VE,({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 ni({props:a}),ie.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new lf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=$(),j(l.$$.fragment)},m(f,c){q(e,f,c),v(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],Ce(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&k(i),H(e,f),n[21](null),H(l,f)}}}function ZE(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,Mn,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function 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 _=R=>t(0,a.minSelect=R.target.value<<0,a);function y(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const C=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Pe.call(this,n,R)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=je(je({},e),Wt(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,y,S,C,T,O,E,L,I,A,P,N]}class GE extends Se{constructor(e){super(),we(this,e,ZE,JE,ye,{field:0,key:1})}}function XE(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 ms({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Me(qe.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,Ce(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),H(t),s=!1,o()}}}function QE(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xE(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[XE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[QE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),o=$(),j(r.$$.fragment),a=$(),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),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(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||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function uh(n){let e,t;return e=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[eD,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),a||(u=Y(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&&gt(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function tD(n){let e,t,i=!n[2]&&uh(n);return{c(){i&&i.c(),e=ve()},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&&M(i,1)):(i=uh(l),i.c(),M(i,1),i.m(e.parentNode,e))},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function nD(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[tD],default:[xE,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function iD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function 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),Wt(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 lD extends Se{constructor(e){super(),we(this,e,iD,nD,ye,{field:0,key:1})}}function sD(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=$(),l=b("i"),o=$(),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(qe.call(null,l,"Clear the field or set it to 0 for no limit.")),Y(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,Ie(c)}}}function oD(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=$(),l=b("i"),o=$(),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(qe.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),Y(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,Ie(d)}}}function rD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=W("Validation pattern"),l=$(),s=b("input"),r=$(),a=b("div"),u=b("p"),f=W("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=Y(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&&he(s,h[0].pattern)},d(h){h&&(k(e),k(l),k(s),k(r),k(a)),d=!1,m()}}}function aD(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=$(),l=b("i"),o=$(),r=b("input"),u=$(),f=b("div"),c=b("p"),d=W("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),v(_,r,y),he(r,n[0].autogeneratePattern),v(_,u,y),v(_,f,y),w(f,c),w(c,d),w(c,m),h||(g=[Me(qe.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),Y(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&&he(r,_[0].autogeneratePattern)},d(_){_&&(k(e),k(o),k(r),k(u),k(f)),h=!1,Ie(g)}}}function uD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[sD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[oD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[rD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"fields."+n[1]+".autogeneratePattern",$$slots:{default:[aD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,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 C={};g&2&&(C.name="fields."+h[1]+".autogeneratePattern"),g&6145&&(C.$$scope={dirty:g,ctx:h}),d.$set(C)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&k(e),H(i),H(o),H(u),H(d)}}}function fD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[uD]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function cD(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),Wt(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 dD extends Se{constructor(e){super(),we(this,e,cD,fD,ye,{field:0,key:1})}}function pD(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 yk({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function mD(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),Wt(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 hD extends Se{constructor(e){super(),we(this,e,mD,pD,ye,{field:0,key:1})}}function fh(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function _D(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=$()},m(f,c){e&&q(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}a?(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],Ce(()=>t=!1)),e.$set(d)}},i(f){l||(e&&M(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&k(i),e&&H(e,f)}}}function ch(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[_D]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function gD(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[24];for(let y=0;y<m.length;y+=1){let S=fh(n,m,y),C=h(S);i.set(C,t[y]=ch(C,S))}o=new oM({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 nM({props:_}),ie.push(()=>be(f,"collection",g)),{c(){e=b("div");for(let y=0;y<t.length;y+=1)t[y].c();s=$(),j(o.$$.fragment),r=$(),a=b("hr"),u=$(),j(f.$$.fragment),p(e,"class",l="schema-fields total-"+n[0].fields.length)},m(y,S){v(y,e,S);for(let C=0;C<t.length;C+=1)t[C]&&t[C].m(e,null);v(y,s,S),q(o,y,S),v(y,r,S),v(y,a,S),v(y,u,S),q(f,y,S),d=!0},p(y,[S]){S&111&&(m=pe(y[0].fields),re(),t=vt(t,S,h,1,y,m,i,e,Bt,ch,null,fh),ae()),(!d||S&1&&l!==(l="schema-fields total-"+y[0].fields.length))&&p(e,"class",l);const C={};!c&&S&1&&(c=!0,C.collection=y[0],Ce(()=>c=!1)),f.$set(C)},i(y){if(!d){for(let S=0;S<m.length;S+=1)M(t[S]);M(o.$$.fragment,y),M(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();H(o,y),H(f,y)}}}function bD(n,e,t){let i,l;Qe(n,Du,N=>t(18,l=N));let{collection:s}=e,o;const r={text:dD,number:IE,bool:OM,email:yk,url:hD,editor:ZM,date:VM,select:lD,json:SE,file:_E,relation:GE,password:HE,autodate:TM};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=U.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",B=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=B+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(B=>B.name==N&&!B._toDelete)||t(0,s.indexes=s.indexes.map(B=>U.replaceIndexColumn(B,N,R)),s)}function g(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const B=s.fields.findIndex(J=>J.name==F.name);B<0||t(0,s.fields[B]=Object.assign(s.fields[B],F),s)}for(let F of R)s.fields.push(F)}function _(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let B=0;B<z.length;B++)z[B]==N&&(z[B]=R)}function y(N,R){h(N,R),_(N,R)}function S(N,R,z,F){z[F]=N,t(0,s)}const C=N=>a(N),T=N=>u(N),O=N=>y(N.detail.oldName,N.detail.newName);function E(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const L=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},I=()=>{Ut({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),g()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,y,o,S,C,T,O,E,L,I,A,P]}class yD extends Se{constructor(e){super(),we(this,e,bD,gD,ye,{collection:0})}}function dh(n,e,t){const i=n.slice();return i[9]=e[t],i}function kD(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=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function vD(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 ph(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=mh(dh(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=dh(s,i,r);l[r]?l[r].p(a,o):(l[r]=mh(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),dt(l,s)}}}function mh(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=W(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&oe(i,t)},d(l){l&&k(e)}}}function wD(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[vD,kD],m=[];function h(_,y){return _[2]?0:1}s=h(n),o=m[s]=d[s](n);let g=n[3].length&&ph(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=$(),o.c(),r=$(),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,Ce(()=>u=!1)),a.$set(y)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(k(e),k(r)),H(a,g),c=!1,d()}}}function ZE(n){let e,t,i,l,s,o=!n[2]&&uh(n);return l=new ce({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[JE,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=$(),i=b("div"),j(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),q(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&&M(o,1)):(o=uh(r),o.c(),M(o,1),o.m(e,t));const u={};a&2&&(u.name="fields."+r[1]+".cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(M(o),M(l.$$.fragment,r),s=!0)},o(r){D(o),D(l.$$.fragment,r),s=!1},d(r){r&&k(e),o&&o.d(),H(l)}}}function GE(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[ZE],default:[WE,({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 ni({props:a}),ie.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new sf({props:u}),n[21](l),l.$on("save",n[22]),{c(){j(e.$$.fragment),i=$(),j(l.$$.fragment)},m(f,c){q(e,f,c),v(f,i,c),q(l,f,c),s=!0},p(f,[c]){const d=c&258?wt(o,[c&2&&{key:f[1]},c&256&&Rt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],Ce(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(M(e.$$.fragment,f),M(l.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),s=!1},d(f){f&&k(i),H(e,f),n[21](null),H(l,f)}}}function XE(n,e,t){let i,l;const s=["field","key"];let o=lt(e,s),r;Qe(n,Mn,R=>t(10,r=R));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=a.maxSelect<=1,h=m;function 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 _=R=>t(0,a.minSelect=R.target.value<<0,a);function y(){a.maxSelect=gt(this.value),t(0,a),t(9,h),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,h),t(2,m))}const C=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,h),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,h),t(2,m)}function L(R){Pe.call(this,n,R)}function I(R){Pe.call(this,n,R)}function A(R){Pe.call(this,n,R)}function P(R){ie[R?"unshift":"push"](()=>{d=R,t(3,d)})}const N=R=>{var z,F;(F=(z=R==null?void 0:R.detail)==null?void 0:z.collection)!=null&&F.id&&R.detail.collection.type!="view"&&t(0,a.collectionId=R.detail.collection.id,a)};return n.$$set=R=>{e=je(je({},e),Wt(R)),t(8,o=lt(e,s)),"field"in R&&t(0,a=R.field),"key"in R&&t(1,u=R.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(R=>!R.system&&R.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.minSelect=0,a),t(0,a.maxSelect=1,a)):t(0,a.maxSelect=999,a)),n.$$.dirty&1&&typeof a.maxSelect>"u"&&g(),n.$$.dirty&1025&&t(4,l=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,_,y,S,C,T,O,E,L,I,A,P,N]}class QE extends Se{constructor(e){super(),we(this,e,XE,GE,ye,{field:0,key:1})}}function xE(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 ms({props:a}),ie.push(()=>be(t,"value",r)),{c(){e=b("div"),j(t.$$.fragment)},m(u,f){v(u,e,f),q(t,e,null),l=!0,s||(o=Me(qe.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,Ce(()=>i=!1)),t.$set(c)},i(u){l||(M(t.$$.fragment,u),l=!0)},o(u){D(t.$$.fragment,u),l=!1},d(u){u&&k(e),H(t),s=!1,o()}}}function eD(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tD(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".values",$$slots:{default:[xE,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[eD,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),j(i.$$.fragment),l=$(),s=b("div"),o=$(),j(r.$$.fragment),a=$(),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),q(i,c,d),v(c,l,d),v(c,s,d),v(c,o,d),q(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||(M(i.$$.fragment,c),M(r.$$.fragment,c),f=!0)},o(c){D(i.$$.fragment,c),D(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(l),k(s),k(o),k(a),k(u)),H(i,c),H(r,c)}}}function fh(n){let e,t;return e=new ce({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[nD,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="fields."+i[1]+".maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nD(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),l=$(),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),he(s,n[0].maxSelect),a||(u=Y(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&&gt(s.value)!==f[0].maxSelect&&he(s,f[0].maxSelect)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function iD(n){let e,t,i=!n[2]&&fh(n);return{c(){i&&i.c(),e=ve()},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&&M(i,1)):(i=fh(l),i.c(),M(i,1),i.m(e.parentNode,e))},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function lD(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[iD],default:[tD,({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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?wt(l,[a&2&&{key:r[1]},a&16&&Rt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function sD(n,e,t){const i=["field","key"];let l=lt(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=s.maxSelect<=1,u=a;function f(){t(0,s.maxSelect=1,s),t(0,s.values=[],s),t(2,a=!0),t(5,u=a)}function c(){s.maxSelect=gt(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.values,S)&&(s.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function h(S){s=S,t(0,s),t(5,u),t(2,a)}function 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),Wt(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 oD extends Se{constructor(e){super(),we(this,e,sD,lD,ye,{field:0,key:1})}}function rD(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=$(),l=b("i"),o=$(),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(qe.call(null,l,"Clear the field or set it to 0 for no limit.")),Y(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,Ie(c)}}}function aD(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=$(),l=b("i"),o=$(),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(qe.call(null,l,"Clear the field or set it to 0 to fallback to the default limit.")),Y(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,Ie(d)}}}function uD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return{c(){e=b("label"),t=W("Validation pattern"),l=$(),s=b("input"),r=$(),a=b("div"),u=b("p"),f=W("Ex. "),c=b("code"),c.textContent="^[a-z0-9]+$",p(e,"for",i=n[11]),p(s,"type","text"),p(s,"id",o=n[11]),p(a,"class","help-block")},m(h,g){v(h,e,g),w(e,t),v(h,l,g),v(h,s,g),he(s,n[0].pattern),v(h,r,g),v(h,a,g),w(a,u),w(u,f),w(u,c),d||(m=Y(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&&he(s,h[0].pattern)},d(h){h&&(k(e),k(l),k(s),k(r),k(a)),d=!1,m()}}}function fD(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=$(),l=b("i"),o=$(),r=b("input"),u=$(),f=b("div"),c=b("p"),d=W("Ex. "),m=b("code"),m.textContent="[a-z0-9]{30}",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[11]),p(r,"type","text"),p(r,"id",a=n[11]),p(f,"class","help-block")},m(_,y){v(_,e,y),w(e,t),w(e,i),w(e,l),v(_,o,y),v(_,r,y),he(r,n[0].autogeneratePattern),v(_,u,y),v(_,f,y),w(f,c),w(c,d),w(c,m),h||(g=[Me(qe.call(null,l,"Set and autogenerate text matching the pattern on missing record create value.")),Y(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&&he(r,_[0].autogeneratePattern)},d(_){_&&(k(e),k(o),k(r),k(u),k(f)),h=!1,Ie(g)}}}function cD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[rD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[aD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[uD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"fields."+n[1]+".autogeneratePattern",$$slots:{default:[fD,({uniqueId:h})=>({11:h}),({uniqueId:h})=>h?2048:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(h,g){v(h,e,g),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),m=!0},p(h,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 C={};g&2&&(C.name="fields."+h[1]+".autogeneratePattern"),g&6145&&(C.$$scope={dirty:g,ctx:h}),d.$set(C)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&k(e),H(i),H(o),H(u),H(d)}}}function dD(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[7](r)}let o={$$slots:{options:[cD]},$$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 ni({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};a&4099&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function pD(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),Wt(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 mD extends Se{constructor(e){super(),we(this,e,pD,dD,ye,{field:0,key:1})}}function hD(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 kk({props:o}),ie.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?wt(l,[a&2&&{key:r[1]},a&4&&Rt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function _D(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),Wt(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 gD extends Se{constructor(e){super(),we(this,e,_D,hD,ye,{field:0,key:1})}}function ch(n,e,t){const i=n.slice();return i[24]=e[t],i[25]=e,i[26]=t,i}function bD(n){let e,t,i,l;function s(f){n[8](f,n[24],n[25],n[26])}function o(){return n[9](n[26])}function r(){return n[10](n[26])}var a=n[1][n[24].type];function u(f,c){let d={key:f[5](f[24]),collection:f[0]};return f[24]!==void 0&&(d.field=f[24]),{props:d}}return a&&(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11])),{c(){e&&j(e.$$.fragment),i=$()},m(f,c){e&&q(e,f,c),v(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[24].type])){if(e){re();const d=e;D(d.$$.fragment,1,0,()=>{H(d,1)}),ae()}a?(e=zt(a,u(n)),ie.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[11]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[24])),c&1&&(d.collection=n[0]),!t&&c&1&&(t=!0,d.field=n[24],Ce(()=>t=!1)),e.$set(d)}},i(f){l||(e&&M(e.$$.fragment,f),l=!0)},o(f){e&&D(e.$$.fragment,f),l=!1},d(f){f&&k(i),e&&H(e,f)}}}function dh(n,e){let t,i,l,s;function o(a){e[12](a)}let r={index:e[26],disabled:e[24]._toDelete,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[bD]},$$scope:{ctx:e}};return e[0].fields!==void 0&&(r.list=e[0].fields),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("drag",e[13]),i.$on("sort",e[14]),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[26]),u&1&&(f.disabled=e[24]._toDelete),u&134217729&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].fields,Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function yD(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[24];for(let y=0;y<m.length;y+=1){let S=ch(n,m,y),C=h(S);i.set(C,t[y]=dh(C,S))}o=new aM({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 lM({props:_}),ie.push(()=>be(f,"collection",g)),{c(){e=b("div");for(let y=0;y<t.length;y+=1)t[y].c();s=$(),j(o.$$.fragment),r=$(),a=b("hr"),u=$(),j(f.$$.fragment),p(e,"class",l="schema-fields total-"+n[0].fields.length)},m(y,S){v(y,e,S);for(let C=0;C<t.length;C+=1)t[C]&&t[C].m(e,null);v(y,s,S),q(o,y,S),v(y,r,S),v(y,a,S),v(y,u,S),q(f,y,S),d=!0},p(y,[S]){S&111&&(m=pe(y[0].fields),re(),t=vt(t,S,h,1,y,m,i,e,Bt,dh,null,ch),ae()),(!d||S&1&&l!==(l="schema-fields total-"+y[0].fields.length))&&p(e,"class",l);const C={};!c&&S&1&&(c=!0,C.collection=y[0],Ce(()=>c=!1)),f.$set(C)},i(y){if(!d){for(let S=0;S<m.length;S+=1)M(t[S]);M(o.$$.fragment,y),M(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();H(o,y),H(f,y)}}}function kD(n,e,t){let i,l;Qe(n,Iu,N=>t(18,l=N));let{collection:s}=e,o;const r={text:mD,number:AE,bool:EM,email:kk,url:gD,editor:XM,date:WM,select:oD,json:CE,file:bE,relation:QE,password:zE,autodate:$M};function a(N){s.fields[N]&&(s.fields.splice(N,1),t(0,s))}function u(N){const R=s.fields[N];if(!R)return;R.onMountSelect=!1;const z=structuredClone(R);z.id="",z.system=!1,z.name=c(z.name+"_copy"),z.onMountSelect=!0,s.fields.splice(N+1,0,z),t(0,s)}function f(N="text"){const R=U.initSchemaField({name:c(),type:N});R.onMountSelect=!0;const z=s.fields.findLastIndex(F=>F.type!="autodate");R.type!="autodate"&&z>=0?s.fields.splice(z+1,0,R):s.fields.push(R),t(0,s)}function c(N="field"){var J;let R=N,z=2,F=((J=N.match(/\d+$/))==null?void 0:J[0])||"",B=F?N.substring(0,N.length-F.length):N;for(;d(R);)R=B+((F<<0)+z),z++;return R}function d(N){var R;return!!((R=s==null?void 0:s.fields)!=null&&R.find(z=>z.name===N))}function m(N){return i.findIndex(R=>R===N)}function h(N,R){var z,F;!((z=s==null?void 0:s.fields)!=null&&z.length)||N===R||!R||(F=s==null?void 0:s.fields)!=null&&F.find(B=>B.name==N&&!B._toDelete)||t(0,s.indexes=s.indexes.map(B=>U.replaceIndexColumn(B,N,R)),s)}function g(){const N=s.fields||[],R=N.filter(F=>!F.system),z=structuredClone(l[s.type]);t(0,s.fields=z.fields,s);for(let F of N){if(!F.system)continue;const B=s.fields.findIndex(J=>J.name==F.name);B<0||t(0,s.fields[B]=Object.assign(s.fields[B],F),s)}for(let F of R)s.fields.push(F)}function _(N,R){var F;if(N===R||!R)return;let z=((F=s.passwordAuth)==null?void 0:F.identityFields)||[];for(let B=0;B<z.length;B++)z[B]==N&&(z[B]=R)}function y(N,R){h(N,R),_(N,R)}function S(N,R,z,F){z[F]=N,t(0,s)}const C=N=>a(N),T=N=>u(N),O=N=>y(N.detail.oldName,N.detail.newName);function E(N){n.$$.not_equal(s.fields,N)&&(s.fields=N,t(0,s))}const L=N=>{if(!N.detail)return;const R=N.detail.target;R.style.opacity=0,setTimeout(()=>{var z;(z=R==null?void 0:R.style)==null||z.removeProperty("opacity")},0),N.detail.dataTransfer.setDragImage(R,0,0)},I=()=>{Ut({})},A=N=>f(N.detail);function P(N){s=N,t(0,s)}return n.$$set=N=>{"collection"in N&&t(0,s=N.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.fields>"u"&&t(0,s.fields=[],s),n.$$.dirty&129&&!s.id&&o!=s.type&&(t(7,o=s.type),g()),n.$$.dirty&1&&(i=s.fields.filter(N=>!N._toDelete))},[s,r,a,u,f,m,y,o,S,C,T,O,E,L,I,A,P]}class vD extends Se{constructor(e){super(),we(this,e,kD,yD,ye,{collection:0})}}function ph(n,e,t){const i=n.slice();return i[9]=e[t],i}function wD(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=zt(o,r(n)),ie.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&j(e.$$.fragment),i=ve()},m(a,u){e&&q(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,()=>{H(f,1)}),ae()}o?(e=zt(o,r(a)),ie.push(()=>be(e,"value",s)),e.$on("change",a[6]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].viewQuery,Ce(()=>t=!1)),e.$set(f)}},i(a){l||(e&&M(e.$$.fragment,a),l=!0)},o(a){e&&D(e.$$.fragment,a),l=!1},d(a){a&&k(i),e&&H(e,a)}}}function SD(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 mh(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=hh(ph(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=ph(s,i,r);l[r]?l[r].p(a,o):(l[r]=hh(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),dt(l,s)}}}function hh(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=W(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&oe(i,t)},d(l){l&&k(e)}}}function TD(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[SD,wD],m=[];function h(_,y){return _[2]?0:1}s=h(n),o=m[s]=d[s](n);let g=n[3].length&&mh(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=$(),o.c(),r=$(),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, 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=$(),g&&g.c(),f=ve(),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()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=ph(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(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 SD(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[wD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function TD(n,e,t){let i;Qe(n,kn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=U.getNestedVal(c,"fields",null);if(U.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=U.extractColumnsFromQuery(l==null?void 0:l.viewQuery);U.removeByValue(m,"id"),U.removeByValue(m,"created"),U.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(U.sentenize(y+": "+_))}}ln(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-8naseTA8.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&&Yn("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 CD extends Se{constructor(e){super(),we(this,e,TD,SD,ye,{collection:0})}}function hh(n,e,t){const i=n.slice();return i[14]=e[t],i}function _h(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A=pe(n[4]),P=[];for(let N=0;N<A.length;N+=1)P[N]=bh(hh(n,A,N));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=$(),o=b("div");for(let N=0;N<P.length;N+=1)P[N].c();r=$(),a=b("hr"),u=$(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=$(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=$(),h=b("hr"),g=$(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
+                <code>(MAX(balance) + 1) as maxBalance</code>.</li></ul>`,u=$(),g&&g.c(),f=ve(),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()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=mh(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(M(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 CD(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[TD,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $D(n,e,t){let i;Qe(n,kn,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){t(3,r=[]);const d=U.getNestedVal(c,"fields",null);if(U.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=U.extractColumnsFromQuery(l==null?void 0:l.viewQuery);U.removeByValue(m,"id"),U.removeByValue(m,"created"),U.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(U.sentenize(y+": "+_))}}ln(async()=>{t(2,o=!0);try{t(1,s=(await Tt(async()=>{const{default:c}=await import("./CodeEditor-kYUfoxD0.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&&Yn("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 Se{constructor(e){super(),we(this,e,$D,CD,ye,{collection:0})}}function _h(n,e,t){const i=n.slice();return i[14]=e[t],i}function gh(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A=pe(n[4]),P=[];for(let N=0;N<A.length;N+=1)P[N]=yh(_h(n,A,N));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=$(),o=b("div");for(let N=0;N<P.length;N+=1)P[N].c();r=$(),a=b("hr"),u=$(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=$(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.body.*</code> <code>@request.auth.*</code>",m=$(),h=b("hr"),g=$(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the
                         <em>@collection</em> filter:`,y=$(),S=b("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=$(),T=b("hr"),O=$(),E=b("p"),E.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(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){v(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z<P.length;z+=1)P[z]&&P[z].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,C),w(i,T),w(i,O),w(i,E),I=!0},p(N,R){if(R&24){A=pe(N[4]);let z;for(z=0;z<A.length;z+=1){const F=hh(N,A,z);P[z]?P[z].p(F,R):(P[z]=bh(F),P[z].c(),P[z].m(o,null))}for(;z<P.length;z+=1)P[z].d(1);P.length=A.length}},i(N){I||(N&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&k(e),dt(P,N),N&&L&&L.end()}}}function gh(n){let e,t=n[14]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[14]+"")&&oe(i,t)},d(l){l&&k(e)}}}function bh(n){let e=!n[3].includes(n[14]),t,i=e&&gh(n);return{c(){i&&i.c(),t=ve()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[14])),e?i?i.p(l,s):(i=gh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function yh(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]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(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 il({props:m}),ie.push(()=>be(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 il({props:g}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=$(),j(l.$$.fragment),o=$(),j(r.$$.fragment)},m(_,y){q(e,_,y),v(_,i,y),q(l,_,y),v(_,o,y),q(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),!t&&y&1&&(t=!0,S.rule=_[0].createRule,Ce(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!s&&y&1&&(s=!0,C.rule=_[0].updateRule,Ce(()=>s=!1)),l.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,Ce(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),H(e,_),H(l,_),H(r,_)}}}function kh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,y){return _[2]?OD:$D}let m=d(n),h=m(n),g=n[2]&&vh(n);return{c(){e=b("hr"),t=$(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=$(),h.c(),r=$(),g&&g.c(),a=ve(),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=Y(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&&M(g,1)):(g=vh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(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 $D(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 OD(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 vh(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:[MD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[ED]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=$(),j(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&131072&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,Ce(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&131072&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,Ce(()=>o=!1)),s.$set(_)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=He(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=He(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&k(e),H(t),H(s),m&&r&&r.end()}}}function MD(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
+                        <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(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,R){v(N,e,R),w(e,t),w(t,i),w(i,l),w(i,s),w(i,o);for(let z=0;z<P.length;z+=1)P[z]&&P[z].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,C),w(i,T),w(i,O),w(i,E),I=!0},p(N,R){if(R&24){A=pe(N[4]);let z;for(z=0;z<A.length;z+=1){const F=_h(N,A,z);P[z]?P[z].p(F,R):(P[z]=yh(F),P[z].c(),P[z].m(o,null))}for(;z<P.length;z+=1)P[z].d(1);P.length=A.length}},i(N){I||(N&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&k(e),dt(P,N),N&&L&&L.end()}}}function bh(n){let e,t=n[14]+"",i;return{c(){e=b("code"),i=W(t)},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&16&&t!==(t=l[14]+"")&&oe(i,t)},d(l){l&&k(e)}}}function yh(n){let e=!n[3].includes(n[14]),t,i=e&&bh(n);return{c(){i&&i.c(),t=ve()},m(l,s){i&&i.m(l,s),v(l,t,s)},p(l,s){s&24&&(e=!l[3].includes(l[14])),e?i?i.p(l,s):(i=bh(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function kh(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]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new il({props:c}),ie.push(()=>be(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 il({props:m}),ie.push(()=>be(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 il({props:g}),ie.push(()=>be(r,"rule",h)),{c(){j(e.$$.fragment),i=$(),j(l.$$.fragment),o=$(),j(r.$$.fragment)},m(_,y){q(e,_,y),v(_,i,y),q(l,_,y),v(_,o,y),q(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),!t&&y&1&&(t=!0,S.rule=_[0].createRule,Ce(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!s&&y&1&&(s=!0,C.rule=_[0].updateRule,Ce(()=>s=!1)),l.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,Ce(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(l.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(l.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),H(e,_),H(l,_),H(r,_)}}}function vh(n){let e,t,i,l,s,o,r,a,u,f,c;function d(_,y){return _[2]?ED:MD}let m=d(n),h=m(n),g=n[2]&&wh(n);return{c(){e=b("hr"),t=$(),i=b("button"),l=b("strong"),l.textContent="Additional auth collection rules",s=$(),h.c(),r=$(),g&&g.c(),a=ve(),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=Y(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&&M(g,1)):(g=wh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(re(),D(g,1,1,()=>{g=null}),ae())},i(_){u||(M(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 MD(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 ED(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 wh(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:[DD]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new il({props:f}),ie.push(()=>be(t,"rule",u));function c(m){n[13](m)}let d={label:"Manage rule",formKey:"manageRule",placeholder:"",required:n[0].manageRule!==null,collection:n[0],$$slots:{default:[ID]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),s=new il({props:d}),ie.push(()=>be(s,"rule",c)),{c(){e=b("div"),j(t.$$.fragment),l=$(),j(s.$$.fragment),p(e,"class","block")},m(m,h){v(m,e,h),q(t,e,null),w(e,l),q(s,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&131072&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,Ce(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&131072&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,Ce(()=>o=!1)),s.$set(_)},i(m){a||(M(t.$$.fragment,m),M(s.$$.fragment,m),m&&tt(()=>{a&&(r||(r=He(e,mt,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(s.$$.fragment,m),m&&(r||(r=He(e,mt,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&k(e),H(t),H(s),m&&r&&r.end()}}}function DD(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=$(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to
-                        <code>verified = true</code>.`,l=$(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=$(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),v(a,o,u),v(a,r,u)},p:te,d(a){a&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r))}}}function ED(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the <code>create</code> and <code>update</code> API
+                        <code>verified = true</code>.`,l=$(),s=b("p"),s.textContent="Leave it empty to allow anyone with an account to authenticate.",o=$(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),v(a,l,u),v(a,s,u),v(a,o,u),v(a,r,u)},p:te,d(a){a&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r))}}}function ID(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the <code>create</code> and <code>update</code> API
                         rules.`,t=$(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg.
                         changing the password without requiring to enter the old one, directly updating the
-                        verified state or email, etc.`},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,d(l){l&&(k(e),k(t),k(i))}}}function DD(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,y,S,C,T,O=n[1]&&_h(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new il({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&yh(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&kh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
+                        verified state or email, etc.`},m(l,s){v(l,e,s),v(l,t,s),v(l,i,s)},p:te,d(l){l&&(k(e),k(t),k(i))}}}function LD(n){var R,z;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,y,S,C,T,O=n[1]&&gh(n);function E(F){n[6](F)}let L={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(L.rule=n[0].listRule),f=new il({props:L}),ie.push(()=>be(f,"rule",E));function I(F){n[7](F)}let A={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(A.rule=n[0].viewRule),m=new il({props:A}),ie.push(()=>be(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&kh(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&vh(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
             <a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
-            </a>.`,l=$(),s=b("button"),r=W(o),a=$(),O&&O.c(),u=$(),j(f.$$.fragment),d=$(),j(m.$$.fragment),g=$(),P&&P.c(),_=$(),N&&N.c(),y=ve(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,B){v(F,e,B),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),v(F,u,B),q(f,F,B),v(F,d,B),q(m,F,B),v(F,g,B),P&&P.m(F,B),v(F,_,B),N&&N.m(F,B),v(F,y,B),S=!0,C||(T=Y(s,"click",n[5]),C=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=_h(F),O.c(),M(O,1),O.m(e,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,Ce(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,Ce(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,B),B&1&&M(P,1)):(P=yh(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(re(),D(P,1,1,()=>{P=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=kh(F),N.c(),M(N,1),N.m(y.parentNode,y)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(P),M(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(k(e),k(u),k(d),k(g),k(_),k(y)),O&&O.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),C=!1,T()}}}function ID(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(y){n.$$.not_equal(s.listRule,y)&&(s.listRule=y,t(0,s))}function f(y){n.$$.not_equal(s.viewRule,y)&&(s.viewRule=y,t(0,s))}function c(y){n.$$.not_equal(s.createRule,y)&&(s.createRule=y,t(0,s))}function d(y){n.$$.not_equal(s.updateRule,y)&&(s.updateRule=y,t(0,s))}function m(y){n.$$.not_equal(s.deleteRule,y)&&(s.deleteRule=y,t(0,s))}const h=()=>{t(2,r=!r)};function g(y){n.$$.not_equal(s.authRule,y)&&(s.authRule=y,t(0,s))}function _(y){n.$$.not_equal(s.manageRule,y)&&(s.manageRule=y,t(0,s))}return n.$$set=y=>{"collection"in y&&t(0,s=y.collection)},n.$$.update=()=>{var y;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(y=s.fields)==null?void 0:y.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class LD extends Se{constructor(e){super(),we(this,e,ID,DD,ye,{collection:0})}}function wh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[30]=e[t],i}function Th(n,e,t){const i=n.slice();return i[33]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[33]=e[t],i}function $h(n,e,t){const i=n.slice();return i[33]=e[t],i}function Oh(n){let e,t,i,l,s,o,r=n[9].length&&Mh();return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),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=$(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Mh(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function Mh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function Eh(n){let e,t,i,l,s,o,r=n[5]&&Dh(n),a=!n[4]&&Ih(n),u=pe(n[3]),f=[];for(let m=0;m<u.length;m+=1)f[m]=Nh(Sh(n,u,m));let c=pe(n[7]),d=[];for(let m=0;m<c.length;m+=1)d[m]=Rh(wh(n,c,m));return{c(){e=b("h6"),e.textContent="Changes:",t=$(),i=b("ul"),r&&r.c(),l=$(),a&&a.c(),s=$();for(let m=0;m<f.length;m+=1)f[m].c();o=$();for(let m=0;m<d.length;m+=1)d[m].c();p(i,"class","changes-list svelte-xqpcsf")},m(m,h){v(m,e,h),v(m,t,h),v(m,i,h),r&&r.m(i,null),w(i,l),a&&a.m(i,null),w(i,s);for(let g=0;g<f.length;g+=1)f[g]&&f[g].m(i,null);w(i,o);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(i,null)},p(m,h){if(m[5]?r?r.p(m,h):(r=Dh(m),r.c(),r.m(i,l)):r&&(r.d(1),r=null),m[4]?a&&(a.d(1),a=null):a?a.p(m,h):(a=Ih(m),a.c(),a.m(i,s)),h[0]&8){u=pe(m[3]);let g;for(g=0;g<u.length;g+=1){const _=Sh(m,u,g);f[g]?f[g].p(_,h):(f[g]=Nh(_),f[g].c(),f[g].m(i,o))}for(;g<f.length;g+=1)f[g].d(1);f.length=u.length}if(h[0]&8320){c=pe(m[7]);let g;for(g=0;g<c.length;g+=1){const _=wh(m,c,g);d[g]?d[g].p(_,h):(d[g]=Rh(_),d[g].c(),d[g].m(i,null))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(k(e),k(t),k(i)),r&&r.d(),a&&a.d(),dt(f,m),dt(d,m)}}}function Dh(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection
-                        `),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(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;_[0]&2&&s!==(s=((y=g[1])==null?void 0:y.name)+"")&&oe(o,s),_[0]&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&oe(d,c)},d(g){g&&k(e)}}}function Ih(n){let e,t,i,l=pe(n[8]),s=[];for(let f=0;f<l.length;f+=1)s[f]=Lh($h(n,l,f));let o=pe(n[10]),r=[];for(let f=0;f<o.length;f+=1)r[f]=Ah(Ch(n,o,f));let a=pe(n[9]),u=[];for(let f=0;f<a.length;f+=1)u[f]=Ph(Th(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=$();for(let f=0;f<r.length;f+=1)r[f].c();t=$();for(let f=0;f<u.length;f+=1)u[f].c();i=ve()},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[0]&256){l=pe(f[8]);let d;for(d=0;d<l.length;d+=1){const m=$h(f,l,d);s[d]?s[d].p(m,c):(s[d]=Lh(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[0]&1024){o=pe(f[10]);let d;for(d=0;d<o.length;d+=1){const m=Ch(f,o,d);r[d]?r[d].p(m,c):(r[d]=Ah(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[0]&512){a=pe(f[9]);let d;for(d=0;d<a.length;d+=1){const m=Th(f,a,d);u[d]?u[d].p(m,c):(u[d]=Ph(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)),dt(s,f),dt(r,f),dt(u,f)}}}function Lh(n){let e,t,i,l=n[33].name+"",s,o,r;return{c(){e=b("li"),t=W(`Multiple to single value conversion of field
-                        `),i=b("strong"),s=W(l),o=$(),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[0]&256&&l!==(l=a[33].name+"")&&oe(s,l)},d(a){a&&k(e)}}}function Ah(n){let e,t,i,l,s=n[33]._originalName+"",o,r,a,u,f,c=n[33].name+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed field
-                            `),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(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[0]&1024&&s!==(s=m[33]._originalName+"")&&oe(o,s),h[0]&1024&&c!==(c=m[33].name+"")&&oe(d,c)},d(m){m&&k(e)}}}function Ph(n){let e,t,i,l=n[33].name+"",s,o;return{c(){e=b("li"),t=W("Removed field "),i=b("span"),s=W(l),o=$(),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[0]&512&&l!==(l=r[33].name+"")&&oe(s,l)},d(r){r&&k(e)}}}function Nh(n){let e,t,i,l=n[30].prop+"",s,o,r,a,u,f,c,d,m=(n[30].oldRule===null?"null (superusers only)":n[30].oldRule||'""')+"",h,g,_,y,S,C,T,O,E=(n[30].newRule===null?"null (superusers only)":n[30].newRule||'""')+"",L;return{c(){e=b("li"),t=W("Changed API rule "),i=b("code"),s=W(l),o=W(`:
+            </a>.`,l=$(),s=b("button"),r=W(o),a=$(),O&&O.c(),u=$(),j(f.$$.fragment),d=$(),j(m.$$.fragment),g=$(),P&&P.c(),_=$(),N&&N.c(),y=ve(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,B){v(F,e,B),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),O&&O.m(e,null),v(F,u,B),q(f,F,B),v(F,d,B),q(m,F,B),v(F,g,B),P&&P.m(F,B),v(F,_,B),N&&N.m(F,B),v(F,y,B),S=!0,C||(T=Y(s,"click",n[5]),C=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&oe(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=gh(F),O.c(),M(O,1),O.m(e,null)):O&&(re(),D(O,1,1,()=>{O=null}),ae());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,Ce(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,Ce(()=>h=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,B),B&1&&M(P,1)):(P=kh(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(re(),D(P,1,1,()=>{P=null}),ae()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=vh(F),N.c(),M(N,1),N.m(y.parentNode,y)):N&&(re(),D(N,1,1,()=>{N=null}),ae())},i(F){S||(M(O),M(f.$$.fragment,F),M(m.$$.fragment,F),M(P),M(N),S=!0)},o(F){D(O),D(f.$$.fragment,F),D(m.$$.fragment,F),D(P),D(N),S=!1},d(F){F&&(k(e),k(u),k(d),k(g),k(_),k(y)),O&&O.d(),H(f,F),H(m,F),P&&P.d(F),N&&N.d(F),C=!1,T()}}}function AD(n,e,t){let i,l,{collection:s}=e,o=!1,r=s.manageRule!==null||s.authRule!=="";const a=()=>t(1,o=!o);function u(y){n.$$.not_equal(s.listRule,y)&&(s.listRule=y,t(0,s))}function f(y){n.$$.not_equal(s.viewRule,y)&&(s.viewRule=y,t(0,s))}function c(y){n.$$.not_equal(s.createRule,y)&&(s.createRule=y,t(0,s))}function d(y){n.$$.not_equal(s.updateRule,y)&&(s.updateRule=y,t(0,s))}function m(y){n.$$.not_equal(s.deleteRule,y)&&(s.deleteRule=y,t(0,s))}const h=()=>{t(2,r=!r)};function g(y){n.$$.not_equal(s.authRule,y)&&(s.authRule=y,t(0,s))}function _(y){n.$$.not_equal(s.manageRule,y)&&(s.manageRule=y,t(0,s))}return n.$$set=y=>{"collection"in y&&t(0,s=y.collection)},n.$$.update=()=>{var y;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(s)),n.$$.dirty&1&&t(3,l=(y=s.fields)==null?void 0:y.filter(S=>S.hidden).map(S=>S.name))},[s,o,r,l,i,a,u,f,c,d,m,h,g,_]}class PD extends Se{constructor(e){super(),we(this,e,AD,LD,ye,{collection:0})}}function Sh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Th(n,e,t){const i=n.slice();return i[30]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[33]=e[t],i}function $h(n,e,t){const i=n.slice();return i[33]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Mh(n){let e,t,i,l,s,o,r=n[9].length&&Eh();return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=$(),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=$(),r&&r.c(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){v(a,e,u),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),r&&r.m(l,null)},p(a,u){a[9].length?r||(r=Eh(),r.c(),r.m(l,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function Eh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function Dh(n){let e,t,i,l,s,o,r=n[5]&&Ih(n),a=!n[4]&&Lh(n),u=pe(n[3]),f=[];for(let m=0;m<u.length;m+=1)f[m]=Rh(Th(n,u,m));let c=pe(n[7]),d=[];for(let m=0;m<c.length;m+=1)d[m]=Fh(Sh(n,c,m));return{c(){e=b("h6"),e.textContent="Changes:",t=$(),i=b("ul"),r&&r.c(),l=$(),a&&a.c(),s=$();for(let m=0;m<f.length;m+=1)f[m].c();o=$();for(let m=0;m<d.length;m+=1)d[m].c();p(i,"class","changes-list svelte-xqpcsf")},m(m,h){v(m,e,h),v(m,t,h),v(m,i,h),r&&r.m(i,null),w(i,l),a&&a.m(i,null),w(i,s);for(let g=0;g<f.length;g+=1)f[g]&&f[g].m(i,null);w(i,o);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(i,null)},p(m,h){if(m[5]?r?r.p(m,h):(r=Ih(m),r.c(),r.m(i,l)):r&&(r.d(1),r=null),m[4]?a&&(a.d(1),a=null):a?a.p(m,h):(a=Lh(m),a.c(),a.m(i,s)),h[0]&8){u=pe(m[3]);let g;for(g=0;g<u.length;g+=1){const _=Th(m,u,g);f[g]?f[g].p(_,h):(f[g]=Rh(_),f[g].c(),f[g].m(i,o))}for(;g<f.length;g+=1)f[g].d(1);f.length=u.length}if(h[0]&8320){c=pe(m[7]);let g;for(g=0;g<c.length;g+=1){const _=Sh(m,c,g);d[g]?d[g].p(_,h):(d[g]=Fh(_),d[g].c(),d[g].m(i,null))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&(k(e),k(t),k(i)),r&&r.d(),a&&a.d(),dt(f,m),dt(d,m)}}}function Ih(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed collection
+                        `),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(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;_[0]&2&&s!==(s=((y=g[1])==null?void 0:y.name)+"")&&oe(o,s),_[0]&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&oe(d,c)},d(g){g&&k(e)}}}function Lh(n){let e,t,i,l=pe(n[8]),s=[];for(let f=0;f<l.length;f+=1)s[f]=Ah(Oh(n,l,f));let o=pe(n[10]),r=[];for(let f=0;f<o.length;f+=1)r[f]=Ph($h(n,o,f));let a=pe(n[9]),u=[];for(let f=0;f<a.length;f+=1)u[f]=Nh(Ch(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=$();for(let f=0;f<r.length;f+=1)r[f].c();t=$();for(let f=0;f<u.length;f+=1)u[f].c();i=ve()},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[0]&256){l=pe(f[8]);let d;for(d=0;d<l.length;d+=1){const m=Oh(f,l,d);s[d]?s[d].p(m,c):(s[d]=Ah(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[0]&1024){o=pe(f[10]);let d;for(d=0;d<o.length;d+=1){const m=$h(f,o,d);r[d]?r[d].p(m,c):(r[d]=Ph(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[0]&512){a=pe(f[9]);let d;for(d=0;d<a.length;d+=1){const m=Ch(f,a,d);u[d]?u[d].p(m,c):(u[d]=Nh(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)),dt(s,f),dt(r,f),dt(u,f)}}}function Ah(n){let e,t,i,l=n[33].name+"",s,o,r;return{c(){e=b("li"),t=W(`Multiple to single value conversion of field
+                        `),i=b("strong"),s=W(l),o=$(),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[0]&256&&l!==(l=a[33].name+"")&&oe(s,l)},d(a){a&&k(e)}}}function Ph(n){let e,t,i,l,s=n[33]._originalName+"",o,r,a,u,f,c=n[33].name+"",d;return{c(){e=b("li"),t=b("div"),i=W(`Renamed field
+                            `),l=b("strong"),o=W(s),r=$(),a=b("i"),u=$(),f=b("strong"),d=W(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[0]&1024&&s!==(s=m[33]._originalName+"")&&oe(o,s),h[0]&1024&&c!==(c=m[33].name+"")&&oe(d,c)},d(m){m&&k(e)}}}function Nh(n){let e,t,i,l=n[33].name+"",s,o;return{c(){e=b("li"),t=W("Removed field "),i=b("span"),s=W(l),o=$(),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[0]&512&&l!==(l=r[33].name+"")&&oe(s,l)},d(r){r&&k(e)}}}function Rh(n){let e,t,i,l=n[30].prop+"",s,o,r,a,u,f,c,d,m=(n[30].oldRule===null?"null (superusers only)":n[30].oldRule||'""')+"",h,g,_,y,S,C,T,O,E=(n[30].newRule===null?"null (superusers only)":n[30].newRule||'""')+"",L;return{c(){e=b("li"),t=W("Changed API rule "),i=b("code"),s=W(l),o=W(`:
                     `),r=b("br"),a=$(),u=b("small"),f=b("strong"),f.textContent="Old",c=W(`:
                         `),d=b("span"),h=W(m),g=$(),_=b("br"),y=$(),S=b("small"),C=b("strong"),C.textContent="New",T=W(`:
-                        `),O=b("span"),L=W(E),p(i,"class","txt-sm"),p(d,"class","txt-preline"),p(u,"class","txt-mono txt-hint"),p(O,"class","txt-preline"),p(S,"class","txt-mono txt-success"),p(e,"class","svelte-xqpcsf")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(e,a),w(e,u),w(u,f),w(u,c),w(u,d),w(d,h),w(e,g),w(e,_),w(e,y),w(e,S),w(S,C),w(S,T),w(S,O),w(O,L)},p(I,A){A[0]&8&&l!==(l=I[30].prop+"")&&oe(s,l),A[0]&8&&m!==(m=(I[30].oldRule===null?"null (superusers only)":I[30].oldRule||'""')+"")&&oe(h,m),A[0]&8&&E!==(E=(I[30].newRule===null?"null (superusers only)":I[30].newRule||'""')+"")&&oe(L,E)},d(I){I&&k(e)}}}function Rh(n){let e,t,i,l=n[27].name+"",s,o,r,a,u=n[27].oldHost+"",f,c,d,m,h,g=n[27].newHost+"",_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J;return{c(){e=b("li"),t=W("Changed "),i=b("code"),s=W(l),o=W(` host
+                        `),O=b("span"),L=W(E),p(i,"class","txt-sm"),p(d,"class","txt-preline"),p(u,"class","txt-mono txt-hint"),p(O,"class","txt-preline"),p(S,"class","txt-mono txt-success"),p(e,"class","svelte-xqpcsf")},m(I,A){v(I,e,A),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(e,a),w(e,u),w(u,f),w(u,c),w(u,d),w(d,h),w(e,g),w(e,_),w(e,y),w(e,S),w(S,C),w(S,T),w(S,O),w(O,L)},p(I,A){A[0]&8&&l!==(l=I[30].prop+"")&&oe(s,l),A[0]&8&&m!==(m=(I[30].oldRule===null?"null (superusers only)":I[30].oldRule||'""')+"")&&oe(h,m),A[0]&8&&E!==(E=(I[30].newRule===null?"null (superusers only)":I[30].newRule||'""')+"")&&oe(L,E)},d(I){I&&k(e)}}}function Fh(n){let e,t,i,l=n[27].name+"",s,o,r,a,u=n[27].oldHost+"",f,c,d,m,h,g=n[27].newHost+"",_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J;return{c(){e=b("li"),t=W("Changed "),i=b("code"),s=W(l),o=W(` host
                     `),r=b("div"),a=b("strong"),f=W(u),c=$(),d=b("i"),m=$(),h=b("strong"),_=W(g),y=$(),S=b("br"),C=$(),T=b("em"),O=W(`If the old and new OIDC configuration is not for the same provider consider deleting
                         all old `),E=b("code"),E.textContent="_externalAuths",L=W(` records associated to the current
                         collection and provider, otherwise it may result in account linking errors.
                         `),I=b("a"),A=W("Review existing "),P=b("code"),P.textContent="_externalAuths",N=W(` records
-                            `),R=b("i"),z=$(),B=W("."),J=$(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(P,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(I,"href",F=n[13](n[27].name)),p(I,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(V,Z){v(V,e,Z),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(r,c),w(r,d),w(r,m),w(r,h),w(h,_),w(e,y),w(e,S),w(e,C),w(e,T),w(T,O),w(T,E),w(T,L),w(T,I),w(I,A),w(I,P),w(I,N),w(I,R),w(I,z),w(T,B),w(e,J)},p(V,Z){Z[0]&128&&l!==(l=V[27].name+"")&&oe(s,l),Z[0]&128&&u!==(u=V[27].oldHost+"")&&oe(f,u),Z[0]&128&&g!==(g=V[27].newHost+"")&&oe(_,g),Z[0]&128&&F!==(F=V[13](V[27].name))&&p(I,"href",F)},d(V){V&&k(e)}}}function AD(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&Oh(n),l=n[11]&&Eh(n);return{c(){i&&i.c(),e=$(),l&&l.c(),t=ve()},m(s,o){i&&i.m(s,o),v(s,e,o),l&&l.m(s,o),v(s,t,o)},p(s,o){s[5]||s[9].length||s[10].length?i?i.p(s,o):(i=Oh(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[11]?l?l.p(s,o):(l=Eh(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(k(e),k(t)),i&&i.d(s),l&&l.d(s)}}}function PD(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 ND(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),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=[Y(e,"click",n[15]),Y(i,"click",n[16])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function RD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[ND],header:[PD],default:[AD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function FD(n,e,t){let i,l,s,o,r,a,u;const f=yt();let c,d,m,h,g=[],_=[];async function y(F,B,J=!0){t(1,d=F),t(2,m=B),h=J,await O(),I(),await dn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():C()}function S(){c==null||c.hide()}function C(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function O(){var F,B,J,V;t(7,g=[]);for(let Z of T){let G=(B=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:B.find(Te=>Te.name==Z),de=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Te=>Te.name==Z);if(!G||!de)continue;let fe=new URL(G.authURL).host,ue=new URL(de.authURL).host;fe!=ue&&await E(Z)&&g.push({name:Z,oldHost:fe,newHost:ue})}}async function E(F){try{return await _e.collection("_externalAuths").getFirstListItem(_e.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let B,J;for(let V of F)B=d==null?void 0:d[V],J=m==null?void 0:m[V],B!==J&&_.push({prop:V,oldRule:B,newRule:J})}const A=()=>S(),P=()=>C();function N(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Pe.call(this,n,F)}function z(F){Pe.call(this,n,F)}return n.$$.update=()=>{var F,B,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(V=>V.id&&!V._toDelete&&V._originalName!=V.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((B=m==null?void 0:m.fields)==null?void 0:B.filter(V=>V.id&&V._toDelete))||[]),n.$$.dirty[0]&6&&t(8,a=((J=m==null?void 0:m.fields)==null?void 0:J.filter(V=>{var G;const Z=(G=d==null?void 0:d.fields)==null?void 0:G.find(de=>de.id==V.id);return Z?Z.maxSelect!=1&&V.maxSelect==1:!1}))||[]),n.$$.dirty[0]&56&&t(11,u=!l||i||_.length)},[S,d,m,_,l,i,c,g,a,r,o,u,C,L,y,A,P,N,R,z]}class qD extends Se{constructor(e){super(),we(this,e,FD,RD,ye,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Fh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function HD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new yD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function jD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new CD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function qh(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 LD({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Ce(()=>i=!1)),t.$set(u)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),H(t)}}}function Hh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new jO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Ce(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&ee(e,"active",r[3]===rs)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),H(t)}}}function zD(n){let e,t,i,l,s,o,r;const a=[jD,HD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===no&&qh(n),d=n[18]&&Hh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=$(),c&&c.c(),o=$(),d&&d.c(),p(t,"class","tab-item"),ee(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()),M(l,1),l.m(t,null)),(!r||h[0]&8)&&ee(t,"active",m[3]===xi),!m[15]&&m[3]===no?c?(c.p(m,h),h[0]&32776&&M(c,1)):(c=qh(m),c.c(),M(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[18]?d?(d.p(m,h),h[0]&262144&&M(d,1)):(d=Hh(m),d.c(),M(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(M(l),M(c),M(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 jh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[UD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131076|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),H(o)}}}function zh(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',t=$(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=Y(e,"click",n[34]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function Uh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-eraser-line" aria-hidden="true"></i> <span class="txt">Truncate</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Vh(n){let e,t,i;return{c(){e=b("button"),e.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 txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",On(nt(n[36]))),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function UD(n){let e,t,i,l=!n[2].system&&zh(n),s=!n[17]&&Uh(n),o=!n[2].system&&Vh(n);return{c(){l&&l.c(),e=$(),s&&s.c(),t=$(),o&&o.c(),i=ve()},m(r,a){l&&l.m(r,a),v(r,e,a),s&&s.m(r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a)},p(r,a){r[2].system?l&&(l.d(1),l=null):l?l.p(r,a):(l=zh(r),l.c(),l.m(e.parentNode,e)),r[17]?s&&(s.d(1),s=null):s?s.p(r,a):(s=Uh(r),s.c(),s.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Vh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(r),s&&s.d(r),o&&o.d(r)}}}function Bh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[VD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=$(),j(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),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(k(e),k(t)),H(i,s)}}}function Wh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=$(),s=b("span"),r=W(o),a=W(" collection"),u=$(),p(t,"class",i=zs(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),ee(e,"selected",n[59]==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=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&oe(r,o),h[0]&68&&ee(e,"selected",n[59]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function VD(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l<t.length;l+=1)i[l]=Wh(Fh(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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]&8388676){t=pe(Object.entries(l[6]));let o;for(o=0;o<t.length;o+=1){const r=Fh(l,t,o);i[o]?i[o].p(r,s):(i[o]=Wh(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),dt(i,l)}}}function Yh(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 BD(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,C,T,O,E,L,I,A,P,N,R=!n[2].id&&Bh(n),z=n[2].system&&Yh();return{c(){e=b("label"),t=W("Name"),l=$(),s=b("input"),f=$(),c=b("div"),d=b("div"),m=b("span"),h=$(),g=b("span"),_=W("Type: "),S=W(y),C=$(),R&&R.c(),L=$(),z&&z.c(),I=ve(),p(e,"for",i=n[58]),p(s,"type","text"),p(s,"id",o=n[58]),s.required=!0,s.disabled=n[16],p(s,"spellcheck","false"),s.autofocus=r=!n[2].id,p(s,"placeholder",a=n[18]?'eg. "users"':'eg. "posts"'),s.value=u=n[2].name,ee(s,"txt-bold",n[2].system),p(m,"aria-hidden","true"),p(g,"class","txt"),p(d,"tabindex",T=n[2].id?-1:0),p(d,"role",O=n[2].id?"":"button"),p(d,"aria-label","View types"),p(d,"class",E="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),ee(d,"btn-disabled",!!n[2].id),p(c,"class","form-field-addon")},m(F,B){v(F,e,B),w(e,t),v(F,l,B),v(F,s,B),v(F,f,B),v(F,c,B),w(c,d),w(d,m),w(d,h),w(d,g),w(g,_),w(g,S),w(d,C),R&&R.m(d,null),v(F,L,B),z&&z.m(F,B),v(F,I,B),A=!0,n[2].id||s.focus(),P||(N=Y(s,"input",n[37]),P=!0)},p(F,B){(!A||B[1]&134217728&&i!==(i=F[58]))&&p(e,"for",i),(!A||B[1]&134217728&&o!==(o=F[58]))&&p(s,"id",o),(!A||B[0]&65536)&&(s.disabled=F[16]),(!A||B[0]&4&&r!==(r=!F[2].id))&&(s.autofocus=r),(!A||B[0]&262144&&a!==(a=F[18]?'eg. "users"':'eg. "posts"'))&&p(s,"placeholder",a),(!A||B[0]&4&&u!==(u=F[2].name)&&s.value!==u)&&(s.value=u),(!A||B[0]&4)&&ee(s,"txt-bold",F[2].system),(!A||B[0]&68)&&y!==(y=(F[6][F[2].type]||"N/A")+"")&&oe(S,y),F[2].id?R&&(re(),D(R,1,1,()=>{R=null}),ae()):R?(R.p(F,B),B[0]&4&&M(R,1)):(R=Bh(F),R.c(),M(R,1),R.m(d,null)),(!A||B[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||B[0]&4&&O!==(O=F[2].id?"":"button"))&&p(d,"role",O),(!A||B[0]&4&&E!==(E="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",E),(!A||B[0]&4)&&ee(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=Yh(),z.c(),z.m(I.parentNode,I)):z&&(z.d(1),z=null)},i(F){A||(M(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(k(e),k(l),k(s),k(f),k(c),k(L),k(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function Kh(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=qe.call(null,e,n[12])),s=!0)},p(r,a){t&&It(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,Ct,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,Ct,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function Jh(n){var a,u,f,c,d,m,h;let e,t,i,l=!U.isEmpty((a=n[5])==null?void 0:a.listRule)||!U.isEmpty((u=n[5])==null?void 0:u.viewRule)||!U.isEmpty((f=n[5])==null?void 0:f.createRule)||!U.isEmpty((c=n[5])==null?void 0:c.updateRule)||!U.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!U.isEmpty((m=n[5])==null?void 0:m.authRule)||!U.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Zh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=$(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===no)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=Y(e,"click",n[41]),s=!0)},p(g,_){var y,S,C,T,O,E,L;_[0]&32&&(l=!U.isEmpty((y=g[5])==null?void 0:y.listRule)||!U.isEmpty((S=g[5])==null?void 0:S.viewRule)||!U.isEmpty((C=g[5])==null?void 0:C.createRule)||!U.isEmpty((T=g[5])==null?void 0:T.updateRule)||!U.isEmpty((O=g[5])==null?void 0:O.deleteRule)||!U.isEmpty((E=g[5])==null?void 0:E.authRule)||!U.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&M(r,1):(r=Zh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&ee(e,"active",g[3]===no)},d(g){g&&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(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function Gh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Xh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=$(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=Y(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&M(r,1):(r=Xh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&ee(e,"active",a[3]===rs)},d(a){a&&k(e),r&&r.d(),s=!1,o()}}}function Xh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function WD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",g,_,y=!U.isEmpty(n[12]),S,C,T,O,E,L=!!n[2].id&&(!n[2].system||!n[17])&&jh(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[BD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=y&&Kh(n),A=!n[15]&&Jh(n),P=n[18]&&Gh(n);return{c(){e=b("h4"),i=W(t),l=$(),L&&L.c(),s=$(),o=b("form"),j(r.$$.fragment),a=$(),u=b("input"),f=$(),c=b("div"),d=b("button"),m=b("span"),g=W(h),_=$(),I&&I.c(),S=$(),A&&A.c(),C=$(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ee(d,"active",n[3]===xi),p(c,"class","tabs-header stretched")},m(N,R){v(N,e,R),w(e,i),v(N,l,R),L&&L.m(N,R),v(N,s,R),v(N,o,R),q(r,o,null),w(o,a),w(o,u),v(N,f,R),v(N,c,R),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,C),P&&P.m(c,null),T=!0,O||(E=[Y(o,"submit",nt(n[39])),Y(d,"click",n[40])],O=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&oe(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&M(L,1)):(L=jh(N),L.c(),M(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&oe(g,h),R[0]&4096&&(y=!U.isEmpty(N[12])),y?I?(I.p(N,R),R[0]&4096&&M(I,1)):(I=Kh(N),I.c(),M(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!T||R[0]&8)&&ee(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Jh(N),A.c(),A.m(c,C)),N[18]?P?P.p(N,R):(P=Gh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(M(L),M(r.$$.fragment,N),M(I),T=!0)},o(N){D(L),D(r.$$.fragment,N),D(I),T=!1},d(N){N&&(k(e),k(l),k(s),k(o),k(f),k(c)),L&&L.d(N),H(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ie(E)}}}function Qh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function YD(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=Y(e,"click",n[33]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function KD(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&&Qh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),l=b("div"),s=b("button"),o=b("span"),a=W(r),f=$(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],ee(s,"btn-expanded",!n[2].id),ee(s,"btn-expanded-sm",!!n[2].id),ee(s,"btn-loading",n[9]||n[10]),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=[Y(e,"click",n[31]),Y(s,"click",n[32])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&oe(a,r),(!c||_[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(s.disabled=u),(!c||_[0]&4)&&ee(s,"btn-expanded",!g[2].id),(!c||_[0]&4)&&ee(s,"btn-expanded-sm",!!g[2].id),(!c||_[0]&1536)&&ee(s,"btn-loading",g[9]||g[10]),g[2].id?h?(h.p(g,_),_[0]&4&&M(h,1)):(h=Qh(g),h.c(),M(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(M(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(k(e),k(i),k(l)),h&&h.d(),d=!1,Ie(m)}}}function JD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[KD],header:[WD],default:[zD]},$$scope:{ctx:n}};e=new Xt({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new qD({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",no="api_rules",rs="options",ZD="base",xh="auth",e_="view";function Aa(n){return JSON.stringify(n)}function GD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Du,Re=>t(30,u=Re)),Qe(n,ti,Re=>t(53,f=Re)),Qe(n,kn,Re=>t(5,c=Re));const d={};d[ZD]="Base",d[e_]="View",d[xh]="Auth";const m=yt();let h,g,_=null,y={},S=!1,C=!1,T=!1,O=xi,E=Aa(y),L="",I=[];function A(Re){t(3,O=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,C=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Ut({}),typeof Re<"u"?(t(28,_=Re),t(2,y=structuredClone(Re))):(t(28,_=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 dn(),t(29,E=Aa(y))}async function F(Re=!0){if(!C){t(10,C=!0);try{y.id?await(g==null?void 0:g.show(_,y,Re)):await B(Re)}catch{}t(10,C=!1)}}function B(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Yt=!y.id;let vn;return Yt?vn=_e.collections.create(Ft):vn=_e.collections.update(y.id,Ft),vn.then(fn=>{Ls(),Yw(fn),Re?(t(11,T=!1),N()):z(fn),tn(y.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Yt,collection:fn}),Yt&&Rn(ti,f=fn,f)}).catch(fn=>{_e.error(fn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},y);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function V(){_!=null&&_.id&&_n(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>_e.collections.truncate(_.id).then(()=>{R(),tn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Re=>{_e.error(Re)}))}function Z(){_!=null&&_.id&&_n(`Do you really want to delete collection "${_.name}" and all its records?`,()=>_e.collections.delete(_.id).then(()=>{R(),tn(`Successfully deleted collection "${_.name}".`),m("delete",_),Kw(_)}).catch(Re=>{_e.error(Re)}))}function G(Re){t(2,y.type=Re,y),t(2,y=Object.assign(structuredClone(u[Re]),y)),Yn("fields")}function de(){r?_n("You have unsaved changes. Do you really want to discard them?",()=>{fe()}):fe()}async function fe(){const Re=_?structuredClone(_):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!U.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!U.isEmpty(Re.indexes))for(let Ft=0;Ft<Re.indexes.length;Ft++){const Yt=U.parseIndex(Re.indexes[Ft]);Yt.indexName="idx_"+U.randomString(10),Yt.tableName=Re.name,Re.indexes[Ft]=U.buildIndex(Yt)}}P(Re),await dn(),t(29,E="")}function ue(Re,Ft=[]){if(U.isEmpty(Re))return!1;const Yt=Object.keys(Re);for(let vn of Yt)if(!Ft.includes(vn))return!0;return!1}const Te=()=>N(),Ke=()=>F(),Je=()=>F(!1),ft=()=>de(),et=()=>V(),xe=()=>Z(),We=Re=>{t(2,y.name=U.slugify(Re.target.value),y),Re.target.value=y.name},at=Re=>G(Re),jt=()=>{a&&F()},Ve=()=>A(xi),Ee=()=>A(no),st=()=>A(rs);function De(Re){y=Re,t(2,y),t(28,_)}function Ye(Re){y=Re,t(2,y),t(28,_)}function ke(Re){y=Re,t(2,y),t(28,_)}function $e(Re){y=Re,t(2,y),t(28,_)}const ct=()=>r&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ht(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Pe.call(this,n,Re)}function ot(Re){Pe.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{g=Re,t(8,g)})}const En=Re=>B(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,I=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]&268435460&&y.name&&(_==null?void 0:_.name)!=y.name&&y.indexes.length>0&&t(2,y.indexes=(Re=y.indexes)==null?void 0:Re.map(Ft=>U.replaceIndexTableName(Ft,y.name)),y),n.$$.dirty[0]&4&&t(18,i=y.type===xh),n.$$.dirty[0]&4&&t(17,l=y.type===e_),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,L=U.getNestedVal(c,"fields.message")||"Has errors"):t(12,L="")),n.$$.dirty[0]&4&&t(16,s=!!y.id&&y.system),n.$$.dirty[0]&4&&t(15,o=!!y.id&&y.system&&y.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Aa(y)),n.$$.dirty[0]&20&&t(14,a=!y.id||r),n.$$.dirty[0]&12&&O===rs&&y.type!=="auth"&&A(xi)},[A,N,y,O,r,c,d,h,g,S,C,T,L,I,a,o,s,l,i,F,B,V,Z,G,de,ue,P,R,_,E,u,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke,$e,ct,Ht,Le,ot,on,En]}class lf extends Se{constructor(e){super(),we(this,e,GD,JD,ye,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function XD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),ee(e,"dragging",n[1])},m(l,s){v(l,e,s),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&ee(e,"dragging",l[1])},i:te,o:te,d(l){l&&k(e),n[4](null),t=!1,Ie(i)}}}function QD(n,e,t){const i=yt();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,C=_.clientX-a,T=_.clientY-u;!f&&Math.abs(C-s.offsetLeft)<l&&Math.abs(T-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 xD extends Se{constructor(e){super(),we(this,e,QD,XD,ye,{tolerance:3})}}function eI(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new xD({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=$(),j(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),q(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||(M(r,a),M(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),H(l,a)}}}const t_="@superuserSidebarWidth";function tI(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(t_)||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=()=>{U.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(t_,a))},[s,o,a,r,l,i,u,f,c,d]}class kk extends Se{constructor(e){super(),we(this,e,tI,eI,ye,{class:0})}}function n_(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"aria-hidden","true")},m(l,s){v(l,e,s),t||(i=Me(qe.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 nI(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 iI(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 lI(n){var T,O;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&n_();function y(E,L){return E[1]?iI:nI}let S=y(n),C=S(n);return{c(){var E;e=b("a"),t=b("i"),l=$(),s=b("span"),r=W(o),a=$(),_&&_.c(),u=$(),f=b("span"),C.c(),p(t,"class",i=zs(U.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),ee(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){v(E,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),C.m(f,null),h||(g=[Me(c=qe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(f,"click",On(nt(n[5]))),Me(Bn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=zs(U.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&oe(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=n_(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=y(E))&&(C.d(1),C=S(E),C&&(C.c(),C.m(f,null))),c&&It(c.update)&&L&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),L&1&&m!==(m=E[0].name)&&p(e,"title",m),L&5&&ee(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&k(e),_&&_.d(),C.d(),h=!1,Ie(g)}}}function sI(n,e,t){let i,l;Qe(n,ti,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?U.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 sf extends Se{constructor(e){super(),we(this,e,sI,lI,ye,{collection:0,pinnedIds:4})}}function i_(n,e,t){const i=n.slice();return i[25]=e[t],i}function l_(n,e,t){const i=n.slice();return i[25]=e[t],i}function s_(n,e,t){const i=n.slice();return i[25]=e[t],i}function o_(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=s_(n,r,u),c=a(f);l.set(c,i[u]=r_(c,f))}return{c(){e=b("div"),e.textContent="Pinned",t=$();for(let u=0;u<i.length;u+=1)i[u].c();s=ve(),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=vt(i,f,a,1,u,r,l,s.parentNode,Bt,r_,s,s_),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)M(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 r_(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 sf({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function a_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&u_(),r=pe(n[8]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=l_(n,r,u),c=a(f);i.set(c,t[u]=f_(c,f))}return{c(){o&&o.c(),e=$();for(let u=0;u<t.length;u+=1)t[u].c();l=ve()},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=u_(),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f[0]&258&&(r=pe(u[8]),re(),t=vt(t,f,a,1,u,r,i,l.parentNode,Bt,f_,l,l_),ae())},i(u){if(!s){for(let f=0;f<r.length;f+=1)M(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 u_(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 f_(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 sf({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function c_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&d_(n),m=(n[6]||n[4].length)&&p_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=$(),d&&d.c(),r=$(),m&&m.c(),a=ve(),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,ee(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=Y(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=d_(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)&&ee(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&M(m,1)):(m=p_(h),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(M(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 d_(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 p_(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=i_(n,s,r),u=o(a);t.set(u,e[r]=m_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ve()},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=vt(e,a,o,1,r,s,t,i.parentNode,Bt,m_,i,i_),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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 m_(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 sf({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function h_(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 __(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=Y(t,"click",n[21]),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function oI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=n[2].length&&o_(n),T=n[8].length&&a_(n),O=n[7].length&&c_(n),E=n[4].length&&!n[3].length&&h_(),L=!n[11]&&__(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=$(),o=b("input"),r=$(),a=b("hr"),u=$(),f=b("div"),C&&C.c(),c=$(),T&&T.c(),d=$(),O&&O.c(),m=$(),E&&E.c(),h=$(),L&&L.c(),g=ve(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),ee(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"),ee(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),ee(f,"fade",n[10]),ee(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),he(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),C&&C.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),O&&O.m(f,null),w(f,m),E&&E.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,y||(S=[Y(l,"click",n[15]),Y(o,"input",n[16])],y=!0)},p(I,A){(!_||A[0]&512)&&ee(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&he(o,I[0]),(!_||A[0]&512)&&ee(t,"active",I[9]),I[2].length?C?(C.p(I,A),A[0]&4&&M(C,1)):(C=o_(I),C.c(),M(C,1),C.m(f,c)):C&&(re(),D(C,1,1,()=>{C=null}),ae()),I[8].length?T?(T.p(I,A),A[0]&256&&M(T,1)):(T=a_(I),T.c(),M(T,1),T.m(f,d)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[7].length?O?(O.p(I,A),A[0]&128&&M(O,1)):(O=c_(I),O.c(),M(O,1),O.m(f,m)):O&&(re(),D(O,1,1,()=>{O=null}),ae()),I[4].length&&!I[3].length?E||(E=h_(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!_||A[0]&1024)&&ee(f,"fade",I[10]),(!_||A[0]&8)&&ee(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=__(I),L.c(),L.m(g.parentNode,g))},i(I){_||(M(C),M(T),M(O),_=!0)},o(I){D(C),D(T),D(O),_=!1},d(I){I&&(k(e),k(r),k(a),k(u),k(f),k(h),k(g)),C&&C.d(),T&&T.d(),O&&O.d(),E&&E.d(),L&&L.d(I),y=!1,Ie(S)}}}function rI(n){let e,t,i,l;e=new kk({props:{class:"collection-sidebar",$$slots:{default:[oI]},$$scope:{ctx:n}}});let s={};return i=new lf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[22](null),H(i,o)}}}const g_="@pinnedCollections";function aI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function uI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,Mn,R=>t(13,u=R)),Qe(n,ti,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",g=[],_=!1,y;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(g_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function C(){t(1,g=g.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function O(){h=this.value,t(0,h)}function E(R){g=R,t(1,g)}function L(R){g=R,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(R){g=R,t(1,g)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&(C(),aI()),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(g_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,B;return R.id==h||((B=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:B.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&y!=f.id&&(t(12,y=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,y,u,f,T,O,E,L,I,A,P,N]}class fI extends Se{constructor(e){super(),we(this,e,uI,rI,ye,{},null,[-1,-1])}}function cI(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 dI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=W(n[2]),l=$(),s=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){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(qe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&oe(i,f[2]),c&2&&oe(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function pI(n){let e;function t(s,o){return s[0]?dI:cI}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 mI(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return U.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 hI extends Se{constructor(e){super(),we(this,e,mI,pI,ye,{date:0})}}function b_(n){let e;function t(s,o){return s[4]==="image"?gI:_I}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 _I(n){let e,t;return{c(){e=b("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){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 gI(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 bI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&b_(n);return{c(){i&&i.c(),t=ve()},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=b_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&k(t),i&&i.d(s)}}}function yI(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=Y(e,"click",nt(n[0])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function kI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W(n[2]),i=$(),l=b("i"),s=$(),o=b("div"),r=$(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"type","button"),p(e,"title",n[2]),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=[Y(e,"auxclick",n[5]),Y(e,"click",n[5]),Y(a,"click",n[0])],u=!0)},p(c,d){d&4&&oe(t,c[2]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(s),k(o),k(r),k(a)),u=!1,Ie(f)}}}function vI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[kI],header:[yI],default:[bI]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("show",n[9]),e.$on("hide",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&8222&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function wI(n,e,t){let i,l,s,o,r="",a;async function u(_){a=_,a&&(t(1,r=await c()),o==null||o.show())}function f(){return o==null?void 0:o.hide()}async function c(){return typeof a=="function"?await a():await a}async function d(){try{t(1,r=await c()),window.open(r,"_blank","noreferrer,noopener")}catch(_){_.isAbort||console.warn("openInNewTab file token failure:",_)}}function m(_){ie[_?"unshift":"push"](()=>{o=_,t(3,o)})}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(7,i=r.indexOf("?")),n.$$.dirty&130&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=U.getFileType(l))},[f,r,l,o,s,d,u,i,m,h,g]}class SI extends Se{constructor(e){super(),we(this,e,wI,vI,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function TI(n){let e,t,i,l,s;function o(u,f){return u[5]==="image"?MI:u[5]==="video"||u[5]==="audio"?OI:$I}let r=o(n),a=r(n);return{c(){e=b("button"),a.c(),p(e,"type","button"),p(e,"draggable",!1),p(e,"class",t="handle thumb "+(n[2]?`thumb-${n[2]}`:"")),p(e,"title",i=(n[8]?"Preview":"Download")+" "+n[1])},m(u,f){v(u,e,f),a.m(e,null),l||(s=Y(e,"click",On(n[10])),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&4&&t!==(t="handle thumb "+(u[2]?`thumb-${u[2]}`:""))&&p(e,"class",t),f&258&&i!==(i=(u[8]?"Preview":"Download")+" "+u[1])&&p(e,"title",i)},d(u){u&&k(e),a.d(),l=!1,s()}}}function CI(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[2]?`thumb-${n[2]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&4&&t!==(t="thumb "+(i[2]?`thumb-${i[2]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function $I(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 OI(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 MI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),bn(e.src,t=n[7])||p(e,"src",t),p(e,"alt",n[1]),p(e,"title",i="Preview "+n[1])},m(o,r){v(o,e,r),l||(s=Y(e,"error",n[9]),l=!0)},p(o,r){r&128&&!bn(e.src,t=o[7])&&p(e,"src",t),r&2&&p(e,"alt",o[1]),r&2&&i!==(i="Preview "+o[1])&&p(e,"title",i)},d(o){o&&k(e),l=!1,s()}}}function y_(n){let e,t,i={};return e=new SI({props:i}),n[11](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function EI(n){let e,t,i;function l(a,u){return a[4]?CI:TI}let s=l(n),o=s(n),r=n[8]&&y_(n);return{c(){o.c(),e=$(),r&&r.c(),t=ve()},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[8]?r?(r.p(a,u),u&256&&M(r,1)):(r=y_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function DI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c=!0;d();async function d(){t(4,c=!0);try{t(3,f=await _e.getSuperuserFileToken(s.collectionId))}catch(_){console.warn("File token failure:",_)}t(4,c=!1)}function m(){t(7,u="")}const h=async()=>{if(l)try{a==null||a.show(async()=>(t(3,f=await _e.getSuperuserFileToken(s.collectionId)),_e.files.getURL(s,o,{token:f})))}catch(_){_.isAbort||console.warn("Preview file token failure:",_)}};function g(_){ie[_?"unshift":"push"](()=>{a=_,t(6,a)})}return n.$$set=_=>{"record"in _&&t(0,s=_.record),"filename"in _&&t(1,o=_.filename),"size"in _&&t(2,r=_.size)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=U.getFileType(o)),n.$$.dirty&34&&t(8,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&27&&t(7,u=c?"":_e.files.getURL(s,o,{thumb:"100x100",token:f}))},[s,o,r,f,c,i,a,u,l,m,h,g]}class of extends Se{constructor(e){super(),we(this,e,DI,EI,ye,{record:0,filename:1,size:2})}}function k_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function v_(n,e,t){const i=n.slice();i[7]=e[t];const l=U.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function w_(n,e,t){const i=n.slice();return i[13]=e[t],i}function S_(n){let e,t;return e=new of({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function T_(n){let e=!U.isEmpty(n[13]),t,i,l=e&&S_(n);return{c(){l&&l.c(),t=ve()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!U.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&M(l,1)):(l=S_(s),l.c(),M(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(M(l),i=!0)},o(s){D(l),i=!1},d(s){s&&k(t),l&&l.d(s)}}}function C_(n){let e,t,i=pe(n[10]),l=[];for(let o=0;o<i.length;o+=1)l[o]=T_(w_(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=ve()},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=w_(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=T_(u),l[a].c(),M(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)M(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),dt(l,o)}}}function $_(n){let e=U.truncate(U.displayValue(n[0],[]),70)+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l&1&&e!==(e=U.truncate(U.displayValue(i[0],[]),70)+"")&&oe(t,e)},d(i){i&&k(t)}}}function II(n){let e;return{c(){e=W(",")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function LI(n){let e=U.truncate(U.displayValue(n[0],[n[7].name]),70)+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l&5&&e!==(e=U.truncate(U.displayValue(i[0],[i[7].name]),70)+"")&&oe(t,e)},i:te,o:te,d(i){i&&k(t)}}}function AI(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 vk({props:s}),ie.push(()=>be(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function O_(n){let e,t,i,l,s,o=n[9]>0&&II();const r=[AI,LI],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=$(),i.c(),l=ve()},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()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(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 PI(n){let e,t,i,l=pe(n[1]),s=[];for(let c=0;c<l.length;c+=1)s[c]=C_(v_(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]=O_(k_(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=$();for(let c=0;c<a.length;c+=1)a[c].c();t=ve(),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=v_(c,l,m);s[m]?(s[m].p(h,d),M(s[m],1)):(s[m]=C_(h),s[m].c(),M(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=k_(c,r,m);a[m]?(a[m].p(h,d),M(a[m],1)):(a[m]=O_(h),a[m].c(),M(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)M(s[d]);for(let d=0;d<r.length;d+=1)M(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)),dt(s,c),dt(a,c),f&&f.d(c)}}}function NI(n,e,t){let i,l;Qe(n,Mn,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 vk extends Se{constructor(e){super(),we(this,e,NI,PI,ye,{record:0})}}function RI(n){let e,t,i,l,s,o,r,a,u,f;return t=new vk({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){v(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Me(r=qe.call(null,l,{text:`Open relation record in new tab:
-`+U.truncate(JSON.stringify(U.truncateObject(M_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(l,"click",On(n[1])),Y(l,"keydown",On(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&It(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab:
-`+U.truncate(JSON.stringify(U.truncateObject(M_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&k(e),H(t),u=!1,Ie(f)}}}function M_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function FI(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 Se{constructor(e){super(),we(this,e,FI,RI,ye,{record:0})}}function E_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function D_(n,e,t){const i=n.slice();return i[14]=e[t],i}function I_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function L_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function qI(n){const e=n.slice(),t=U.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function HI(n){var s,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.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 jI(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function zI(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function UI(n){let e,t=U.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=U.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=U.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=U.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&k(e)}}}function VI(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=E_(n,o,u),c=r(f);i.set(c,t[u]=A_(c,f))}let a=n[17].length>n[18]&&P_();return{c(){e=b("div");for(let u=0;u<t.length;u+=1)t[u].c();l=$(),a&&a.c(),p(e,"class","inline-flex"),ee(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=vt(t,f,r,1,u,o,i,e,Bt,A_,l,E_),ae()),u[17].length>u[18]?a||(a=P_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&ee(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)M(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 BI(n){let e,t,i,l,s;const o=[tL,eL],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]&&F_();return{c(){e=b("div"),i.c(),l=$(),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()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=F_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function WI(n){let e,t=[],i=new Map,l=pe(U.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o<l.length;o+=1){let r=L_(n,l,o),a=s(r);i.set(a,t[o]=q_(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(U.toArray(o[3])),t=vt(t,r,s,1,o,l,i,e,di,q_,null,L_))},i:te,o:te,d(o){o&&k(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function YI(n){let e,t;return e=new hI({props:{date:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KI(n){let e,t,i,l;const s=[iL,nL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function JI(n){let e,t=U.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){v(o,e,r),w(e,i),l||(s=[Me(qe.call(null,e,"Open in new tab")),Y(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=U.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&k(e),l=!1,Ie(s)}}}function ZI(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function GI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","label"),ee(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")&&oe(i,t),s&8&&ee(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&k(e)}}}function XI(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 QI(n){let e,t,i,l;const s=[sL,lL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function xI(n){let e,t,i,l,s,o,r,a;t=new Ci({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&j_();return{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("div"),s=W(n[3]),o=$(),u&&u.c(),r=ve(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){v(f,e,c),q(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)&&oe(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=j_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(M(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(k(e),k(o),k(r)),H(t),u&&u.d(f)}}}function A_(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=ve(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(i,s)}}}function P_(n){let e;return{c(){e=W("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function eL(n){let e,t=pe(n[10].slice(0,n[12])),i=[];for(let l=0;l<t.length;l+=1)i[l]=N_(D_(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=D_(l,t,o);i[o]?i[o].p(r,s):(i[o]=N_(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),dt(i,l)}}}function tL(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=I_(n,s,r),u=o(a);t.set(u,e[r]=R_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ve()},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=vt(e,a,o,1,r,s,t,i.parentNode,Bt,R_,i,I_),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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_(n){let e,t=n[14]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&12&&t!==(t=l[14]+"")&&oe(i,t)},d(l){l&&k(e)}}}function R_(n,e){let t,i,l,s;return i=new Ur({props:{record:e[7]}}),{key:n,first:null,c(){t=b("span"),j(i.$$.fragment),l=$(),p(t,"class","label"),this.first=t},m(o,r){v(o,t,r),q(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||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function F_(n){let e;return{c(){e=W("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function q_(n,e){let t,i=e[7]+"",l;return{key:n,first:null,c(){t=b("span"),l=W(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]+"")&&oe(l,i)},d(s){s&&k(t)}}}function nL(n){let e,t;return e=new $u({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(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iL(n){let e,t=U.truncate(U.plainText(n[3]),195)+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=U.truncate(U.plainText(l[3]),195)+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function lL(n){let e,t=U.truncate(n[6],500,!0)+"",i,l,s,o,r=n[6].length>500&&H_(n);return{c(){e=b("span"),i=W(t),l=$(),r&&r.c(),s=ve(),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=U.truncate(a[6],500,!0)+"")&&oe(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=H_(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(k(e),k(l),k(s)),r&&r.d(a)}}}function sL(n){let e,t=U.truncate(n[6])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=U.truncate(l[6])+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function H_(n){let e,t;return e=new Ci({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function j_(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 oL(n){let e,t,i,l,s;const o=[xI,QI,XI,GI,ZI,JI,KI,YI,WI,BI,VI,UI,zI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!U.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?jI(f):c===9?HI(f):c===10?qI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ve()},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()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(l),r[t].d(f)}}}function rL(n,e,t){let i,l;Qe(n,Rr,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 wk extends Se{constructor(e){super(),we(this,e,rL,oL,ye,{record:0,field:1,short:2})}}function z_(n,e,t){const i=n.slice();return i[13]=e[t],i}function U_(n){let e,t,i=n[13].name+"",l,s,o,r,a,u;return r=new wk({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=W(i),s=$(),o=b("td"),j(r.$$.fragment),a=$(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){v(f,e,c),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),w(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&oe(l,i);const d={};c&1&&(d.field=f[13]),c&8&&(d.record=f[3]),r.$set(d)},i(f){u||(M(r.$$.fragment,f),u=!0)},o(f){D(r.$$.fragment,f),u=!1},d(f){f&&k(e),H(r)}}}function aL(n){var r;let e,t,i,l=pe((r=n[0])==null?void 0:r.fields),s=[];for(let a=0;a<l.length;a+=1)s[a]=U_(z_(n,l,a));const o=a=>D(s[a],1,1,()=>{s[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;a<s.length;a+=1)s[a].c();p(e,"class","table-border preview-table"),ee(e,"table-loading",n[4])},m(a,u){v(a,e,u),w(e,t);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(t,null);i=!0},p(a,u){var f;if(u&9){l=pe((f=a[0])==null?void 0:f.fields);let c;for(c=0;c<l.length;c+=1){const d=z_(a,l,c);s[c]?(s[c].p(d,u),M(s[c],1)):(s[c]=U_(d),s[c].c(),M(s[c],1),s[c].m(t,null))}for(re(),c=l.length;c<s.length;c+=1)o(c);ae()}(!i||u&16)&&ee(e,"table-loading",a[4])},i(a){if(!i){for(let u=0;u<l.length;u+=1)M(s[u]);i=!0}},o(a){s=s.filter(Boolean);for(let u=0;u<s.length;u+=1)D(s[u]);i=!1},d(a){a&&k(e),dt(s,a)}}}function uL(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=W(i),s=W(" 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)+"")&&oe(l,i)},d(r){r&&k(e)}}}function fL(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=Y(e,"click",n[7]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function cL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[fL],header:[uL],default:[aL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function dL(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 _e.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 pL extends Se{constructor(e){super(),we(this,e,dL,cL,ye,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function mL(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=qe.call(null,e,{text:n[0].join(`
+                            `),R=b("i"),z=$(),B=W("."),J=$(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(P,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(I,"href",F=n[13](n[27].name)),p(I,"target","_blank"),p(T,"class","txt-hint"),p(e,"class","svelte-xqpcsf")},m(V,Z){v(V,e,Z),w(e,t),w(e,i),w(i,s),w(e,o),w(e,r),w(r,a),w(a,f),w(r,c),w(r,d),w(r,m),w(r,h),w(h,_),w(e,y),w(e,S),w(e,C),w(e,T),w(T,O),w(T,E),w(T,L),w(T,I),w(I,A),w(I,P),w(I,N),w(I,R),w(I,z),w(T,B),w(e,J)},p(V,Z){Z[0]&128&&l!==(l=V[27].name+"")&&oe(s,l),Z[0]&128&&u!==(u=V[27].oldHost+"")&&oe(f,u),Z[0]&128&&g!==(g=V[27].newHost+"")&&oe(_,g),Z[0]&128&&F!==(F=V[13](V[27].name))&&p(I,"href",F)},d(V){V&&k(e)}}}function ND(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&Mh(n),l=n[11]&&Dh(n);return{c(){i&&i.c(),e=$(),l&&l.c(),t=ve()},m(s,o){i&&i.m(s,o),v(s,e,o),l&&l.m(s,o),v(s,t,o)},p(s,o){s[5]||s[9].length||s[10].length?i?i.p(s,o):(i=Mh(s),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),s[11]?l?l.p(s,o):(l=Dh(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(s){s&&(k(e),k(t)),i&&i.d(s),l&&l.d(s)}}}function RD(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 FD(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),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=[Y(e,"click",n[15]),Y(i,"click",n[16])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function qD(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[FD],header:[RD],default:[ND]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&4030|s[1]&512&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[17](null),H(e,l)}}}function HD(n,e,t){let i,l,s,o,r,a,u;const f=yt();let c,d,m,h,g=[],_=[];async function y(F,B,J=!0){t(1,d=F),t(2,m=B),h=J,await O(),I(),await dn(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():C()}function S(){c==null||c.hide()}function C(){S(),f("confirm",h)}const T=["oidc","oidc2","oidc3"];async function O(){var F,B,J,V;t(7,g=[]);for(let Z of T){let G=(B=(F=d==null?void 0:d.oauth2)==null?void 0:F.providers)==null?void 0:B.find(Te=>Te.name==Z),de=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Te=>Te.name==Z);if(!G||!de)continue;let fe=new URL(G.authURL).host,ue=new URL(de.authURL).host;fe!=ue&&await E(Z)&&g.push({name:Z,oldHost:fe,newHost:ue})}}async function E(F){try{return await _e.collection("_externalAuths").getFirstListItem(_e.filter("collectionRef={:collectionId} && provider={:provider}",{collectionId:m==null?void 0:m.id,provider:F})),!0}catch{}return!1}function L(F){return`#/collections?collection=_externalAuths&filter=collectionRef%3D%22${m==null?void 0:m.id}%22+%26%26+provider%3D%22${F}%22`}function I(){if(t(3,_=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];l||F.push("createRule","updateRule","deleteRule"),s&&F.push("manageRule","authRule");let B,J;for(let V of F)B=d==null?void 0:d[V],J=m==null?void 0:m[V],B!==J&&_.push({prop:V,oldRule:B,newRule:J})}const A=()=>S(),P=()=>C();function N(F){ie[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Pe.call(this,n,F)}function z(F){Pe.call(this,n,F)}return n.$$.update=()=>{var F,B,J;n.$$.dirty[0]&6&&t(5,i=(d==null?void 0:d.name)!=(m==null?void 0:m.name)),n.$$.dirty[0]&4&&t(4,l=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(s=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!l&&((F=m==null?void 0:m.fields)==null?void 0:F.filter(V=>V.id&&!V._toDelete&&V._originalName!=V.name))||[]),n.$$.dirty[0]&20&&t(9,r=!l&&((B=m==null?void 0:m.fields)==null?void 0:B.filter(V=>V.id&&V._toDelete))||[]),n.$$.dirty[0]&6&&t(8,a=((J=m==null?void 0:m.fields)==null?void 0:J.filter(V=>{var G;const Z=(G=d==null?void 0:d.fields)==null?void 0:G.find(de=>de.id==V.id);return Z?Z.maxSelect!=1&&V.maxSelect==1:!1}))||[]),n.$$.dirty[0]&56&&t(11,u=!l||i||_.length)},[S,d,m,_,l,i,c,g,a,r,o,u,C,L,y,A,P,N,R,z]}class jD extends Se{constructor(e){super(),we(this,e,HD,qD,ye,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function qh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function zD(n){let e,t,i;function l(o){n[44](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new vD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function UD(n){let e,t,i;function l(o){n[43](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new OD({props:s}),ie.push(()=>be(e,"collection",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Hh(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 PD({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Ce(()=>i=!1)),t.$set(u)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),H(t)}}}function jh(n){let e,t,i,l;function s(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new UO({props:o}),ie.push(()=>be(t,"collection",s)),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(r,a){v(r,e,a),q(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Ce(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&ee(e,"active",r[3]===rs)},i(r){l||(M(t.$$.fragment,r),l=!0)},o(r){D(t.$$.fragment,r),l=!1},d(r){r&&k(e),H(t)}}}function VD(n){let e,t,i,l,s,o,r;const a=[UD,zD],u=[];function f(m,h){return m[17]?0:1}i=f(n),l=u[i]=a[i](n);let c=!n[15]&&n[3]===no&&Hh(n),d=n[18]&&jh(n);return{c(){e=b("div"),t=b("div"),l.c(),s=$(),c&&c.c(),o=$(),d&&d.c(),p(t,"class","tab-item"),ee(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()),M(l,1),l.m(t,null)),(!r||h[0]&8)&&ee(t,"active",m[3]===xi),!m[15]&&m[3]===no?c?(c.p(m,h),h[0]&32776&&M(c,1)):(c=Hh(m),c.c(),M(c,1),c.m(e,o)):c&&(re(),D(c,1,1,()=>{c=null}),ae()),m[18]?d?(d.p(m,h),h[0]&262144&&M(d,1)):(d=jh(m),d.c(),M(d,1),d.m(e,null)):d&&(re(),D(d,1,1,()=>{d=null}),ae())},i(m){r||(M(l),M(c),M(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 zh(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&131076|u[2]&2&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),H(o)}}}function Uh(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',t=$(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){v(o,e,r),v(o,t,r),v(o,i,r),l||(s=Y(e,"click",n[34]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function Vh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-eraser-line" aria-hidden="true"></i> <span class="txt">Truncate</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Bh(n){let e,t,i;return{c(){e=b("button"),e.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 txt-danger"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",On(nt(n[36]))),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function BD(n){let e,t,i,l=!n[2].system&&Uh(n),s=!n[17]&&Vh(n),o=!n[2].system&&Bh(n);return{c(){l&&l.c(),e=$(),s&&s.c(),t=$(),o&&o.c(),i=ve()},m(r,a){l&&l.m(r,a),v(r,e,a),s&&s.m(r,a),v(r,t,a),o&&o.m(r,a),v(r,i,a)},p(r,a){r[2].system?l&&(l.d(1),l=null):l?l.p(r,a):(l=Uh(r),l.c(),l.m(e.parentNode,e)),r[17]?s&&(s.d(1),s=null):s?s.p(r,a):(s=Vh(r),s.c(),s.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=Bh(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(r),s&&s.d(r),o&&o.d(r)}}}function Wh(n){let e,t,i,l;return i=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[WD]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=$(),j(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),q(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&(k(e),k(t)),H(i,s)}}}function Yh(n){let e,t,i,l,s,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),l=$(),s=b("span"),r=W(o),a=W(" collection"),u=$(),p(t,"class",i=zs(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),ee(e,"selected",n[59]==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=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=zs(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&oe(r,o),h[0]&68&&ee(e,"selected",n[59]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function WD(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l<t.length;l+=1)i[l]=Yh(qh(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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]&8388676){t=pe(Object.entries(l[6]));let o;for(o=0;o<t.length;o+=1){const r=qh(l,t,o);i[o]?i[o].p(r,s):(i[o]=Yh(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),dt(i,l)}}}function Kh(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 YD(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,C,T,O,E,L,I,A,P,N,R=!n[2].id&&Wh(n),z=n[2].system&&Kh();return{c(){e=b("label"),t=W("Name"),l=$(),s=b("input"),f=$(),c=b("div"),d=b("div"),m=b("span"),h=$(),g=b("span"),_=W("Type: "),S=W(y),C=$(),R&&R.c(),L=$(),z&&z.c(),I=ve(),p(e,"for",i=n[58]),p(s,"type","text"),p(s,"id",o=n[58]),s.required=!0,s.disabled=n[16],p(s,"spellcheck","false"),s.autofocus=r=!n[2].id,p(s,"placeholder",a=n[18]?'eg. "users"':'eg. "posts"'),s.value=u=n[2].name,ee(s,"txt-bold",n[2].system),p(m,"aria-hidden","true"),p(g,"class","txt"),p(d,"tabindex",T=n[2].id?-1:0),p(d,"role",O=n[2].id?"":"button"),p(d,"aria-label","View types"),p(d,"class",E="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),ee(d,"btn-disabled",!!n[2].id),p(c,"class","form-field-addon")},m(F,B){v(F,e,B),w(e,t),v(F,l,B),v(F,s,B),v(F,f,B),v(F,c,B),w(c,d),w(d,m),w(d,h),w(d,g),w(g,_),w(g,S),w(d,C),R&&R.m(d,null),v(F,L,B),z&&z.m(F,B),v(F,I,B),A=!0,n[2].id||s.focus(),P||(N=Y(s,"input",n[37]),P=!0)},p(F,B){(!A||B[1]&134217728&&i!==(i=F[58]))&&p(e,"for",i),(!A||B[1]&134217728&&o!==(o=F[58]))&&p(s,"id",o),(!A||B[0]&65536)&&(s.disabled=F[16]),(!A||B[0]&4&&r!==(r=!F[2].id))&&(s.autofocus=r),(!A||B[0]&262144&&a!==(a=F[18]?'eg. "users"':'eg. "posts"'))&&p(s,"placeholder",a),(!A||B[0]&4&&u!==(u=F[2].name)&&s.value!==u)&&(s.value=u),(!A||B[0]&4)&&ee(s,"txt-bold",F[2].system),(!A||B[0]&68)&&y!==(y=(F[6][F[2].type]||"N/A")+"")&&oe(S,y),F[2].id?R&&(re(),D(R,1,1,()=>{R=null}),ae()):R?(R.p(F,B),B[0]&4&&M(R,1)):(R=Wh(F),R.c(),M(R,1),R.m(d,null)),(!A||B[0]&4&&T!==(T=F[2].id?-1:0))&&p(d,"tabindex",T),(!A||B[0]&4&&O!==(O=F[2].id?"":"button"))&&p(d,"role",O),(!A||B[0]&4&&E!==(E="btn btn-sm p-r-10 p-l-10 "+(F[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",E),(!A||B[0]&4)&&ee(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=Kh(),z.c(),z.m(I.parentNode,I)):z&&(z.d(1),z=null)},i(F){A||(M(R),A=!0)},o(F){D(R),A=!1},d(F){F&&(k(e),k(l),k(s),k(f),k(c),k(L),k(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function Jh(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=qe.call(null,e,n[12])),s=!0)},p(r,a){t&&It(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){l||(r&&tt(()=>{l&&(i||(i=He(e,Ct,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=He(e,Ct,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&k(e),r&&i&&i.end(),s=!1,o()}}}function Zh(n){var a,u,f,c,d,m,h;let e,t,i,l=!U.isEmpty((a=n[5])==null?void 0:a.listRule)||!U.isEmpty((u=n[5])==null?void 0:u.viewRule)||!U.isEmpty((f=n[5])==null?void 0:f.createRule)||!U.isEmpty((c=n[5])==null?void 0:c.updateRule)||!U.isEmpty((d=n[5])==null?void 0:d.deleteRule)||!U.isEmpty((m=n[5])==null?void 0:m.authRule)||!U.isEmpty((h=n[5])==null?void 0:h.manageRule),s,o,r=l&&Gh();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=$(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===no)},m(g,_){v(g,e,_),w(e,t),w(e,i),r&&r.m(e,null),s||(o=Y(e,"click",n[41]),s=!0)},p(g,_){var y,S,C,T,O,E,L;_[0]&32&&(l=!U.isEmpty((y=g[5])==null?void 0:y.listRule)||!U.isEmpty((S=g[5])==null?void 0:S.viewRule)||!U.isEmpty((C=g[5])==null?void 0:C.createRule)||!U.isEmpty((T=g[5])==null?void 0:T.updateRule)||!U.isEmpty((O=g[5])==null?void 0:O.deleteRule)||!U.isEmpty((E=g[5])==null?void 0:E.authRule)||!U.isEmpty((L=g[5])==null?void 0:L.manageRule)),l?r?_[0]&32&&M(r,1):(r=Gh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),_[0]&8&&ee(e,"active",g[3]===no)},d(g){g&&k(e),r&&r.d(),s=!1,o()}}}function Gh(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(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function Xh(n){let e,t,i,l=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),s,o,r=l&&Qh();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=$(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),ee(e,"active",n[3]===rs)},m(a,u){v(a,e,u),w(e,t),w(e,i),r&&r.m(e,null),s||(o=Y(e,"click",n[42]),s=!0)},p(a,u){u[0]&8224&&(l=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),l?r?u[0]&8224&&M(r,1):(r=Qh(),r.c(),M(r,1),r.m(e,null)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),u[0]&8&&ee(e,"active",a[3]===rs)},d(a){a&&k(e),r&&r.d(),s=!1,o()}}}function Qh(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(qe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function KD(n){let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",g,_,y=!U.isEmpty(n[12]),S,C,T,O,E,L=!!n[2].id&&(!n[2].system||!n[17])&&zh(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[YD,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=y&&Jh(n),A=!n[15]&&Zh(n),P=n[18]&&Xh(n);return{c(){e=b("h4"),i=W(t),l=$(),L&&L.c(),s=$(),o=b("form"),j(r.$$.fragment),a=$(),u=b("input"),f=$(),c=b("div"),d=b("button"),m=b("span"),g=W(h),_=$(),I&&I.c(),S=$(),A&&A.c(),C=$(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ee(d,"active",n[3]===xi),p(c,"class","tabs-header stretched")},m(N,R){v(N,e,R),w(e,i),v(N,l,R),L&&L.m(N,R),v(N,s,R),v(N,o,R),q(r,o,null),w(o,a),w(o,u),v(N,f,R),v(N,c,R),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,C),P&&P.m(c,null),T=!0,O||(E=[Y(o,"submit",nt(n[39])),Y(d,"click",n[40])],O=!0)},p(N,R){(!T||R[0]&4)&&t!==(t=N[2].id?"Edit collection":"New collection")&&oe(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&M(L,1)):(L=zh(N),L.c(),M(L,1),L.m(s.parentNode,s)):L&&(re(),D(L,1,1,()=>{L=null}),ae());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&h!==(h=N[17]?"Query":"Fields")&&oe(g,h),R[0]&4096&&(y=!U.isEmpty(N[12])),y?I?(I.p(N,R),R[0]&4096&&M(I,1)):(I=Jh(N),I.c(),M(I,1),I.m(d,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae()),(!T||R[0]&8)&&ee(d,"active",N[3]===xi),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=Zh(N),A.c(),A.m(c,C)),N[18]?P?P.p(N,R):(P=Xh(N),P.c(),P.m(c,null)):P&&(P.d(1),P=null)},i(N){T||(M(L),M(r.$$.fragment,N),M(I),T=!0)},o(N){D(L),D(r.$$.fragment,N),D(I),T=!1},d(N){N&&(k(e),k(l),k(s),k(o),k(f),k(c)),L&&L.d(N),H(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ie(E)}}}function xh(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[14]||n[9]||n[10]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&17920&&s!==(s=!r[14]||r[9]||r[10]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function JD(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=Y(e,"click",n[33]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function ZD(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&&xh(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),l=b("div"),s=b("button"),o=b("span"),a=W(r),f=$(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(s,"type","button"),p(s,"title","Save and close"),p(s,"class","btn"),s.disabled=u=!n[14]||n[9]||n[10],ee(s,"btn-expanded",!n[2].id),ee(s,"btn-expanded-sm",!!n[2].id),ee(s,"btn-loading",n[9]||n[10]),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=[Y(e,"click",n[31]),Y(s,"click",n[32])],d=!0)},p(g,_){(!c||_[0]&512)&&(e.disabled=g[9]),(!c||_[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&oe(a,r),(!c||_[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(s.disabled=u),(!c||_[0]&4)&&ee(s,"btn-expanded",!g[2].id),(!c||_[0]&4)&&ee(s,"btn-expanded-sm",!!g[2].id),(!c||_[0]&1536)&&ee(s,"btn-loading",g[9]||g[10]),g[2].id?h?(h.p(g,_),_[0]&4&&M(h,1)):(h=xh(g),h.c(),M(h,1),h.m(l,null)):h&&(re(),D(h,1,1,()=>{h=null}),ae())},i(g){c||(M(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(k(e),k(i),k(l)),h&&h.d(),d=!1,Ie(m)}}}function GD(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[ZD],header:[KD],default:[VD]},$$scope:{ctx:n}};e=new Xt({props:s}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new jD({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&2064&&(u.beforeHide=r[47]),a[0]&521836|a[2]&2&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[48](null),H(e,r),n[51](null),H(i,r)}}}const xi="schema",no="api_rules",rs="options",XD="base",e_="auth",t_="view";function Aa(n){return JSON.stringify(n)}function QD(n,e,t){let i,l,s,o,r,a,u,f,c;Qe(n,Iu,Re=>t(30,u=Re)),Qe(n,ti,Re=>t(53,f=Re)),Qe(n,kn,Re=>t(5,c=Re));const d={};d[XD]="Base",d[t_]="View",d[e_]="Auth";const m=yt();let h,g,_=null,y={},S=!1,C=!1,T=!1,O=xi,E=Aa(y),L="",I=[];function A(Re){t(3,O=Re)}function P(Re){return z(Re),t(11,T=!0),t(10,C=!1),t(9,S=!1),A(xi),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function R(){t(11,T=!1),N()}async function z(Re){Ut({}),typeof Re<"u"?(t(28,_=Re),t(2,y=structuredClone(Re))):(t(28,_=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 dn(),t(29,E=Aa(y))}async function F(Re=!0){if(!C){t(10,C=!0);try{y.id?await(g==null?void 0:g.show(_,y,Re)):await B(Re)}catch{}t(10,C=!1)}}function B(Re=!0){if(S)return;t(9,S=!0);const Ft=J(),Yt=!y.id;let vn;return Yt?vn=_e.collections.create(Ft):vn=_e.collections.update(y.id,Ft),vn.then(fn=>{Ls(),Jw(fn),Re?(t(11,T=!1),N()):z(fn),tn(y.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Yt,collection:fn}),Yt&&Rn(ti,f=fn,f)}).catch(fn=>{_e.error(fn)}).finally(()=>{t(9,S=!1)})}function J(){const Re=Object.assign({},y);Re.fields=Re.fields.slice(0);for(let Ft=Re.fields.length-1;Ft>=0;Ft--)Re.fields[Ft]._toDelete&&Re.fields.splice(Ft,1);return Re}function V(){_!=null&&_.id&&_n(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>_e.collections.truncate(_.id).then(()=>{R(),tn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Re=>{_e.error(Re)}))}function Z(){_!=null&&_.id&&_n(`Do you really want to delete collection "${_.name}" and all its records?`,()=>_e.collections.delete(_.id).then(()=>{R(),tn(`Successfully deleted collection "${_.name}".`),m("delete",_),Zw(_)}).catch(Re=>{_e.error(Re)}))}function G(Re){t(2,y.type=Re,y),t(2,y=Object.assign(structuredClone(u[Re]),y)),Yn("fields")}function de(){r?_n("You have unsaved changes. Do you really want to discard them?",()=>{fe()}):fe()}async function fe(){const Re=_?structuredClone(_):null;if(Re){if(Re.id="",Re.created="",Re.updated="",Re.name+="_duplicate",!U.isEmpty(Re.fields))for(const Ft of Re.fields)Ft.id="";if(!U.isEmpty(Re.indexes))for(let Ft=0;Ft<Re.indexes.length;Ft++){const Yt=U.parseIndex(Re.indexes[Ft]);Yt.indexName="idx_"+U.randomString(10),Yt.tableName=Re.name,Re.indexes[Ft]=U.buildIndex(Yt)}}P(Re),await dn(),t(29,E="")}function ue(Re,Ft=[]){if(U.isEmpty(Re))return!1;const Yt=Object.keys(Re);for(let vn of Yt)if(!Ft.includes(vn))return!0;return!1}const Te=()=>N(),Ke=()=>F(),Je=()=>F(!1),ft=()=>de(),et=()=>V(),xe=()=>Z(),We=Re=>{t(2,y.name=U.slugify(Re.target.value),y),Re.target.value=y.name},at=Re=>G(Re),jt=()=>{a&&F()},Ve=()=>A(xi),Ee=()=>A(no),st=()=>A(rs);function De(Re){y=Re,t(2,y),t(28,_)}function Ye(Re){y=Re,t(2,y),t(28,_)}function ke(Re){y=Re,t(2,y),t(28,_)}function $e(Re){y=Re,t(2,y),t(28,_)}const ct=()=>r&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ht(Re){ie[Re?"unshift":"push"](()=>{h=Re,t(7,h)})}function Le(Re){Pe.call(this,n,Re)}function ot(Re){Pe.call(this,n,Re)}function on(Re){ie[Re?"unshift":"push"](()=>{g=Re,t(8,g)})}const En=Re=>B(Re.detail);return n.$$.update=()=>{var Re;n.$$.dirty[0]&1073741824&&t(13,I=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]&268435460&&y.name&&(_==null?void 0:_.name)!=y.name&&y.indexes.length>0&&t(2,y.indexes=(Re=y.indexes)==null?void 0:Re.map(Ft=>U.replaceIndexTableName(Ft,y.name)),y),n.$$.dirty[0]&4&&t(18,i=y.type===e_),n.$$.dirty[0]&4&&t(17,l=y.type===t_),n.$$.dirty[0]&32&&(c.fields||c.viewQuery||c.indexes?t(12,L=U.getNestedVal(c,"fields.message")||"Has errors"):t(12,L="")),n.$$.dirty[0]&4&&t(16,s=!!y.id&&y.system),n.$$.dirty[0]&4&&t(15,o=!!y.id&&y.system&&y.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Aa(y)),n.$$.dirty[0]&20&&t(14,a=!y.id||r),n.$$.dirty[0]&12&&O===rs&&y.type!=="auth"&&A(xi)},[A,N,y,O,r,c,d,h,g,S,C,T,L,I,a,o,s,l,i,F,B,V,Z,G,de,ue,P,R,_,E,u,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke,$e,ct,Ht,Le,ot,on,En]}class sf extends Se{constructor(e){super(),we(this,e,QD,GD,ye,{changeTab:0,show:26,hide:1,forceHide:27},null,[-1,-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[26]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[27]}}function xD(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),ee(e,"dragging",n[1])},m(l,s){v(l,e,s),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&ee(e,"dragging",l[1])},i:te,o:te,d(l){l&&k(e),n[4](null),t=!1,Ie(i)}}}function eI(n,e,t){const i=yt();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,C=_.clientX-a,T=_.clientY-u;!f&&Math.abs(C-s.offsetLeft)<l&&Math.abs(T-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 tI extends Se{constructor(e){super(),we(this,e,eI,xD,ye,{tolerance:3})}}function nI(n){let e,t,i,l,s;const o=n[5].default,r=Lt(o,n,n[4],null);return l=new tI({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=$(),j(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),q(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||(M(r,a),M(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),H(l,a)}}}const n_="@superuserSidebarWidth";function iI(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(n_)||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=()=>{U.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(n_,a))},[s,o,a,r,l,i,u,f,c,d]}class vk extends Se{constructor(e){super(),we(this,e,iI,nI,ye,{class:0})}}function i_(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm link-hint"),p(e,"aria-hidden","true")},m(l,s){v(l,e,s),t||(i=Me(qe.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 lI(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 sI(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 oI(n){var T,O;let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h,g,_=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&i_();function y(E,L){return E[1]?sI:lI}let S=y(n),C=S(n);return{c(){var E;e=b("a"),t=b("i"),l=$(),s=b("span"),r=W(o),a=$(),_&&_.c(),u=$(),f=b("span"),C.c(),p(t,"class",i=zs(U.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(f,"class","btn btn-xs btn-circle btn-hint btn-transparent btn-pin-collection m-l-auto svelte-5oh3nd"),p(f,"aria-label","Pin collection"),p(f,"aria-hidden","true"),p(e,"href",d="/collections?collection="+n[0].id),p(e,"class","sidebar-list-item svelte-5oh3nd"),p(e,"title",m=n[0].name),ee(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){v(E,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),C.m(f,null),h||(g=[Me(c=qe.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(f,"click",On(nt(n[5]))),Me(Bn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=zs(U.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&oe(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=i_(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=y(E))&&(C.d(1),C=S(E),C&&(C.c(),C.m(f,null))),c&&It(c.update)&&L&2&&c.update.call(null,{position:"right",text:(E[1]?"Unpin":"Pin")+" collection"}),L&1&&d!==(d="/collections?collection="+E[0].id)&&p(e,"href",d),L&1&&m!==(m=E[0].name)&&p(e,"title",m),L&5&&ee(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&k(e),_&&_.d(),C.d(),h=!1,Ie(g)}}}function rI(n,e,t){let i,l;Qe(n,ti,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?U.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 of extends Se{constructor(e){super(),we(this,e,rI,oI,ye,{collection:0,pinnedIds:4})}}function l_(n,e,t){const i=n.slice();return i[25]=e[t],i}function s_(n,e,t){const i=n.slice();return i[25]=e[t],i}function o_(n,e,t){const i=n.slice();return i[25]=e[t],i}function r_(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=o_(n,r,u),c=a(f);l.set(c,i[u]=a_(c,f))}return{c(){e=b("div"),e.textContent="Pinned",t=$();for(let u=0;u<i.length;u+=1)i[u].c();s=ve(),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=vt(i,f,a,1,u,r,l,s.parentNode,Bt,a_,s,o_),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)M(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 a_(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 of({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function u_(n){let e,t=[],i=new Map,l,s,o=n[2].length&&f_(),r=pe(n[8]);const a=u=>u[25].id;for(let u=0;u<r.length;u+=1){let f=s_(n,r,u),c=a(f);i.set(c,t[u]=c_(c,f))}return{c(){o&&o.c(),e=$();for(let u=0;u<t.length;u+=1)t[u].c();l=ve()},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=f_(),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f[0]&258&&(r=pe(u[8]),re(),t=vt(t,f,a,1,u,r,i,l.parentNode,Bt,c_,l,s_),ae())},i(u){if(!s){for(let f=0;f<r.length;f+=1)M(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 f_(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 c_(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 of({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function d_(n){let e,t,i,l,s,o,r,a,u,f,c,d=!n[4].length&&p_(n),m=(n[6]||n[4].length)&&m_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=$(),d&&d.c(),r=$(),m&&m.c(),a=ve(),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,ee(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=Y(e,"click",n[19]),f=!0)},p(h,g){h[4].length?d&&(d.d(1),d=null):d?d.p(h,g):(d=p_(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)&&ee(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&M(m,1)):(m=m_(h),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(re(),D(m,1,1,()=>{m=null}),ae())},i(h){u||(M(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 p_(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 m_(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=l_(n,s,r),u=o(a);t.set(u,e[r]=h_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ve()},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=vt(e,a,o,1,r,s,t,i.parentNode,Bt,h_,i,l_),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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 h_(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 of({props:r}),ie.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!l&&u[0]&2&&(l=!0,f.pinnedIds=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function __(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 g_(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=Y(t,"click",n[21]),i=!0)},p:te,d(s){s&&k(e),i=!1,l()}}}function aI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=n[2].length&&r_(n),T=n[8].length&&u_(n),O=n[7].length&&d_(n),E=n[4].length&&!n[3].length&&__(),L=!n[11]&&g_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=$(),o=b("input"),r=$(),a=b("hr"),u=$(),f=b("div"),C&&C.c(),c=$(),T&&T.c(),d=$(),O&&O.c(),m=$(),E&&E.c(),h=$(),L&&L.c(),g=ve(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),ee(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"),ee(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),ee(f,"fade",n[10]),ee(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),he(o,n[0]),v(I,r,A),v(I,a,A),v(I,u,A),v(I,f,A),C&&C.m(f,null),w(f,c),T&&T.m(f,null),w(f,d),O&&O.m(f,null),w(f,m),E&&E.m(f,null),v(I,h,A),L&&L.m(I,A),v(I,g,A),_=!0,y||(S=[Y(l,"click",n[15]),Y(o,"input",n[16])],y=!0)},p(I,A){(!_||A[0]&512)&&ee(l,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&he(o,I[0]),(!_||A[0]&512)&&ee(t,"active",I[9]),I[2].length?C?(C.p(I,A),A[0]&4&&M(C,1)):(C=r_(I),C.c(),M(C,1),C.m(f,c)):C&&(re(),D(C,1,1,()=>{C=null}),ae()),I[8].length?T?(T.p(I,A),A[0]&256&&M(T,1)):(T=u_(I),T.c(),M(T,1),T.m(f,d)):T&&(re(),D(T,1,1,()=>{T=null}),ae()),I[7].length?O?(O.p(I,A),A[0]&128&&M(O,1)):(O=d_(I),O.c(),M(O,1),O.m(f,m)):O&&(re(),D(O,1,1,()=>{O=null}),ae()),I[4].length&&!I[3].length?E||(E=__(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!_||A[0]&1024)&&ee(f,"fade",I[10]),(!_||A[0]&8)&&ee(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=g_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(M(C),M(T),M(O),_=!0)},o(I){D(C),D(T),D(O),_=!1},d(I){I&&(k(e),k(r),k(a),k(u),k(f),k(h),k(g)),C&&C.d(),T&&T.d(),O&&O.d(),E&&E.d(),L&&L.d(I),y=!1,Ie(S)}}}function uI(n){let e,t,i,l;e=new vk({props:{class:"collection-sidebar",$$slots:{default:[aI]},$$scope:{ctx:n}}});let s={};return i=new sf({props:s}),n[22](i),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,r){const a={};r[0]&4095|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[22](null),H(i,o)}}}const b_="@pinnedCollections";function fI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function cI(n,e,t){let i,l,s,o,r,a,u,f,c,d;Qe(n,Mn,R=>t(13,u=R)),Qe(n,ti,R=>t(14,f=R)),Qe(n,Js,R=>t(10,c=R)),Qe(n,Dl,R=>t(11,d=R));let m,h="",g=[],_=!1,y;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(b_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function C(){t(1,g=g.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,h="");function O(){h=this.value,t(0,h)}function E(R){g=R,t(1,g)}function L(R){g=R,t(1,g)}const I=()=>{i.length||t(6,_=!_)};function A(R){g=R,t(1,g)}const P=()=>m==null?void 0:m.show();function N(R){ie[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&(C(),fI()),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(b_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,s=u.filter(R=>{var z,F,B;return R.id==h||((B=(F=(z=R.name)==null?void 0:z.replace(/\s+/g,""))==null?void 0:F.toLowerCase())==null?void 0:B.includes(i))})),n.$$.dirty[0]&10&&t(2,o=s.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=s.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=s.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&y!=f.id&&(t(12,y=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,s,i,m,_,a,r,l,c,d,y,u,f,T,O,E,L,I,A,P,N]}class dI extends Se{constructor(e){super(),we(this,e,cI,uI,ye,{},null,[-1,-1])}}function pI(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 mI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=W(n[2]),l=$(),s=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){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(qe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&oe(i,f[2]),c&2&&oe(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function hI(n){let e;function t(s,o){return s[0]?mI:pI}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 _I(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return U.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 gI extends Se{constructor(e){super(),we(this,e,_I,hI,ye,{date:0})}}function y_(n){let e;function t(s,o){return s[4]==="image"?yI:bI}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 bI(n){let e,t;return{c(){e=b("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){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 yI(n){let e,t,i;return{c(){e=b("img"),bn(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&&!bn(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 kI(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&y_(n);return{c(){i&&i.c(),t=ve()},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=y_(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&k(t),i&&i.d(s)}}}function vI(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=Y(e,"click",nt(n[0])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function wI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=W(n[2]),i=$(),l=b("i"),s=$(),o=b("div"),r=$(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"type","button"),p(e,"title",n[2]),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=[Y(e,"auxclick",n[5]),Y(e,"click",n[5]),Y(a,"click",n[0])],u=!0)},p(c,d){d&4&&oe(t,c[2]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(s),k(o),k(r),k(a)),u=!1,Ie(f)}}}function SI(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[wI],header:[vI],default:[kI]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("show",n[9]),e.$on("hide",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&8222&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function TI(n,e,t){let i,l,s,o,r="",a;async function u(_){a=_,a&&(t(1,r=await c()),o==null||o.show())}function f(){return o==null?void 0:o.hide()}async function c(){return typeof a=="function"?await a():await a}async function d(){try{t(1,r=await c()),window.open(r,"_blank","noreferrer,noopener")}catch(_){_.isAbort||console.warn("openInNewTab file token failure:",_)}}function m(_){ie[_?"unshift":"push"](()=>{o=_,t(3,o)})}function h(_){Pe.call(this,n,_)}function g(_){Pe.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(7,i=r.indexOf("?")),n.$$.dirty&130&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=U.getFileType(l))},[f,r,l,o,s,d,u,i,m,h,g]}class CI extends Se{constructor(e){super(),we(this,e,TI,SI,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function $I(n){let e,t,i,l,s;function o(u,f){return u[5]==="image"?DI:u[5]==="video"||u[5]==="audio"?EI:MI}let r=o(n),a=r(n);return{c(){e=b("button"),a.c(),p(e,"type","button"),p(e,"draggable",!1),p(e,"class",t="handle thumb "+(n[2]?`thumb-${n[2]}`:"")),p(e,"title",i=(n[8]?"Preview":"Download")+" "+n[1])},m(u,f){v(u,e,f),a.m(e,null),l||(s=Y(e,"click",On(n[10])),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&4&&t!==(t="handle thumb "+(u[2]?`thumb-${u[2]}`:""))&&p(e,"class",t),f&258&&i!==(i=(u[8]?"Preview":"Download")+" "+u[1])&&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[2]?`thumb-${n[2]}`:""))},m(i,l){v(i,e,l)},p(i,l){l&4&&t!==(t="thumb "+(i[2]?`thumb-${i[2]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function MI(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 EI(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 DI(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),bn(e.src,t=n[7])||p(e,"src",t),p(e,"alt",n[1]),p(e,"title",i="Preview "+n[1])},m(o,r){v(o,e,r),l||(s=Y(e,"error",n[9]),l=!0)},p(o,r){r&128&&!bn(e.src,t=o[7])&&p(e,"src",t),r&2&&p(e,"alt",o[1]),r&2&&i!==(i="Preview "+o[1])&&p(e,"title",i)},d(o){o&&k(e),l=!1,s()}}}function k_(n){let e,t,i={};return e=new CI({props:i}),n[11](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function II(n){let e,t,i;function l(a,u){return a[4]?OI:$I}let s=l(n),o=s(n),r=n[8]&&k_(n);return{c(){o.c(),e=$(),r&&r.c(),t=ve()},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[8]?r?(r.p(a,u),u&256&&M(r,1)):(r=k_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function LI(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c=!0;d();async function d(){t(4,c=!0);try{t(3,f=await _e.getSuperuserFileToken(s.collectionId))}catch(_){console.warn("File token failure:",_)}t(4,c=!1)}function m(){t(7,u="")}const h=async()=>{if(l)try{a==null||a.show(async()=>(t(3,f=await _e.getSuperuserFileToken(s.collectionId)),_e.files.getURL(s,o,{token:f})))}catch(_){_.isAbort||console.warn("Preview file token failure:",_)}};function g(_){ie[_?"unshift":"push"](()=>{a=_,t(6,a)})}return n.$$set=_=>{"record"in _&&t(0,s=_.record),"filename"in _&&t(1,o=_.filename),"size"in _&&t(2,r=_.size)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=U.getFileType(o)),n.$$.dirty&34&&t(8,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&27&&t(7,u=c?"":_e.files.getURL(s,o,{thumb:"100x100",token:f}))},[s,o,r,f,c,i,a,u,l,m,h,g]}class rf extends Se{constructor(e){super(),we(this,e,LI,II,ye,{record:0,filename:1,size:2})}}function v_(n,e,t){const i=n.slice();return i[7]=e[t],i[8]=e,i[9]=t,i}function w_(n,e,t){const i=n.slice();i[7]=e[t];const l=U.toArray(i[0][i[7].name]).slice(0,5);return i[10]=l,i}function S_(n,e,t){const i=n.slice();return i[13]=e[t],i}function T_(n){let e,t;return e=new rf({props:{record:n[0],filename:n[13],size:"xs"}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[13]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function C_(n){let e=!U.isEmpty(n[13]),t,i,l=e&&T_(n);return{c(){l&&l.c(),t=ve()},m(s,o){l&&l.m(s,o),v(s,t,o),i=!0},p(s,o){o&3&&(e=!U.isEmpty(s[13])),e?l?(l.p(s,o),o&3&&M(l,1)):(l=T_(s),l.c(),M(l,1),l.m(t.parentNode,t)):l&&(re(),D(l,1,1,()=>{l=null}),ae())},i(s){i||(M(l),i=!0)},o(s){D(l),i=!1},d(s){s&&k(t),l&&l.d(s)}}}function $_(n){let e,t,i=pe(n[10]),l=[];for(let o=0;o<i.length;o+=1)l[o]=C_(S_(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=ve()},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=S_(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=C_(u),l[a].c(),M(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)M(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),dt(l,o)}}}function O_(n){let e=U.truncate(U.displayValue(n[0],[]),70)+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l&1&&e!==(e=U.truncate(U.displayValue(i[0],[]),70)+"")&&oe(t,e)},d(i){i&&k(t)}}}function AI(n){let e;return{c(){e=W(",")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function PI(n){let e=U.truncate(U.displayValue(n[0],[n[7].name]),70)+"",t;return{c(){t=W(e)},m(i,l){v(i,t,l)},p(i,l){l&5&&e!==(e=U.truncate(U.displayValue(i[0],[i[7].name]),70)+"")&&oe(t,e)},i:te,o:te,d(i){i&&k(t)}}}function NI(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 wk({props:s}),ie.push(()=>be(e,"record",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};!t&&r&5&&(t=!0,a.record=n[0].expand[n[7].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function M_(n){let e,t,i,l,s,o=n[9]>0&&AI();const r=[NI,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=$(),i.c(),l=ve()},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()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(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 RI(n){let e,t,i,l=pe(n[1]),s=[];for(let c=0;c<l.length;c+=1)s[c]=$_(w_(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]=M_(v_(n,r,c));const u=c=>D(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=O_(n)),{c(){for(let c=0;c<s.length;c+=1)s[c].c();e=$();for(let c=0;c<a.length;c+=1)a[c].c();t=ve(),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=w_(c,l,m);s[m]?(s[m].p(h,d),M(s[m],1)):(s[m]=$_(h),s[m].c(),M(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=v_(c,r,m);a[m]?(a[m].p(h,d),M(a[m],1)):(a[m]=M_(h),a[m].c(),M(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=O_(c),f.c(),f.m(t.parentNode,t))}},i(c){if(!i){for(let d=0;d<l.length;d+=1)M(s[d]);for(let d=0;d<r.length;d+=1)M(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)),dt(s,c),dt(a,c),f&&f.d(c)}}}function FI(n,e,t){let i,l;Qe(n,Mn,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 wk extends Se{constructor(e){super(),we(this,e,FI,RI,ye,{record:0})}}function qI(n){let e,t,i,l,s,o,r,a,u,f;return t=new wk({props:{record:n[0]}}),{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("a"),s=b("i"),p(s,"class","ri-external-link-line txt-sm"),p(l,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(l,"target","_blank"),p(l,"class","inline-flex link-hint"),p(l,"rel","noopener noreferrer"),p(e,"class","record-info svelte-69icne")},m(c,d){v(c,e,d),q(t,e,null),w(e,i),w(e,l),w(l,s),a=!0,u||(f=[Me(r=qe.call(null,l,{text:`Open relation record in new tab:
+`+U.truncate(JSON.stringify(U.truncateObject(E_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(l,"click",On(n[1])),Y(l,"keydown",On(n[2]))],u=!0)},p(c,[d]){const m={};d&1&&(m.record=c[0]),t.$set(m),(!a||d&1&&o!==(o="#/collections?collection="+c[0].collectionId+"&recordId="+c[0].id))&&p(l,"href",o),r&&It(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab:
+`+U.truncate(JSON.stringify(U.truncateObject(E_(c[0],"expand")),null,2),800,!0),class:"code",position:"left"})},i(c){a||(M(t.$$.fragment,c),a=!0)},o(c){D(t.$$.fragment,c),a=!1},d(c){c&&k(e),H(t),u=!1,Ie(f)}}}function E_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function HI(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 Se{constructor(e){super(),we(this,e,HI,qI,ye,{record:0})}}function D_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function I_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function A_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function jI(n){const e=n.slice(),t=U.toArray(e[3]);e[17]=t;const i=e[2]?10:500;return e[18]=i,e}function zI(n){var s,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.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 UI(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function VI(n){let e,t;return{c(){e=b("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function BI(n){let e,t=U.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=U.truncate(n[3]))},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&8&&t!==(t=U.truncate(s[3])+"")&&oe(i,t),o&8&&l!==(l=U.truncate(s[3]))&&p(e,"title",l)},i:te,o:te,d(s){s&&k(e)}}}function WI(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=D_(n,o,u),c=r(f);i.set(c,t[u]=P_(c,f))}let a=n[17].length>n[18]&&N_();return{c(){e=b("div");for(let u=0;u<t.length;u+=1)t[u].c();l=$(),a&&a.c(),p(e,"class","inline-flex"),ee(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=vt(t,f,r,1,u,o,i,e,Bt,P_,l,D_),ae()),u[17].length>u[18]?a||(a=N_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&ee(e,"multiple",u[1].maxSelect!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)M(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 YI(n){let e,t,i,l,s;const o=[iL,nL],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]&&q_();return{c(){e=b("div"),i.c(),l=$(),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()),M(i,1),i.m(e,l)),f[10].length>f[12]?u||(u=q_(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function KI(n){let e,t=[],i=new Map,l=pe(U.toArray(n[3]));const s=o=>o[9]+o[7];for(let o=0;o<l.length;o+=1){let r=A_(n,l,o),a=s(r);i.set(a,t[o]=H_(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(U.toArray(o[3])),t=vt(t,r,s,1,o,l,i,e,di,H_,null,A_))},i:te,o:te,d(o){o&&k(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function JI(n){let e,t;return e=new gI({props:{date:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZI(n){let e,t,i,l;const s=[sL,lL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function GI(n){let e,t=U.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){v(o,e,r),w(e,i),l||(s=[Me(qe.call(null,e,"Open in new tab")),Y(e,"click",On(n[5]))],l=!0)},p(o,r){r&8&&t!==(t=U.truncate(o[3])+"")&&oe(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&k(e),l=!1,Ie(s)}}}function XI(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,l){v(i,e,l),w(e,t)},p(i,l){l&8&&oe(t,i[3])},i:te,o:te,d(i){i&&k(e)}}}function QI(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","label"),ee(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")&&oe(i,t),s&8&&ee(e,"label-success",!!l[3])},i:te,o:te,d(l){l&&k(e)}}}function xI(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 eL(n){let e,t,i,l;const s=[rL,oL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function tL(n){let e,t,i,l,s,o,r,a;t=new Ci({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&z_();return{c(){e=b("div"),j(t.$$.fragment),i=$(),l=b("div"),s=W(n[3]),o=$(),u&&u.c(),r=ve(),p(l,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){v(f,e,c),q(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)&&oe(s,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=z_(),u.c(),u.m(r.parentNode,r)):u&&(u.d(1),u=null)},i(f){a||(M(t.$$.fragment,f),a=!0)},o(f){D(t.$$.fragment,f),a=!1},d(f){f&&(k(e),k(o),k(r)),H(t),u&&u.d(f)}}}function P_(n,e){let t,i,l;return i=new rf({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(i,s)}}}function N_(n){let e;return{c(){e=W("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function nL(n){let e,t=pe(n[10].slice(0,n[12])),i=[];for(let l=0;l<t.length;l+=1)i[l]=R_(I_(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=I_(l,t,o);i[o]?i[o].p(r,s):(i[o]=R_(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),dt(i,l)}}}function iL(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=L_(n,s,r),u=o(a);t.set(u,e[r]=F_(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ve()},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=vt(e,a,o,1,r,s,t,i.parentNode,Bt,F_,i,L_),ae())},i(r){if(!l){for(let a=0;a<s.length;a+=1)M(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 R_(n){let e,t=n[14]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","label")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&12&&t!==(t=l[14]+"")&&oe(i,t)},d(l){l&&k(e)}}}function F_(n,e){let t,i,l,s;return i=new Ur({props:{record:e[7]}}),{key:n,first:null,c(){t=b("span"),j(i.$$.fragment),l=$(),p(t,"class","label"),this.first=t},m(o,r){v(o,t,r),q(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||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function q_(n){let e;return{c(){e=W("...")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function H_(n,e){let t,i=e[7]+"",l;return{key:n,first:null,c(){t=b("span"),l=W(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]+"")&&oe(l,i)},d(s){s&&k(t)}}}function lL(n){let e,t;return e=new Ou({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(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sL(n){let e,t=U.truncate(U.plainText(n[3]),195)+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=U.truncate(U.plainText(l[3]),195)+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function oL(n){let e,t=U.truncate(n[6],500,!0)+"",i,l,s,o,r=n[6].length>500&&j_(n);return{c(){e=b("span"),i=W(t),l=$(),r&&r.c(),s=ve(),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=U.truncate(a[6],500,!0)+"")&&oe(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=j_(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(re(),D(r,1,1,()=>{r=null}),ae())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(k(e),k(l),k(s)),r&&r.d(a)}}}function rL(n){let e,t=U.truncate(n[6])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(l,s){v(l,e,s),w(e,i)},p(l,s){s&8&&t!==(t=U.truncate(l[6])+"")&&oe(i,t)},i:te,o:te,d(l){l&&k(e)}}}function j_(n){let e,t;return e=new Ci({props:{value:JSON.stringify(n[3],null,2)}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function z_(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 aL(n){let e,t,i,l,s;const o=[tL,eL,xI,QI,XI,GI,ZI,JI,KI,YI,WI,BI,VI],r=[];function a(f,c){return c&8&&(e=null),f[1].primaryKey?0:f[1].type==="json"?1:(e==null&&(e=!!U.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?UI(f):c===9?zI(f):c===10?jI(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ve()},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()),M(i,1),i.m(l.parentNode,l))},i(f){s||(M(i),s=!0)},o(f){D(i),s=!1},d(f){f&&k(l),r[t].d(f)}}}function uL(n,e,t){let i,l;Qe(n,Rr,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 Sk extends Se{constructor(e){super(),we(this,e,uL,aL,ye,{record:0,field:1,short:2})}}function U_(n,e,t){const i=n.slice();return i[13]=e[t],i}function V_(n){let e,t,i=n[13].name+"",l,s,o,r,a,u;return r=new Sk({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=W(i),s=$(),o=b("td"),j(r.$$.fragment),a=$(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){v(f,e,c),w(e,t),w(t,l),w(e,s),w(e,o),q(r,o,null),w(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&oe(l,i);const d={};c&1&&(d.field=f[13]),c&8&&(d.record=f[3]),r.$set(d)},i(f){u||(M(r.$$.fragment,f),u=!0)},o(f){D(r.$$.fragment,f),u=!1},d(f){f&&k(e),H(r)}}}function fL(n){var r;let e,t,i,l=pe((r=n[0])==null?void 0:r.fields),s=[];for(let a=0;a<l.length;a+=1)s[a]=V_(U_(n,l,a));const o=a=>D(s[a],1,1,()=>{s[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;a<s.length;a+=1)s[a].c();p(e,"class","table-border preview-table"),ee(e,"table-loading",n[4])},m(a,u){v(a,e,u),w(e,t);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(t,null);i=!0},p(a,u){var f;if(u&9){l=pe((f=a[0])==null?void 0:f.fields);let c;for(c=0;c<l.length;c+=1){const d=U_(a,l,c);s[c]?(s[c].p(d,u),M(s[c],1)):(s[c]=V_(d),s[c].c(),M(s[c],1),s[c].m(t,null))}for(re(),c=l.length;c<s.length;c+=1)o(c);ae()}(!i||u&16)&&ee(e,"table-loading",a[4])},i(a){if(!i){for(let u=0;u<l.length;u+=1)M(s[u]);i=!0}},o(a){s=s.filter(Boolean);for(let u=0;u<s.length;u+=1)D(s[u]);i=!1},d(a){a&&k(e),dt(s,a)}}}function cL(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=W(i),s=W(" 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)+"")&&oe(l,i)},d(r){r&&k(e)}}}function dL(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=Y(e,"click",n[7]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function pL(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[dL],header:[cL],default:[fL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[8](null),H(e,l)}}}function mL(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 _e.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 hL extends Se{constructor(e){super(),we(this,e,mL,pL,ye,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function _L(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=qe.call(null,e,{text:n[0].join(`
 `),position:"left"})),i=!0)},p(s,[o]){t&&It(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 hL="yyyy-MM-dd HH:mm:ss.SSS";function _L(n,e,t){let i,l;Qe(n,Mn,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+": "+U.formatToLocalDate(s[u.name],hL)+" 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 gL extends Se{constructor(e){super(),we(this,e,_L,mL,ye,{record:1})}}function V_(n,e,t){const i=n.slice();return i[9]=e[t],i}function bL(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 yL(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=B_(V_(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=V_(l,t,o);i[o]?i[o].p(r,s):(i[o]=B_(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),dt(i,l)}}}function kL(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 B_(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 C(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=$(),o=b("span"),a=W(r),u=$(),f=b("div"),c=W("ID: "),m=W(d),h=$(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=$(),bn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,g),w(e,_),y||(S=Y(g,"click",C),y=!0)},p(T,O){var E;n=T,O&2&&!bn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),O&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&k(e),y=!1,S()}}}function vL(n){let e;function t(s,o){var r;return s[2]?kL:(r=s[0])!=null&&r.id&&s[1].length?yL:bL}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 wL(n,e,t){const i=yt();let{record:l}=e,s=[],o=!1;function r(d){return tf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||U.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 _e.collection("_externalAuths").getFullList({filter:_e.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){_e.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||_n(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>_e.collection("_externalAuths").delete(d.id).then(()=>{tn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{_e.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 SL extends Se{constructor(e){super(),we(this,e,wL,vL,ye,{record:0})}}function TL(n){let e,t,i,l,s,o,r,a,u,f;return s=new Ci({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=$(),j(s.$$.fragment),o=$(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Me(qe.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),H(s),u=!1,Ie(f)}}}function CL(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:[TL]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){v(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Me(r=qe.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],Ce(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&It(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&k(e),H(l),u=!1,f()}}}function $L(n,e,t){const i=yt();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=U.randomSecret(s)),i("generate",o),await dn(),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 OL extends Se{constructor(e){super(),we(this,e,$L,CL,ye,{class:0,length:5})}}function W_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=W("Public: "),o=W(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Me(qe.call(null,t,{text:"Make email public or private",position:"top-right"})),Y(t,"click",nt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&oe(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,Ie(u)}}}function ML(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&W_(n);return{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="email",o=$(),m&&m.c(),r=$(),a=b("input"),p(t,"class",U.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),he(a,n[0].email),n[1]&&a.focus(),c||(d=Y(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=W_(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&&he(a,h[0].email)},d(h){h&&(k(e),k(o),k(r),k(a)),m&&m.d(h),c=!1,d()}}}function Y_(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[EL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function EL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 K_(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[DL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[IL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),ee(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&ee(t,"p-t-xs",f[2])},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(l),H(r),f&&a&&a.end()}}}function DL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new OL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="Password",o=$(),r=b("input"),u=$(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),he(r,n[0].password),v(g,u,_),v(g,f,_),q(c,f,null),d=!0,m||(h=Y(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&&he(r,g[0].password);const y={};_&8&&(y.length=Math.max(15,g[3].min||0)),c.$set(y)},i(g){d||(M(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)),H(c),m=!1,h()}}}function IL(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="Password confirm",o=$(),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),he(r,n[0].passwordConfirm),u||(f=Y(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&&he(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 ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[LL,({uniqueId:l})=>({14:l}),({uniqueId:l})=>l?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function LL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[Y(e,"change",n[12]),Y(e,"change",nt(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,Ie(a)}}}function AL(n){var d;let e,t,i,l,s,o,r,a;i=new ce({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[ML,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&Y_(n),f=(n[1]||n[2])&&K_(n),c=!n[5]&&J_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),u&&u.c(),o=$(),f&&f.c(),r=$(),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),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var _;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&&M(u,1)):(u=Y_(m),u.c(),M(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&M(f,1)):(f=K_(m),f.c(),M(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&&M(c,1)):(c=J_(m),c.c(),M(c,1),c.m(e,null))},i(m){a||(M(i.$$.fragment,m),M(u),M(f),M(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&k(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function PL(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||_n("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(C=>C.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find(C=>C.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Yn("password"),Yn("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class NL extends Se{constructor(e){super(),we(this,e,PL,AL,ye,{record:0,collection:6,isNew:1})}}function Z_(n){let e;function t(s,o){return s[1].primaryKey?FL:RL}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 RL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=U.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function FL(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function G_(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 qL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&Z_(n),f=n[1].hidden&&G_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=$(),i=b("span"),s=W(l),o=$(),f&&f.c(),r=$(),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+"")&&oe(s,l),m[1].hidden?f||(f=G_(),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||(M(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 HL(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 ii extends Se{constructor(e){super(),we(this,e,HL,qL,ye,{uniqueId:0,field:1,icon:2})}}function jL(n){let e,t,i,l,s,o,r;return l=new ii({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=$(),j(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),q(l,a,u),s=!0,o||(r=Y(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),H(l,a),o=!1,r()}}}function zL(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UL(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 VL extends Se{constructor(e){super(),we(this,e,UL,zL,ye,{field:1,value:0})}}function X_(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(qe.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:te,d(s){s&&k(e),i=!1,Ie(l)}}}function BL(n){let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&X_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new nf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=$(),a&&a.c(),i=$(),j(l.$$.fragment)},m(d,m){q(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=X_(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],Ce(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],Ce(()=>o=!1)),l.$set(g)},i(d){r||(M(e.$$.fragment,d),M(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(k(t),k(i)),H(e,d),a&&a.d(d),H(l,d)}}}function WL(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YL(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 KL extends Se{constructor(e){super(),we(this,e,YL,WL,ye,{field:1,value:0})}}function Q_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function x_(n,e,t){const i=n.slice();return i[48]=e[t],i}function eg(n,e,t){const i=n.slice();return i[51]=e[t],i}function JL(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,g,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let C=eg(n,_,S),T=y(C);l.set(T,i[S]=tg(T,C))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Nu({props:{class:"files-list",vThreshold:100,$$slots:{default:[eA]},$$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=$(),o=b("div"),r=b("div"),j(a.$$.fragment),u=$(),f=b("button"),f.innerHTML='<div class="txt">New record</div>',c=$(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,C){v(S,e,C),w(e,t);for(let T=0;T<i.length;T+=1)i[T]&&i[T].m(t,null);w(e,s),w(e,o),w(o,r),q(a,r,null),w(r,u),w(r,f),w(o,c),q(d,o,null),m=!0,h||(g=Y(f,"click",n[31]),h=!0)},p(S,C){C[0]&384&&(_=pe(S[7]),i=vt(i,C,y,1,S,_,l,t,di,tg,null,eg));const T={};C[0]&16&&(T.value=S[4]),C[0]&256&&(T.autocompleteCollection=S[8]),a.$set(T);const O={};C[0]&98416|C[1]&8388608&&(O.$$scope={dirty:C,ctx:S}),d.$set(O)},i(S){m||(M(a.$$.fragment,S),M(d.$$.fragment,S),m=!0)},o(S){D(a.$$.fragment,S),D(d.$$.fragment,S),m=!1},d(S){S&&k(e);for(let C=0;C<i.length;C+=1)i[C].d();H(a),H(d),h=!1,g()}}}function ZL(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 tg(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=W(i),s=$(),p(t,"type","button"),p(t,"class","sidebar-item"),ee(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=Y(t,"click",nt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),f[0]&384&&ee(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function GL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&ng(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=$(),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=ng(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function XL(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=Q_(n,l,o),a=s(r);t.set(a,e[o]=lg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,lg,i,Q_))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function ng(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=Y(e,"click",nt(n[17])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function QL(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 xL(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),bn(e.src,t=_e.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&&!bn(e.src,t=_e.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 ig(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!U.hasImageExtension(f[48])),t?xL:QL}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=$(),p(e,"type","button"),p(e,"class","thumb handle"),ee(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=qe.call(null,e,n[48]+`
+`),position:"left"})},i:te,o:te,d(s){s&&k(e),i=!1,l()}}}const gL="yyyy-MM-dd HH:mm:ss.SSS";function bL(n,e,t){let i,l;Qe(n,Mn,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+": "+U.formatToLocalDate(s[u.name],gL)+" 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 yL extends Se{constructor(e){super(),we(this,e,bL,_L,ye,{record:1})}}function B_(n,e,t){const i=n.slice();return i[9]=e[t],i}function kL(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 vL(n){let e,t=pe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=W_(B_(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=B_(l,t,o);i[o]?i[o].p(r,s):(i[o]=W_(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),dt(i,l)}}}function wL(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 W_(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 C(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=$(),o=b("span"),a=W(r),u=$(),f=b("div"),c=W("ID: "),m=W(d),h=$(),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=$(),bn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(e,s),w(e,o),w(o,a),w(e,u),w(e,f),w(f,c),w(f,m),w(e,h),w(e,g),w(e,_),y||(S=Y(g,"click",C),y=!0)},p(T,O){var E;n=T,O&2&&!bn(i.src,l="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",l),O&2&&r!==(r=n[4](n[9].provider)+"")&&oe(a,r),O&2&&d!==(d=n[9].providerId+"")&&oe(m,d)},d(T){T&&k(e),y=!1,S()}}}function SL(n){let e;function t(s,o){var r;return s[2]?wL:(r=s[0])!=null&&r.id&&s[1].length?vL:kL}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 TL(n,e,t){const i=yt();let{record:l}=e,s=[],o=!1;function r(d){return nf.find(m=>m.key==d)||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||U.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 _e.collection("_externalAuths").getFullList({filter:_e.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:l.collectionId,recordId:l.id})}))}catch(d){_e.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||_n(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>_e.collection("_externalAuths").delete(d.id).then(()=>{tn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{_e.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 CL extends Se{constructor(e){super(),we(this,e,TL,SL,ye,{record:0})}}function $L(n){let e,t,i,l,s,o,r,a,u,f;return s=new Ci({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),l=$(),j(s.$$.fragment),o=$(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){v(c,e,d),w(e,t),w(t,i),n[6](t),w(e,l),q(s,e,null),w(e,o),w(e,r),a=!0,u||(f=[Me(qe.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&oe(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(M(s.$$.fragment,c),a=!0)},o(c){D(s.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),H(s),u=!1,Ie(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:[$L]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new jn({props:d}),ie.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){v(m,e,h),w(e,t),w(e,i),q(l,e,null),a=!0,u||(f=Me(r=qe.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],Ce(()=>s=!1)),l.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&It(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(l.$$.fragment,m),a=!0)},o(m){D(l.$$.fragment,m),a=!1},d(m){m&&k(e),H(l),u=!1,f()}}}function ML(n,e,t){const i=yt();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=U.randomSecret(s)),i("generate",o),await dn(),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 EL extends Se{constructor(e){super(),we(this,e,ML,OL,ye,{class:0,length:5})}}function Y_(n){let e,t,i,l,s=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),l=W("Public: "),o=W(s),p(i,"class","txt"),p(t,"type","button"),p(t,"class",r="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(e,"class","form-field-addon email-visibility-addon svelte-1751a4d")},m(f,c){v(f,e,c),w(e,t),w(t,i),w(i,l),w(i,o),a||(u=[Me(qe.call(null,t,{text:"Make email public or private",position:"top-right"})),Y(t,"click",nt(n[7]))],a=!0)},p(f,c){c&1&&s!==(s=f[0].emailVisibility?"On":"Off")&&oe(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,Ie(u)}}}function DL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=!n[5]&&Y_(n);return{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="email",o=$(),m&&m.c(),r=$(),a=b("input"),p(t,"class",U.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),he(a,n[0].email),n[1]&&a.focus(),c||(d=Y(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=Y_(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&&he(a,h[0].email)},d(h){h&&(k(e),k(o),k(r),k(a)),m&&m.d(h),c=!1,d()}}}function K_(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[IL,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&49156&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 J_(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[LL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[AL,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),ee(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&ee(t,"p-t-xs",f[2])},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(l),H(r),f&&a&&a.end()}}}function LL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new EL({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="Password",o=$(),r=b("input"),u=$(),f=b("div"),j(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){v(g,e,_),w(e,t),w(e,i),w(e,l),v(g,o,_),v(g,r,_),he(r,n[0].password),v(g,u,_),v(g,f,_),q(c,f,null),d=!0,m||(h=Y(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&&he(r,g[0].password);const y={};_&8&&(y.length=Math.max(15,g[3].min||0)),c.$set(y)},i(g){d||(M(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)),H(c),m=!1,h()}}}function AL(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="Password confirm",o=$(),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),he(r,n[0].passwordConfirm),u||(f=Y(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&&he(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function Z_(n){let e,t,i;return t=new ce({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"),j(t.$$.fragment),p(e,"class","col-lg-12")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s&49155&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function PL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(l,"for",o=n[14])},m(u,f){v(u,e,f),e.checked=n[0].verified,v(u,i,f),v(u,l,f),w(l,s),r||(a=[Y(e,"change",n[12]),Y(e,"change",nt(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,Ie(a)}}}function NL(n){var d;let e,t,i,l,s,o,r,a;i=new ce({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[DL,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&K_(n),f=(n[1]||n[2])&&J_(n),c=!n[5]&&Z_(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),u&&u.c(),o=$(),f&&f.c(),r=$(),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),q(i,t,null),w(e,l),w(e,s),u&&u.m(s,null),w(s,o),f&&f.m(s,null),w(e,r),c&&c.m(e,null),a=!0},p(m,[h]){var _;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&&M(u,1)):(u=K_(m),u.c(),M(u,1),u.m(s,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&M(f,1)):(f=J_(m),f.c(),M(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&&M(c,1)):(c=Z_(m),c.c(),M(c,1),c.m(e,null))},i(m){a||(M(i.$$.fragment,m),M(u),M(f),M(c),a=!0)},o(m){D(i.$$.fragment,m),D(u),D(f),D(c),a=!1},d(m){m&&k(e),H(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function RL(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||_n("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(C=>C.name=="email"))||{}),n.$$.dirty&64&&t(3,s=((S=r==null?void 0:r.fields)==null?void 0:S.find(C=>C.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Yn("password"),Yn("passwordConfirm")))},[o,a,u,s,l,i,r,f,c,d,m,h,g,_]}class FL extends Se{constructor(e){super(),we(this,e,RL,NL,ye,{record:0,collection:6,isNew:1})}}function G_(n){let e;function t(s,o){return s[1].primaryKey?HL:qL}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 qL(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[1].type))},m(i,l){v(i,e,l)},p(i,l){l&2&&t!==(t=U.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function HL(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function X_(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 jL(n){let e,t,i,l=n[1].name+"",s,o,r,a,u=n[2]&&G_(n),f=n[1].hidden&&X_();const c=n[4].default,d=Lt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=$(),i=b("span"),s=W(l),o=$(),f&&f.c(),r=$(),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=G_(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&l!==(l=m[1].name+"")&&oe(s,l),m[1].hidden?f||(f=X_(),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||(M(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 zL(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 ii extends Se{constructor(e){super(),we(this,e,zL,jL,ye,{uniqueId:0,field:1,icon:2})}}function UL(n){let e,t,i,l,s,o,r;return l=new ii({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=$(),j(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),q(l,a,u),s=!0,o||(r=Y(e,"change",n[2]),o=!0)},p(a,u){(!s||u&8&&t!==(t=a[3]))&&p(e,"id",t),u&1&&(e.checked=a[0]);const f={};u&8&&(f.uniqueId=a[3]),u&2&&(f.field=a[1]),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(i)),H(l,a),o=!1,r()}}}function VL(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[UL,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function BL(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 WL extends Se{constructor(e){super(),we(this,e,BL,VL,ye,{field:1,value:0})}}function Q_(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(qe.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:te,d(s){s&&k(e),i=!1,Ie(l)}}}function YL(n){let e,t,i,l,s,o,r;e=new ii({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&Q_(n);function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[8],options:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0]!==void 0&&(c.formattedValue=n[0]),l=new lf({props:c}),ie.push(()=>be(l,"value",u)),ie.push(()=>be(l,"formattedValue",f)),l.$on("close",n[3]),{c(){j(e.$$.fragment),t=$(),a&&a.c(),i=$(),j(l.$$.fragment)},m(d,m){q(e,d,m),v(d,t,m),a&&a.m(d,m),v(d,i,m),q(l,d,m),r=!0},p(d,m){const h={};m&256&&(h.uniqueId=d[8]),m&2&&(h.field=d[1]),e.$set(h),d[0]&&!d[1].required?a?a.p(d,m):(a=Q_(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],Ce(()=>s=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],Ce(()=>o=!1)),l.$set(g)},i(d){r||(M(e.$$.fragment,d),M(l.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(l.$$.fragment,d),r=!1},d(d){d&&(k(t),k(i)),H(e,d),a&&a.d(d),H(l,d)}}}function KL(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[YL,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JL(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class ZL extends Se{constructor(e){super(),we(this,e,JL,KL,ye,{field:1,value:0})}}function x_(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function eg(n,e,t){const i=n.slice();return i[48]=e[t],i}function tg(n,e,t){const i=n.slice();return i[51]=e[t],i}function GL(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 C=tg(n,_,S),T=y(C);l.set(T,i[S]=ng(T,C))}return a=new Hr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Ru({props:{class:"files-list",vThreshold:100,$$slots:{default:[nA]},$$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=$(),o=b("div"),r=b("div"),j(a.$$.fragment),u=$(),f=b("button"),f.innerHTML='<div class="txt">New record</div>',c=$(),j(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,C){v(S,e,C),w(e,t);for(let T=0;T<i.length;T+=1)i[T]&&i[T].m(t,null);w(e,s),w(e,o),w(o,r),q(a,r,null),w(r,u),w(r,f),w(o,c),q(d,o,null),m=!0,h||(g=Y(f,"click",n[31]),h=!0)},p(S,C){C[0]&384&&(_=pe(S[7]),i=vt(i,C,y,1,S,_,l,t,di,ng,null,tg));const T={};C[0]&16&&(T.value=S[4]),C[0]&256&&(T.autocompleteCollection=S[8]),a.$set(T);const O={};C[0]&98416|C[1]&8388608&&(O.$$scope={dirty:C,ctx:S}),d.$set(O)},i(S){m||(M(a.$$.fragment,S),M(d.$$.fragment,S),m=!0)},o(S){D(a.$$.fragment,S),D(d.$$.fragment,S),m=!1},d(S){S&&k(e);for(let C=0;C<i.length;C+=1)i[C].d();H(a),H(d),h=!1,g()}}}function XL(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 ng(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=W(i),s=$(),p(t,"type","button"),p(t,"class","sidebar-item"),ee(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=Y(t,"click",nt(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&oe(l,i),f[0]&384&&ee(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function QL(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&ig(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=$(),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=ig(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function xL(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=x_(n,l,o),a=s(r);t.set(a,e[o]=sg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,sg,i,x_))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function ig(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=Y(e,"click",nt(n[17])),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function eA(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 tA(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),bn(e.src,t=_e.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&&!bn(e.src,t=_e.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 lg(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!U.hasImageExtension(f[48])),t?tA:eA}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=$(),p(e,"type","button"),p(e,"class","thumb handle"),ee(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=qe.call(null,e,n[48]+`
 (record: `+n[44].id+")")),Y(e,"click",nt(function(){It(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&&It(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
-(record: `+n[44].id+")"),c[0]&589856&&ee(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),s=!1,Ie(o)}}}function lg(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=ig(x_(e,l,o));return{key:n,first:null,c(){t=ve();for(let o=0;o<s.length;o+=1)s[o].c();i=ve(),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=x_(e,l,a);s[a]?s[a].p(u,r):(s[a]=ig(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)),dt(s,o)}}}function sg(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 eA(n){let e,t;function i(r,a){if(r[15])return XL;if(!r[6])return GL}let l=i(n),s=l&&l(n),o=n[6]&&sg();return{c(){s&&s.c(),e=$(),o&&o.c(),t=ve()},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=sg(),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 tA(n){let e,t,i,l;const s=[ZL,JL],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function nA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&k(e)}}}function og(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[iA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function iA(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function lA(n){var h;let e,t,i,l=U.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&og(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),m&&m.c(),s=$(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){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=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var y;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=U.hasImageExtension((y=g[9])==null?void 0:y.name)),l?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=og(g),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(M(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,Ie(d)}}}function sA(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[lA],header:[nA],default:[tA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new Xt({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(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?wt(s,[s[0],s[1],Rt(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||(M(e.$$.fragment,a),M(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),H(e,a),n[36](null),H(i,a)}}}const rg=50;function oA(n,e,t){let i,l,s,o;const r=["title","submitText","fileTypes","show","hide"];let a=lt(e,r),u;Qe(n,Mn,Ve=>t(27,u=Ve));const f=yt(),c="file_picker_"+U.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,y="",S=[],C=1,T=0,O=!1,E=[],L=[],I=[],A={},P={},N="";function R(){return J(!0),g==null?void 0:g.show()}function z(){return g==null?void 0:g.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function B(){t(4,y="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,O=!0),Ve&&F();try{const Ee=Ve?1:C+1,st=U.getAllCollectionIdentifiers(A);let De=U.normalizeSearchFilter(y,st)||"";De&&(De+=" && "),De+="("+L.map($e=>`${$e.name}:length>0`).join("||")+")";let Ye="";A.type!="view"&&(Ye="-@rowid");const ke=await _e.collection(A.id).getList(Ee,rg,{filter:De,sort:Ye,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=U.filterDuplicatesByKey(S.concat(ke.items))),C=ke.page,t(26,T=ke.items.length),t(6,O=!1)}catch(Ee){Ee.isAbort||(_e.error(Ee),t(6,O=!1))}}}function V(){var Ee;let Ve=["100x100"];if((Ee=P==null?void 0:P.record)!=null&&Ee.id){for(const st of L)if(U.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(U.toArray(st.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const st of Ve)I.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function Z(Ve){let Ee=[];for(const st of L){const De=U.toArray(Ve[st.name]);for(const Ye of De)h.includes(U.getFileType(Ye))&&Ee.push(Ye)}return Ee}function G(Ve,Ee){t(9,P={record:Ve,name:Ee})}function de(){o&&(f("submit",Object.assign({size:N},P)),z())}function fe(Ve){N=Ve,t(12,N)}const ue=Ve=>{t(8,A=Ve)},Te=Ve=>t(4,y=Ve.detail),Ke=()=>_==null?void 0:_.show(),Je=()=>{s&&J()};function ft(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(3,g)})}function et(Ve){Pe.call(this,n,Ve)}function xe(Ve){Pe.call(this,n,Ve)}function We(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(10,_)})}const at=Ve=>{U.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Ee=Z(Ve.detail.record);Ee.length>0&&G(Ve.detail.record,Ee[0])},jt=Ve=>{var Ee;((Ee=P==null?void 0:P.record)==null?void 0:Ee.id)==Ve.detail.id&&t(9,P={}),U.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=je(je({},e),Wt(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,E=u.filter(Ee=>Ee.type!=="view"&&!!U.toArray(Ee.fields).find(st=>{var De,Ye;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Ye=st.mimeTypes)!=null&&Ye.find(ke=>ke.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Ee=>Ee.type==="file"&&!Ee.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(B(),V()),n.$$.dirty[0]&512&&P!=null&&P.name&&V(),n.$$.dirty[0]&280&&typeof y<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Ee,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Ee.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ee=>Z(Ee).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!O&&T==rg),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,g,y,S,O,E,A,P,_,I,N,o,s,l,i,B,J,Z,G,de,a,c,h,R,T,u,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt]}class rA extends Se{constructor(e){super(),we(this,e,oA,sA,ye,{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 aA(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 uA(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 $u({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function fA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[11],field:n[1]}});const r=[uA,aA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=$(),l.c(),s=ve()},m(f,c){q(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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),H(e,f),a[i].d(f)}}}function cA(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[fA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new rA({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[8](null),H(i,o)}}}function dA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;ln(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,_e.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(U.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 pA extends Se{constructor(e){super(),we(this,e,dA,cA,ye,{field:1,value:0})}}function mA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function hA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[mA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _A(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 gA extends Se{constructor(e){super(),we(this,e,_A,hA,ye,{field:1,value:0})}}function bA(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 yA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),bn(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&&!bn(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 kA(n){let e;function t(s,o){return s[2]?yA:bA}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 vA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){U.hasImageExtension(l==null?void 0:l.name)?U.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 wA extends Se{constructor(e){super(),we(this,e,vA,kA,ye,{file:0,size:1})}}function ag(n,e,t){const i=n.slice();return i[31]=e[t],i[33]=t,i}function ug(n,e,t){const i=n.slice();i[36]=e[t],i[33]=t;const l=i[2].includes(i[36]);return i[37]=l,i}function SA(n){let e,t,i;function l(){return n[19](n[36])}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(qe.call(null,e,"Remove file")),Y(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function TA(n){let e,t,i;function l(){return n[18](n[36])}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=Y(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,i()}}}function CA(n){let e,t,i,l,s,o,r=n[36]+"",a,u,f,c,d,m,h;i=new of({props:{record:n[3],filename:n[36]}});function g(){return n[16](n[36])}function _(){return n[17](n[36])}function y(T,O){return T[37]?TA:SA}let S=y(n),C=S(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("button"),a=W(r),f=$(),c=b("div"),C.c(),ee(t,"fade",n[37]),p(o,"type","button"),p(o,"draggable",!1),p(o,"class",u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")),p(o,"title","Download"),p(s,"class","content"),p(c,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[34]),ee(e,"dragover",n[35])},m(T,O){v(T,e,O),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,f),w(e,c),C.m(c,null),d=!0,m||(h=[Y(o,"auxclick",g),Y(o,"click",_)],m=!0)},p(T,O){n=T;const E={};O[0]&8&&(E.record=n[3]),O[0]&32&&(E.filename=n[36]),i.$set(E),(!d||O[0]&36)&&ee(t,"fade",n[37]),(!d||O[0]&32)&&r!==(r=n[36]+"")&&oe(a,r),(!d||O[0]&36&&u!==(u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")))&&p(o,"class",u),S===(S=y(n))&&C?C.p(n,O):(C.d(1),C=S(n),C&&(C.c(),C.m(c,null))),(!d||O[1]&8)&&ee(e,"dragging",n[34]),(!d||O[1]&16)&&ee(e,"dragover",n[35])},i(T){d||(M(i.$$.fragment,T),d=!0)},o(T){D(i.$$.fragment,T),d=!1},d(T){T&&k(e),H(i),C.d(),m=!1,Ie(h)}}}function fg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_uploaded",index:e[33],disabled:!e[6],$$slots:{default:[CA,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&44|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function $A(n){let e,t,i,l,s,o,r,a,u=n[31].name+"",f,c,d,m,h,g,_;i=new wA({props:{file:n[31]}});function y(){return n[21](n[33])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=$(),s=b("div"),o=b("small"),o.textContent="New",r=$(),a=b("span"),f=W(u),d=$(),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[31].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),ee(e,"dragging",n[34]),ee(e,"dragover",n[35])},m(S,C){v(S,e,C),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,g||(_=[Me(qe.call(null,m,"Remove file")),Y(m,"click",y)],g=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[31]),i.$set(T),(!h||C[0]&2)&&u!==(u=n[31].name+"")&&oe(f,u),(!h||C[0]&2&&c!==(c=n[31].name))&&p(s,"title",c),(!h||C[1]&8)&&ee(e,"dragging",n[34]),(!h||C[1]&16)&&ee(e,"dragover",n[35])},i(S){h||(M(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&k(e),H(i),g=!1,Ie(_)}}}function cg(n,e){let t,i,l,s;function o(a){e[22](a)}let r={group:e[4].name+"_new",index:e[33],disabled:!e[6],$$slots:{default:[$A,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function OA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,y,S,C,T;e=new ii({props:{uniqueId:n[30],field:n[4]}});let O=pe(n[5]);const E=A=>A[36]+A[3].id;for(let A=0;A<O.length;A+=1){let P=ug(n,O,A),N=E(P);s.set(N,l[A]=fg(N,P))}let L=pe(n[1]);const I=A=>A[31].name+A[33];for(let A=0;A<L.length;A+=1){let P=ag(n,L,A),N=I(P);a.set(N,r[A]=cg(N,P))}return{c(){var A;j(e.$$.fragment),t=$(),i=b("div");for(let P=0;P<l.length;P+=1)l[P].c();o=$();for(let P=0;P<r.length;P+=1)r[P].c();u=$(),f=b("div"),c=b("input"),m=$(),h=b("button"),g=b("i"),_=$(),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[10],p(f,"class","list-item list-item-btn"),p(i,"class","list")},m(A,P){q(e,A,P),v(A,t,P),v(A,i,P);for(let N=0;N<l.length;N+=1)l[N]&&l[N].m(i,null);w(i,o);for(let N=0;N<r.length;N+=1)r[N]&&r[N].m(i,null);w(i,u),w(i,f),w(f,c),n[23](c),w(f,m),w(f,h),w(h,g),w(h,_),w(h,y),n[26](i),S=!0,C||(T=[Y(c,"change",n[24]),Y(h,"click",n[25])],C=!0)},p(A,P){var R;const N={};P[0]&1073741824&&(N.uniqueId=A[30]),P[0]&16&&(N.field=A[4]),e.$set(N),P[0]&39037|P[1]&24&&(O=pe(A[5]),re(),l=vt(l,P,E,1,A,O,s,i,Bt,fg,o,ug),ae()),P[0]&8274|P[1]&24&&(L=pe(A[1]),re(),r=vt(r,P,I,1,A,L,a,i,Bt,cg,u,ag),ae()),(!S||P[0]&16&&d!==(d=((R=A[4].mimeTypes)==null?void 0:R.join(","))||null))&&p(c,"accept",d),(!S||P[0]&64)&&(c.multiple=A[6]),(!S||P[0]&1024)&&(h.disabled=A[10])},i(A){if(!S){M(e.$$.fragment,A);for(let P=0;P<O.length;P+=1)M(l[P]);for(let P=0;P<L.length;P+=1)M(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)),H(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[23](null),n[26](null),C=!1,Ie(T)}}}function MA(n){let e,t,i,l,s;return t=new ce({props:{class:`
+(record: `+n[44].id+")"),c[0]&589856&&ee(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),s=!1,Ie(o)}}}function sg(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=lg(eg(e,l,o));return{key:n,first:null,c(){t=ve();for(let o=0;o<s.length;o+=1)s[o].c();i=ve(),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=eg(e,l,a);s[a]?s[a].p(u,r):(s[a]=lg(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)),dt(s,o)}}}function og(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 nA(n){let e,t;function i(r,a){if(r[15])return xL;if(!r[6])return QL}let l=i(n),s=l&&l(n),o=n[6]&&og();return{c(){s&&s.c(),e=$(),o&&o.c(),t=ve()},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=og(),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 iA(n){let e,t,i,l;const s=[XL,GL],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=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function lA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,l){v(i,e,l),w(e,t)},p(i,l){l[0]&1&&oe(t,i[0])},d(i){i&&k(e)}}}function rg(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[sA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function sA(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 zn({props:s}),ie.push(()=>be(e,"keyOfSelected",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function oA(n){var h;let e,t,i,l=U.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&rg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),m&&m.c(),s=$(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){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=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var y;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(l=U.hasImageExtension((y=g[9])==null?void 0:y.name)),l?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=rg(g),m.c(),M(m,1),m.m(s.parentNode,s)):m&&(re(),D(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&oe(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(M(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,Ie(d)}}}function rA(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[oA],header:[lA],default:[iA]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new Xt({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new af({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?wt(s,[s[0],s[1],Rt(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||(M(e.$$.fragment,a),M(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),H(e,a),n[36](null),H(i,a)}}}const ag=50;function aA(n,e,t){let i,l,s,o;const r=["title","submitText","fileTypes","show","hide"];let a=lt(e,r),u;Qe(n,Mn,Ve=>t(27,u=Ve));const f=yt(),c="file_picker_"+U.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,g,_,y="",S=[],C=1,T=0,O=!1,E=[],L=[],I=[],A={},P={},N="";function R(){return J(!0),g==null?void 0:g.show()}function z(){return g==null?void 0:g.hide()}function F(){t(5,S=[]),t(9,P={}),t(12,N="")}function B(){t(4,y="")}async function J(Ve=!1){if(A!=null&&A.id){t(6,O=!0),Ve&&F();try{const Ee=Ve?1:C+1,st=U.getAllCollectionIdentifiers(A);let De=U.normalizeSearchFilter(y,st)||"";De&&(De+=" && "),De+="("+L.map($e=>`${$e.name}:length>0`).join("||")+")";let Ye="";A.type!="view"&&(Ye="-@rowid");const ke=await _e.collection(A.id).getList(Ee,ag,{filter:De,sort:Ye,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=U.filterDuplicatesByKey(S.concat(ke.items))),C=ke.page,t(26,T=ke.items.length),t(6,O=!1)}catch(Ee){Ee.isAbort||(_e.error(Ee),t(6,O=!1))}}}function V(){var Ee;let Ve=["100x100"];if((Ee=P==null?void 0:P.record)!=null&&Ee.id){for(const st of L)if(U.toArray(P.record[st.name]).includes(P.name)){Ve=Ve.concat(U.toArray(st.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const st of Ve)I.push({label:`${st} thumb`,value:st});N&&!Ve.includes(N)&&t(12,N="")}function Z(Ve){let Ee=[];for(const st of L){const De=U.toArray(Ve[st.name]);for(const Ye of De)h.includes(U.getFileType(Ye))&&Ee.push(Ye)}return Ee}function G(Ve,Ee){t(9,P={record:Ve,name:Ee})}function de(){o&&(f("submit",Object.assign({size:N},P)),z())}function fe(Ve){N=Ve,t(12,N)}const ue=Ve=>{t(8,A=Ve)},Te=Ve=>t(4,y=Ve.detail),Ke=()=>_==null?void 0:_.show(),Je=()=>{s&&J()};function ft(Ve){ie[Ve?"unshift":"push"](()=>{g=Ve,t(3,g)})}function et(Ve){Pe.call(this,n,Ve)}function xe(Ve){Pe.call(this,n,Ve)}function We(Ve){ie[Ve?"unshift":"push"](()=>{_=Ve,t(10,_)})}const at=Ve=>{U.removeByKey(S,"id",Ve.detail.record.id),S.unshift(Ve.detail.record),t(5,S);const Ee=Z(Ve.detail.record);Ee.length>0&&G(Ve.detail.record,Ee[0])},jt=Ve=>{var Ee;((Ee=P==null?void 0:P.record)==null?void 0:Ee.id)==Ve.detail.id&&t(9,P={}),U.removeByKey(S,"id",Ve.detail.id),t(5,S)};return n.$$set=Ve=>{e=je(je({},e),Wt(Ve)),t(22,a=lt(e,r)),"title"in Ve&&t(0,d=Ve.title),"submitText"in Ve&&t(1,m=Ve.submitText),"fileTypes"in Ve&&t(24,h=Ve.fileTypes)},n.$$.update=()=>{var Ve;n.$$.dirty[0]&134217728&&t(7,E=u.filter(Ee=>Ee.type!=="view"&&!!U.toArray(Ee.fields).find(st=>{var De,Ye;return st.type==="file"&&!st.protected&&(!((De=st.mimeTypes)!=null&&De.length)||!!((Ye=st.mimeTypes)!=null&&Ye.find(ke=>ke.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ve=A==null?void 0:A.fields)==null?void 0:Ve.filter(Ee=>Ee.type==="file"&&!Ee.protected)),n.$$.dirty[0]&256&&A!=null&&A.id&&(B(),V()),n.$$.dirty[0]&512&&P!=null&&P.name&&V(),n.$$.dirty[0]&280&&typeof y<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(Ee,st)=>{var De;return(P==null?void 0:P.name)==st&&((De=P==null?void 0:P.record)==null?void 0:De.id)==Ee.id}),n.$$.dirty[0]&32&&t(15,l=S.find(Ee=>Z(Ee).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!O&&T==ag),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,g,y,S,O,E,A,P,_,I,N,o,s,l,i,B,J,Z,G,de,a,c,h,R,T,u,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt]}class uA extends Se{constructor(e){super(),we(this,e,aA,rA,ye,{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 fA(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 cA(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 Ou({props:s}),ie.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[11],field:n[1]}});const r=[cA,fA],a=[];function u(f,c){return f[4]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=$(),l.c(),s=ve()},m(f,c){q(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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),H(e,f),a[i].d(f)}}}function pA(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dA,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new uA({props:s}),n[8](i),i.$on("submit",n[9]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[8](null),H(i,o)}}}function mA(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;ln(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,_e.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(U.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 hA extends Se{constructor(e){super(),we(this,e,mA,pA,ye,{field:1,value:0})}}function _A(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","email"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function gA(n){let e,t;return e=new ce({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(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bA(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 yA extends Se{constructor(e){super(),we(this,e,bA,gA,ye,{field:1,value:0})}}function kA(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 vA(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),bn(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&&!bn(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 wA(n){let e;function t(s,o){return s[2]?vA:kA}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 SA(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){U.hasImageExtension(l==null?void 0:l.name)?U.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 TA extends Se{constructor(e){super(),we(this,e,SA,wA,ye,{file:0,size:1})}}function ug(n,e,t){const i=n.slice();return i[31]=e[t],i[33]=t,i}function fg(n,e,t){const i=n.slice();i[36]=e[t],i[33]=t;const l=i[2].includes(i[36]);return i[37]=l,i}function CA(n){let e,t,i;function l(){return n[19](n[36])}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(qe.call(null,e,"Remove file")),Y(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&k(e),t=!1,Ie(i)}}}function $A(n){let e,t,i;function l(){return n[18](n[36])}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=Y(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[36]+"",a,u,f,c,d,m,h;i=new rf({props:{record:n[3],filename:n[36]}});function g(){return n[16](n[36])}function _(){return n[17](n[36])}function y(T,O){return T[37]?$A:CA}let S=y(n),C=S(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("button"),a=W(r),f=$(),c=b("div"),C.c(),ee(t,"fade",n[37]),p(o,"type","button"),p(o,"draggable",!1),p(o,"class",u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")),p(o,"title","Download"),p(s,"class","content"),p(c,"class","actions"),p(e,"class","list-item"),ee(e,"dragging",n[34]),ee(e,"dragover",n[35])},m(T,O){v(T,e,O),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(o,a),w(e,f),w(e,c),C.m(c,null),d=!0,m||(h=[Y(o,"auxclick",g),Y(o,"click",_)],m=!0)},p(T,O){n=T;const E={};O[0]&8&&(E.record=n[3]),O[0]&32&&(E.filename=n[36]),i.$set(E),(!d||O[0]&36)&&ee(t,"fade",n[37]),(!d||O[0]&32)&&r!==(r=n[36]+"")&&oe(a,r),(!d||O[0]&36&&u!==(u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")))&&p(o,"class",u),S===(S=y(n))&&C?C.p(n,O):(C.d(1),C=S(n),C&&(C.c(),C.m(c,null))),(!d||O[1]&8)&&ee(e,"dragging",n[34]),(!d||O[1]&16)&&ee(e,"dragover",n[35])},i(T){d||(M(i.$$.fragment,T),d=!0)},o(T){D(i.$$.fragment,T),d=!1},d(T){T&&k(e),H(i),C.d(),m=!1,Ie(h)}}}function cg(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_uploaded",index:e[33],disabled:!e[6],$$slots:{default:[OA,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&44|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function MA(n){let e,t,i,l,s,o,r,a,u=n[31].name+"",f,c,d,m,h,g,_;i=new TA({props:{file:n[31]}});function y(){return n[21](n[33])}return{c(){e=b("div"),t=b("figure"),j(i.$$.fragment),l=$(),s=b("div"),o=b("small"),o.textContent="New",r=$(),a=b("span"),f=W(u),d=$(),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[31].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),ee(e,"dragging",n[34]),ee(e,"dragover",n[35])},m(S,C){v(S,e,C),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),w(s,r),w(s,a),w(a,f),w(e,d),w(e,m),h=!0,g||(_=[Me(qe.call(null,m,"Remove file")),Y(m,"click",y)],g=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[31]),i.$set(T),(!h||C[0]&2)&&u!==(u=n[31].name+"")&&oe(f,u),(!h||C[0]&2&&c!==(c=n[31].name))&&p(s,"title",c),(!h||C[1]&8)&&ee(e,"dragging",n[34]),(!h||C[1]&16)&&ee(e,"dragover",n[35])},i(S){h||(M(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&k(e),H(i),g=!1,Ie(_)}}}function dg(n,e){let t,i,l,s;function o(a){e[22](a)}let r={group:e[4].name+"_new",index:e[33],disabled:!e[6],$$slots:{default:[MA,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new _o({props:r}),ie.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function EA(n){let e,t,i,l=[],s=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,y,S,C,T;e=new ii({props:{uniqueId:n[30],field:n[4]}});let O=pe(n[5]);const E=A=>A[36]+A[3].id;for(let A=0;A<O.length;A+=1){let P=fg(n,O,A),N=E(P);s.set(N,l[A]=cg(N,P))}let L=pe(n[1]);const I=A=>A[31].name+A[33];for(let A=0;A<L.length;A+=1){let P=ug(n,L,A),N=I(P);a.set(N,r[A]=dg(N,P))}return{c(){var A;j(e.$$.fragment),t=$(),i=b("div");for(let P=0;P<l.length;P+=1)l[P].c();o=$();for(let P=0;P<r.length;P+=1)r[P].c();u=$(),f=b("div"),c=b("input"),m=$(),h=b("button"),g=b("i"),_=$(),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[10],p(f,"class","list-item list-item-btn"),p(i,"class","list")},m(A,P){q(e,A,P),v(A,t,P),v(A,i,P);for(let N=0;N<l.length;N+=1)l[N]&&l[N].m(i,null);w(i,o);for(let N=0;N<r.length;N+=1)r[N]&&r[N].m(i,null);w(i,u),w(i,f),w(f,c),n[23](c),w(f,m),w(f,h),w(h,g),w(h,_),w(h,y),n[26](i),S=!0,C||(T=[Y(c,"change",n[24]),Y(h,"click",n[25])],C=!0)},p(A,P){var R;const N={};P[0]&1073741824&&(N.uniqueId=A[30]),P[0]&16&&(N.field=A[4]),e.$set(N),P[0]&39037|P[1]&24&&(O=pe(A[5]),re(),l=vt(l,P,E,1,A,O,s,i,Bt,cg,o,fg),ae()),P[0]&8274|P[1]&24&&(L=pe(A[1]),re(),r=vt(r,P,I,1,A,L,a,i,Bt,dg,u,ug),ae()),(!S||P[0]&16&&d!==(d=((R=A[4].mimeTypes)==null?void 0:R.join(","))||null))&&p(c,"accept",d),(!S||P[0]&64)&&(c.multiple=A[6]),(!S||P[0]&1024)&&(h.disabled=A[10])},i(A){if(!S){M(e.$$.fragment,A);for(let P=0;P<O.length;P+=1)M(l[P]);for(let P=0;P<L.length;P+=1)M(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)),H(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[23](null),n[26](null),C=!1,Ie(T)}}}function DA(n){let e,t,i,l,s;return t=new ce({props:{class:`
             form-field form-field-list form-field-file
             `+(n[4].required?"required":"")+`
             `+(n[9]?"dragover":"")+`
-        `,name:n[4].name,$$slots:{default:[OA,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","block")},m(o,r){v(o,e,r),q(t,e,null),i=!0,l||(s=[Y(e,"dragover",nt(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
+        `,name:n[4].name,$$slots:{default:[EA,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","block")},m(o,r){v(o,e,r),q(t,e,null),i=!0,l||(s=[Y(e,"dragover",nt(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
             form-field form-field-list form-field-file
             `+(o[4].required?"required":"")+`
             `+(o[9]?"dragover":"")+`
-        `),r[0]&16&&(a.name=o[4].name),r[0]&1073743359|r[1]&256&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),l=!1,Ie(s)}}}function EA(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;function h(V){U.removeByValue(f,V),t(2,f)}function g(V){U.pushUnique(f,V),t(2,f)}function _(V){U.isEmpty(u[V])||u.splice(V,1),t(1,u)}function y(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function S(V){var G;V.preventDefault(),t(9,m=!1);const Z=((G=V.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const de of Z){const fe=l.length+u.length-f.length;if(r.maxSelect<=fe)break;u.push(de)}t(1,u)}}async function C(V){try{let Z=await _e.getSuperuserFileToken(o.collectionId),G=_e.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>C(V),O=V=>C(V),E=V=>h(V),L=V=>g(V);function I(V){a=V,t(0,a),t(6,i),t(4,r)}const A=V=>_(V);function P(V){u=V,t(1,u)}function N(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const R=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},z=()=>c==null?void 0:c.click();function F(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const B=()=>{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=U.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=U.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&U.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=U.toArray(a)),n.$$.dirty[0]&54&&t(10,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&y()},[a,u,f,o,r,l,i,c,d,m,s,h,g,_,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J]}class DA extends Se{constructor(e){super(),we(this,e,EA,MA,ye,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function IA(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 LA(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 AA(n){let e,t,i,l;function s(a,u){return a[4]?LA:IA}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=qe.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&&It(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 PA(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 NA(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=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ve()},m(o,r){e&&q(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,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&H(e,o)}}}function RA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[AA]},$$scope:{ctx:n}}});const r=[NA,PA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=$(),l.c(),s=ve()},m(f,c){q(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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),H(e,f),a[i].d(f)}}}function FA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[RA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function dg(n){return typeof n=="string"&&Sk(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Sk(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function qA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=dg(s);ln(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-8naseTA8.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=dg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Sk(r))},[s,l,r,o,i,a]}class HA extends Se{constructor(e){super(),we(this,e,qA,FA,ye,{field:1,value:0})}}function jA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=Y(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&&gt(i.value)!==c[0]&&he(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(k(t),k(i)),H(e,c),u=!1,f()}}}function zA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class VA extends Se{constructor(e){super(),we(this,e,UA,zA,ye,{field:1,value:0})}}function BA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function WA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[BA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YA(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 KA extends Se{constructor(e){super(),we(this,e,YA,WA,ye,{field:1,value:0})}}function pg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function JA(n,e){e=pg(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=pg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function mg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function hg(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function _g(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=Y(e,"click",n[31]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function gg(n){let e,t=!n[13]&&bg(n);return{c(){t&&t.c(),e=ve()},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=bg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function bg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=$(),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=yg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function yg(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=Y(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function ZA(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function GA(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 kg(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(qe.call(null,t,"Edit")),Y(t,"keydown",On(n[27])),Y(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,Ie(l)}}}function vg(n,e){let t,i,l,s,o,r,a,u;function f(_,y){return _[6]?GA:ZA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&kg(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=$(),l=b("div"),j(s.$$.fragment),o=$(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(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),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[Y(t,"click",h),Y(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=kg(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&ee(t,"selected",e[6]),(!r||y[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(M(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function wg(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 Sg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=W("("),i=W(t),l=W(" of MAX "),s=W(n[4]),o=W(")")},m(r,a){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+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(k(e),k(i),k(l),k(s),k(o))}}}function XA(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 QA(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Tg(mg(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=mg(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=Tg(u),l[a].c(),M(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)M(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),dt(l,o)}}}function xA(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"),j(t.$$.fragment),i=$(),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=$(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=Y(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)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(s)),H(t),r=!1,a()}}}function Tg(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[xA,({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 _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,y,S,C;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&_g(n),O=pe(n[8]);const E=z=>z[50].id;for(let z=0;z<O.length;z+=1){let F=hg(n,O,z),B=E(F);r.set(B,o[z]=vg(B,F))}let L=null;O.length||(L=gg(n));let I=n[13]&&wg(),A=n[4]>1&&Sg(n);const P=[QA,XA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=$(),T&&T.c(),l=$(),s=b("div");for(let z=0;z<o.length;z+=1)o[z].c();L&&L.c(),a=$(),I&&I.c(),f=$(),c=b("h5"),d=W(`Selected
-        `),A&&A.c(),m=$(),g.c(),_=ve(),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(z,F){v(z,e,F),q(t,e,null),w(e,i),T&&T.m(e,null),v(z,l,F),v(z,s,F);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(s,null);L&&L.m(s,null),w(s,a),I&&I.m(s,null),v(z,f,F),v(z,c,F),w(c,d),A&&A.m(c,null),v(z,m,F),N[h].m(z,F),v(z,_,F),y=!0,S||(C=Me(u=JA.call(null,s,n[36])),S=!0)},p(z,F){const B={};F[0]&4&&(B.value=z[2]),F[0]&32&&(B.autocompleteCollection=z[5]),t.$set(B),z[11]?T&&(T.d(1),T=null):T?T.p(z,F):(T=_g(z),T.c(),T.m(e,null)),F[0]&143252&&(O=pe(z[8]),re(),o=vt(o,F,E,1,z,O,r,s,Bt,vg,a,hg),ae(),!O.length&&L?L.p(z,F):O.length?L&&(L.d(1),L=null):(L=gg(z),L.c(),L.m(s,a))),z[13]?I||(I=wg(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&It(u.update)&&F[0]&4104&&u.update.call(null,z[36]),z[4]>1?A?A.p(z,F):(A=Sg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(re(),D(N[J],1,1,()=>{N[J]=null}),ae(),g=N[h],g?g.p(z,F):(g=N[h]=P[h](z),g.c()),M(g,1),g.m(_.parentNode,_))},i(z){if(!y){M(t.$$.fragment,z);for(let F=0;F<O.length;F+=1)M(o[F]);M(g),y=!0}},o(z){D(t.$$.fragment,z);for(let F=0;F<o.length;F+=1)D(o[F]);D(g),y=!1},d(z){z&&(k(e),k(l),k(s),k(f),k(c),k(m),k(_)),H(t),T&&T.d();for(let F=0;F<o.length;F+=1)o[F].d();L&&L.d(),I&&I.d(),A&&A.d(),N[h].d(z),S=!1,C()}}}function tP(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=W("Select "),i=b("strong"),s=W(l),o=W(" 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)||"")+"")&&oe(s,l)},d(a){a&&k(e)}}}function nP(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),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=[Y(e,"click",n[28]),Y(i,"click",n[29])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function iP(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[nP],header:[tP],default:[eP]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new Xt({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(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),l=!0},p(a,u){const f=u[0]&524288?wt(s,[s[0],s[1],Rt(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||(M(e.$$.fragment,a),M(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),H(e,a),n[42](null),H(i,a)}}}const Go=50;function lP(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,Mn,$e=>t(26,m=$e));const h=yt(),g="picker_"+U.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",O=[],E=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,E=[]),F(),B(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var Ht;let $e="";const ct=(Ht=s==null?void 0:s.fields)==null?void 0:Ht.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ct){const ot=U.getExpandPresentableRelField(Le,m,2);ot&&($e!=""&&($e+=","),$e+=ot)}return $e}async function F(){const $e=U.toArray(_);if(!l||!$e.length)return;t(24,P=!0);let ct=[];const Ht=$e.slice(),Le=[];for(;Ht.length>0;){const ot=[];for(const on of Ht.splice(0,Go))ot.push(`id="${on}"`);Le.push(_e.collection(l).getFullList({batch:Go,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ct=ct.concat(...ot)}),t(6,E=[]);for(const ot of $e){const on=U.findByKey(ct,"id",ot);on&&E.push(on)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(_e.error(ot),t(24,P=!1))}}async function B($e=!1){if(l){t(3,A=!0),$e&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{const ct=$e?1:L+1,Ht=U.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await _e.collection(l).getList(ct,Go,{filter:U.normalizeSearchFilter(T,Ht),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:g+"loadList"});t(8,O=U.filterDuplicatesByKey(O.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ct){ct.isAbort||(_e.error(ct),t(3,A=!1))}}}function J($e){i==1?t(6,E=[$e]):u&&(U.pushOrReplaceByKey(E,$e),t(6,E))}function V($e){U.removeByKey(E,"id",$e.id),t(6,E)}function Z($e){f($e)?V($e):J($e)}function G(){var $e;i!=1?t(20,_=E.map(ct=>ct.id)):t(20,_=(($e=E==null?void 0:E[0])==null?void 0:$e.id)||""),h("save",E),R()}function de($e){Pe.call(this,n,$e)}const fe=()=>R(),ue=()=>G(),Te=$e=>t(2,T=$e.detail),Ke=()=>C==null?void 0:C.show(),Je=$e=>C==null?void 0:C.show($e.id),ft=$e=>Z($e),et=($e,ct)=>{(ct.code==="Enter"||ct.code==="Space")&&(ct.preventDefault(),ct.stopPropagation(),Z($e))},xe=()=>t(2,T=""),We=()=>{a&&!A&&B()},at=$e=>V($e);function jt($e){E=$e,t(6,E)}function Ve($e){ie[$e?"unshift":"push"](()=>{S=$e,t(1,S)})}function Ee($e){Pe.call(this,n,$e)}function st($e){Pe.call(this,n,$e)}function De($e){ie[$e?"unshift":"push"](()=>{C=$e,t(7,C)})}const Ye=$e=>{U.removeByKey(O,"id",$e.detail.record.id),O.unshift($e.detail.record),t(8,O),J($e.detail.record)},ke=$e=>{U.removeByKey(O,"id",$e.detail.id),t(8,O),V($e.detail)};return n.$$set=$e=>{e=je(je({},e),Wt($e)),t(19,d=lt(e,c)),"value"in $e&&t(20,_=$e.value),"field"in $e&&t(21,y=$e.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($e=>$e.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&B(!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>E.length),n.$$.dirty[0]&64&&t(9,f=function($e){return U.findByKey(E,"id",$e.id)})},[R,S,T,A,i,s,E,C,O,f,u,o,a,r,B,J,V,Z,G,d,_,y,N,I,P,l,m,de,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke]}class sP extends Se{constructor(e){super(),we(this,e,lP,iP,ye,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function $g(n,e,t){const i=n.slice();return i[27]=e[t],i}function Og(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=qe.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&&It(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 oP(n){let e,t=n[6].length&&Og(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Og(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function Mg(n){let e,t=n[5]&&Eg(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Eg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function Eg(n){let e,t=pe(U.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l<t.length;l+=1)i[l]=Dg($g(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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(U.toArray(l[0]).slice(0,10));let o;for(o=0;o<t.length;o+=1){const r=$g(l,t,o);i[o]?i[o].p(r,s):(i[o]=Dg(),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),dt(i,l)}}}function Dg(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 rP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=$(),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"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Me(qe.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),H(i),u=!1,Ie(f)}}}function Ig(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:[rP,({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 _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function aP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[oP]},$$scope:{ctx:n}}});let m=pe(n[4]);const h=_=>_[22].id;for(let _=0;_<m.length;_+=1){let y=Cg(n,m,_),S=h(y);o.set(S,s[_]=Ig(S,y))}let g=null;return m.length||(g=Mg(n)),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div");for(let _=0;_<s.length;_+=1)s[_].c();g&&g.c(),r=$(),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){q(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=Y(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=vt(s,y,h,1,_,m,o,l,Bt,Ig,null,Cg),ae(),!m.length&&g?g.p(_,y):m.length?g&&(g.d(1),g=null):(g=Mg(_),g.c(),g.m(l,null)))},i(_){if(!f){M(e.$$.fragment,_);for(let y=0;y<m.length;y+=1)M(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)),H(e,_);for(let y=0;y<s.length;y+=1)s[y].d();g&&g.d(),c=!1,d()}}}function uP(n){let e,t,i,l,s={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[aP,({uniqueId:r})=>({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new sP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Lg=100;function fP(n,e,t){let i,l;Qe(n,Mn,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=U.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=U.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(B=>B.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(B=>!B.hidden&&B.presentable&&B.type=="relation");for(const B of P){const J=U.getExpandPresentableRelField(B,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const B=[];for(const J of N.splice(0,Lg))B.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Lg,{filter:B.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let B=[];await Promise.all(R).then(J=>{B=B.concat(...J)});for(const J of I){const V=U.findByKey(B,"id",J);V?u.push(V):d.push(J)}t(4,u),_()}catch(B){_e.error(B)}t(5,f=!1)}function g(I){U.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)||"")}oo(()=>{clearTimeout(c)});const y=I=>g(I);function S(I){u=I,t(4,u)}const C=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(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,C,T,O,E,L]}class cP extends Se{constructor(e){super(),we(this,e,fP,uP,ye,{field:2,value:0,picker:1})}}function Ag(n){let e,t,i,l;return{c(){e=b("div"),t=W("Select up to "),i=W(n[2]),l=W(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&k(e)}}}function dP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({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 ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Ag(n);return{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),s=$(),f&&f.c(),o=ve()},m(m,h){q(e,m,h),v(m,t,h),q(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],Ce(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Ag(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(k(t),k(s),k(o)),H(e,m),H(i,m),f&&f.d(m)}}}function pP(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[dP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function mP(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 hP extends Se{constructor(e){super(),we(this,e,mP,pP,ye,{field:1,value:0})}}function _P(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"),ei(e,s),ee(e,"svelte-1x1pbts",!0)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),he(e,n[0]),t||(i=[Y(e,"input",n[6]),Y(e,"keydown",n[2])],t=!0)},p(o,[r]){ei(e,s=wt(l,[r&8&&o[3]])),r&1&&he(e,o[0]),ee(e,"svelte-1x1pbts",!0)},i:te,o:te,d(o){o&&k(e),n[5](null),t=!1,Ie(i)}}}function gP(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()}}ln(()=>(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),Wt(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 bP extends Se{constructor(e){super(),we(this,e,gP,_P,ye,{value:0,maxHeight:4})}}function yP(n){let e,t,i,l,s;e=new ii({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 bP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],Ce(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(e,a),H(i,a)}}}function kP(n){let e,t;return e=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[yP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function vP(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=!U.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class wP extends Se{constructor(e){super(),we(this,e,vP,kP,ye,{original:4,field:1,value:0})}}function SP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function TP(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function CP(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 $P extends Se{constructor(e){super(),we(this,e,CP,TP,ye,{field:1,value:0})}}function Pg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=W(l),o=$(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(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=Y(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&k(t),r=!1,a()}}}function Fg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new xu({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("em"),r=b("a"),u=W(a),f=W(" SDK"),d=$(),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"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,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+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&k(t),H(i)}}}function OP(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 _=Ng(n,c,g),y=d(_);l.set(y,i[g]=Rg(y,_))}let m=pe(n[2]);const h=g=>g[6].language;for(let g=0;g<m.length;g+=1){let _=Pg(n,m,g),y=h(_);a.set(y,r[g]=Fg(y,_))}return{c(){e=b("div"),t=b("div");for(let g=0;g<i.length;g+=1)i[g].c();s=$(),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=vt(i,_,d,1,g,c,l,t,di,Rg,null,Ng)),_&6&&(m=pe(g[2]),re(),r=vt(r,_,h,1,g,m,a,o,Bt,Fg,null,Pg),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)M(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 qg="pb_sdk_preference";function MP(n,e,t){let i,{class:l="m-b-sm"}=e,{js:s=""}=e,{dart:o=""}=e,r=localStorage.getItem(qg)||"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(qg,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 EP extends Se{constructor(e){super(),we(this,e,MP,OP,ye,{class:0,js:3,dart:4})}}function DP(n){let e,t,i,l,s,o=U.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new ce({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[LP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=W(`Generate a non-refreshable auth token for
-                    `),s=b("strong"),r=W(o),a=W(":"),u=$(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=Y(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=U.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&k(e),H(f),d=!1,m()}}}function IP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new Ci({props:{value:n[3].authStore.token}}),u=new EP({props:{class:"m-b-0",js:`
+        `),r[0]&16&&(a.name=o[4].name),r[0]&1073743359|r[1]&256&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(M(t.$$.fragment,o),i=!0)},o(o){D(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),l=!1,Ie(s)}}}function IA(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;function h(V){U.removeByValue(f,V),t(2,f)}function g(V){U.pushUnique(f,V),t(2,f)}function _(V){U.isEmpty(u[V])||u.splice(V,1),t(1,u)}function y(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function S(V){var G;V.preventDefault(),t(9,m=!1);const Z=((G=V.dataTransfer)==null?void 0:G.files)||[];if(!(s||!Z.length)){for(const de of Z){const fe=l.length+u.length-f.length;if(r.maxSelect<=fe)break;u.push(de)}t(1,u)}}async function C(V){try{let Z=await _e.getSuperuserFileToken(o.collectionId),G=_e.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>C(V),O=V=>C(V),E=V=>h(V),L=V=>g(V);function I(V){a=V,t(0,a),t(6,i),t(4,r)}const A=V=>_(V);function P(V){u=V,t(1,u)}function N(V){ie[V?"unshift":"push"](()=>{c=V,t(7,c)})}const R=()=>{for(let V of c.files)u.push(V);t(1,u),t(7,c.value=null,c)},z=()=>c==null?void 0:c.click();function F(V){ie[V?"unshift":"push"](()=>{d=V,t(8,d)})}const B=()=>{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=U.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=U.toArray(f))),n.$$.dirty[0]&16&&t(6,i=r.maxSelect>1),n.$$.dirty[0]&65&&U.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=U.toArray(a)),n.$$.dirty[0]&54&&t(10,s=(l.length||u.length)&&r.maxSelect<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&y()},[a,u,f,o,r,l,i,c,d,m,s,h,g,_,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J]}class LA extends Se{constructor(e){super(),we(this,e,IA,DA,ye,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function AA(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 NA(n){let e,t,i,l;function s(a,u){return a[4]?PA:AA}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=qe.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&&It(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 RA(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 FA(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=zt(l,s(n)),e.$on("change",n[5])),{c(){e&&j(e.$$.fragment),t=ve()},m(o,r){e&&q(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,()=>{H(a,1)}),ae()}l?(e=zt(l,s(o)),e.$on("change",o[5]),j(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&M(e.$$.fragment,o),i=!0)},o(o){e&&D(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&H(e,o)}}}function qA(n){let e,t,i,l,s,o;e=new ii({props:{uniqueId:n[6],field:n[1],$$slots:{default:[NA]},$$scope:{ctx:n}}});const r=[FA,RA],a=[];function u(f,c){return f[3]?0:1}return i=u(n),l=a[i]=r[i](n),{c(){j(e.$$.fragment),t=$(),l.c(),s=ve()},m(f,c){q(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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(e.$$.fragment,f),M(l),o=!0)},o(f){D(e.$$.fragment,f),D(l),o=!1},d(f){f&&(k(t),k(s)),H(e,f),a[i].d(f)}}}function HA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pg(n){return typeof n=="string"&&Tk(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Tk(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function jA(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=pg(s);ln(async()=>{try{t(3,o=(await Tt(async()=>{const{default:u}=await import("./CodeEditor-kYUfoxD0.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=pg(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=Tk(r))},[s,l,r,o,i,a]}class zA extends Se{constructor(e){super(),we(this,e,jA,HA,ye,{field:1,value:0})}}function UA(n){let e,t,i,l,s,o,r,a,u,f;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","number"),p(i,"id",l=n[3]),i.required=s=n[1].required,p(i,"min",o=n[1].min),p(i,"max",r=n[1].max),p(i,"step","any")},m(c,d){q(e,c,d),v(c,t,d),v(c,i,d),he(i,n[0]),a=!0,u||(f=Y(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&&gt(i.value)!==c[0]&&he(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(k(t),k(i)),H(e,c),u=!1,f()}}}function VA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[UA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function BA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=gt(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class WA extends Se{constructor(e){super(),we(this,e,BA,VA,ye,{field:1,value:0})}}function YA(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","password"),p(i,"id",l=n[3]),p(i,"autocomplete","new-password"),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function KA(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[YA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function JA(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class ZA extends Se{constructor(e){super(),we(this,e,JA,KA,ye,{field:1,value:0})}}function mg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function GA(n,e){e=mg(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=mg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function hg(n,e,t){const i=n.slice();return i[50]=e[t],i[52]=t,i}function _g(n,e,t){const i=n.slice();i[50]=e[t];const l=i[9](i[50]);return i[6]=l,i}function gg(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=Y(e,"click",n[31]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function bg(n){let e,t=!n[13]&&yg(n);return{c(){t&&t.c(),e=ve()},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=yg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function yg(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&kg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=$(),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=kg(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&k(e),l&&l.d()}}}function kg(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=Y(e,"click",n[35]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function XA(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 QA(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 vg(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(qe.call(null,t,"Edit")),Y(t,"keydown",On(n[27])),Y(t,"click",On(s))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,Ie(l)}}}function wg(n,e){let t,i,l,s,o,r,a,u;function f(_,y){return _[6]?QA:XA}let c=f(e),d=c(e);s=new Ur({props:{record:e[50]}});let m=!e[11]&&vg(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=$(),l=b("div"),j(s.$$.fragment),o=$(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),ee(t,"selected",e[6]),ee(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),q(s,l,null),w(t,o),m&&m.m(t,null),r=!0,a||(u=[Y(t,"click",h),Y(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=vg(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&ee(t,"selected",e[6]),(!r||y[0]&1808)&&ee(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(M(s.$$.fragment,_),r=!0)},o(_){D(s.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),H(s),m&&m.d(),a=!1,Ie(u)}}}function Sg(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 Tg(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=W("("),i=W(t),l=W(" of MAX "),s=W(n[4]),o=W(")")},m(r,a){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+"")&&oe(i,t),a[0]&16&&oe(s,r[4])},d(r){r&&(k(e),k(i),k(l),k(s),k(o))}}}function xA(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 eP(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Cg(hg(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=hg(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=Cg(u),l[a].c(),M(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)M(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),dt(l,o)}}}function tP(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"),j(t.$$.fragment),i=$(),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=$(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),ee(e,"label-danger",n[53]),ee(e,"label-warning",n[54])},m(f,c){v(f,e,c),q(t,e,null),w(e,i),w(e,l),v(f,s,c),o=!0,r||(a=Y(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)&&ee(e,"label-danger",n[53]),(!o||c[1]&8388608)&&ee(e,"label-warning",n[54])},i(f){o||(M(t.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(s)),H(t),r=!1,a()}}}function Cg(n){let e,t,i;function l(o){n[38](o)}let s={index:n[52],$$slots:{default:[tP,({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 _o({props:s}),ie.push(()=>be(e,"list",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&79691776&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function nP(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,g,_,y,S,C;t=new Hr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&gg(n),O=pe(n[8]);const E=z=>z[50].id;for(let z=0;z<O.length;z+=1){let F=_g(n,O,z),B=E(F);r.set(B,o[z]=wg(B,F))}let L=null;O.length||(L=bg(n));let I=n[13]&&Sg(),A=n[4]>1&&Tg(n);const P=[eP,xA],N=[];function R(z,F){return z[6].length?0:1}return h=R(n),g=N[h]=P[h](n),{c(){e=b("div"),j(t.$$.fragment),i=$(),T&&T.c(),l=$(),s=b("div");for(let z=0;z<o.length;z+=1)o[z].c();L&&L.c(),a=$(),I&&I.c(),f=$(),c=b("h5"),d=W(`Selected
+        `),A&&A.c(),m=$(),g.c(),_=ve(),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(z,F){v(z,e,F),q(t,e,null),w(e,i),T&&T.m(e,null),v(z,l,F),v(z,s,F);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(s,null);L&&L.m(s,null),w(s,a),I&&I.m(s,null),v(z,f,F),v(z,c,F),w(c,d),A&&A.m(c,null),v(z,m,F),N[h].m(z,F),v(z,_,F),y=!0,S||(C=Me(u=GA.call(null,s,n[36])),S=!0)},p(z,F){const B={};F[0]&4&&(B.value=z[2]),F[0]&32&&(B.autocompleteCollection=z[5]),t.$set(B),z[11]?T&&(T.d(1),T=null):T?T.p(z,F):(T=gg(z),T.c(),T.m(e,null)),F[0]&143252&&(O=pe(z[8]),re(),o=vt(o,F,E,1,z,O,r,s,Bt,wg,a,_g),ae(),!O.length&&L?L.p(z,F):O.length?L&&(L.d(1),L=null):(L=bg(z),L.c(),L.m(s,a))),z[13]?I||(I=Sg(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&It(u.update)&&F[0]&4104&&u.update.call(null,z[36]),z[4]>1?A?A.p(z,F):(A=Tg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=h;h=R(z),h===J?N[h].p(z,F):(re(),D(N[J],1,1,()=>{N[J]=null}),ae(),g=N[h],g?g.p(z,F):(g=N[h]=P[h](z),g.c()),M(g,1),g.m(_.parentNode,_))},i(z){if(!y){M(t.$$.fragment,z);for(let F=0;F<O.length;F+=1)M(o[F]);M(g),y=!0}},o(z){D(t.$$.fragment,z);for(let F=0;F<o.length;F+=1)D(o[F]);D(g),y=!1},d(z){z&&(k(e),k(l),k(s),k(f),k(c),k(m),k(_)),H(t),T&&T.d();for(let F=0;F<o.length;F+=1)o[F].d();L&&L.d(),I&&I.d(),A&&A.d(),N[h].d(z),S=!1,C()}}}function iP(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=W("Select "),i=b("strong"),s=W(l),o=W(" 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)||"")+"")&&oe(s,l)},d(a){a&&k(e)}}}function lP(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=$(),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=[Y(e,"click",n[28]),Y(i,"click",n[29])],l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,Ie(s)}}}function sP(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[lP],header:[iP],default:[nP]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=je(o,s[a]);e=new Xt({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new af({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),l=!0},p(a,u){const f=u[0]&524288?wt(s,[s[0],s[1],Rt(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||(M(e.$$.fragment,a),M(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),H(e,a),n[42](null),H(i,a)}}}const Go=50;function oP(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,Mn,$e=>t(26,m=$e));const h=yt(),g="picker_"+U.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",O=[],E=[],L=1,I=0,A=!1,P=!1;function N(){return t(2,T=""),t(8,O=[]),t(6,E=[]),F(),B(!0),S==null?void 0:S.show()}function R(){return S==null?void 0:S.hide()}function z(){var Ht;let $e="";const ct=(Ht=s==null?void 0:s.fields)==null?void 0:Ht.filter(Le=>!Le.hidden&&Le.presentable&&Le.type=="relation");for(const Le of ct){const ot=U.getExpandPresentableRelField(Le,m,2);ot&&($e!=""&&($e+=","),$e+=ot)}return $e}async function F(){const $e=U.toArray(_);if(!l||!$e.length)return;t(24,P=!0);let ct=[];const Ht=$e.slice(),Le=[];for(;Ht.length>0;){const ot=[];for(const on of Ht.splice(0,Go))ot.push(`id="${on}"`);Le.push(_e.collection(l).getFullList({batch:Go,filter:ot.join("||"),fields:"*:excerpt(200)",expand:z(),requestKey:null}))}try{await Promise.all(Le).then(ot=>{ct=ct.concat(...ot)}),t(6,E=[]);for(const ot of $e){const on=U.findByKey(ct,"id",ot);on&&E.push(on)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(24,P=!1)}catch(ot){ot.isAbort||(_e.error(ot),t(24,P=!1))}}async function B($e=!1){if(l){t(3,A=!0),$e&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{const ct=$e?1:L+1,Ht=U.getAllCollectionIdentifiers(s);let Le="";o||(Le="-@rowid");const ot=await _e.collection(l).getList(ct,Go,{filter:U.normalizeSearchFilter(T,Ht),sort:Le,fields:"*:excerpt(200)",skipTotal:1,expand:z(),requestKey:g+"loadList"});t(8,O=U.filterDuplicatesByKey(O.concat(ot.items))),L=ot.page,t(23,I=ot.items.length),t(3,A=!1)}catch(ct){ct.isAbort||(_e.error(ct),t(3,A=!1))}}}function J($e){i==1?t(6,E=[$e]):u&&(U.pushOrReplaceByKey(E,$e),t(6,E))}function V($e){U.removeByKey(E,"id",$e.id),t(6,E)}function Z($e){f($e)?V($e):J($e)}function G(){var $e;i!=1?t(20,_=E.map(ct=>ct.id)):t(20,_=(($e=E==null?void 0:E[0])==null?void 0:$e.id)||""),h("save",E),R()}function de($e){Pe.call(this,n,$e)}const fe=()=>R(),ue=()=>G(),Te=$e=>t(2,T=$e.detail),Ke=()=>C==null?void 0:C.show(),Je=$e=>C==null?void 0:C.show($e.id),ft=$e=>Z($e),et=($e,ct)=>{(ct.code==="Enter"||ct.code==="Space")&&(ct.preventDefault(),ct.stopPropagation(),Z($e))},xe=()=>t(2,T=""),We=()=>{a&&!A&&B()},at=$e=>V($e);function jt($e){E=$e,t(6,E)}function Ve($e){ie[$e?"unshift":"push"](()=>{S=$e,t(1,S)})}function Ee($e){Pe.call(this,n,$e)}function st($e){Pe.call(this,n,$e)}function De($e){ie[$e?"unshift":"push"](()=>{C=$e,t(7,C)})}const Ye=$e=>{U.removeByKey(O,"id",$e.detail.record.id),O.unshift($e.detail.record),t(8,O),J($e.detail.record)},ke=$e=>{U.removeByKey(O,"id",$e.detail.id),t(8,O),V($e.detail)};return n.$$set=$e=>{e=je(je({},e),Wt($e)),t(19,d=lt(e,c)),"value"in $e&&t(20,_=$e.value),"field"in $e&&t(21,y=$e.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($e=>$e.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&B(!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>E.length),n.$$.dirty[0]&64&&t(9,f=function($e){return U.findByKey(E,"id",$e.id)})},[R,S,T,A,i,s,E,C,O,f,u,o,a,r,B,J,V,Z,G,d,_,y,N,I,P,l,m,de,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke]}class rP extends Se{constructor(e){super(),we(this,e,oP,sP,ye,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function $g(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Og(n,e,t){const i=n.slice();return i[27]=e[t],i}function Mg(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=qe.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&&It(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 aP(n){let e,t=n[6].length&&Mg(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[6].length?t?t.p(i,l):(t=Mg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function Eg(n){let e,t=n[5]&&Dg(n);return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),v(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Dg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function Dg(n){let e,t=pe(U.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l<t.length;l+=1)i[l]=Ig(Og(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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(U.toArray(l[0]).slice(0,10));let o;for(o=0;o<t.length;o+=1){const r=Og(l,t,o);i[o]?i[o].p(r,s):(i[o]=Ig(),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),dt(i,l)}}}function Ig(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 uP(n){let e,t,i,l,s,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=$(),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"),ee(e,"dragging",n[25]),ee(e,"dragover",n[26])},m(d,m){v(d,e,m),w(e,t),q(i,t,null),w(e,l),w(e,s),w(s,o),v(d,r,m),a=!0,u||(f=[Me(qe.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[22]),i.$set(h),(!a||m&33554432)&&ee(e,"dragging",n[25]),(!a||m&67108864)&&ee(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),H(i),u=!1,Ie(f)}}}function Lg(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:[uP,({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 _o({props:r}),ie.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function fP(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c,d;e=new ii({props:{uniqueId:n[21],field:n[2],$$slots:{default:[aP]},$$scope:{ctx:n}}});let m=pe(n[4]);const h=_=>_[22].id;for(let _=0;_<m.length;_+=1){let y=$g(n,m,_),S=h(y);o.set(S,s[_]=Lg(S,y))}let g=null;return m.length||(g=Eg(n)),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div");for(let _=0;_<s.length;_+=1)s[_].c();g&&g.c(),r=$(),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){q(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=Y(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=vt(s,y,h,1,_,m,o,l,Bt,Lg,null,$g),ae(),!m.length&&g?g.p(_,y):m.length?g&&(g.d(1),g=null):(g=Eg(_),g.c(),g.m(l,null)))},i(_){if(!f){M(e.$$.fragment,_);for(let y=0;y<m.length;y+=1)M(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)),H(e,_);for(let y=0;y<s.length;y+=1)s[y].d();g&&g.d(),c=!1,d()}}}function cP(n){let e,t,i,l,s={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[fP,({uniqueId:r})=>({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new rP({props:o}),n[16](i),i.$on("save",n[17]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(r,a){q(e,r,a),v(r,t,a),q(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&1075839223&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(M(e.$$.fragment,r),M(i.$$.fragment,r),l=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),l=!1},d(r){r&&k(t),n[15](null),H(e,r),n[16](null),H(i,r)}}}const Ag=100;function dP(n,e,t){let i,l;Qe(n,Mn,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=U.toArray(o);return t(4,u=u.filter(A=>I.includes(A.id))),I.length!=u.length}async function h(){var z,F;const I=U.toArray(o);if(t(4,u=[]),t(6,d=[]),!(s!=null&&s.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A="";const P=(F=(z=l.find(B=>B.id==s.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(B=>!B.hidden&&B.presentable&&B.type=="relation");for(const B of P){const J=U.getExpandPresentableRelField(B,l,2);J&&(A!=""&&(A+=","),A+=J)}const N=I.slice(),R=[];for(;N.length>0;){const B=[];for(const J of N.splice(0,Ag))B.push(`id="${J}"`);R.push(_e.collection(s.collectionId).getFullList(Ag,{filter:B.join("||"),fields:"*:excerpt(200)",expand:A,requestKey:null}))}try{let B=[];await Promise.all(R).then(J=>{B=B.concat(...J)});for(const J of I){const V=U.findByKey(B,"id",J);V?u.push(V):d.push(J)}t(4,u),_()}catch(B){_e.error(B)}t(5,f=!1)}function g(I){U.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)||"")}oo(()=>{clearTimeout(c)});const y=I=>g(I);function S(I){u=I,t(4,u)}const C=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ie[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(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,C,T,O,E,L]}class pP extends Se{constructor(e){super(),we(this,e,dP,cP,ye,{field:2,value:0,picker:1})}}function Pg(n){let e,t,i,l;return{c(){e=b("div"),t=W("Select up to "),i=W(n[2]),l=W(" items."),p(e,"class","help-block")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(e,l)},p(s,o){o&4&&oe(i,s[2])},d(s){s&&k(e)}}}function mP(n){var c,d;let e,t,i,l,s,o,r;e=new ii({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 ps({props:u}),ie.push(()=>be(i,"selected",a));let f=n[3]&&Pg(n);return{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),s=$(),f&&f.c(),o=ve()},m(m,h){q(e,m,h),v(m,t,h),q(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],Ce(()=>l=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Pg(m),f.c(),f.m(o.parentNode,o)):f&&(f.d(1),f=null)},i(m){r||(M(e.$$.fragment,m),M(i.$$.fragment,m),r=!0)},o(m){D(e.$$.fragment,m),D(i.$$.fragment,m),r=!1},d(m){m&&(k(t),k(s),k(o)),H(e,m),H(i,m),f&&f.d(m)}}}function hP(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[mP,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _P(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 gP extends Se{constructor(e){super(),we(this,e,_P,hP,ye,{field:1,value:0})}}function bP(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"),ei(e,s),ee(e,"svelte-1x1pbts",!0)},m(o,r){v(o,e,r),e.autofocus&&e.focus(),n[5](e),he(e,n[0]),t||(i=[Y(e,"input",n[6]),Y(e,"keydown",n[2])],t=!0)},p(o,[r]){ei(e,s=wt(l,[r&8&&o[3]])),r&1&&he(e,o[0]),ee(e,"svelte-1x1pbts",!0)},i:te,o:te,d(o){o&&k(e),n[5](null),t=!1,Ie(i)}}}function yP(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()}}ln(()=>(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),Wt(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 kP extends Se{constructor(e){super(),we(this,e,yP,bP,ye,{value:0,maxHeight:4})}}function vP(n){let e,t,i,l,s;e=new ii({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 kP({props:r}),ie.push(()=>be(i,"value",o)),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),s=!0},p(a,u){const f={};u&64&&(f.uniqueId=a[6]),u&2&&(f.field=a[1]),e.$set(f);const c={};u&64&&(c.id=a[6]),u&8&&(c.required=a[3]),u&4&&(c.placeholder=a[2]?"Leave empty to autogenerate...":""),!l&&u&1&&(l=!0,c.value=a[0],Ce(()=>l=!1)),i.$set(c)},i(a){s||(M(e.$$.fragment,a),M(i.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(e,a),H(i,a)}}}function wP(n){let e,t;return e=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[vP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field "+(i[3]?"required":"")),l&2&&(s.name=i[1].name),l&207&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function SP(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=!U.isEmpty(o.autogeneratePattern)&&!(s!=null&&s.id)),n.$$.dirty&6&&t(3,l=o.required&&!i)},[r,o,i,l,s,a]}class TP extends Se{constructor(e){super(),we(this,e,SP,wP,ye,{original:4,field:1,value:0})}}function CP(n){let e,t,i,l,s,o,r,a;return e=new ii({props:{uniqueId:n[3],field:n[1]}}),{c(){j(e.$$.fragment),t=$(),i=b("input"),p(i,"type","url"),p(i,"id",l=n[3]),i.required=s=n[1].required},m(u,f){q(e,u,f),v(u,t,f),v(u,i,f),he(i,n[0]),o=!0,r||(a=Y(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]&&he(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(k(t),k(i)),H(e,u),r=!1,a()}}}function $P(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[CP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function 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 MP extends Se{constructor(e){super(),we(this,e,OP,$P,ye,{field:1,value:0})}}function Ng(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fg(n,e){let t,i,l=e[6].title+"",s,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),s=W(l),o=$(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ee(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=Y(t,"click",u),r=!0)},p(f,c){e=f,c&4&&l!==(l=e[6].title+"")&&oe(s,l),c&6&&ee(t,"active",e[1]===e[6].language)},d(f){f&&k(t),r=!1,a()}}}function qg(n,e){let t,i,l,s,o,r,a=e[6].title+"",u,f,c,d,m;return i=new ef({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),o=b("em"),r=b("a"),u=W(a),f=W(" SDK"),d=$(),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"),ee(t,"active",e[1]===e[6].language),this.first=t},m(h,g){v(h,t,g),q(i,t,null),w(t,l),w(t,s),w(s,o),w(o,r),w(r,u),w(r,f),w(t,d),m=!0},p(h,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+"")&&oe(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&ee(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&k(t),H(i)}}}function EP(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 _=Rg(n,c,g),y=d(_);l.set(y,i[g]=Fg(y,_))}let m=pe(n[2]);const h=g=>g[6].language;for(let g=0;g<m.length;g+=1){let _=Ng(n,m,g),y=h(_);a.set(y,r[g]=qg(y,_))}return{c(){e=b("div"),t=b("div");for(let g=0;g<i.length;g+=1)i[g].c();s=$(),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=vt(i,_,d,1,g,c,l,t,di,Fg,null,Rg)),_&6&&(m=pe(g[2]),re(),r=vt(r,_,h,1,g,m,a,o,Bt,qg,null,Ng),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)M(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 Hg="pb_sdk_preference";function DP(n,e,t){let i,{class:l="m-b-sm"}=e,{js:s=""}=e,{dart:o=""}=e,r=localStorage.getItem(Hg)||"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(Hg,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 IP extends Se{constructor(e){super(),we(this,e,DP,EP,ye,{class:0,js:3,dart:4})}}function LP(n){let e,t,i,l,s,o=U.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new ce({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[PP,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),l=W(`Generate a non-refreshable auth token for
+                    `),s=b("strong"),r=W(o),a=W(":"),u=$(),j(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){v(h,e,g),w(e,t),w(t,i),w(i,l),w(i,s),w(s,r),w(s,a),w(e,u),q(f,e,null),c=!0,d||(m=Y(e,"submit",nt(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=U.displayValue(h[1])+"")&&oe(r,o);const _={};g&3145761&&(_.$$scope={dirty:g,ctx:h}),f.$set(_)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&k(e),H(f),d=!1,m()}}}function AP(n){let e,t,i,l=n[3].authStore.token+"",s,o,r,a,u,f;return r=new Ci({props:{value:n[3].authStore.token}}),u=new IP({props:{class:"m-b-0",js:`
                 import PocketBase from 'pocketbase';
 
                 const token = "...";
@@ -154,23 +154,23 @@ var Ek=Object.defineProperty;var Dk=(n,e,t)=>e in n?Ek(n,e,{enumerable:!0,config
                 final pb = PocketBase('${c[7]}');
 
                 pb.authStore.save(token, null);
-            `),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(k(e),k(a)),H(r),H(u,c)}}}function LP(n){let e,t,i,l,s,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),l=$(),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=Y(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 AP(n){let e,t,i,l,s,o;const r=[IP,DP],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=$(),l.c(),s=ve(),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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(e),k(t),k(s)),a[i].d(f)}}}function PP(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 NP(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],ee(e,"btn-loading",n[6])},m(s,o){v(s,e,o),w(e,t),i||(l=Y(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&ee(e,"btn-loading",s[6])},d(s){s&&k(e),i=!1,l()}}}function RP(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=Y(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&k(e),i=!1,l()}}}function FP(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?RP:NP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=$(),u.c(),l=ve(),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=Y(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 qP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[FP],header:[PP],default:[AP]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function HP(n,e,t){let i;const l=yt(),s="impersonate_"+U.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),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 _e.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){_e.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),C=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Pe.call(this,n,L)}function E(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=U.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,y,S,C,T,O,E]}class jP extends Se{constructor(e){super(),we(this,e,HP,qP,ye,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function Hg(n,e,t){const i=n.slice();return i[84]=e[t],i[85]=e,i[86]=t,i}function jg(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=$(),s=b("div"),o=W(`The record has previous unsaved changes.
-                            `),r=b("button"),r.textContent="Restore draft",a=$(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=$(),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=[Y(r,"click",n[48]),Me(qe.call(null,u,"Discard draft")),Y(u,"click",nt(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=_u(e,mt,{duration:150})),m=!1},d(_){_&&k(e),_&&d&&d.end(),h=!1,Ie(g)}}}function zg(n){let e,t,i;return t=new gL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function zP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=!n[6]&&zg(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="id",s=$(),o=b("span"),a=$(),C&&C.c(),u=$(),f=b("input"),p(t,"class",zs(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!U.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=((O=n[19])==null?void 0:O.min)||null),p(f,"maxlength",h=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){v(T,e,O),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v(T,a,O),C&&C.m(T,O),v(T,u,O),v(T,f,O),he(f,n[3].id),_=!0,y||(S=Y(f,"input",n[50]),y=!0)},p(T,O){var E,L,I;(!_||O[2]&33554432&&r!==(r=T[87]))&&p(e,"for",r),T[6]?C&&(re(),D(C,1,1,()=>{C=null}),ae()):C?(C.p(T,O),O[0]&64&&M(C,1)):(C=zg(T),C.c(),M(C,1),C.m(u.parentNode,u)),(!_||O[2]&33554432&&c!==(c=T[87]))&&p(f,"id",c),(!_||O[0]&524416&&d!==(d=!T[7]&&!U.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!_||O[0]&524288&&h!==(h=((I=T[19])==null?void 0:I.max)||null))&&p(f,"maxlength",h),(!_||O[0]&64&&g!==(g=!T[6]))&&(f.readOnly=g),O[0]&8&&f.value!==T[3].id&&he(f,T[3].id)},i(T){_||(M(C),_=!0)},o(T){D(C),_=!1},d(T){T&&(k(e),k(a),k(u),k(f)),C&&C.d(T),y=!1,S()}}}function Ug(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new NL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Vg();return{c(){j(e.$$.fragment),i=$(),a&&a.c(),l=ve()},m(u,f){q(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],Ce(()=>t=!1)),e.$set(c),u[16].length?a||(a=Vg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(k(i),k(l)),H(e,u),a&&a.d(u)}}}function Vg(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function UP(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function VP(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new cP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function BP(n){let e,t,i,l,s;function o(f){n[61](f,n[84])}function r(f){n[62](f,n[84])}function a(f){n[63](f,n[84])}let u={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(u.value=n[3][n[84].name]),n[4][n[84].name]!==void 0&&(u.uploadedFiles=n[4][n[84].name]),n[5][n[84].name]!==void 0&&(u.deletedFileNames=n[5][n[84].name]),e=new DA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[84]),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[84].name],Ce(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[84].name],Ce(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[84].name],Ce(()=>l=!1)),e.$set(d)},i(f){s||(M(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function WP(n){let e,t,i;function l(o){n[60](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new HA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YP(n){let e,t,i;function l(o){n[59](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new hP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function KP(n){let e,t,i;function l(o){n[58](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new KL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JP(n){let e,t,i;function l(o){n[57](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new pA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZP(n){let e,t,i;function l(o){n[56](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new $P({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GP(n){let e,t,i;function l(o){n[55](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new gA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XP(n){let e,t,i;function l(o){n[54](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QP(n){let e,t,i;function l(o){n[53](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new VA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xP(n){let e,t,i;function l(o){n[52](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new wP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Bg(n,e){let t,i,l,s,o;const r=[xP,QP,XP,GP,ZP,JP,KP,YP,WP,BP,VP,UP],a=[];function u(f,c){return f[84].type==="text"?0:f[84].type==="number"?1:f[84].type==="bool"?2:f[84].type==="email"?3:f[84].type==="url"?4:f[84].type==="editor"?5:f[84].type==="date"?6:f[84].type==="select"?7:f[84].type==="json"?8:f[84].type==="file"?9:f[84].type==="relation"?10:f[84].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ve(),l&&l.c(),s=ve(),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()),M(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(t),k(s)),~i&&a[i].d(f)}}}function Wg(n){let e,t,i;return t=new SL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[15]===io)},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&ee(e,"active",l[15]===io)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function eN(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&jg(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[zP,({uniqueId:S})=>({87:S}),({uniqueId:S})=>[0,0,S?33554432:0]]},$$scope:{ctx:n}}});let h=n[9]&&Ug(n),g=pe(n[16]);const _=S=>S[84].name;for(let S=0;S<g.length;S+=1){let C=Hg(n,g,S),T=_(C);a.set(T,r[S]=Bg(T,C))}let y=n[9]&&!n[17]&&!n[6]&&Wg(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=$(),j(l.$$.fragment),s=$(),h&&h.c(),o=$();for(let S=0;S<r.length;S+=1)r[S].c();u=$(),y&&y.c(),p(t,"id",n[21]),p(t,"class","tab-item"),ee(t,"no-pointer-events",n[7]),ee(t,"active",n[15]===El),p(e,"class","tabs-content no-animations")},m(S,C){v(S,e,C),w(e,t),m&&m.m(t,null),w(t,i),q(l,t,null),w(t,s),h&&h.m(t,null),w(t,o);for(let T=0;T<r.length;T+=1)r[T]&&r[T].m(t,null);w(e,u),y&&y.m(e,null),f=!0,c||(d=[Y(t,"submit",nt(n[25])),Y(t,"keydown",n[30])],c=!0)},p(S,C){!S[8]&&S[12]&&!S[7]?m?(m.p(S,C),C[0]&4480&&M(m,1)):(m=jg(S),m.c(),M(m,1),m.m(t,i)):m&&(re(),D(m,1,1,()=>{m=null}),ae());const T={};C[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),C[0]&524488|C[2]&100663296&&(T.$$scope={dirty:C,ctx:S}),l.$set(T),S[9]?h?(h.p(S,C),C[0]&512&&M(h,1)):(h=Ug(S),h.c(),M(h,1),h.m(t,o)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),C[0]&65596&&(g=pe(S[16]),re(),r=vt(r,C,_,1,S,g,a,t,Bt,Bg,null,Hg),ae()),(!f||C[0]&128)&&ee(t,"no-pointer-events",S[7]),(!f||C[0]&32768)&&ee(t,"active",S[15]===El),S[9]&&!S[17]&&!S[6]?y?(y.p(S,C),C[0]&131648&&M(y,1)):(y=Wg(S),y.c(),M(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(S){if(!f){M(m),M(l.$$.fragment,S),M(h);for(let C=0;C<g.length;C+=1)M(r[C]);M(y),f=!0}},o(S){D(m),D(l.$$.fragment,S),D(h);for(let C=0;C<r.length;C+=1)D(r[C]);D(y),f=!1},d(S){S&&k(e),m&&m.d(),H(l),h&&h.d();for(let C=0;C<r.length;C+=1)r[C].d();y&&y.d(),c=!1,Ie(d)}}}function tN(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]&&Yg(n);return{c(){e=b("h4"),i=W(t),l=$(),s=b("strong"),r=W(o),a=W(" record"),u=$(),d&&d.c(),f=ve(),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")&&oe(i,t),(!c||g[0]&1)&&o!==(o=((_=h[0])==null?void 0:_.name)+"")&&oe(r,o),h[6]?d&&(re(),D(d,1,1,()=>{d=null}),ae()):d?(d.p(h,g),g[0]&64&&M(d,1)):(d=Yg(h),d.c(),M(d,1),d.m(f.parentNode,f))},i(h){c||(M(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(k(e),k(u),k(f)),d&&d.d(h)}}}function nN(n){let e,t,i;return{c(){e=b("span"),t=$(),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 Yg(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[iN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&67108864&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),H(o)}}}function Kg(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=Y(e,"click",n[40]),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=Y(e,"click",n[41]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Zg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-id-card-line" aria-hidden="true"></i> <span class="txt">Impersonate</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[42]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function iN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&Kg(n),h=n[9]&&n[2].email&&Jg(n),g=n[9]&&Zg(n);return{c(){m&&m.c(),e=$(),h&&h.c(),t=$(),g&&g.c(),i=$(),l=b("button"),l.innerHTML='<i class="ri-braces-line" aria-hidden="true"></i> <span class="txt">Copy raw JSON</span>',s=$(),o=b("button"),o.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',r=$(),a=b("hr"),u=$(),f=b("button"),f.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item closable"),p(o,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item txt-danger closable"),p(f,"role","menuitem")},m(_,y){m&&m.m(_,y),v(_,e,y),h&&h.m(_,y),v(_,t,y),g&&g.m(_,y),v(_,i,y),v(_,l,y),v(_,s,y),v(_,o,y),v(_,r,y),v(_,a,y),v(_,u,y),v(_,f,y),c||(d=[Y(l,"click",n[43]),Y(o,"click",n[44]),Y(f,"click",On(nt(n[45])))],c=!0)},p(_,y){_[9]&&!_[2].verified&&_[2].email?m?m.p(_,y):(m=Kg(_),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_[9]&&_[2].email?h?h.p(_,y):(h=Jg(_),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),_[9]?g?g.p(_,y):(g=Zg(_),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(_){_&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r),k(a),k(u),k(f)),m&&m.d(_),h&&h.d(_),g&&g.d(_),c=!1,Ie(d)}}}function Gg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=$(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),ee(t,"active",n[15]===El),p(l,"type","button"),p(l,"class","tab-item"),ee(l,"active",n[15]===io),p(e,"class","tabs-header stretched")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[Y(t,"click",n[46]),Y(l,"click",n[47])],s=!0)},p(r,a){a[0]&32768&&ee(t,"active",r[15]===El),a[0]&32768&&ee(l,"active",r[15]===io)},d(r){r&&k(e),s=!1,Ie(o)}}}function lN(n){let e,t,i,l,s;const o=[nN,tN],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]&&Gg(n);return{c(){t.c(),i=$(),u&&u.c(),l=ve()},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()),M(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Gg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(M(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(k(i),k(l)),r[e].d(f),u&&u.d(f)}}}function Xg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[sN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function sN(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=Y(e,"click",n[39]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function oN(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&Xg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=$(),s=b("div"),o=b("button"),r=b("span"),u=W(a),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"),o.disabled=f=!n[18]||n[13],ee(o,"btn-expanded",n[6]),ee(o,"btn-expanded-sm",!n[6]),ee(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=Y(e,"click",n[38]),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")&&oe(u,a),(!d||y[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||y[0]&64)&&ee(o,"btn-expanded",_[6]),(!d||y[0]&64)&&ee(o,"btn-expanded-sm",!_[6]),(!d||y[0]&8320)&&ee(o,"btn-loading",_[13]||_[7]),_[6]?g&&(re(),D(g,1,1,()=>{g=null}),ae()):g?(g.p(_,y),y[0]&64&&M(g,1)):(g=Xg(_),g.c(),M(g,1),g.m(s,null))},i(_){d||(M(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(k(e),k(l),k(s)),g&&g.d(),m=!1,h()}}}function Qg(n){let e,t,i={record:n[3],collection:n[0]};return e=new jP({props:i}),n[70](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),s[0]&1&&(o.collection=l[0]),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[70](null),H(e,l)}}}function rN(n){let e,t,i,l,s={class:`
+            `),u.$set(h)},i(c){f||(M(r.$$.fragment,c),M(u.$$.fragment,c),f=!0)},o(c){D(r.$$.fragment,c),D(u.$$.fragment,c),f=!1},d(c){c&&(k(e),k(a)),H(r),H(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=W("Token duration (in seconds)"),l=$(),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=Y(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 NP(n){let e,t,i,l,s,o;const r=[AP,LP],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=$(),l.c(),s=ve(),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()),M(l,1),l.m(s.parentNode,s))},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(e),k(t),k(s)),a[i].d(f)}}}function RP(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 FP(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],ee(e,"btn-loading",n[6])},m(s,o){v(s,e,o),w(e,t),i||(l=Y(e,"click",n[13]),i=!0)},p(s,o){o&64&&(e.disabled=s[6]),o&64&&ee(e,"btn-loading",s[6])},d(s){s&&k(e),i=!1,l()}}}function qP(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=Y(e,"click",n[12]),i=!0)},p(s,o){o&64&&(e.disabled=s[6])},d(s){s&&k(e),i=!1,l()}}}function HP(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?qP:FP}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=$(),u.c(),l=ve(),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=Y(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 jP(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[HP],header:[RP],default:[NP]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&64&&(o.escClose=!l[6]),s&64&&(o.beforeHide=l[15]),s&2097387&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[16](null),H(e,l)}}}function zP(n,e,t){let i;const l=yt(),s="impersonate_"+U.randomString(5);let{collection:o}=e,{record:r}=e,a,u=0,f=!1,c;function d(){r&&(g(),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 _e.collection(o.name).impersonate(r.id,u)),l("submit",c)}catch(L){_e.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),C=()=>!f;function T(L){ie[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Pe.call(this,n,L)}function E(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=U.getApiExampleUrl(c==null?void 0:c.baseURL))},[o,r,m,c,a,u,f,i,s,h,g,d,_,y,S,C,T,O,E]}class UP extends Se{constructor(e){super(),we(this,e,zP,jP,ye,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function jg(n,e,t){const i=n.slice();return i[84]=e[t],i[85]=e,i[86]=t,i}function zg(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=$(),s=b("div"),o=W(`The record has previous unsaved changes.
+                            `),r=b("button"),r.textContent="Restore draft",a=$(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=$(),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=[Y(r,"click",n[48]),Me(qe.call(null,u,"Discard draft")),Y(u,"click",nt(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=gu(e,mt,{duration:150})),m=!1},d(_){_&&k(e),_&&d&&d.end(),h=!1,Ie(g)}}}function Ug(n){let e,t,i;return t=new yL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function VP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C=!n[6]&&Ug(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=$(),l=b("span"),l.textContent="id",s=$(),o=b("span"),a=$(),C&&C.c(),u=$(),f=b("input"),p(t,"class",zs(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[87]),p(f,"type","text"),p(f,"id",c=n[87]),p(f,"placeholder",d=!n[7]&&!U.isEmpty((T=n[19])==null?void 0:T.autogeneratePattern)?"Leave empty to auto generate...":""),p(f,"minlength",m=((O=n[19])==null?void 0:O.min)||null),p(f,"maxlength",h=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){v(T,e,O),w(e,t),w(e,i),w(e,l),w(e,s),w(e,o),v(T,a,O),C&&C.m(T,O),v(T,u,O),v(T,f,O),he(f,n[3].id),_=!0,y||(S=Y(f,"input",n[50]),y=!0)},p(T,O){var E,L,I;(!_||O[2]&33554432&&r!==(r=T[87]))&&p(e,"for",r),T[6]?C&&(re(),D(C,1,1,()=>{C=null}),ae()):C?(C.p(T,O),O[0]&64&&M(C,1)):(C=Ug(T),C.c(),M(C,1),C.m(u.parentNode,u)),(!_||O[2]&33554432&&c!==(c=T[87]))&&p(f,"id",c),(!_||O[0]&524416&&d!==(d=!T[7]&&!U.isEmpty((E=T[19])==null?void 0:E.autogeneratePattern)?"Leave empty to auto generate...":""))&&p(f,"placeholder",d),(!_||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!_||O[0]&524288&&h!==(h=((I=T[19])==null?void 0:I.max)||null))&&p(f,"maxlength",h),(!_||O[0]&64&&g!==(g=!T[6]))&&(f.readOnly=g),O[0]&8&&f.value!==T[3].id&&he(f,T[3].id)},i(T){_||(M(C),_=!0)},o(T){D(C),_=!1},d(T){T&&(k(e),k(a),k(u),k(f)),C&&C.d(T),y=!1,S()}}}function Vg(n){let e,t,i,l,s;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new FL({props:r}),ie.push(()=>be(e,"record",o));let a=n[16].length&&Bg();return{c(){j(e.$$.fragment),i=$(),a&&a.c(),l=ve()},m(u,f){q(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],Ce(()=>t=!1)),e.$set(c),u[16].length?a||(a=Bg(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){s||(M(e.$$.fragment,u),s=!0)},o(u){D(e.$$.fragment,u),s=!1},d(u){u&&(k(i),k(l)),H(e,u),a&&a.d(u)}}}function Bg(n){let e;return{c(){e=b("hr")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function BP(n){let e,t,i;function l(o){n[65](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new ZA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function WP(n){let e,t,i;function l(o){n[64](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new pP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function YP(n){let e,t,i,l,s;function o(f){n[61](f,n[84])}function r(f){n[62](f,n[84])}function a(f){n[63](f,n[84])}let u={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(u.value=n[3][n[84].name]),n[4][n[84].name]!==void 0&&(u.uploadedFiles=n[4][n[84].name]),n[5][n[84].name]!==void 0&&(u.deletedFileNames=n[5][n[84].name]),e=new LA({props:u}),ie.push(()=>be(e,"value",o)),ie.push(()=>be(e,"uploadedFiles",r)),ie.push(()=>be(e,"deletedFileNames",a)),{c(){j(e.$$.fragment)},m(f,c){q(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[84]),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[84].name],Ce(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[84].name],Ce(()=>i=!1)),!l&&c[0]&65568&&(l=!0,d.deletedFileNames=n[5][n[84].name],Ce(()=>l=!1)),e.$set(d)},i(f){s||(M(e.$$.fragment,f),s=!0)},o(f){D(e.$$.fragment,f),s=!1},d(f){H(e,f)}}}function KP(n){let e,t,i;function l(o){n[60](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new zA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function JP(n){let e,t,i;function l(o){n[59](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new gP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function ZP(n){let e,t,i;function l(o){n[58](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new ZL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function GP(n){let e,t,i;function l(o){n[57](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new hA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function XP(n){let e,t,i;function l(o){n[56](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new MP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function QP(n){let e,t,i;function l(o){n[55](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new yA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function xP(n){let e,t,i;function l(o){n[54](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new WL({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eN(n){let e,t,i;function l(o){n[53](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new WA({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tN(n){let e,t,i;function l(o){n[52](o,n[84])}let s={field:n[84],original:n[2],record:n[3]};return n[3][n[84].name]!==void 0&&(s.value=n[3][n[84].name]),e=new TP({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[84]),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[84].name],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function Wg(n,e){let t,i,l,s,o;const r=[tN,eN,xP,QP,XP,GP,ZP,JP,KP,YP,WP,BP],a=[];function u(f,c){return f[84].type==="text"?0:f[84].type==="number"?1:f[84].type==="bool"?2:f[84].type==="email"?3:f[84].type==="url"?4:f[84].type==="editor"?5:f[84].type==="date"?6:f[84].type==="select"?7:f[84].type==="json"?8:f[84].type==="file"?9:f[84].type==="relation"?10:f[84].type==="password"?11:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ve(),l&&l.c(),s=ve(),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()),M(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(M(l),o=!0)},o(f){D(l),o=!1},d(f){f&&(k(t),k(s)),~i&&a[i].d(f)}}}function Yg(n){let e,t,i;return t=new CL({props:{record:n[3]}}),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[15]===io)},m(l,s){v(l,e,s),q(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&32768)&&ee(e,"active",l[15]===io)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function nN(n){let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&zg(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[VP,({uniqueId:S})=>({87:S}),({uniqueId:S})=>[0,0,S?33554432:0]]},$$scope:{ctx:n}}});let h=n[9]&&Vg(n),g=pe(n[16]);const _=S=>S[84].name;for(let S=0;S<g.length;S+=1){let C=jg(n,g,S),T=_(C);a.set(T,r[S]=Wg(T,C))}let y=n[9]&&!n[17]&&!n[6]&&Yg(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=$(),j(l.$$.fragment),s=$(),h&&h.c(),o=$();for(let S=0;S<r.length;S+=1)r[S].c();u=$(),y&&y.c(),p(t,"id",n[21]),p(t,"class","tab-item"),ee(t,"no-pointer-events",n[7]),ee(t,"active",n[15]===El),p(e,"class","tabs-content no-animations")},m(S,C){v(S,e,C),w(e,t),m&&m.m(t,null),w(t,i),q(l,t,null),w(t,s),h&&h.m(t,null),w(t,o);for(let T=0;T<r.length;T+=1)r[T]&&r[T].m(t,null);w(e,u),y&&y.m(e,null),f=!0,c||(d=[Y(t,"submit",nt(n[25])),Y(t,"keydown",n[30])],c=!0)},p(S,C){!S[8]&&S[12]&&!S[7]?m?(m.p(S,C),C[0]&4480&&M(m,1)):(m=zg(S),m.c(),M(m,1),m.m(t,i)):m&&(re(),D(m,1,1,()=>{m=null}),ae());const T={};C[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),C[0]&524488|C[2]&100663296&&(T.$$scope={dirty:C,ctx:S}),l.$set(T),S[9]?h?(h.p(S,C),C[0]&512&&M(h,1)):(h=Vg(S),h.c(),M(h,1),h.m(t,o)):h&&(re(),D(h,1,1,()=>{h=null}),ae()),C[0]&65596&&(g=pe(S[16]),re(),r=vt(r,C,_,1,S,g,a,t,Bt,Wg,null,jg),ae()),(!f||C[0]&128)&&ee(t,"no-pointer-events",S[7]),(!f||C[0]&32768)&&ee(t,"active",S[15]===El),S[9]&&!S[17]&&!S[6]?y?(y.p(S,C),C[0]&131648&&M(y,1)):(y=Yg(S),y.c(),M(y,1),y.m(e,null)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(S){if(!f){M(m),M(l.$$.fragment,S),M(h);for(let C=0;C<g.length;C+=1)M(r[C]);M(y),f=!0}},o(S){D(m),D(l.$$.fragment,S),D(h);for(let C=0;C<r.length;C+=1)D(r[C]);D(y),f=!1},d(S){S&&k(e),m&&m.d(),H(l),h&&h.d();for(let C=0;C<r.length;C+=1)r[C].d();y&&y.d(),c=!1,Ie(d)}}}function iN(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]&&Kg(n);return{c(){e=b("h4"),i=W(t),l=$(),s=b("strong"),r=W(o),a=W(" record"),u=$(),d&&d.c(),f=ve(),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")&&oe(i,t),(!c||g[0]&1)&&o!==(o=((_=h[0])==null?void 0:_.name)+"")&&oe(r,o),h[6]?d&&(re(),D(d,1,1,()=>{d=null}),ae()):d?(d.p(h,g),g[0]&64&&M(d,1)):(d=Kg(h),d.c(),M(d,1),d.m(f.parentNode,f))},i(h){c||(M(d),c=!0)},o(h){D(d),c=!1},d(h){h&&(k(e),k(u),k(f)),d&&d.d(h)}}}function lN(n){let e,t,i;return{c(){e=b("span"),t=$(),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 Kg(n){let e,t,i,l,s,o,r;return o=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[sN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=$(),i=b("div"),l=b("i"),s=$(),j(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){v(a,e,u),v(a,t,u),v(a,i,u),w(i,l),w(i,s),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&67108864&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(M(o.$$.fragment,a),r=!0)},o(a){D(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),H(o)}}}function Jg(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=Y(e,"click",n[40]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Zg(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=Y(e,"click",n[41]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function Gg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-id-card-line" aria-hidden="true"></i> <span class="txt">Impersonate</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[42]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function sN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&Jg(n),h=n[9]&&n[2].email&&Zg(n),g=n[9]&&Gg(n);return{c(){m&&m.c(),e=$(),h&&h.c(),t=$(),g&&g.c(),i=$(),l=b("button"),l.innerHTML='<i class="ri-braces-line" aria-hidden="true"></i> <span class="txt">Copy raw JSON</span>',s=$(),o=b("button"),o.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',r=$(),a=b("hr"),u=$(),f=b("button"),f.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(o,"type","button"),p(o,"class","dropdown-item closable"),p(o,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item txt-danger closable"),p(f,"role","menuitem")},m(_,y){m&&m.m(_,y),v(_,e,y),h&&h.m(_,y),v(_,t,y),g&&g.m(_,y),v(_,i,y),v(_,l,y),v(_,s,y),v(_,o,y),v(_,r,y),v(_,a,y),v(_,u,y),v(_,f,y),c||(d=[Y(l,"click",n[43]),Y(o,"click",n[44]),Y(f,"click",On(nt(n[45])))],c=!0)},p(_,y){_[9]&&!_[2].verified&&_[2].email?m?m.p(_,y):(m=Jg(_),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_[9]&&_[2].email?h?h.p(_,y):(h=Zg(_),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),_[9]?g?g.p(_,y):(g=Gg(_),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(_){_&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r),k(a),k(u),k(f)),m&&m.d(_),h&&h.d(_),g&&g.d(_),c=!1,Ie(d)}}}function Xg(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=$(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),ee(t,"active",n[15]===El),p(l,"type","button"),p(l,"class","tab-item"),ee(l,"active",n[15]===io),p(e,"class","tabs-header stretched")},m(r,a){v(r,e,a),w(e,t),w(e,i),w(e,l),s||(o=[Y(t,"click",n[46]),Y(l,"click",n[47])],s=!0)},p(r,a){a[0]&32768&&ee(t,"active",r[15]===El),a[0]&32768&&ee(l,"active",r[15]===io)},d(r){r&&k(e),s=!1,Ie(o)}}}function oN(n){let e,t,i,l,s;const o=[lN,iN],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]&&Xg(n);return{c(){t.c(),i=$(),u&&u.c(),l=ve()},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()),M(t,1),t.m(i.parentNode,i)),f[9]&&!f[17]&&!f[6]?u?u.p(f,c):(u=Xg(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(M(t),s=!0)},o(f){D(t),s=!1},d(f){f&&(k(i),k(l)),r[e].d(f),u&&u.d(f)}}}function Qg(n){let e,t,i,l,s,o;return l=new jn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[rN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=$(),j(l.$$.fragment),p(t,"class","ri-arrow-down-s-line"),p(t,"aria-hidden","true"),p(e,"type","button"),p(e,"class","btn p-l-5 p-r-5 flex-gap-0"),e.disabled=s=!n[18]||n[13]},m(r,a){v(r,e,a),w(e,t),w(e,i),q(l,e,null),o=!0},p(r,a){const u={};a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),l.$set(u),(!o||a[0]&270336&&s!==(s=!r[18]||r[13]))&&(e.disabled=s)},i(r){o||(M(l.$$.fragment,r),o=!0)},o(r){D(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(l)}}}function rN(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=Y(e,"click",n[39]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function aN(n){let e,t,i,l,s,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&Qg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=$(),s=b("div"),o=b("button"),r=b("span"),u=W(a),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"),o.disabled=f=!n[18]||n[13],ee(o,"btn-expanded",n[6]),ee(o,"btn-expanded-sm",!n[6]),ee(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=Y(e,"click",n[38]),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")&&oe(u,a),(!d||y[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||y[0]&64)&&ee(o,"btn-expanded",_[6]),(!d||y[0]&64)&&ee(o,"btn-expanded-sm",!_[6]),(!d||y[0]&8320)&&ee(o,"btn-loading",_[13]||_[7]),_[6]?g&&(re(),D(g,1,1,()=>{g=null}),ae()):g?(g.p(_,y),y[0]&64&&M(g,1)):(g=Qg(_),g.c(),M(g,1),g.m(s,null))},i(_){d||(M(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(k(e),k(l),k(s)),g&&g.d(),m=!1,h()}}}function xg(n){let e,t,i={record:n[3],collection:n[0]};return e=new UP({props:i}),n[70](e),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),s[0]&1&&(o.collection=l[0]),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[70](null),H(e,l)}}}function uN(n){let e,t,i,l,s={class:`
         record-panel
         `+(n[20]?"overlay-panel-xl":"overlay-panel-lg")+`
         `+(n[9]&&!n[17]&&!n[6]?"colored-header":"")+`
-    `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[66],$$slots:{footer:[oN],header:[lN],default:[eN]},$$scope:{ctx:n}};e=new Xt({props:s}),n[67](e),e.$on("hide",n[68]),e.$on("show",n[69]);let o=n[9]&&Qg(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=ve()},m(r,a){q(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]&1180224&&(u.class=`
+    `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[66],$$slots:{footer:[aN],header:[oN],default:[nN]},$$scope:{ctx:n}};e=new Xt({props:s}),n[67](e),e.$on("hide",n[68]),e.$on("show",n[69]);let o=n[9]&&xg(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=ve()},m(r,a){q(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]&1180224&&(u.class=`
         record-panel
         `+(r[20]?"overlay-panel-xl":"overlay-panel-lg")+`
         `+(r[9]&&!r[17]&&!r[6]?"colored-header":"")+`
-    `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=Qg(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function aN(n,e,t){let i,l,s,o,r,a,u,f;const c=yt(),d="record_"+U.randomString(5);let{collection:m}=e,h,g,_={},y={},S=null,C=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=El,P=!0,N=!0,R=m,z=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return fe(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function V(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),V()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(y)),Z())}async function de(se){if(!se)return null;let Oe=typeof se=="string"?se:se==null?void 0:se.id;if(Oe)try{return await _e.collection(m.id).getOne(Oe)}catch(Ne){Ne.isAbort||(Z(),console.warn("resolveModel:",Ne),$i(`Unable to load record with id "${Oe}"`))}return typeof se=="object"?se:null}async function fe(se){t(7,N=!0),Ut({}),t(4,O={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,y=structuredClone(_)),t(2,_=await de(se)||{}),t(3,y=structuredClone(_)),await dn(),t(12,S=Ke()),!S||et(y,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(y)),t(7,N=!1)}async function ue(se){var Ne,ze;Ut({}),t(2,_=se||{}),t(4,O={}),t(5,E={});const Oe=((ze=(Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Oe.includes(Ge)||t(3,y[Ge]=se[Ge],y);await dn(),t(33,L=JSON.stringify(y)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Oe=window.localStorage.getItem(Te());if(Oe)return JSON.parse(Oe)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,y=S),t(12,S=null))}function et(se,Oe){var qt;const Ne=structuredClone(se||{}),ze=structuredClone(Oe||{}),Ge=(qt=m==null?void 0:m.fields)==null?void 0:qt.filter(Sn=>Sn.type==="file");for(let Sn of Ge)delete Ne[Sn.name],delete ze[Sn.name];const Qt=["expand","password","passwordConfirm"];for(let Sn of Qt)delete Ne[Sn],delete ze[Sn];return JSON.stringify(Ne)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Oe;if(!(C||!u||!(m!=null&&m.id))){t(13,C=!0);try{const Ne=jt();let ze;if(P?ze=await _e.collection(m.id).create(Ne):ze=await _e.collection(m.id).update(y.id,Ne),tn(P?"Successfully created record.":"Successfully updated record."),xe(),l&&(y==null?void 0:y.id)==((Oe=_e.authStore.record)==null?void 0:Oe.id)&&Ne.get("password"))return _e.logout();se?Z():ue(ze),c("save",{isNew:P,record:ze})}catch(Ne){_e.error(Ne)}t(13,C=!1)}}function at(){_!=null&&_.id&&_n("Do you really want to delete the selected record?",()=>_e.collection(_.collectionId).delete(_.id).then(()=>{Z(),tn("Successfully deleted record."),c("delete",_)}).catch(se=>{_e.error(se)}))}function jt(){const se=structuredClone(y||{}),Oe=new FormData,Ne={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Ne[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Ne.password=!0),i&&se.passwordConfirm&&(Ne.passwordConfirm=!0);for(const Ge in se)if(Ne[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(Qt){const qt={};throw qt[Ge]={code:"invalid_json",message:Qt.toString()},new Fn({status:400,response:{data:qt}})}U.addValueToFormData(Oe,Ge,se[Ge])}for(const Ge in O){const Qt=U.toArray(O[Ge]);for(const qt of Qt)Oe.append(Ge+"+",qt)}for(const Ge in E){const Qt=U.toArray(E[Ge]);for(const qt of Qt)Oe.append(Ge+"-",qt)}return Oe}function Ve(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent verification email to ${_.email}?`,()=>_e.collection(m.id).requestVerification(_.email).then(()=>{tn(`Successfully sent verification email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function Ee(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent password reset email to ${_.email}?`,()=>_e.collection(m.id).requestPasswordReset(_.email).then(()=>{tn(`Successfully sent password reset email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function st(){a?_n("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let se=_?structuredClone(_):null;if(se){const Oe=["file","autodate"],Ne=(m==null?void 0:m.fields)||[];for(const ze of Ne)Oe.includes(ze.type)&&delete se[ze.name];se.id=""}xe(),J(se),await dn(),t(33,L="")}function Ye(se){(se.ctrlKey||se.metaKey)&&se.code=="KeyS"&&(se.preventDefault(),se.stopPropagation(),We(!1))}function ke(){U.copyToClipboard(JSON.stringify(_,null,2)),Ks("The record JSON was copied to your clipboard!",3e3)}const $e=()=>V(),ct=()=>We(!1),Ht=()=>Ve(),Le=()=>Ee(),ot=()=>g==null?void 0:g.show(),on=()=>ke(),En=()=>st(),Re=()=>at(),Ft=()=>t(15,A=El),Yt=()=>t(15,A=io),vn=()=>ft(),fn=()=>xe();function Oi(){y.id=this.value,t(3,y)}function li(se){y=se,t(3,y)}function bt(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function wn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function sn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Dt(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Mi(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function ul(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function zi(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Ui(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function fl(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Dn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Rl(se,Oe){n.$$.not_equal(O[Oe.name],se)&&(O[Oe.name]=se,t(4,O))}function cl(se,Oe){n.$$.not_equal(E[Oe.name],se)&&(E[Oe.name]=se,t(5,E))}function X(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function x(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}const le=()=>a&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Ut({}),xe(),!0);function ge(se){ie[se?"unshift":"push"](()=>{h=se,t(10,h)})}function Fe(se){Pe.call(this,n,se)}function Be(se){Pe.call(this,n,se)}function rt(se){ie[se?"unshift":"push"](()=>{g=se,t(11,g)})}return n.$$set=se=>{"collection"in se&&t(0,m=se.collection)},n.$$.update=()=>{var se,Oe,Ne;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=!!((se=m==null?void 0:m.fields)!=null&&se.find(ze=>ze.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Oe=m==null?void 0:m.fields)==null?void 0:Oe.find(ze=>ze.name==="id")),n.$$.dirty[0]&48&&t(37,r=U.hasNonEmptyProps(O)||U.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(y)),n.$$.dirty[1]&76&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&8&&(N||Je(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&G(),n.$$.dirty[0]&512&&t(36,f=i?B:F),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&t(16,z=((Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(ze=>!f.includes(ze.name)&&ze.type!="autodate"))||[])},[m,V,_,y,O,E,P,N,a,i,h,g,S,C,T,A,z,l,u,o,s,d,Z,ft,xe,We,at,Ve,Ee,st,Ye,ke,J,L,I,R,f,r,$e,ct,Ht,Le,ot,on,En,Re,Ft,Yt,vn,fn,Oi,li,bt,wn,sn,Dt,Mi,ul,zi,Ui,fl,Dn,Rl,cl,X,x,le,ge,Fe,Be,rt]}class rf extends Se{constructor(e){super(),we(this,e,aN,rN,ye,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function uN(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=$(),l=b("span"),o=W(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){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])+"")&&oe(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 fN(n,e,t){const i=yt();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=U.getAllCollectionIdentifiers(l),c=await _e.collection(l.id).getList(1,1,{filter:U.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 cN extends Se{constructor(e){super(),we(this,e,fN,uN,ye,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function xg(n,e,t){const i=n.slice();return i[58]=e[t],i}function e1(n,e,t){const i=n.slice();return i[61]=e[t],i}function t1(n,e,t){const i=n.slice();return i[61]=e[t],i}function n1(n,e,t){const i=n.slice();return i[54]=e[t],i}function i1(n){let e;function t(s,o){return s[9]?pN:dN}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 dN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=$(),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=Y(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&k(e),o=!1,r()}}}function pN(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 mN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[61].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=U.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function hN(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function _N(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?hN:mN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=$(),i=b("span"),s=W(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[61].name+"")&&oe(s,l)},d(u){u&&k(e),a.d()}}}function l1(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[_N]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function s1(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[33](e)},p:te,d(t){t&&k(e),n[33](null)}}}function o1(n){let e;function t(s,o){return s[9]?bN:gN}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 gN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return kN;if(!a[16])return yN}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=$(),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 bN(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 yN(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=Y(e,"click",n[38]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function kN(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=Y(e,"click",n[37]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function r1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=$(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[Y(i,"change",c),Y(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,Ie(f)}}}function a1(n,e){let t,i,l,s;return i=new wk({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){v(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function u1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&r1(e),d=pe(e[15]);const m=_=>_[61].id;for(let _=0;_<d.length;_+=1){let y=e1(e,d,_),S=m(y);s.set(S,l[_]=a1(S,y))}function h(){return e[35](e[58])}function g(..._){return e[36](e[58],..._)}return{key:n,first:null,c(){t=b("tr"),c&&c.c(),i=$();for(let _=0;_<l.length;_+=1)l[_].c();o=$(),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=[Y(t,"click",h),Y(t,"keydown",g)],u=!0)},p(_,y){e=_,e[16]?c&&(c.d(1),c=null):c?c.p(e,y):(c=r1(e),c.c(),c.m(t,i)),y[0]&32776&&(d=pe(e[15]),re(),l=vt(l,y,m,1,e,d,s,t,Bt,a1,o,e1),ae())},i(_){if(!a){for(let y=0;y<d.length;y+=1)M(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,Ie(f)}}}function f1(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],ee(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=Y(i,"click",nt(n[39])),s=!0)},p(r,a){a[0]&512&&(i.disabled=r[9]),a[0]&512&&ee(i,"btn-loading",r[9])},d(r){r&&k(e),s=!1,o()}}}function vN(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c=[],d=new Map,m,h,g=!n[16]&&i1(n),_=pe(n[15]);const y=L=>L[61].id;for(let L=0;L<_.length;L+=1){let I=t1(n,_,L),A=y(I);o.set(A,s[L]=l1(A,I))}let S=n[12].length&&s1(n),C=pe(n[3]);const T=L=>L[16]?L[58]:L[58].id;for(let L=0;L<C.length;L+=1){let I=xg(n,C,L),A=T(I);d.set(A,c[L]=u1(A,I))}let O=null;C.length||(O=o1(n));let E=n[3].length&&n[14]&&f1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=$();for(let L=0;L<s.length;L+=1)s[L].c();r=$(),a=b("th"),S&&S.c(),u=$(),f=b("tbody");for(let L=0;L<c.length;L+=1)c[L].c();O&&O.c(),m=$(),E&&E.c(),p(a,"class","col-type-action min-width"),p(e,"class","table"),ee(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);O&&O.m(f,null),w(f,m),E&&E.m(f,null),h=!0},p(L,I){L[16]?g&&(g.d(1),g=null):g?g.p(L,I):(g=i1(L),g.c(),g.m(i,l)),I[0]&32769&&(_=pe(L[15]),re(),s=vt(s,I,y,1,L,_,o,i,Bt,l1,r,t1),ae()),L[12].length?S?S.p(L,I):(S=s1(L),S.c(),S.m(a,null)):S&&(S.d(1),S=null),I[0]&1278490&&(C=pe(L[3]),re(),c=vt(c,I,T,1,L,C,d,f,Bt,u1,m,xg),ae(),!C.length&&O?O.p(L,I):C.length?O&&(O.d(1),O=null):(O=o1(L),O.c(),O.m(f,m))),L[3].length&&L[14]?E?E.p(L,I):(E=f1(L),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!h||I[0]&512)&&ee(e,"table-loading",L[9])},i(L){if(!h){for(let I=0;I<_.length;I+=1)M(s[I]);for(let I=0;I<C.length;I+=1)M(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();O&&O.d(),E&&E.d()}}}function c1(n){let e,t;return e=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[11],$$slots:{default:[SN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&2048&&(s.trigger=i[11]),l[0]&4128|l[2]&16&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function wN(n){let e,t,i,l,s,o=n[54].name+"",r,a,u,f,c;function d(...m){return n[30](n[54],...m)}return{c(){e=b("input"),l=$(),s=b("label"),r=W(o),u=$(),p(e,"type","checkbox"),p(e,"id",t=n[57]),e.checked=i=!n[5].includes(n[54].id),p(s,"for",a=n[57])},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),v(m,u,h),f||(c=Y(e,"change",d),f=!0)},p(m,h){n=m,h[1]&67108864&&t!==(t=n[57])&&p(e,"id",t),h[0]&4128&&i!==(i=!n[5].includes(n[54].id))&&(e.checked=i),h[0]&4096&&o!==(o=n[54].name+"")&&oe(r,o),h[1]&67108864&&a!==(a=n[57])&&p(s,"for",a)},d(m){m&&(k(e),k(l),k(s),k(u)),f=!1,c()}}}function d1(n,e){let t,i,l;return i=new ce({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[wN,({uniqueId:s})=>({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(i,s)}}}function SN(n){let e,t,i=[],l=new Map,s,o,r=pe(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u<r.length;u+=1){let f=n1(n,r,u),c=a(f);l.set(c,i[u]=d1(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=$();for(let u=0;u<i.length;u+=1)i[u].c();s=ve(),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]&67108864&&(r=pe(u[12]),re(),i=vt(i,f,a,1,u,r,l,s.parentNode,Bt,d1,s,n1),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)M(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 TN(n){let e,t,i=n[11]&&c1(n);return{c(){i&&i.c(),e=ve()},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&&M(i,1)):(i=c1(l),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function p1(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=W("Selected "),l=b("strong"),s=W(n[6]),o=$(),a=W(r),u=$(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=$(),d=b("div"),m=$(),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"),ee(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),ee(h,"btn-loading",n[10]),ee(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m(C,T){v(C,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,y||(S=[Y(f,"click",n[41]),Y(h,"click",n[42])],y=!0)},p(C,T){(!_||T[0]&64)&&oe(s,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&oe(a,r),(!_||T[0]&1024)&&ee(f,"btn-disabled",C[10]),(!_||T[0]&1024)&&ee(h,"btn-loading",C[10]),(!_||T[0]&1024)&&ee(h,"btn-disabled",C[10])},i(C){_||(C&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(C){C&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(C){C&&k(e),C&&g&&g.end(),y=!1,Ie(S)}}}function CN(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[TN],default:[vN]},$$scope:{ctx:n}};e=new Nu({props:s}),n[40](e);let o=n[6]&&p1(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=ve()},m(r,a){q(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]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&M(o,1)):(o=p1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[40](null),H(e,r),o&&o.d(r)}}}const $N=/^([\+\-])?(\w+)$/,m1=40;function ON(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,Mn,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=yt();let{collection:g}=e,{sort:_=""}=e,{filter:y=""}=e,S,C=[],T=1,O=0,E={},L=!0,I=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function B(){g!=null&&g.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function V(Le){return!!C.find(ot=>ot.id==Le)}async function Z(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await G(ot,!1)}async function G(Le=1,ot=!0){var fn,Oi,li;if(!(g!=null&&g.id))return;t(9,L=!0);let on=_;const En=on.match($N),Re=En?r.find(bt=>bt.name===En[2]):null;if(En&&Re){const bt=((li=(Oi=(fn=d==null?void 0:d.find(sn=>sn.id==Re.collectionId))==null?void 0:fn.fields)==null?void 0:Oi.filter(sn=>sn.presentable))==null?void 0:li.map(sn=>sn.name))||[],wn=[];for(const sn of bt)wn.push((En[1]||"")+En[2]+"."+sn);wn.length>0&&(on=wn.join(","))}const Ft=U.getAllCollectionIdentifiers(g),Yt=o.map(bt=>bt.name+":excerpt(200)").concat(r.map(bt=>"expand."+bt.name+".*:excerpt(200)"));Yt.length&&Yt.unshift("*");const vn=[];for(const bt of r){const wn=U.getExpandPresentableRelField(bt,d,2);wn&&vn.push(wn)}return _e.collection(g.id).getList(Le,m1,{sort:on,skipTotal:1,filter:U.normalizeSearchFilter(y,Ft),expand:vn.join(","),fields:Yt.join(","),requestKey:"records_list"}).then(async bt=>{var wn;if(Le<=1&&de(),t(9,L=!1),t(8,T=bt.page),t(25,O=bt.items.length),h("load",C.concat(bt.items)),o.length)for(let sn of bt.items)sn._partial=!0;if(ot){const sn=++A;for(;(wn=bt.items)!=null&&wn.length&&A==sn;){const Dt=bt.items.splice(0,20);for(let Mi of Dt)U.pushOrReplaceByKey(C,Mi);t(3,C),await U.yieldToMain()}}else{for(let sn of bt.items)U.pushOrReplaceByKey(C,sn);t(3,C)}}).catch(bt=>{bt!=null&&bt.isAbort||(t(9,L=!1),console.warn(bt),de(),_e.error(bt,!y||(bt==null?void 0:bt.status)!=400))})}function de(){S==null||S.resetVerticalScroll(),t(3,C=[]),t(8,T=1),t(25,O=0),t(4,E={})}function fe(){c?ue():Te()}function ue(){t(4,E={})}function Te(){for(const Le of C)t(4,E[Le.id]=Le,E);t(4,E)}function Ke(Le){E[Le.id]?delete E[Le.id]:t(4,E[Le.id]=Le,E),t(4,E)}function Je(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ft)}async function ft(){if(I||!f||!(g!=null&&g.id))return;let Le=[];for(const ot of Object.keys(E))Le.push(_e.collection(g.id).delete(ot));return t(10,I=!0),Promise.all(Le).then(()=>{tn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ue()}).catch(ot=>{_e.error(ot)}).finally(()=>(t(10,I=!1),Z()))}function et(Le){Pe.call(this,n,Le)}const xe=(Le,ot)=>{ot.target.checked?U.removeByValue(N,Le.id):U.pushUnique(N,Le.id),t(5,N)},We=()=>fe();function at(Le){_=Le,t(0,_)}function jt(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ke(Le),Ee=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,y=""),Ye=()=>h("new"),ke=()=>G(T+1);function $e(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ct=()=>ue(),Ht=()=>Je();return n.$$set=Le=>{"collection"in Le&&t(22,g=Le.collection),"sort"in Le&&t(0,_=Le.sort),"filter"in Le&&t(1,y=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&g!=null&&g.id&&(z=g.id+"@hiddenColumns",J(),de()),n.$$.dirty[0]&4194304&&t(16,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((g==null?void 0:g.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&_!==-1&&y!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=O>=m1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=C.length&&f===C.length),n.$$.dirty[0]&32&&N!==-1&&B(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[_,y,G,C,E,N,f,S,T,L,I,P,R,c,u,a,i,h,fe,ue,Ke,Je,g,V,Z,O,s,l,m,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke,$e,ct,Ht]}class MN extends Se{constructor(e){super(),we(this,e,ON,CN,ye,{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 EN(n){let e,t,i,l;return e=new fI({}),i=new pi({props:{class:"flex-content",$$slots:{footer:[AN],default:[LN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function DN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[RN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function IN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[FN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function h1(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(qe.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[21])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function _1(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=Y(e,"click",n[24]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function LN(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N=!n[12]&&h1(n);c=new Pu({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&_1(n);y=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new MN({props:B}),n[26](O),ie.push(()=>be(O,"filter",z)),ie.push(()=>be(O,"sort",F)),O.$on("select",n[29]),O.$on("delete",n[30]),O.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=$(),s=b("div"),r=W(o),a=$(),u=b("div"),N&&N.c(),f=$(),j(c.$$.fragment),d=$(),m=b("div"),h=b("button"),h.innerHTML='<i class="ri-code-s-slash-line"></i> <span class="txt">API Preview</span>',g=$(),R&&R.c(),_=$(),j(y.$$.fragment),S=$(),C=b("div"),T=$(),j(O.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(J,V){v(J,e,V),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),R&&R.m(m,null),v(J,_,V),q(y,J,V),v(J,S,V),v(J,C,V),v(J,T,V),q(O,J,V),I=!0,A||(P=Y(h,"click",n[23]),A=!0)},p(J,V){(!I||V[0]&4)&&o!==(o=J[2].name+"")&&oe(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,V):(N=h1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,V):(R=_1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const Z={};V[0]&1&&(Z.value=J[0]),V[0]&4&&(Z.autocompleteCollection=J[2]),y.$set(Z);const G={};V[0]&4&&(G.collection=J[2]),!E&&V[0]&1&&(E=!0,G.filter=J[0],Ce(()=>E=!1)),!L&&V[0]&2&&(L=!0,G.sort=J[1],Ce(()=>L=!1)),O.$set(G)},i(J){I||(M(c.$$.fragment,J),M(y.$$.fragment,J),M(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(y.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(k(e),k(_),k(S),k(C),k(T)),N&&N.d(),H(c),R&&R.d(),H(y,J),n[26](null),H(O,J),A=!1,P()}}}function AN(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new cN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function PN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=$(),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=Y(i,"click",n[18]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function NN(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 RN(n){let e,t,i;function l(r,a){return r[12]?NN:PN}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=$(),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 FN(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 qN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[IN,DN,EN],m=[];function h(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new lf({props:g}),n[32](l),l.$on("truncate",n[33]);let _={};o=new H6({props:_}),n[34](o);let y={collection:n[2]};a=new rf({props:y}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new pL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),u=$(),j(f.$$.fragment)},m(C,T){m[e].m(C,T),v(C,i,T),q(l,C,T),v(C,s,T),q(o,C,T),v(C,r,T),q(a,C,T),v(C,u,T),q(f,C,T),c=!0},p(C,T){let O=e;e=h(C),e===O?m[e].p(C,T):(re(),D(m[O],1,1,()=>{m[O]=null}),ae(),t=m[e],t?t.p(C,T):(t=m[e]=d[e](C),t.c()),M(t,1),t.m(i.parentNode,i));const E={};l.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=C[2]),a.$set(I);const A={};T[0]&4&&(A.collection=C[2]),f.$set(A)},i(C){c||(M(t),M(l.$$.fragment,C),M(o.$$.fragment,C),M(a.$$.fragment,C),M(f.$$.fragment,C),c=!0)},o(C){D(t),D(l.$$.fragment,C),D(o.$$.fragment,C),D(a.$$.fragment,C),D(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(s),k(r),k(u)),m[e].d(C),n[32](null),H(l,C),n[34](null),H(o,C),n[35](null),H(a,C),n[39](null),H(f,C)}}}function HN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ti,Ee=>t(2,s=Ee)),Qe(n,un,Ee=>t(41,o=Ee)),Qe(n,Js,Ee=>t(3,r=Ee)),Qe(n,Au,Ee=>t(17,a=Ee)),Qe(n,Mn,Ee=>t(11,u=Ee)),Qe(n,Dl,Ee=>t(12,f=Ee));const c=new URLSearchParams(a);let d,m,h,g,_,y,S=c.get("filter")||"",C=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),O=0;Iu(T);async function E(Ee){await dn(),(s==null?void 0:s.type)==="view"?g.show(Ee):h==null||h.show(Ee)}function L(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,C="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!C)return;const Ee=U.getAllCollectionIdentifiers(s),st=C.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Ee.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,C="-@rowid"):Ee.includes("created")?t(1,C="-created"):t(1,C=""))}function A(Ee={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:C},Ee);U.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Ee){ie[Ee?"unshift":"push"](()=>{y=Ee,t(9,y)})}function R(Ee){O=Ee,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{_==null||_.load(),y==null||y.reload()},B=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),V=Ee=>t(0,S=Ee.detail);function Z(Ee){ie[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function G(Ee){S=Ee,t(0,S)}function de(Ee){C=Ee,t(1,C)}const fe=Ee=>{A({recordId:Ee.detail.id});let st=Ee.detail._partial?Ee.detail.id:Ee.detail;s.type==="view"?g==null||g.show(st):h==null||h.show(st)},ue=()=>{y==null||y.reload()},Te=()=>h==null?void 0:h.show();function Ke(Ee){ie[Ee?"unshift":"push"](()=>{d=Ee,t(4,d)})}const Je=()=>{_==null||_.load(),y==null||y.reload()};function ft(Ee){ie[Ee?"unshift":"push"](()=>{m=Ee,t(5,m)})}function et(Ee){ie[Ee?"unshift":"push"](()=>{h=Ee,t(6,h)})}const xe=()=>{A({recordId:null})},We=Ee=>{S?y==null||y.reload():Ee.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},at=Ee=>{(!S||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function jt(Ee){ie[Ee?"unshift":"push"](()=>{g=Ee,t(7,g)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Ww(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&L(),n.$$.dirty[0]&4&&s!=null&&s.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&(C||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(un,o=(s==null?void 0:s.name)||"Collections",o)},[S,C,s,r,d,m,h,g,_,y,O,u,f,A,T,l,i,a,P,N,R,z,F,B,J,V,Z,G,de,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve]}class jN extends Se{constructor(e){super(),we(this,e,HN,qN,ye,{},null,[-1,-1])}}function g1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='<span class="txt">Sync</span>',t=$(),i=b("a"),i.innerHTML='<i class="ri-uninstall-line" aria-hidden="true"></i> <span class="txt">Export collections</span>',l=$(),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(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Me(Bn.call(null,i)),Me(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Me(Bn.call(null,s))],o=!0)},d(a){a&&(k(e),k(t),k(i),k(l),k(s)),o=!1,Ie(r)}}}function zN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&g1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=$(),l=b("a"),l.innerHTML='<i class="ri-home-gear-line" aria-hidden="true"></i> <span class="txt">Application</span>',s=$(),o=b("a"),o.innerHTML='<i class="ri-send-plane-2-line" aria-hidden="true"></i> <span class="txt">Mail settings</span>',r=$(),a=b("a"),a.innerHTML='<i class="ri-archive-drawer-line" aria-hidden="true"></i> <span class="txt">Files storage</span>',u=$(),f=b("a"),f.innerHTML='<i class="ri-archive-line" aria-hidden="true"></i> <span class="txt">Backups</span>',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(qi.call(null,l,{path:"/settings"})),Me(Bn.call(null,l)),Me(qi.call(null,o,{path:"/settings/mail/?.*"})),Me(Bn.call(null,o)),Me(qi.call(null,a,{path:"/settings/storage/?.*"})),Me(Bn.call(null,a)),Me(qi.call(null,f,{path:"/settings/backups/?.*"})),Me(Bn.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=g1(),h.c(),h.m(e,null))},d(g){g&&k(e),h&&h.d(),d=!1,Ie(m)}}}function UN(n){let e,t;return e=new kk({props:{class:"settings-sidebar",$$slots:{default:[zN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function VN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class hs extends Se{constructor(e){super(),we(this,e,VN,UN,ye,{})}}function BN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(l,"for",r=n[8])},m(f,c){v(f,e,c),e.checked=n[0].batch.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=Y(e,"change",n[4]),a=!0)},p(f,c){c&256&&t!==(t=f[8])&&p(e,"id",t),c&1&&(e.checked=f[0].batch.enabled),c&256&&r!==(r=f[8])&&p(l,"for",r)},d(f){f&&(k(e),k(i),k(l)),a=!1,u()}}}function WN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max allowed batch requests"),l=$(),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),he(s,n[0].batch.maxRequests),r||(a=Y(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&&gt(s.value)!==u[0].batch.maxRequests&&he(s,u[0].batch.maxRequests)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function YN(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=$(),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),he(s,n[0].batch.timeout),r||(a=Y(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&&gt(s.value)!==u[0].batch.timeout&&he(s,u[0].batch.timeout)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function KN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),l=$(),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=Y(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 JN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[BN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[WN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[YN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[KN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div"),j(s.$$.fragment),o=$(),r=b("div"),j(a.$$.fragment),u=$(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),v(m,t,h),v(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const 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||(M(e.$$.fragment,m),M(s.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(k(t),k(i)),H(e,m),H(s),H(a),H(c)}}}function ZN(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){v(t,e,i)},d(t){t&&k(e)}}}function GN(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 b1(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function XN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?GN:ZN}let a=r(n),u=a(n),f=n[2]&&b1();return{c(){e=b("div"),e.innerHTML='<i class="ri-archive-stack-line"></i> <span class="txt">Batch API</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=b1(),f.c(),M(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 QN(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[XN],default:[JN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xN(n,e,t){let i,l,s;Qe(n,kn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!U.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 e7 extends Se{constructor(e){super(),we(this,e,xN,QN,ye,{formSettings:0})}}function y1(n,e,t){const i=n.slice();return i[17]=e[t],i}function k1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function t7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ms({props:S}),ie.push(()=>be(s,"value",y));let C=pe(n[2]),T=[];for(let O=0;O<C.length;O+=1)T[O]=k1(y1(n,C,O));return{c(){e=b("label"),t=W("Trusted proxy headers"),l=$(),j(s.$$.fragment),r=$(),a=b("div"),u=b("button"),u.textContent="Clear",f=$(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as:
-                        `);for(let O=0;O<T.length;O+=1)T[O].c();p(e,"for",i=n[16]),p(u,"type","button"),p(u,"class","btn btn-sm btn-hint btn-transparent btn-clear"),ee(u,"hidden",U.isEmpty(n[0].trustedProxy.headers)),p(a,"class","form-field-addon"),p(c,"class","help-block")},m(O,E){v(O,e,E),w(e,t),v(O,l,E),q(s,O,E),v(O,r,E),v(O,a,E),w(a,u),v(O,f,E),v(O,c,E),w(c,d),w(d,m);for(let L=0;L<T.length;L+=1)T[L]&&T[L].m(d,null);h=!0,g||(_=Y(u,"click",n[12]),g=!0)},p(O,E){(!h||E&65536&&i!==(i=O[16]))&&p(e,"for",i);const L={};if(E&65536&&(L.id=O[16]),!o&&E&1&&(o=!0,L.value=O[0].trustedProxy.headers,Ce(()=>o=!1)),s.$set(L),(!h||E&1)&&ee(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){C=pe(O[2]);let I;for(I=0;I<C.length;I+=1){const A=y1(O,C,I);T[I]?T[I].p(A,E):(T[I]=k1(A),T[I].c(),T[I].m(d,null))}for(;I<T.length;I+=1)T[I].d(1);T.length=C.length}},i(O){h||(M(s.$$.fragment,O),h=!0)},o(O){D(s.$$.fragment,O),h=!1},d(O){O&&(k(e),k(l),k(r),k(a),k(f),k(c)),H(s,O),dt(T,O),g=!1,_()}}}function n7(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 zn({props:m}),ie.push(()=>be(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=$(),l=b("i"),o=$(),j(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),q(r,h,g),u=!0,f||(c=Me(qe.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,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(k(e),k(o)),H(r,h),f=!1,c()}}}function i7(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")+"",C,T,O,E,L,I,A,P,N,R,z,F,B;return A=new ce({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[t7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new ce({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[n7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=$(),o=b("strong"),a=W(r),u=$(),f=b("i"),c=$(),d=b("br"),m=$(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=$(),y=b("strong"),C=W(S),T=$(),O=b("div"),O.innerHTML=`<p>When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as
+    `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[66]),a[0]&1031165|a[2]&67108864&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=xg(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[67](null),H(e,r),o&&o.d(r)}}}const El="form",io="providers";function fN(n,e,t){let i,l,s,o,r,a,u,f;const c=yt(),d="record_"+U.randomString(5);let{collection:m}=e,h,g,_={},y={},S=null,C=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=El,P=!0,N=!0,R=m,z=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(se){return fe(se),t(14,T=!0),t(15,A=El),h==null?void 0:h.show()}function V(){return h==null?void 0:h.hide()}function Z(){t(14,T=!1),V()}function G(){t(35,R=m),h!=null&&h.isActive()&&(Je(JSON.stringify(y)),Z())}async function de(se){if(!se)return null;let Oe=typeof se=="string"?se:se==null?void 0:se.id;if(Oe)try{return await _e.collection(m.id).getOne(Oe)}catch(Ne){Ne.isAbort||(Z(),console.warn("resolveModel:",Ne),$i(`Unable to load record with id "${Oe}"`))}return typeof se=="object"?se:null}async function fe(se){t(7,N=!0),Ut({}),t(4,O={}),t(5,E={}),t(2,_=typeof se=="string"?{id:se,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:se||{}),t(3,y=structuredClone(_)),t(2,_=await de(se)||{}),t(3,y=structuredClone(_)),await dn(),t(12,S=Ke()),!S||et(y,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(y)),t(7,N=!1)}async function ue(se){var Ne,ze;Ut({}),t(2,_=se||{}),t(4,O={}),t(5,E={});const Oe=((ze=(Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(Ge=>Ge.type!="file"))==null?void 0:ze.map(Ge=>Ge.name))||[];for(let Ge in se)Oe.includes(Ge)||t(3,y[Ge]=se[Ge],y);await dn(),t(33,L=JSON.stringify(y)),xe()}function Te(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ke(se){try{const Oe=window.localStorage.getItem(Te());if(Oe)return JSON.parse(Oe)}catch{}return se}function Je(se){try{window.localStorage.setItem(Te(),se)}catch(Oe){console.warn("updateDraft failure:",Oe),window.localStorage.removeItem(Te())}}function ft(){S&&(t(3,y=S),t(12,S=null))}function et(se,Oe){var qt;const Ne=structuredClone(se||{}),ze=structuredClone(Oe||{}),Ge=(qt=m==null?void 0:m.fields)==null?void 0:qt.filter(Sn=>Sn.type==="file");for(let Sn of Ge)delete Ne[Sn.name],delete ze[Sn.name];const Qt=["expand","password","passwordConfirm"];for(let Sn of Qt)delete Ne[Sn],delete ze[Sn];return JSON.stringify(Ne)==JSON.stringify(ze)}function xe(){t(12,S=null),window.localStorage.removeItem(Te())}async function We(se=!0){var Oe;if(!(C||!u||!(m!=null&&m.id))){t(13,C=!0);try{const Ne=jt();let ze;if(P?ze=await _e.collection(m.id).create(Ne):ze=await _e.collection(m.id).update(y.id,Ne),tn(P?"Successfully created record.":"Successfully updated record."),xe(),l&&(y==null?void 0:y.id)==((Oe=_e.authStore.record)==null?void 0:Oe.id)&&Ne.get("password"))return _e.logout();se?Z():ue(ze),c("save",{isNew:P,record:ze})}catch(Ne){_e.error(Ne)}t(13,C=!1)}}function at(){_!=null&&_.id&&_n("Do you really want to delete the selected record?",()=>_e.collection(_.collectionId).delete(_.id).then(()=>{Z(),tn("Successfully deleted record."),c("delete",_)}).catch(se=>{_e.error(se)}))}function jt(){const se=structuredClone(y||{}),Oe=new FormData,Ne={},ze={};for(const Ge of(m==null?void 0:m.fields)||[])Ge.type=="autodate"||i&&Ge.type=="password"||(Ne[Ge.name]=!0,Ge.type=="json"&&(ze[Ge.name]=!0));i&&se.password&&(Ne.password=!0),i&&se.passwordConfirm&&(Ne.passwordConfirm=!0);for(const Ge in se)if(Ne[Ge]){if(typeof se[Ge]>"u"&&(se[Ge]=null),ze[Ge]&&se[Ge]!=="")try{JSON.parse(se[Ge])}catch(Qt){const qt={};throw qt[Ge]={code:"invalid_json",message:Qt.toString()},new Fn({status:400,response:{data:qt}})}U.addValueToFormData(Oe,Ge,se[Ge])}for(const Ge in O){const Qt=U.toArray(O[Ge]);for(const qt of Qt)Oe.append(Ge+"+",qt)}for(const Ge in E){const Qt=U.toArray(E[Ge]);for(const qt of Qt)Oe.append(Ge+"-",qt)}return Oe}function Ve(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent verification email to ${_.email}?`,()=>_e.collection(m.id).requestVerification(_.email).then(()=>{tn(`Successfully sent verification email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function Ee(){!(m!=null&&m.id)||!(_!=null&&_.email)||_n(`Do you really want to sent password reset email to ${_.email}?`,()=>_e.collection(m.id).requestPasswordReset(_.email).then(()=>{tn(`Successfully sent password reset email to ${_.email}.`)}).catch(se=>{_e.error(se)}))}function st(){a?_n("You have unsaved changes. Do you really want to discard them?",()=>{De()}):De()}async function De(){let se=_?structuredClone(_):null;if(se){const Oe=["file","autodate"],Ne=(m==null?void 0:m.fields)||[];for(const ze of Ne)Oe.includes(ze.type)&&delete se[ze.name];se.id=""}xe(),J(se),await dn(),t(33,L="")}function Ye(se){(se.ctrlKey||se.metaKey)&&se.code=="KeyS"&&(se.preventDefault(),se.stopPropagation(),We(!1))}function ke(){U.copyToClipboard(JSON.stringify(_,null,2)),Ks("The record JSON was copied to your clipboard!",3e3)}const $e=()=>V(),ct=()=>We(!1),Ht=()=>Ve(),Le=()=>Ee(),ot=()=>g==null?void 0:g.show(),on=()=>ke(),En=()=>st(),Re=()=>at(),Ft=()=>t(15,A=El),Yt=()=>t(15,A=io),vn=()=>ft(),fn=()=>xe();function Oi(){y.id=this.value,t(3,y)}function li(se){y=se,t(3,y)}function bt(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function wn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function sn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Dt(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Mi(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function ul(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function zi(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Ui(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function fl(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Dn(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function Rl(se,Oe){n.$$.not_equal(O[Oe.name],se)&&(O[Oe.name]=se,t(4,O))}function cl(se,Oe){n.$$.not_equal(E[Oe.name],se)&&(E[Oe.name]=se,t(5,E))}function X(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}function x(se,Oe){n.$$.not_equal(y[Oe.name],se)&&(y[Oe.name]=se,t(3,y))}const le=()=>a&&T?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Ut({}),xe(),!0);function ge(se){ie[se?"unshift":"push"](()=>{h=se,t(10,h)})}function Fe(se){Pe.call(this,n,se)}function Be(se){Pe.call(this,n,se)}function rt(se){ie[se?"unshift":"push"](()=>{g=se,t(11,g)})}return n.$$set=se=>{"collection"in se&&t(0,m=se.collection)},n.$$.update=()=>{var se,Oe,Ne;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=!!((se=m==null?void 0:m.fields)!=null&&se.find(ze=>ze.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(Oe=m==null?void 0:m.fields)==null?void 0:Oe.find(ze=>ze.name==="id")),n.$$.dirty[0]&48&&t(37,r=U.hasNonEmptyProps(O)||U.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(y)),n.$$.dirty[1]&76&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!_||!_.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&8&&(N||Je(I)),n.$$.dirty[0]&1|n.$$.dirty[1]&16&&m&&(R==null?void 0:R.id)!=(m==null?void 0:m.id)&&G(),n.$$.dirty[0]&512&&t(36,f=i?B:F),n.$$.dirty[0]&1|n.$$.dirty[1]&32&&t(16,z=((Ne=m==null?void 0:m.fields)==null?void 0:Ne.filter(ze=>!f.includes(ze.name)&&ze.type!="autodate"))||[])},[m,V,_,y,O,E,P,N,a,i,h,g,S,C,T,A,z,l,u,o,s,d,Z,ft,xe,We,at,Ve,Ee,st,Ye,ke,J,L,I,R,f,r,$e,ct,Ht,Le,ot,on,En,Re,Ft,Yt,vn,fn,Oi,li,bt,wn,sn,Dt,Mi,ul,zi,Ui,fl,Dn,Rl,cl,X,x,le,ge,Fe,Be,rt]}class af extends Se{constructor(e){super(),we(this,e,fN,uN,ye,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function cN(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=$(),l=b("span"),o=W(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){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])+"")&&oe(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 dN(n,e,t){const i=yt();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=U.getAllCollectionIdentifiers(l),c=await _e.collection(l.id).getList(1,1,{filter:U.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 pN extends Se{constructor(e){super(),we(this,e,dN,cN,ye,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function e1(n,e,t){const i=n.slice();return i[58]=e[t],i}function t1(n,e,t){const i=n.slice();return i[61]=e[t],i}function n1(n,e,t){const i=n.slice();return i[61]=e[t],i}function i1(n,e,t){const i=n.slice();return i[54]=e[t],i}function l1(n){let e;function t(s,o){return s[9]?hN:mN}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 mN(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=$(),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=Y(t,"change",n[31]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&8192&&(t.checked=a[13])},d(a){a&&k(e),o=!1,r()}}}function hN(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 _N(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[61].type))},m(i,l){v(i,e,l)},p(i,l){l[0]&32768&&t!==(t=U.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&k(e)}}}function gN(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function bN(n){let e,t,i,l=n[61].name+"",s;function o(u,f){return u[61].primaryKey?gN:_N}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=$(),i=b("span"),s=W(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[61].name+"")&&oe(s,l)},d(u){u&&k(e),a.d()}}}function s1(n,e){let t,i,l,s;function o(a){e[32](a)}let r={class:"col-type-"+e[61].type+" col-field-"+e[61].name,name:e[61].name,$$slots:{default:[bN]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new ir({props:r}),ie.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(a,u){v(a,t,u),q(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&32768&&(f.class="col-type-"+e[61].type+" col-field-"+e[61].name),u[0]&32768&&(f.name=e[61].name),u[0]&32768|u[2]&16&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],Ce(()=>l=!1)),i.$set(f)},i(a){s||(M(i.$$.fragment,a),s=!0)},o(a){D(i.$$.fragment,a),s=!1},d(a){a&&k(t),H(i,a)}}}function o1(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[33](e)},p:te,d(t){t&&k(e),n[33](null)}}}function r1(n){let e;function t(s,o){return s[9]?kN:yN}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 yN(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return wN;if(!a[16])return vN}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=$(),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 kN(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 vN(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=Y(e,"click",n[38]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function wN(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=Y(e,"click",n[37]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function a1(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=$(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[58].id),i.checked=s=n[4][n[58].id],p(r,"for",a="checkbox_"+n[58].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){v(d,e,m),w(e,t),w(t,i),w(t,o),w(t,r),u||(f=[Y(i,"change",c),Y(t,"click",On(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[58].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[58].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,Ie(f)}}}function u1(n,e){let t,i,l,s;return i=new Sk({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),j(i.$$.fragment),p(t,"class",l="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){v(o,t,r),q(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[58]),r[0]&32768&&(a.field=e[61]),i.$set(a),(!s||r[0]&32768&&l!==(l="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",l)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function f1(n,e){let t,i,l=[],s=new Map,o,r,a,u,f,c=!e[16]&&a1(e),d=pe(e[15]);const m=_=>_[61].id;for(let _=0;_<d.length;_+=1){let y=t1(e,d,_),S=m(y);s.set(S,l[_]=u1(S,y))}function h(){return e[35](e[58])}function g(..._){return e[36](e[58],..._)}return{key:n,first:null,c(){t=b("tr"),c&&c.c(),i=$();for(let _=0;_<l.length;_+=1)l[_].c();o=$(),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=[Y(t,"click",h),Y(t,"keydown",g)],u=!0)},p(_,y){e=_,e[16]?c&&(c.d(1),c=null):c?c.p(e,y):(c=a1(e),c.c(),c.m(t,i)),y[0]&32776&&(d=pe(e[15]),re(),l=vt(l,y,m,1,e,d,s,t,Bt,u1,o,t1),ae())},i(_){if(!a){for(let y=0;y<d.length;y+=1)M(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,Ie(f)}}}function c1(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],ee(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=Y(i,"click",nt(n[39])),s=!0)},p(r,a){a[0]&512&&(i.disabled=r[9]),a[0]&512&&ee(i,"btn-loading",r[9])},d(r){r&&k(e),s=!1,o()}}}function SN(n){let e,t,i,l,s=[],o=new Map,r,a,u,f,c=[],d=new Map,m,h,g=!n[16]&&l1(n),_=pe(n[15]);const y=L=>L[61].id;for(let L=0;L<_.length;L+=1){let I=n1(n,_,L),A=y(I);o.set(A,s[L]=s1(A,I))}let S=n[12].length&&o1(n),C=pe(n[3]);const T=L=>L[16]?L[58]:L[58].id;for(let L=0;L<C.length;L+=1){let I=e1(n,C,L),A=T(I);d.set(A,c[L]=f1(A,I))}let O=null;C.length||(O=r1(n));let E=n[3].length&&n[14]&&c1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),l=$();for(let L=0;L<s.length;L+=1)s[L].c();r=$(),a=b("th"),S&&S.c(),u=$(),f=b("tbody");for(let L=0;L<c.length;L+=1)c[L].c();O&&O.c(),m=$(),E&&E.c(),p(a,"class","col-type-action min-width"),p(e,"class","table"),ee(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);O&&O.m(f,null),w(f,m),E&&E.m(f,null),h=!0},p(L,I){L[16]?g&&(g.d(1),g=null):g?g.p(L,I):(g=l1(L),g.c(),g.m(i,l)),I[0]&32769&&(_=pe(L[15]),re(),s=vt(s,I,y,1,L,_,o,i,Bt,s1,r,n1),ae()),L[12].length?S?S.p(L,I):(S=o1(L),S.c(),S.m(a,null)):S&&(S.d(1),S=null),I[0]&1278490&&(C=pe(L[3]),re(),c=vt(c,I,T,1,L,C,d,f,Bt,f1,m,e1),ae(),!C.length&&O?O.p(L,I):C.length?O&&(O.d(1),O=null):(O=r1(L),O.c(),O.m(f,m))),L[3].length&&L[14]?E?E.p(L,I):(E=c1(L),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!h||I[0]&512)&&ee(e,"table-loading",L[9])},i(L){if(!h){for(let I=0;I<_.length;I+=1)M(s[I]);for(let I=0;I<C.length;I+=1)M(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();O&&O.d(),E&&E.d()}}}function d1(n){let e,t;return e=new jn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[11],$$slots:{default:[CN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&2048&&(s.trigger=i[11]),l[0]&4128|l[2]&16&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function TN(n){let e,t,i,l,s,o=n[54].name+"",r,a,u,f,c;function d(...m){return n[30](n[54],...m)}return{c(){e=b("input"),l=$(),s=b("label"),r=W(o),u=$(),p(e,"type","checkbox"),p(e,"id",t=n[57]),e.checked=i=!n[5].includes(n[54].id),p(s,"for",a=n[57])},m(m,h){v(m,e,h),v(m,l,h),v(m,s,h),w(s,r),v(m,u,h),f||(c=Y(e,"change",d),f=!0)},p(m,h){n=m,h[1]&67108864&&t!==(t=n[57])&&p(e,"id",t),h[0]&4128&&i!==(i=!n[5].includes(n[54].id))&&(e.checked=i),h[0]&4096&&o!==(o=n[54].name+"")&&oe(r,o),h[1]&67108864&&a!==(a=n[57])&&p(s,"for",a)},d(m){m&&(k(e),k(l),k(s),k(u)),f=!1,c()}}}function p1(n,e){let t,i,l;return i=new ce({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[TN,({uniqueId:s})=>({57:s}),({uniqueId:s})=>[0,s?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ve(),j(i.$$.fragment),this.first=t},m(s,o){v(s,t,o),q(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(M(i.$$.fragment,s),l=!0)},o(s){D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(i,s)}}}function CN(n){let e,t,i=[],l=new Map,s,o,r=pe(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u<r.length;u+=1){let f=i1(n,r,u),c=a(f);l.set(c,i[u]=p1(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=$();for(let u=0;u<i.length;u+=1)i[u].c();s=ve(),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]&67108864&&(r=pe(u[12]),re(),i=vt(i,f,a,1,u,r,l,s.parentNode,Bt,p1,s,i1),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)M(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 $N(n){let e,t,i=n[11]&&d1(n);return{c(){i&&i.c(),e=ve()},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&&M(i,1)):(i=d1(l),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(re(),D(i,1,1,()=>{i=null}),ae())},i(l){t||(M(i),t=!0)},o(l){D(i),t=!1},d(l){l&&k(e),i&&i.d(l)}}}function m1(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=W("Selected "),l=b("strong"),s=W(n[6]),o=$(),a=W(r),u=$(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=$(),d=b("div"),m=$(),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"),ee(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),ee(h,"btn-loading",n[10]),ee(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m(C,T){v(C,e,T),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o),w(t,a),w(e,u),w(e,f),w(e,c),w(e,d),w(e,m),w(e,h),_=!0,y||(S=[Y(f,"click",n[41]),Y(h,"click",n[42])],y=!0)},p(C,T){(!_||T[0]&64)&&oe(s,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&oe(a,r),(!_||T[0]&1024)&&ee(f,"btn-disabled",C[10]),(!_||T[0]&1024)&&ee(h,"btn-loading",C[10]),(!_||T[0]&1024)&&ee(h,"btn-disabled",C[10])},i(C){_||(C&&tt(()=>{_&&(g||(g=He(e,qn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(C){C&&(g||(g=He(e,qn,{duration:150,y:5},!1)),g.run(0)),_=!1},d(C){C&&k(e),C&&g&&g.end(),y=!1,Ie(S)}}}function ON(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[$N],default:[SN]},$$scope:{ctx:n}};e=new Ru({props:s}),n[40](e);let o=n[6]&&m1(n);return{c(){j(e.$$.fragment),t=$(),o&&o.c(),i=ve()},m(r,a){q(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]&16&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&M(o,1)):(o=m1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(re(),D(o,1,1,()=>{o=null}),ae())},i(r){l||(M(e.$$.fragment,r),M(o),l=!0)},o(r){D(e.$$.fragment,r),D(o),l=!1},d(r){r&&(k(t),k(i)),n[40](null),H(e,r),o&&o.d(r)}}}const MN=/^([\+\-])?(\w+)$/,h1=40;function EN(n,e,t){let i,l,s,o,r,a,u,f,c,d,m;Qe(n,Mn,Le=>t(47,d=Le)),Qe(n,Js,Le=>t(28,m=Le));const h=yt();let{collection:g}=e,{sort:_=""}=e,{filter:y=""}=e,S,C=[],T=1,O=0,E={},L=!0,I=!1,A=0,P,N=[],R=[],z="";const F=["verified","emailVisibility"];function B(){g!=null&&g.id&&(N.length?localStorage.setItem(z,JSON.stringify(N)):localStorage.removeItem(z))}function J(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Le=localStorage.getItem(z);Le&&t(5,N=JSON.parse(Le)||[])}catch{}}function V(Le){return!!C.find(ot=>ot.id==Le)}async function Z(){const Le=T;for(let ot=1;ot<=Le;ot++)(ot===1||u)&&await G(ot,!1)}async function G(Le=1,ot=!0){var fn,Oi,li;if(!(g!=null&&g.id))return;t(9,L=!0);let on=_;const En=on.match(MN),Re=En?r.find(bt=>bt.name===En[2]):null;if(En&&Re){const bt=((li=(Oi=(fn=d==null?void 0:d.find(sn=>sn.id==Re.collectionId))==null?void 0:fn.fields)==null?void 0:Oi.filter(sn=>sn.presentable))==null?void 0:li.map(sn=>sn.name))||[],wn=[];for(const sn of bt)wn.push((En[1]||"")+En[2]+"."+sn);wn.length>0&&(on=wn.join(","))}const Ft=U.getAllCollectionIdentifiers(g),Yt=o.map(bt=>bt.name+":excerpt(200)").concat(r.map(bt=>"expand."+bt.name+".*:excerpt(200)"));Yt.length&&Yt.unshift("*");const vn=[];for(const bt of r){const wn=U.getExpandPresentableRelField(bt,d,2);wn&&vn.push(wn)}return _e.collection(g.id).getList(Le,h1,{sort:on,skipTotal:1,filter:U.normalizeSearchFilter(y,Ft),expand:vn.join(","),fields:Yt.join(","),requestKey:"records_list"}).then(async bt=>{var wn;if(Le<=1&&de(),t(9,L=!1),t(8,T=bt.page),t(25,O=bt.items.length),h("load",C.concat(bt.items)),o.length)for(let sn of bt.items)sn._partial=!0;if(ot){const sn=++A;for(;(wn=bt.items)!=null&&wn.length&&A==sn;){const Dt=bt.items.splice(0,20);for(let Mi of Dt)U.pushOrReplaceByKey(C,Mi);t(3,C),await U.yieldToMain()}}else{for(let sn of bt.items)U.pushOrReplaceByKey(C,sn);t(3,C)}}).catch(bt=>{bt!=null&&bt.isAbort||(t(9,L=!1),console.warn(bt),de(),_e.error(bt,!y||(bt==null?void 0:bt.status)!=400))})}function de(){S==null||S.resetVerticalScroll(),t(3,C=[]),t(8,T=1),t(25,O=0),t(4,E={})}function fe(){c?ue():Te()}function ue(){t(4,E={})}function Te(){for(const Le of C)t(4,E[Le.id]=Le,E);t(4,E)}function Ke(Le){E[Le.id]?delete E[Le.id]:t(4,E[Le.id]=Le,E),t(4,E)}function Je(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ft)}async function ft(){if(I||!f||!(g!=null&&g.id))return;let Le=[];for(const ot of Object.keys(E))Le.push(_e.collection(g.id).delete(ot));return t(10,I=!0),Promise.all(Le).then(()=>{tn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ue()}).catch(ot=>{_e.error(ot)}).finally(()=>(t(10,I=!1),Z()))}function et(Le){Pe.call(this,n,Le)}const xe=(Le,ot)=>{ot.target.checked?U.removeByValue(N,Le.id):U.pushUnique(N,Le.id),t(5,N)},We=()=>fe();function at(Le){_=Le,t(0,_)}function jt(Le){ie[Le?"unshift":"push"](()=>{P=Le,t(11,P)})}const Ve=Le=>Ke(Le),Ee=Le=>h("select",Le),st=(Le,ot)=>{ot.code==="Enter"&&(ot.preventDefault(),h("select",Le))},De=()=>t(1,y=""),Ye=()=>h("new"),ke=()=>G(T+1);function $e(Le){ie[Le?"unshift":"push"](()=>{S=Le,t(7,S)})}const ct=()=>ue(),Ht=()=>Je();return n.$$set=Le=>{"collection"in Le&&t(22,g=Le.collection),"sort"in Le&&t(0,_=Le.sort),"filter"in Le&&t(1,y=Le.filter)},n.$$.update=()=>{n.$$.dirty[0]&4194304&&g!=null&&g.id&&(z=g.id+"@hiddenColumns",J(),de()),n.$$.dirty[0]&4194304&&t(16,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&4194304&&t(27,l=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,s=((g==null?void 0:g.fields)||[]).filter(Le=>!Le.hidden&&(!l||!F.includes(Le.name)))),n.$$.dirty[0]&67108864&&(o=s.filter(Le=>Le.type==="editor")),n.$$.dirty[0]&67108864&&(r=s.filter(Le=>Le.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=s.filter(Le=>!N.includes(Le.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&_!==-1&&y!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=O>=h1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=C.length&&f===C.length),n.$$.dirty[0]&32&&N!==-1&&B(),n.$$.dirty[0]&67108864&&t(12,R=s.filter(Le=>!Le.primaryKey).map(Le=>({id:Le.id,name:Le.name})))},[_,y,G,C,E,N,f,S,T,L,I,P,R,c,u,a,i,h,fe,ue,Ke,Je,g,V,Z,O,s,l,m,et,xe,We,at,jt,Ve,Ee,st,De,Ye,ke,$e,ct,Ht]}class DN extends Se{constructor(e){super(),we(this,e,EN,ON,ye,{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 IN(n){let e,t,i,l;return e=new dI({}),i=new pi({props:{class:"flex-content",$$slots:{footer:[NN],default:[PN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function LN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[qN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function AN(n){let e,t;return e=new pi({props:{center:!0,$$slots:{default:[HN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[1]&32768&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function _1(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(qe.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[21])],t=!0)},p:te,d(l){l&&k(e),t=!1,Ie(i)}}}function g1(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=Y(e,"click",n[24]),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,C,T,O,E,L,I,A,P,N=!n[12]&&_1(n);c=new Nu({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&g1(n);y=new Hr({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new DN({props:B}),n[26](O),ie.push(()=>be(O,"filter",z)),ie.push(()=>be(O,"sort",F)),O.$on("select",n[29]),O.$on("delete",n[30]),O.$on("new",n[31]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=$(),s=b("div"),r=W(o),a=$(),u=b("div"),N&&N.c(),f=$(),j(c.$$.fragment),d=$(),m=b("div"),h=b("button"),h.innerHTML='<i class="ri-code-s-slash-line"></i> <span class="txt">API Preview</span>',g=$(),R&&R.c(),_=$(),j(y.$$.fragment),S=$(),C=b("div"),T=$(),j(O.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(J,V){v(J,e,V),w(e,t),w(t,i),w(t,l),w(t,s),w(s,r),w(e,a),w(e,u),N&&N.m(u,null),w(u,f),q(c,u,null),w(e,d),w(e,m),w(m,h),w(m,g),R&&R.m(m,null),v(J,_,V),q(y,J,V),v(J,S,V),v(J,C,V),v(J,T,V),q(O,J,V),I=!0,A||(P=Y(h,"click",n[23]),A=!0)},p(J,V){(!I||V[0]&4)&&o!==(o=J[2].name+"")&&oe(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,V):(N=_1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,V):(R=g1(J),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const Z={};V[0]&1&&(Z.value=J[0]),V[0]&4&&(Z.autocompleteCollection=J[2]),y.$set(Z);const G={};V[0]&4&&(G.collection=J[2]),!E&&V[0]&1&&(E=!0,G.filter=J[0],Ce(()=>E=!1)),!L&&V[0]&2&&(L=!0,G.sort=J[1],Ce(()=>L=!1)),O.$set(G)},i(J){I||(M(c.$$.fragment,J),M(y.$$.fragment,J),M(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(y.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(k(e),k(_),k(S),k(C),k(T)),N&&N.d(),H(c),R&&R.d(),H(y,J),n[26](null),H(O,J),A=!1,P()}}}function NN(n){let e,t,i;function l(o){n[20](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new pN({props:s}),n[19](e),ie.push(()=>be(e,"totalCount",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){n[19](null),H(e,o)}}}function RN(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=$(),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=Y(i,"click",n[18]),l=!0)},p:te,d(o){o&&(k(e),k(t),k(i)),l=!1,s()}}}function FN(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 qN(n){let e,t,i;function l(r,a){return r[12]?FN:RN}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=$(),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 HN(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 jN(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[AN,LN,IN],m=[];function h(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};l=new sf({props:g}),n[32](l),l.$on("truncate",n[33]);let _={};o=new z6({props:_}),n[34](o);let y={collection:n[2]};a=new af({props:y}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new hL({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=$(),j(l.$$.fragment),s=$(),j(o.$$.fragment),r=$(),j(a.$$.fragment),u=$(),j(f.$$.fragment)},m(C,T){m[e].m(C,T),v(C,i,T),q(l,C,T),v(C,s,T),q(o,C,T),v(C,r,T),q(a,C,T),v(C,u,T),q(f,C,T),c=!0},p(C,T){let O=e;e=h(C),e===O?m[e].p(C,T):(re(),D(m[O],1,1,()=>{m[O]=null}),ae(),t=m[e],t?t.p(C,T):(t=m[e]=d[e](C),t.c()),M(t,1),t.m(i.parentNode,i));const E={};l.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=C[2]),a.$set(I);const A={};T[0]&4&&(A.collection=C[2]),f.$set(A)},i(C){c||(M(t),M(l.$$.fragment,C),M(o.$$.fragment,C),M(a.$$.fragment,C),M(f.$$.fragment,C),c=!0)},o(C){D(t),D(l.$$.fragment,C),D(o.$$.fragment,C),D(a.$$.fragment,C),D(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(s),k(r),k(u)),m[e].d(C),n[32](null),H(l,C),n[34](null),H(o,C),n[35](null),H(a,C),n[39](null),H(f,C)}}}function zN(n,e,t){let i,l,s,o,r,a,u,f;Qe(n,ti,Ee=>t(2,s=Ee)),Qe(n,un,Ee=>t(41,o=Ee)),Qe(n,Js,Ee=>t(3,r=Ee)),Qe(n,Pu,Ee=>t(17,a=Ee)),Qe(n,Mn,Ee=>t(11,u=Ee)),Qe(n,Dl,Ee=>t(12,f=Ee));const c=new URLSearchParams(a);let d,m,h,g,_,y,S=c.get("filter")||"",C=c.get("sort")||"-@rowid",T=c.get("collection")||(s==null?void 0:s.id),O=0;Lu(T);async function E(Ee){await dn(),(s==null?void 0:s.type)==="view"?g.show(Ee):h==null||h.show(Ee)}function L(){t(14,T=s==null?void 0:s.id),t(0,S=""),t(1,C="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!C)return;const Ee=U.getAllCollectionIdentifiers(s),st=C.split(",").map(De=>De.startsWith("+")||De.startsWith("-")?De.substring(1):De);st.filter(De=>Ee.includes(De)).length!=st.length&&((s==null?void 0:s.type)!="view"?t(1,C="-@rowid"):Ee.includes("created")?t(1,C="-created"):t(1,C=""))}function A(Ee={}){const st=Object.assign({collection:(s==null?void 0:s.id)||"",filter:S,sort:C},Ee);U.replaceHashQueryParams(st)}const P=()=>d==null?void 0:d.show();function N(Ee){ie[Ee?"unshift":"push"](()=>{y=Ee,t(9,y)})}function R(Ee){O=Ee,t(10,O)}const z=()=>d==null?void 0:d.show(s),F=()=>{_==null||_.load(),y==null||y.reload()},B=()=>m==null?void 0:m.show(s),J=()=>h==null?void 0:h.show(),V=Ee=>t(0,S=Ee.detail);function Z(Ee){ie[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function G(Ee){S=Ee,t(0,S)}function de(Ee){C=Ee,t(1,C)}const fe=Ee=>{A({recordId:Ee.detail.id});let st=Ee.detail._partial?Ee.detail.id:Ee.detail;s.type==="view"?g==null||g.show(st):h==null||h.show(st)},ue=()=>{y==null||y.reload()},Te=()=>h==null?void 0:h.show();function Ke(Ee){ie[Ee?"unshift":"push"](()=>{d=Ee,t(4,d)})}const Je=()=>{_==null||_.load(),y==null||y.reload()};function ft(Ee){ie[Ee?"unshift":"push"](()=>{m=Ee,t(5,m)})}function et(Ee){ie[Ee?"unshift":"push"](()=>{h=Ee,t(6,h)})}const xe=()=>{A({recordId:null})},We=Ee=>{S?y==null||y.reload():Ee.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},at=Ee=>{(!S||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function jt(Ee){ie[Ee?"unshift":"push"](()=>{g=Ee,t(7,g)})}const Ve=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,l=i.get("collection")),n.$$.dirty[0]&49164&&!r&&l&&l!=T&&l!=(s==null?void 0:s.id)&&l!=(s==null?void 0:s.name)&&Kw(l),n.$$.dirty[0]&16388&&s!=null&&s.id&&T!=s.id&&T!=s.name&&L(),n.$$.dirty[0]&4&&s!=null&&s.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&(C||S||s!=null&&s.id)&&A(),n.$$.dirty[0]&4&&Rn(un,o=(s==null?void 0:s.name)||"Collections",o)},[S,C,s,r,d,m,h,g,_,y,O,u,f,A,T,l,i,a,P,N,R,z,F,B,J,V,Z,G,de,fe,ue,Te,Ke,Je,ft,et,xe,We,at,jt,Ve]}class UN extends Se{constructor(e){super(),we(this,e,zN,jN,ye,{},null,[-1,-1])}}function b1(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='<span class="txt">Sync</span>',t=$(),i=b("a"),i.innerHTML='<i class="ri-uninstall-line" aria-hidden="true"></i> <span class="txt">Export collections</span>',l=$(),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(qi.call(null,i,{path:"/settings/export-collections/?.*"})),Me(Bn.call(null,i)),Me(qi.call(null,s,{path:"/settings/import-collections/?.*"})),Me(Bn.call(null,s))],o=!0)},d(a){a&&(k(e),k(t),k(i),k(l),k(s)),o=!1,Ie(r)}}}function VN(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[0]&&b1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=$(),l=b("a"),l.innerHTML='<i class="ri-home-gear-line" aria-hidden="true"></i> <span class="txt">Application</span>',s=$(),o=b("a"),o.innerHTML='<i class="ri-send-plane-2-line" aria-hidden="true"></i> <span class="txt">Mail settings</span>',r=$(),a=b("a"),a.innerHTML='<i class="ri-archive-drawer-line" aria-hidden="true"></i> <span class="txt">Files storage</span>',u=$(),f=b("a"),f.innerHTML='<i class="ri-archive-line" aria-hidden="true"></i> <span class="txt">Backups</span>',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(qi.call(null,l,{path:"/settings"})),Me(Bn.call(null,l)),Me(qi.call(null,o,{path:"/settings/mail/?.*"})),Me(Bn.call(null,o)),Me(qi.call(null,a,{path:"/settings/storage/?.*"})),Me(Bn.call(null,a)),Me(qi.call(null,f,{path:"/settings/backups/?.*"})),Me(Bn.call(null,f))],d=!0)},p(g,_){g[0]?h&&(h.d(1),h=null):h||(h=b1(),h.c(),h.m(e,null))},d(g){g&&k(e),h&&h.d(),d=!1,Ie(m)}}}function BN(n){let e,t;return e=new vk({props:{class:"settings-sidebar",$$slots:{default:[VN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function WN(n,e,t){let i;return Qe(n,Dl,l=>t(0,i=l)),[i]}class hs extends Se{constructor(e){super(),we(this,e,WN,BN,ye,{})}}function YN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(l,"for",r=n[8])},m(f,c){v(f,e,c),e.checked=n[0].batch.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=Y(e,"change",n[4]),a=!0)},p(f,c){c&256&&t!==(t=f[8])&&p(e,"id",t),c&1&&(e.checked=f[0].batch.enabled),c&256&&r!==(r=f[8])&&p(l,"for",r)},d(f){f&&(k(e),k(i),k(l)),a=!1,u()}}}function KN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max allowed batch requests"),l=$(),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),he(s,n[0].batch.maxRequests),r||(a=Y(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&&gt(s.value)!==u[0].batch.maxRequests&&he(s,u[0].batch.maxRequests)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function JN(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",l=$(),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),he(s,n[0].batch.timeout),r||(a=Y(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&&gt(s.value)!==u[0].batch.timeout&&he(s,u[0].batch.timeout)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function ZN(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),l=$(),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=Y(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 GN(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[YN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[KN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[JN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[ZN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),i=b("div"),l=b("div"),j(s.$$.fragment),o=$(),r=b("div"),j(a.$$.fragment),u=$(),f=b("div"),j(c.$$.fragment),p(l,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,h){q(e,m,h),v(m,t,h),v(m,i,h),w(i,l),q(s,l,null),w(i,o),w(i,r),q(a,r,null),w(i,u),w(i,f),q(c,f,null),d=!0},p(m,h){const 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||(M(e.$$.fragment,m),M(s.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(s.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(k(t),k(i)),H(e,m),H(s),H(a),H(c)}}}function XN(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 QN(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 y1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function xN(n){let e,t,i,l,s,o;function r(c,d){return c[1]?QN:XN}let a=r(n),u=a(n),f=n[2]&&y1();return{c(){e=b("div"),e.innerHTML='<i class="ri-archive-stack-line"></i> <span class="txt">Batch API</span>',t=$(),i=b("div"),l=$(),u.c(),s=$(),f&&f.c(),o=ve(),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&&M(f,1):(f=y1(),f.c(),M(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 e7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[xN],default:[GN]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function t7(n,e,t){let i,l,s;Qe(n,kn,c=>t(3,s=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=gt(this.value),t(0,o)}function u(){o.batch.timeout=gt(this.value),t(0,o)}const f=c=>t(0,o.batch.maxBodySize=c.target.value<<0,o);return n.$$set=c=>{"formSettings"in c&&t(0,o=c.formSettings)},n.$$.update=()=>{var c;n.$$.dirty&8&&t(2,i=!U.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 n7 extends Se{constructor(e){super(),we(this,e,t7,e7,ye,{formSettings:0})}}function k1(n,e,t){const i=n.slice();return i[17]=e[t],i}function v1(n){let e,t=n[17]+"",i,l,s,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),l=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){v(a,e,u),w(e,i),v(a,l,u),s||(o=Y(e,"click",r),s=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&oe(i,t)},d(a){a&&(k(e),k(l)),s=!1,o()}}}function i7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;function y(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),s=new ms({props:S}),ie.push(()=>be(s,"value",y));let C=pe(n[2]),T=[];for(let O=0;O<C.length;O+=1)T[O]=v1(k1(n,C,O));return{c(){e=b("label"),t=W("Trusted proxy headers"),l=$(),j(s.$$.fragment),r=$(),a=b("div"),u=b("button"),u.textContent="Clear",f=$(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as:
+                        `);for(let O=0;O<T.length;O+=1)T[O].c();p(e,"for",i=n[16]),p(u,"type","button"),p(u,"class","btn btn-sm btn-hint btn-transparent btn-clear"),ee(u,"hidden",U.isEmpty(n[0].trustedProxy.headers)),p(a,"class","form-field-addon"),p(c,"class","help-block")},m(O,E){v(O,e,E),w(e,t),v(O,l,E),q(s,O,E),v(O,r,E),v(O,a,E),w(a,u),v(O,f,E),v(O,c,E),w(c,d),w(d,m);for(let L=0;L<T.length;L+=1)T[L]&&T[L].m(d,null);h=!0,g||(_=Y(u,"click",n[12]),g=!0)},p(O,E){(!h||E&65536&&i!==(i=O[16]))&&p(e,"for",i);const L={};if(E&65536&&(L.id=O[16]),!o&&E&1&&(o=!0,L.value=O[0].trustedProxy.headers,Ce(()=>o=!1)),s.$set(L),(!h||E&1)&&ee(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){C=pe(O[2]);let I;for(I=0;I<C.length;I+=1){const A=k1(O,C,I);T[I]?T[I].p(A,E):(T[I]=v1(A),T[I].c(),T[I].m(d,null))}for(;I<T.length;I+=1)T[I].d(1);T.length=C.length}},i(O){h||(M(s.$$.fragment,O),h=!0)},o(O){D(s.$$.fragment,O),h=!1},d(O){O&&(k(e),k(l),k(r),k(a),k(f),k(c)),H(s,O),dt(T,O),g=!1,_()}}}function l7(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 zn({props:m}),ie.push(()=>be(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=$(),l=b("i"),o=$(),j(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),q(r,h,g),u=!0,f||(c=Me(qe.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,Ce(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(k(e),k(o)),H(r,h),f=!1,c()}}}function s7(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")+"",C,T,O,E,L,I,A,P,N,R,z,F,B;return A=new ce({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[i7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new ce({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[l7,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("span"),l.textContent="Resolved user IP:",s=$(),o=b("strong"),a=W(r),u=$(),f=b("i"),c=$(),d=b("br"),m=$(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=$(),y=b("strong"),C=W(S),T=$(),O=b("div"),O.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>`,E=$(),L=b("div"),I=b("div"),j(A.$$.fragment),P=$(),N=b("div"),j(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(h,"class","inline-flex flex-gap-5"),p(t,"class","content"),p(e,"class","alert alert-info m-b-sm"),p(O,"class","content m-b-sm"),p(I,"class","col-lg-9"),p(N,"class","col-lg-3"),p(L,"class","grid grid-sm")},m(J,V){v(J,e,V),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,C),v(J,T,V),v(J,O,V),v(J,E,V),v(J,L,V),w(L,I),q(A,I,null),w(L,P),w(L,N),q(R,N,null),z=!0,F||(B=Me(qe.call(null,f,`Must show your actual IP.
-If not, set the correct proxy header.`)),F=!0)},p(J,V){(!z||V&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!z||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe(C,S);const Z={};V&1114117&&(Z.$$scope={dirty:V,ctx:J}),A.$set(Z);const G={};V&1114113&&(G.$$scope={dirty:V,ctx:J}),R.$set(G)},i(J){z||(M(A.$$.fragment,J),M(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(k(e),k(T),k(O),k(E),k(L)),H(A),H(R),F=!1,B()}}}function l7(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(qe.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 s7(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(qe.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 o7(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 r7(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 v1(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function a7(n){let e,t,i,l,s,o,r,a,u,f,c;function d(C,T){if(T&43&&(o=null),!C[3]&&C[1].possibleProxyHeader)return s7;if(o==null&&(o=!!(C[3]&&!C[5]&&!C[0].trustedProxy.headers.includes(C[1].possibleProxyHeader))),o)return l7}let m=d(n,-1),h=m&&m(n);function g(C,T){return C[3]?r7:o7}let _=g(n),y=_(n),S=n[4]&&v1();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),l.textContent="User IP proxy headers",s=$(),h&&h.c(),r=$(),a=b("div"),u=$(),y.c(),f=$(),S&&S.c(),c=ve(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m(C,T){v(C,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v(C,r,T),v(C,a,T),v(C,u,T),y.m(C,T),v(C,f,T),S&&S.m(C,T),v(C,c,T)},p(C,T){m!==(m=d(C,T))&&(h&&h.d(1),h=m&&m(C),h&&(h.c(),h.m(e,null))),_!==(_=g(C))&&(y.d(1),y=_(C),y&&(y.c(),y.m(f.parentNode,f))),C[4]?S?T&16&&M(S,1):(S=v1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d(C){C&&(k(e),k(r),k(a),k(u),k(f),k(c)),h&&h.d(),y.d(C),S&&S.d(C)}}}function u7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[a7],default:[i7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function f7(n,e,t){let i,l,s,o,r,a;Qe(n,kn,C=>t(10,a=C));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m(C){t(0,f.trustedProxy.headers=[C],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g(C){n.$$.not_equal(f.trustedProxy.headers,C)&&(f.trustedProxy.headers=C,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),y=C=>m(C);function S(C){n.$$.not_equal(f.trustedProxy.useLeftmostIP,C)&&(f.trustedProxy.useLeftmostIP=C,t(0,f))}return n.$$set=C=>{"formSettings"in C&&t(0,f=C.formSettings),"healthData"in C&&t(1,c=C.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!U.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!U.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter(C=>C!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,y,S]}class c7 extends Se{constructor(e){super(),we(this,e,f7,u7,ye,{formSettings:0,healthData:1})}}function w1(n,e,t){const i=n.slice();return i[5]=e[t],i}function S1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=W(t),e.__value=l=n[5].value,he(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,he(e,e.__value))},d(s){s&&k(e)}}}function d7(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]=S1(w1(n,u,c));return{c(){e=b("input"),i=$(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();ei(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=Y(e,"input",n[4]),s=!0)},p(c,[d]){if(ei(e,a=wt(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=w1(c,u,m);f[m]?f[m].p(h,d):(f[m]=S1(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)),dt(f,c),s=!1,o()}}}function p7(n,e,t){const i=["value","options"];let l=lt(e,i),{value:s=""}=e,{options:o=[]}=e;const r="list_"+U.randomString(5),a=u=>{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},e),Wt(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 m7 extends Se{constructor(e){super(),we(this,e,p7,d7,ye,{value:0,options:1})}}function T1(n,e,t){const i=n.slice();return i[22]=e[t],i}function C1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function h7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(l,"for",r=n[28])},m(f,c){v(f,e,c),e.checked=n[0].rateLimits.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=Y(e,"change",n[9]),a=!0)},p(f,c){c&268435456&&t!==(t=f[28])&&p(e,"id",t),c&1&&(e.checked=f[0].rateLimits.enabled),c&268435456&&r!==(r=f[28])&&p(l,"for",r)},d(f){f&&(k(e),k(i),k(l)),a=!1,u()}}}function $1(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]=O1(C1(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 class="col-label">Rate limit label</th> <th class="col-requests">Max requests<br/><small>(per IP)</small></th> <th class="col-duration">Interval<br/><small>(in seconds)</small></th> <th class="col-audience">Targeted users</th> <th></th></tr>',i=$(),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&293){o=pe(u[0].rateLimits.rules||[]);let c;for(c=0;c<o.length;c+=1){const d=C1(u,o,c);r[c]?(r[c].p(d,f),M(r[c],1)):(r[c]=O1(d),r[c].c(),M(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)M(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),dt(r,u)}}}function _7(n){let e,t,i;function l(o){n[10](o,n[25])}let s={required:!0,placeholder:"tag (users:create) or path (/api/)",options:n[2]};return n[25].label!==void 0&&(s.value=n[25].label),e=new m7({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[25].label,Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function g7(n){let e,t,i;function l(){n[11].call(e,n[26],n[27])}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),he(e,n[25].maxRequests),t||(i=Y(e,"input",l),t=!0)},p(s,o){n=s,o&1&&gt(e.value)!==n[25].maxRequests&&he(e,n[25].maxRequests)},d(s){s&&k(e),t=!1,i()}}}function b7(n){let e,t,i;function l(){n[12].call(e,n[26],n[27])}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),he(e,n[25].duration),t||(i=Y(e,"input",l),t=!0)},p(s,o){n=s,o&1&&gt(e.value)!==n[25].duration&&he(e,n[25].duration)},d(s){s&&k(e),t=!1,i()}}}function y7(n){let e,t,i;function l(r){n[13](r,n[25])}function s(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new zn({props:o}),ie.push(()=>be(e,"keyOfSelected",l)),e.$on("change",s),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,a){n=r;const u={};!t&&a&1&&(t=!0,u.keyOfSelected=n[25].audience,Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function O1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C;i=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[_7]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[g7]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[b7]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[y7]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=$(),s=b("td"),j(o.$$.fragment),r=$(),a=b("td"),j(u.$$.fragment),f=$(),c=b("td"),j(d.$$.fragment),m=$(),h=b("td"),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=$(),p(t,"class","col-label"),p(s,"class","col-requests"),p(a,"class","col-duration"),p(c,"class","col-audience"),p(g,"type","button"),p(g,"title","Remove rule"),p(g,"aria-label","Remove rule"),p(g,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(h,"class","col-action"),p(e,"class","rate-limit-row")},m(O,E){v(O,e,E),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),w(h,g),w(e,_),y=!0,S||(C=Y(g,"click",T),S=!0)},p(O,E){n=O;const L={};E&536870917&&(L.$$scope={dirty:E,ctx:n}),i.$set(L);const I={};E&536870913&&(I.$$scope={dirty:E,ctx:n}),o.$set(I);const A={};E&536870913&&(A.$$scope={dirty:E,ctx:n}),u.$set(A);const P={};E&536870913&&(P.$$scope={dirty:E,ctx:n}),d.$set(P)},i(O){y||(M(i.$$.fragment,O),M(o.$$.fragment,O),M(u.$$.fragment,O),M(d.$$.fragment,O),y=!0)},o(O){D(i.$$.fragment,O),D(o.$$.fragment,O),D(u.$$.fragment,O),D(d.$$.fragment,O),y=!1},d(O){O&&k(e),H(i),H(o),H(u),H(d),S=!1,C()}}}function k7(n){let e,t,i=!U.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new ce({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[h7,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&$1(n);return{c(){var m,h,g;j(e.$$.fragment),t=$(),d&&d.c(),l=$(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add rate limit rule</span>',r=$(),a=b("button"),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"),ee(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,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),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=[Y(o,"click",n[16]),Y(a,"click",n[17])],f=!0)},p(m,h){var _,y,S;const g={};h&805306369&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!U.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&M(d,1)):(d=$1(m),d.c(),M(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&ee(o,"btn-danger",(S=(y=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:y.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(k(t),k(l),k(s)),H(e,m),d&&d.d(m),f=!1,Ie(c)}}}function M1(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function v7(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 w7(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 S7(n){let e,t,i,l,s,o,r=n[4]&&M1();function a(c,d){return c[0].rateLimits.enabled?w7:v7}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=$(),i=b("div"),l=$(),r&&r.c(),s=$(),f.c(),o=ve(),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[4]?r?d&16&&M(r,1):(r=M1(),r.c(),M(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 T7(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E1(n){let e,t=n[22].value.replace("*:",":")+"",i,l,s,o=n[22].description&&T7(n);return{c(){e=b("li"),i=W(t),l=$(),o&&o.c(),s=$(),p(e,"class","m-0")},m(r,a){v(r,e,a),w(e,i),w(e,l),o&&o.m(e,null),w(e,s)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&k(e),o&&o.d()}}}function C7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J=pe(n[6]),V=[];for(let Z=0;Z<J.length;Z+=1)V[Z]=E1(T1(n,J,Z));return{c(){e=b("p"),e.textContent="The rate limit rules are resolved in the following order (stops on the first match):",t=$(),i=b("ol"),i.innerHTML="<li>exact tag (e.g. <code>users:create</code>)</li> <li>wildcard tag (e.g. <code>*:create</code>)</li> <li>METHOD + exact path (e.g. <code>POST /a/b</code>)</li> <li>METHOD + prefix path (e.g. <code>POST /a/b<strong>/</strong></code>)</li> <li>exact path (e.g. <code>/a/b</code>)</li> <li>prefix path (e.g. <code>/a/b<strong>/</strong></code>)</li>",l=$(),s=b("p"),s.textContent=`In case of multiple rules with the same label but different target user audience (e.g. "guest" vs
+If not, set the correct proxy header.`)),F=!0)},p(J,V){(!z||V&2)&&r!==(r=(J[1].realIP||"N/A")+"")&&oe(a,r),(!z||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&oe(C,S);const Z={};V&1114117&&(Z.$$scope={dirty:V,ctx:J}),A.$set(Z);const G={};V&1114113&&(G.$$scope={dirty:V,ctx:J}),R.$set(G)},i(J){z||(M(A.$$.fragment,J),M(R.$$.fragment,J),z=!0)},o(J){D(A.$$.fragment,J),D(R.$$.fragment,J),z=!1},d(J){J&&(k(e),k(T),k(O),k(E),k(L)),H(A),H(R),F=!1,B()}}}function o7(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(qe.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 r7(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(qe.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 a7(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 u7(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 w1(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){v(o,e,r),i=!0,l||(s=Me(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function f7(n){let e,t,i,l,s,o,r,a,u,f,c;function d(C,T){if(T&43&&(o=null),!C[3]&&C[1].possibleProxyHeader)return r7;if(o==null&&(o=!!(C[3]&&!C[5]&&!C[0].trustedProxy.headers.includes(C[1].possibleProxyHeader))),o)return o7}let m=d(n,-1),h=m&&m(n);function g(C,T){return C[3]?u7:a7}let _=g(n),y=_(n),S=n[4]&&w1();return{c(){e=b("div"),t=b("i"),i=$(),l=b("span"),l.textContent="User IP proxy headers",s=$(),h&&h.c(),r=$(),a=b("div"),u=$(),y.c(),f=$(),S&&S.c(),c=ve(),p(t,"class","ri-route-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m(C,T){v(C,e,T),w(e,t),w(e,i),w(e,l),w(e,s),h&&h.m(e,null),v(C,r,T),v(C,a,T),v(C,u,T),y.m(C,T),v(C,f,T),S&&S.m(C,T),v(C,c,T)},p(C,T){m!==(m=d(C,T))&&(h&&h.d(1),h=m&&m(C),h&&(h.c(),h.m(e,null))),_!==(_=g(C))&&(y.d(1),y=_(C),y&&(y.c(),y.m(f.parentNode,f))),C[4]?S?T&16&&M(S,1):(S=w1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(re(),D(S,1,1,()=>{S=null}),ae())},d(C){C&&(k(e),k(r),k(a),k(u),k(f),k(c)),h&&h.d(),y.d(C),S&&S.d(C)}}}function c7(n){let e,t;return e=new ji({props:{single:!0,$$slots:{header:[f7],default:[s7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&1048639&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function d7(n,e,t){let i,l,s,o,r,a;Qe(n,kn,C=>t(10,a=C));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m(C){t(0,f.trustedProxy.headers=[C],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g(C){n.$$.not_equal(f.trustedProxy.headers,C)&&(f.trustedProxy.headers=C,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),y=C=>m(C);function S(C){n.$$.not_equal(f.trustedProxy.useLeftmostIP,C)&&(f.trustedProxy.useLeftmostIP=C,t(0,f))}return n.$$set=C=>{"formSettings"in C&&t(0,f=C.formSettings),"healthData"in C&&t(1,c=C.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,l=d!=i),n.$$.dirty&1024&&t(4,s=!U.isEmpty(a==null?void 0:a.trustedProxy)),n.$$.dirty&1&&t(3,o=!U.isEmpty(f.trustedProxy.headers)),n.$$.dirty&2&&t(2,r=c.possibleProxyHeader?[c.possibleProxyHeader].concat(u.filter(C=>C!=c.possibleProxyHeader)):u)},[f,c,r,o,s,l,m,h,d,i,a,g,_,y,S]}class p7 extends Se{constructor(e){super(),we(this,e,d7,c7,ye,{formSettings:0,healthData:1})}}function S1(n,e,t){const i=n.slice();return i[5]=e[t],i}function T1(n){let e,t=(n[5].label||"")+"",i,l;return{c(){e=b("option"),i=W(t),e.__value=l=n[5].value,he(e,e.__value)},m(s,o){v(s,e,o),w(e,i)},p(s,o){o&2&&t!==(t=(s[5].label||"")+"")&&oe(i,t),o&2&&l!==(l=s[5].value)&&(e.__value=l,he(e,e.__value))},d(s){s&&k(e)}}}function m7(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]=T1(S1(n,u,c));return{c(){e=b("input"),i=$(),l=b("datalist");for(let c=0;c<f.length;c+=1)f[c].c();ei(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=Y(e,"input",n[4]),s=!0)},p(c,[d]){if(ei(e,a=wt(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=S1(c,u,m);f[m]?f[m].p(h,d):(f[m]=T1(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)),dt(f,c),s=!1,o()}}}function h7(n,e,t){const i=["value","options"];let l=lt(e,i),{value:s=""}=e,{options:o=[]}=e;const r="list_"+U.randomString(5),a=u=>{t(0,s=u.target.value)};return n.$$set=u=>{e=je(je({},e),Wt(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 _7 extends Se{constructor(e){super(),we(this,e,h7,m7,ye,{value:0,options:1})}}function C1(n,e,t){const i=n.slice();return i[22]=e[t],i}function $1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function g7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(l,"for",r=n[28])},m(f,c){v(f,e,c),e.checked=n[0].rateLimits.enabled,v(f,i,c),v(f,l,c),w(l,s),w(l,o),a||(u=Y(e,"change",n[9]),a=!0)},p(f,c){c&268435456&&t!==(t=f[28])&&p(e,"id",t),c&1&&(e.checked=f[0].rateLimits.enabled),c&268435456&&r!==(r=f[28])&&p(l,"for",r)},d(f){f&&(k(e),k(i),k(l)),a=!1,u()}}}function O1(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]=M1($1(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 class="col-label">Rate limit label</th> <th class="col-requests">Max requests<br/><small>(per IP)</small></th> <th class="col-duration">Interval<br/><small>(in seconds)</small></th> <th class="col-audience">Targeted users</th> <th></th></tr>',i=$(),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&293){o=pe(u[0].rateLimits.rules||[]);let c;for(c=0;c<o.length;c+=1){const d=$1(u,o,c);r[c]?(r[c].p(d,f),M(r[c],1)):(r[c]=M1(d),r[c].c(),M(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)M(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),dt(r,u)}}}function b7(n){let e,t,i;function l(o){n[10](o,n[25])}let s={required:!0,placeholder:"tag (users:create) or path (/api/)",options:n[2]};return n[25].label!==void 0&&(s.value=n[25].label),e=new _7({props:s}),ie.push(()=>be(e,"value",l)),{c(){j(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r&4&&(a.options=n[2]),!t&&r&1&&(t=!0,a.value=n[25].label,Ce(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function y7(n){let e,t,i;function l(){n[11].call(e,n[26],n[27])}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),he(e,n[25].maxRequests),t||(i=Y(e,"input",l),t=!0)},p(s,o){n=s,o&1&&gt(e.value)!==n[25].maxRequests&&he(e,n[25].maxRequests)},d(s){s&&k(e),t=!1,i()}}}function k7(n){let e,t,i;function l(){n[12].call(e,n[26],n[27])}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),he(e,n[25].duration),t||(i=Y(e,"input",l),t=!0)},p(s,o){n=s,o&1&&gt(e.value)!==n[25].duration&&he(e,n[25].duration)},d(s){s&&k(e),t=!1,i()}}}function v7(n){let e,t,i;function l(r){n[13](r,n[25])}function s(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new zn({props:o}),ie.push(()=>be(e,"keyOfSelected",l)),e.$on("change",s),{c(){j(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,a){n=r;const u={};!t&&a&1&&(t=!0,u.keyOfSelected=n[25].audience,Ce(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function M1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C;i=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[b7]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[y7]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[k7]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[v7]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),j(i.$$.fragment),l=$(),s=b("td"),j(o.$$.fragment),r=$(),a=b("td"),j(u.$$.fragment),f=$(),c=b("td"),j(d.$$.fragment),m=$(),h=b("td"),g=b("button"),g.innerHTML='<i class="ri-close-line"></i>',_=$(),p(t,"class","col-label"),p(s,"class","col-requests"),p(a,"class","col-duration"),p(c,"class","col-audience"),p(g,"type","button"),p(g,"title","Remove rule"),p(g,"aria-label","Remove rule"),p(g,"class","btn btn-xs btn-circle btn-hint btn-transparent"),p(h,"class","col-action"),p(e,"class","rate-limit-row")},m(O,E){v(O,e,E),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),w(h,g),w(e,_),y=!0,S||(C=Y(g,"click",T),S=!0)},p(O,E){n=O;const L={};E&536870917&&(L.$$scope={dirty:E,ctx:n}),i.$set(L);const I={};E&536870913&&(I.$$scope={dirty:E,ctx:n}),o.$set(I);const A={};E&536870913&&(A.$$scope={dirty:E,ctx:n}),u.$set(A);const P={};E&536870913&&(P.$$scope={dirty:E,ctx:n}),d.$set(P)},i(O){y||(M(i.$$.fragment,O),M(o.$$.fragment,O),M(u.$$.fragment,O),M(d.$$.fragment,O),y=!0)},o(O){D(i.$$.fragment,O),D(o.$$.fragment,O),D(u.$$.fragment,O),D(d.$$.fragment,O),y=!1},d(O){O&&k(e),H(i),H(o),H(u),H(d),S=!1,C()}}}function w7(n){let e,t,i=!U.isEmpty(n[0].rateLimits.rules),l,s,o,r,a,u,f,c;e=new ce({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[g7,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&O1(n);return{c(){var m,h,g;j(e.$$.fragment),t=$(),d&&d.c(),l=$(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-add-line"></i> <span class="txt">Add rate limit rule</span>',r=$(),a=b("button"),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"),ee(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,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(s,"class","flex m-t-sm")},m(m,h){q(e,m,h),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=[Y(o,"click",n[16]),Y(a,"click",n[17])],f=!0)},p(m,h){var _,y,S;const g={};h&805306369&&(g.$$scope={dirty:h,ctx:m}),e.$set(g),h&1&&(i=!U.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,h),h&1&&M(d,1)):(d=O1(m),d.c(),M(d,1),d.m(l.parentNode,l)):d&&(re(),D(d,1,1,()=>{d=null}),ae()),(!u||h&2)&&ee(o,"btn-danger",(S=(y=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:y.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(k(t),k(l),k(s)),H(e,m),d&&d.d(m),f=!1,Ie(c)}}}function E1(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(qe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=He(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),l=!1,s()}}}function S7(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 T7(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 C7(n){let e,t,i,l,s,o,r=n[4]&&E1();function a(c,d){return c[0].rateLimits.enabled?T7:S7}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=$(),i=b("div"),l=$(),r&&r.c(),s=$(),f.c(),o=ve(),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[4]?r?d&16&&M(r,1):(r=E1(),r.c(),M(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 $7(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function D1(n){let e,t=n[22].value.replace("*:",":")+"",i,l,s,o=n[22].description&&$7(n);return{c(){e=b("li"),i=W(t),l=$(),o&&o.c(),s=$(),p(e,"class","m-0")},m(r,a){v(r,e,a),w(e,i),w(e,l),o&&o.m(e,null),w(e,s)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&k(e),o&&o.d()}}}function O7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J=pe(n[6]),V=[];for(let Z=0;Z<J.length;Z+=1)V[Z]=D1(C1(n,J,Z));return{c(){e=b("p"),e.textContent="The rate limit rules are resolved in the following order (stops on the first match):",t=$(),i=b("ol"),i.innerHTML="<li>exact tag (e.g. <code>users:create</code>)</li> <li>wildcard tag (e.g. <code>*:create</code>)</li> <li>METHOD + exact path (e.g. <code>POST /a/b</code>)</li> <li>METHOD + prefix path (e.g. <code>POST /a/b<strong>/</strong></code>)</li> <li>exact path (e.g. <code>/a/b</code>)</li> <li>prefix path (e.g. <code>/a/b<strong>/</strong></code>)</li>",l=$(),s=b("p"),s.textContent=`In case of multiple rules with the same label but different target user audience (e.g. "guest" vs
         "auth"), only the matching audience rule is taken in consideration.`,o=$(),r=b("hr"),a=$(),u=b("p"),u.textContent="The rate limit label could be in one of the following formats:",f=$(),c=b("ul"),d=b("li"),d.innerHTML=`<code>[METHOD ]/my/path</code> - full exact route match (
             <strong>must be without trailing slash </strong>; &quot;METHOD&quot; is optional).
             <br/> For example:
@@ -184,16 +184,16 @@ It is recommend to list it as trusted.`)),t=!0)},d(l){l&&k(e),t=!1,i()}}}functio
             `),O=b("code"),O.textContent="posts:create",E=W(", "),L=b("code"),L.textContent="users:listAuthMethods",I=W(", "),A=b("code"),A.textContent="*:auth",P=W(`.
             `),N=b("br"),R=W(`
             The predifined collection tags are (`),z=b("em"),z.textContent="there should be autocomplete once you start typing",F=W(`):
-            `),B=b("ul");for(let Z=0;Z<V.length;Z+=1)V[Z].c();p(r,"class","m-t-xs m-b-xs"),p(d,"class","m-b-sm"),p(h,"class","m-b-sm")},m(Z,G){v(Z,e,G),v(Z,t,G),v(Z,i,G),v(Z,l,G),v(Z,s,G),v(Z,o,G),v(Z,r,G),v(Z,a,G),v(Z,u,G),v(Z,f,G),v(Z,c,G),w(c,d),w(c,m),w(c,h),w(c,g),w(c,_),w(_,y),w(_,S),w(_,C),w(_,T),w(_,O),w(_,E),w(_,L),w(_,I),w(_,A),w(_,P),w(_,N),w(_,R),w(_,z),w(_,F),w(_,B);for(let de=0;de<V.length;de+=1)V[de]&&V[de].m(B,null)},p(Z,G){if(G&64){J=pe(Z[6]);let de;for(de=0;de<J.length;de+=1){const fe=T1(Z,J,de);V[de]?V[de].p(fe,G):(V[de]=E1(fe),V[de].c(),V[de].m(B,null))}for(;de<V.length;de+=1)V[de].d(1);V.length=J.length}},d(Z){Z&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r),k(a),k(u),k(f),k(c)),dt(V,Z)}}}function $7(n){let e;return{c(){e=b("h4"),e.textContent="Rate limit label format",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function O7(n){let e,t,i;return{c(){e=b("button"),e.textContent="Close",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[18]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function M7(n){let e,t,i,l;e=new ji({props:{single:!0,$$slots:{header:[S7],default:[k7]},$$scope:{ctx:n}}});let s={$$slots:{footer:[O7],header:[$7],default:[C7]},$$scope:{ctx:n}};return i=new Xt({props:s}),n[19](i),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&536870943&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&536870920&&(u.$$scope={dirty:r,ctx:o}),i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[19](null),H(i,o)}}}function E7(n,e,t){let i,l,s;Qe(n,Mn,A=>t(20,l=A)),Qe(n,kn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Iu(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(P=>P.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Ut({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Ut({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,P){n.$$.not_equal(P.label,A)&&(P.label=A,t(0,o))}function _(A,P){A[P].maxRequests=gt(this.value),t(0,o)}function y(A,P){A[P].duration=gt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const C=A=>{Yn("rateLimits.rules."+A)},T=A=>m(A),O=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unshift":"push"](()=>{f=A,t(3,f)})}return n.$$set=A=>{"formSettings"in A&&t(0,o=A.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(4,i=!U.isEmpty(s==null?void 0:s.rateLimits))},[o,s,u,f,i,r,a,d,m,h,g,_,y,S,C,T,O,E,L,I]}class D7 extends Se{constructor(e){super(),we(this,e,E7,M7,ye,{formSettings:0})}}function I7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[A7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[P7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});function J(Te){n[11](Te)}let V={healthData:n[3]};n[0]!==void 0&&(V.formSettings=n[0]),f=new c7({props:V}),ie.push(()=>be(f,"formSettings",J));function Z(Te){n[12](Te)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new D7({props:G}),ie.push(()=>be(m,"formSettings",Z));function de(Te){n[13](Te)}let fe={};n[0]!==void 0&&(fe.formSettings=n[0]),_=new e7({props:fe}),ie.push(()=>be(_,"formSettings",de)),T=new ce({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[N7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});let ue=n[4]&&D1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),u=b("div"),j(f.$$.fragment),d=$(),j(m.$$.fragment),g=$(),j(_.$$.fragment),S=$(),C=b("div"),j(T.$$.fragment),O=$(),E=b("div"),L=b("div"),I=$(),ue&&ue.c(),A=$(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],ee(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Te,Ke){v(Te,e,Ke),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,g),q(_,u,null),w(e,S),w(e,C),q(T,C,null),v(Te,O,Ke),v(Te,E,Ke),w(E,L),w(E,I),ue&&ue.m(E,null),w(E,A),w(E,P),w(P,N),z=!0,F||(B=Y(P,"click",n[16]),F=!0)},p(Te,Ke){const Je={};Ke&25165825&&(Je.$$scope={dirty:Ke,ctx:Te}),i.$set(Je);const ft={};Ke&25165825&&(ft.$$scope={dirty:Ke,ctx:Te}),o.$set(ft);const et={};Ke&8&&(et.healthData=Te[3]),!c&&Ke&1&&(c=!0,et.formSettings=Te[0],Ce(()=>c=!1)),f.$set(et);const xe={};!h&&Ke&1&&(h=!0,xe.formSettings=Te[0],Ce(()=>h=!1)),m.$set(xe);const We={};!y&&Ke&1&&(y=!0,We.formSettings=Te[0],Ce(()=>y=!1)),_.$set(We);const at={};Ke&25165825&&(at.$$scope={dirty:Ke,ctx:Te}),T.$set(at),Te[4]?ue?ue.p(Te,Ke):(ue=D1(Te),ue.c(),ue.m(E,A)):ue&&(ue.d(1),ue=null),(!z||Ke&20&&R!==(R=!Te[4]||Te[2]))&&(P.disabled=R),(!z||Ke&4)&&ee(P,"btn-loading",Te[2])},i(Te){z||(M(i.$$.fragment,Te),M(o.$$.fragment,Te),M(f.$$.fragment,Te),M(m.$$.fragment,Te),M(_.$$.fragment,Te),M(T.$$.fragment,Te),z=!0)},o(Te){D(i.$$.fragment,Te),D(o.$$.fragment,Te),D(f.$$.fragment,Te),D(m.$$.fragment,Te),D(_.$$.fragment,Te),D(T.$$.fragment,Te),z=!1},d(Te){Te&&(k(e),k(O),k(E)),H(i),H(o),H(f),H(m),H(_),H(T),ue&&ue.d(),F=!1,B()}}}function L7(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 A7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application name"),l=$(),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),he(s,n[0].meta.appName),r||(a=Y(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&&he(s,u[0].meta.appName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function P7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application URL"),l=$(),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),he(s,n[0].meta.appURL),r||(a=Y(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&&he(s,u[0].meta.appURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function N7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=$(),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=[Y(e,"change",n[14]),Me(qe.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,Ie(f)}}}function D1(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=Y(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&k(e),i=!1,l()}}}function R7(n){let e,t,i,l,s,o,r,a,u;const f=[L7,I7],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=$(),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=Y(l,"submit",nt(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()),M(o,1),o.m(l,null))},i(m){r||(M(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 F7(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[R7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function I1(n){if(!n)return;let e=[{},{}];return n.sort((t,i)=>{e[0].length=t.label.length,e[0].isTag=t.label.includes(":")||!t.label.includes("/"),e[0].isWildcardTag=e[0].isTag&&t.label.startsWith("*"),e[0].isExactTag=e[0].isTag&&!e[0].isWildcardTag,e[0].isPrefix=!e[0].isTag&&t.label.endsWith("/"),e[0].hasMethod=!e[0].isTag&&t.label.includes(" /"),e[1].length=i.label.length,e[1].isTag=i.label.includes(":")||!i.label.includes("/"),e[1].isWildcardTag=e[1].isTag&&i.label.startsWith("*"),e[1].isExactTag=e[1].isTag&&!e[1].isWildcardTag,e[1].isPrefix=!e[1].isTag&&i.label.endsWith("/"),e[1].hasMethod=!e[1].isTag&&i.label.includes(" /");for(let l of e)l.priority=0,l.isTag?(l.priority+=1e3,l.isExactTag?l.priority+=10:l.priority+=5):(l.hasMethod&&(l.priority+=10),l.isPrefix||(l.priority+=5));return e[0].isPrefix&&e[1].isPrefix&&(e[0].hasMethod&&e[1].hasMethod||!e[0].hasMethod&&!e[1].hasMethod)&&(e[0].length>e[1].length?e[0].priority+=1:e[0].length<e[1].length&&(e[1].priority+=1)),e[0].priority>e[1].priority?-1:e[0].priority<e[1].priority?1:0}),n}function q7(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,un,P=>t(19,o=P)),Rn(un,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 _e.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await _e.settings.getAll()||{};_(P),await m()}catch(P){_e.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=I1(a.rateLimits.rules),a);try{const P=await _e.settings.update(U.filterRedactedProps(a));_(P),await m(),Ut({}),tn("Successfully saved application settings.")}catch(P){_e.error(P)}t(2,f=!1)}}function _(P={}){var N,R;Rn(_r,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),I1(a.rateLimits.rules),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 C(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function 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,C,T,O,E,L,I,A]}class H7 extends Se{constructor(e){super(),we(this,e,q7,F7,ye,{})}}function j7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Backup name"),l=$(),s=b("input"),r=$(),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),he(s,n[2]),v(c,r,d),v(c,a,d),u||(f=Y(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]&&he(s,c[2])},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function z7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[j7,({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
+            `),B=b("ul");for(let Z=0;Z<V.length;Z+=1)V[Z].c();p(r,"class","m-t-xs m-b-xs"),p(d,"class","m-b-sm"),p(h,"class","m-b-sm")},m(Z,G){v(Z,e,G),v(Z,t,G),v(Z,i,G),v(Z,l,G),v(Z,s,G),v(Z,o,G),v(Z,r,G),v(Z,a,G),v(Z,u,G),v(Z,f,G),v(Z,c,G),w(c,d),w(c,m),w(c,h),w(c,g),w(c,_),w(_,y),w(_,S),w(_,C),w(_,T),w(_,O),w(_,E),w(_,L),w(_,I),w(_,A),w(_,P),w(_,N),w(_,R),w(_,z),w(_,F),w(_,B);for(let de=0;de<V.length;de+=1)V[de]&&V[de].m(B,null)},p(Z,G){if(G&64){J=pe(Z[6]);let de;for(de=0;de<J.length;de+=1){const fe=C1(Z,J,de);V[de]?V[de].p(fe,G):(V[de]=D1(fe),V[de].c(),V[de].m(B,null))}for(;de<V.length;de+=1)V[de].d(1);V.length=J.length}},d(Z){Z&&(k(e),k(t),k(i),k(l),k(s),k(o),k(r),k(a),k(u),k(f),k(c)),dt(V,Z)}}}function M7(n){let e;return{c(){e=b("h4"),e.textContent="Rate limit label format",p(e,"class","center txt-break")},m(t,i){v(t,e,i)},p:te,d(t){t&&k(e)}}}function E7(n){let e,t,i;return{c(){e=b("button"),e.textContent="Close",p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){v(l,e,s),t||(i=Y(e,"click",n[18]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function D7(n){let e,t,i,l;e=new ji({props:{single:!0,$$slots:{header:[C7],default:[w7]},$$scope:{ctx:n}}});let s={$$slots:{footer:[E7],header:[M7],default:[O7]},$$scope:{ctx:n}};return i=new Xt({props:s}),n[19](i),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(o,r){q(e,o,r),v(o,t,r),q(i,o,r),l=!0},p(o,[r]){const a={};r&536870943&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&536870920&&(u.$$scope={dirty:r,ctx:o}),i.$set(u)},i(o){l||(M(e.$$.fragment,o),M(i.$$.fragment,o),l=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),l=!1},d(o){o&&k(t),H(e,o),n[19](null),H(i,o)}}}function I7(n,e,t){let i,l,s;Qe(n,Mn,A=>t(20,l=A)),Qe(n,kn,A=>t(1,s=A));let{formSettings:o}=e;const r=[{value:"",label:"All"},{value:"@guest",label:"Guest only"},{value:"@auth",label:"Auth only"}],a=[{value:"*:list"},{value:"*:view"},{value:"*:create"},{value:"*:update"},{value:"*:delete"},{value:"*:file",description:"targets the files download endpoint"},{value:"*:listAuthMethods"},{value:"*:authRefresh"},{value:"*:auth",description:"targets all auth methods"},{value:"*:authWithPassword"},{value:"*:authWithOAuth2"},{value:"*:authWithOTP"},{value:"*:requestOTP"},{value:"*:requestPasswordReset"},{value:"*:confirmPasswordReset"},{value:"*:requestVerification"},{value:"*:confirmVerification"},{value:"*:requestEmailChange"},{value:"*:confirmEmailChange"}];let u=a,f;c();async function c(){await Lu(),t(2,u=[]);for(let A of l)A.system||(u.push({value:A.name+":list"}),u.push({value:A.name+":view"}),A.type!="view"&&(u.push({value:A.name+":create"}),u.push({value:A.name+":update"}),u.push({value:A.name+":delete"})),A.type=="auth"&&(u.push({value:A.name+":listAuthMethods"}),u.push({value:A.name+":authRefresh"}),u.push({value:A.name+":auth"}),u.push({value:A.name+":authWithPassword"}),u.push({value:A.name+":authWithOAuth2"}),u.push({value:A.name+":authWithOTP"}),u.push({value:A.name+":requestOTP"}),u.push({value:A.name+":requestPasswordReset"}),u.push({value:A.name+":confirmPasswordReset"}),u.push({value:A.name+":requestVerification"}),u.push({value:A.name+":confirmVerification"}),u.push({value:A.name+":requestEmailChange"}),u.push({value:A.name+":confirmEmailChange"})),A.fields.find(P=>P.type=="file")&&u.push({value:A.name+":file"}));t(2,u=u.concat(a))}function d(){Ut({}),Array.isArray(o.rateLimits.rules)||t(0,o.rateLimits.rules=[],o),o.rateLimits.rules.push({label:"",maxRequests:300,duration:10,audience:""}),t(0,o),o.rateLimits.rules.length==1&&t(0,o.rateLimits.enabled=!0,o)}function m(A){Ut({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function h(){o.rateLimits.enabled=this.checked,t(0,o)}function g(A,P){n.$$.not_equal(P.label,A)&&(P.label=A,t(0,o))}function _(A,P){A[P].maxRequests=gt(this.value),t(0,o)}function y(A,P){A[P].duration=gt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const C=A=>{Yn("rateLimits.rules."+A)},T=A=>m(A),O=()=>d(),E=()=>f==null?void 0:f.show(),L=()=>f==null?void 0:f.hide();function I(A){ie[A?"unshift":"push"](()=>{f=A,t(3,f)})}return n.$$set=A=>{"formSettings"in A&&t(0,o=A.formSettings)},n.$$.update=()=>{n.$$.dirty&2&&t(4,i=!U.isEmpty(s==null?void 0:s.rateLimits))},[o,s,u,f,i,r,a,d,m,h,g,_,y,S,C,T,O,E,L,I]}class L7 extends Se{constructor(e){super(),we(this,e,I7,D7,ye,{formSettings:0})}}function A7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[N7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[R7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});function J(Te){n[11](Te)}let V={healthData:n[3]};n[0]!==void 0&&(V.formSettings=n[0]),f=new p7({props:V}),ie.push(()=>be(f,"formSettings",J));function Z(Te){n[12](Te)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new L7({props:G}),ie.push(()=>be(m,"formSettings",Z));function de(Te){n[13](Te)}let fe={};n[0]!==void 0&&(fe.formSettings=n[0]),_=new n7({props:fe}),ie.push(()=>be(_,"formSettings",de)),T=new ce({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[F7,({uniqueId:Te})=>({23:Te}),({uniqueId:Te})=>Te?8388608:0]},$$scope:{ctx:n}}});let ue=n[4]&&I1(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),u=b("div"),j(f.$$.fragment),d=$(),j(m.$$.fragment),g=$(),j(_.$$.fragment),S=$(),C=b("div"),j(T.$$.fragment),O=$(),E=b("div"),L=b("div"),I=$(),ue&&ue.c(),A=$(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],ee(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Te,Ke){v(Te,e,Ke),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),w(a,u),q(f,u,null),w(u,d),q(m,u,null),w(u,g),q(_,u,null),w(e,S),w(e,C),q(T,C,null),v(Te,O,Ke),v(Te,E,Ke),w(E,L),w(E,I),ue&&ue.m(E,null),w(E,A),w(E,P),w(P,N),z=!0,F||(B=Y(P,"click",n[16]),F=!0)},p(Te,Ke){const Je={};Ke&25165825&&(Je.$$scope={dirty:Ke,ctx:Te}),i.$set(Je);const ft={};Ke&25165825&&(ft.$$scope={dirty:Ke,ctx:Te}),o.$set(ft);const et={};Ke&8&&(et.healthData=Te[3]),!c&&Ke&1&&(c=!0,et.formSettings=Te[0],Ce(()=>c=!1)),f.$set(et);const xe={};!h&&Ke&1&&(h=!0,xe.formSettings=Te[0],Ce(()=>h=!1)),m.$set(xe);const We={};!y&&Ke&1&&(y=!0,We.formSettings=Te[0],Ce(()=>y=!1)),_.$set(We);const at={};Ke&25165825&&(at.$$scope={dirty:Ke,ctx:Te}),T.$set(at),Te[4]?ue?ue.p(Te,Ke):(ue=I1(Te),ue.c(),ue.m(E,A)):ue&&(ue.d(1),ue=null),(!z||Ke&20&&R!==(R=!Te[4]||Te[2]))&&(P.disabled=R),(!z||Ke&4)&&ee(P,"btn-loading",Te[2])},i(Te){z||(M(i.$$.fragment,Te),M(o.$$.fragment,Te),M(f.$$.fragment,Te),M(m.$$.fragment,Te),M(_.$$.fragment,Te),M(T.$$.fragment,Te),z=!0)},o(Te){D(i.$$.fragment,Te),D(o.$$.fragment,Te),D(f.$$.fragment,Te),D(m.$$.fragment,Te),D(_.$$.fragment,Te),D(T.$$.fragment,Te),z=!1},d(Te){Te&&(k(e),k(O),k(E)),H(i),H(o),H(f),H(m),H(_),H(T),ue&&ue.d(),F=!1,B()}}}function P7(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 N7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application name"),l=$(),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),he(s,n[0].meta.appName),r||(a=Y(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&&he(s,u[0].meta.appName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function R7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Application URL"),l=$(),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),he(s,n[0].meta.appURL),r||(a=Y(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&&he(s,u[0].meta.appURL)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function F7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=$(),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=[Y(e,"change",n[14]),Me(qe.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,Ie(f)}}}function I1(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=Y(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&k(e),i=!1,l()}}}function q7(n){let e,t,i,l,s,o,r,a,u;const f=[P7,A7],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=$(),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=Y(l,"submit",nt(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()),M(o,1),o.m(l,null))},i(m){r||(M(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 H7(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function L1(n){if(!n)return;let e=[{},{}];return n.sort((t,i)=>{e[0].length=t.label.length,e[0].isTag=t.label.includes(":")||!t.label.includes("/"),e[0].isWildcardTag=e[0].isTag&&t.label.startsWith("*"),e[0].isExactTag=e[0].isTag&&!e[0].isWildcardTag,e[0].isPrefix=!e[0].isTag&&t.label.endsWith("/"),e[0].hasMethod=!e[0].isTag&&t.label.includes(" /"),e[1].length=i.label.length,e[1].isTag=i.label.includes(":")||!i.label.includes("/"),e[1].isWildcardTag=e[1].isTag&&i.label.startsWith("*"),e[1].isExactTag=e[1].isTag&&!e[1].isWildcardTag,e[1].isPrefix=!e[1].isTag&&i.label.endsWith("/"),e[1].hasMethod=!e[1].isTag&&i.label.includes(" /");for(let l of e)l.priority=0,l.isTag?(l.priority+=1e3,l.isExactTag?l.priority+=10:l.priority+=5):(l.hasMethod&&(l.priority+=10),l.isPrefix||(l.priority+=5));return e[0].isPrefix&&e[1].isPrefix&&(e[0].hasMethod&&e[1].hasMethod||!e[0].hasMethod&&!e[1].hasMethod)&&(e[0].length>e[1].length?e[0].priority+=1:e[0].length<e[1].length&&(e[1].priority+=1)),e[0].priority>e[1].priority?-1:e[0].priority<e[1].priority?1:0}),n}function j7(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,un,P=>t(19,o=P)),Rn(un,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 _e.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function h(){t(1,u=!0);try{const P=await _e.settings.getAll()||{};_(P),await m()}catch(P){_e.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=L1(a.rateLimits.rules),a);try{const P=await _e.settings.update(U.filterRedactedProps(a));_(P),await m(),Ut({}),tn("Successfully saved application settings.")}catch(P){_e.error(P)}t(2,f=!1)}}function _(P={}){var N,R;Rn(_r,s=(N=P==null?void 0:P.meta)==null?void 0:N.appName,s),Rn(Dl,l=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),l),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),L1(a.rateLimits.rules),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 C(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function 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,C,T,O,E,L,I,A]}class z7 extends Se{constructor(e){super(),we(this,e,j7,H7,ye,{})}}function U7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=W("Backup name"),l=$(),s=b("input"),r=$(),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),he(s,n[2]),v(c,r,d),v(c,a,d),u||(f=Y(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]&&he(s,c[2])},d(c){c&&(k(e),k(l),k(s),k(r),k(a)),u=!1,f()}}}function V7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[U7,({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=$(),i=b("form"),j(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),q(l,i,null),s=!0,o||(r=Y(i,"submit",nt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(t),k(i)),H(l),o=!1,r()}}}function U7(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 V7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&ee(l,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(l)),o=!1,r()}}}function B7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[V7],header:[U7],default:[z7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function W7(n,e,t){const i=yt(),l="backup_create_"+U.randomString(5);let s,o="",r=!1,a;function u(S){Ut({}),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 _e.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),tn("Successfully generated new backup.")}catch(S){S.isAbort||_e.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function 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 Y7 extends Se{constructor(e){super(),we(this,e,W7,B7,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function K7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=$(),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),he(s,n[2]),r||(a=Y(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]&&he(s,u[2])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function J7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new Ci({props:{value:n[1]}}),m=new ce({props:{class:"form-field required m-0",name:"name",$$slots:{default:[K7,({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=$(),i=b("form"),j(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),q(l,i,null),s=!0,o||(r=Y(i,"submit",nt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(M(l.$$.fragment,a),s=!0)},o(a){D(l.$$.fragment,a),s=!1},d(a){a&&(k(e),k(t),k(i)),H(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 W7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&ee(l,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(l)),o=!1,r()}}}function Y7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[W7],header:[B7],default:[V7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[10](null),H(e,l)}}}function K7(n,e,t){const i=yt(),l="backup_create_"+U.randomString(5);let s,o="",r=!1,a;function u(S){Ut({}),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 _e.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),tn("Successfully generated new backup.")}catch(S){S.isAbort||_e.error(S)}clearTimeout(a),t(3,r=!1)}}oo(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Ks("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Ks("The backup was started but may take a while to complete. You can come back later.",4500),!0);function 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 J7 extends Se{constructor(e){super(),we(this,e,K7,Y7,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Z7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Backup name"),l=$(),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),he(s,n[2]),r||(a=Y(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]&&he(s,u[2])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function G7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;return u=new Ci({props:{value:n[1]}}),m=new ce({props:{class:"form-field required m-0",name:"name",$$slots:{default:[Z7,({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=$(),i=b("div"),l=W(`Type the backup name
         `),s=b("div"),o=b("span"),r=W(n[1]),a=$(),j(u.$$.fragment),f=W(`
-        to confirm:`),c=$(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(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),q(u,s,null),w(i,f),v(y,c,S),v(y,d,S),q(m,d,null),h=!0,g||(_=Y(d,"submit",nt(n[7])),g=!0)},p(y,S){(!h||S&2)&&oe(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),m.$set(T)},i(y){h||(M(u.$$.fragment,y),M(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)),H(u),H(m),g=!1,_()}}}function Z7(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&k(e)}}}function G7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=$(),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],ee(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=Y(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&&ee(l,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function X7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[G7],header:[Z7],default:[J7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function Q7(n,e,t){let i;const l="backup_restore_"+U.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Ut({}),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 _e.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),$i(((S=C.response)==null?void 0:S.message)||C.message))}}}oo(()=>{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 x7 extends Se{constructor(e){super(),we(this,e,Q7,X7,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function L1(n,e,t){const i=n.slice();return i[22]=e[t],i}function A1(n,e,t){const i=n.slice();return i[19]=e[t],i}function eR(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=L1(n,s,a),f=o(u);t.set(f,e[a]=N1(f,u))}let r=null;return s.length||(r=P1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ve(),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=vt(e,u,o,1,a,s,t,i.parentNode,Bt,N1,i,L1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=P1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)M(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 tR(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=R1(A1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=A1(l,t,o);i[o]?i[o].p(r,s):(i[o]=R1(),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),dt(i,l)}}}function P1(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 N1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=U.formattedFileSize(e[22].size)+"",h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V;function Z(){return e[10](e[22])}function G(){return e[11](e[22])}function de(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=$(),s=b("div"),o=b("span"),a=W(r),f=$(),c=b("span"),d=W("("),h=W(m),g=W(")"),_=$(),y=b("div"),S=b("button"),C=b("i"),O=$(),E=b("button"),L=b("i"),A=$(),P=b("button"),N=b("i"),z=$(),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(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),ee(S,"btn-loading",e[5][e[22].key]),p(L,"class","ri-restart-line"),p(E,"type","button"),p(E,"class","btn btn-sm btn-circle btn-hint btn-transparent"),E.disabled=I=e[6][e[22].key],p(E,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),ee(P,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(fe,ue){v(fe,t,ue),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,C),w(y,O),w(y,E),w(E,L),w(y,A),w(y,P),w(P,N),w(t,z),B=!0,J||(V=[Me(qe.call(null,S,"Download")),Y(S,"click",nt(Z)),Me(qe.call(null,E,"Restore")),Y(E,"click",nt(G)),Me(qe.call(null,P,"Delete")),Y(P,"click",nt(de))],J=!0)},p(fe,ue){e=fe,(!B||ue&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!B||ue&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ue&8)&&m!==(m=U.formattedFileSize(e[22].size)+"")&&oe(h,m),(!B||ue&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ue&40)&&ee(S,"btn-loading",e[5][e[22].key]),(!B||ue&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!B||ue&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!B||ue&72)&&ee(P,"btn-loading",e[6][e[22].key])},i(fe){B||(fe&&tt(()=>{B&&(F||(F=He(t,mt,{duration:150},!0)),F.run(1))}),B=!0)},o(fe){fe&&(F||(F=He(t,mt,{duration:150},!1)),F.run(0)),B=!1},d(fe){fe&&k(t),fe&&F&&F.end(),J=!1,Ie(V)}}}function R1(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 nR(n){let e,t,i;return{c(){e=b("span"),t=$(),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 iR(n){let e,t,i;return{c(){e=b("i"),t=$(),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 lR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[tR,eR],y=[];function S(I,A){return I[4]?0:1}i=S(n),l=y[i]=_[i](n);function C(I,A){return I[7]?iR:nR}let T=C(n),O=T(n),E={};f=new Y7({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new x7({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=$(),o=b("div"),r=b("button"),O.c(),u=$(),j(f.$$.fragment),c=$(),j(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){v(I,e,A),w(e,t),y[i].m(t,null),w(e,s),w(e,o),w(o,r),O.m(r,null),v(I,u,A),q(f,I,A),v(I,c,A),q(d,I,A),m=!0,h||(g=Y(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()),M(l,1),l.m(t,null)),T!==(T=C(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(M(l),M(f.$$.fragment,I),M(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(),O.d(),n[14](null),H(f,I),n[16](null),H(d,I),h=!1,g()}}}function sR(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 _e.backups.getFullList()),s.sort((E,L)=>E.modified<L.modified?1:E.modified>L.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(_e.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await _e.getSuperuserFileToken();U.download(_e.backups.getDownloadURL(L,E))}catch(L){L.isAbort||_e.error(L)}delete r[E],t(5,r)}}function d(E){_n(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await _e.backups.delete(E),U.removeByKey(s,"name",E),f(),tn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||_e.error(L)}delete a[E],t(6,a)}}async function h(){var E;try{const L=await _e.health.check({$autoCancel:!1}),I=u;t(7,u=((E=L==null?void 0:L.data)==null?void 0:E.canBackup)||!1),I!=u&&u&&f()}catch{}}ln(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),_=E=>l.show(E.key),y=E=>d(E.key),S=()=>i==null?void 0:i.show();function C(E){ie[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ie[E?"unshift":"push"](()=>{l=E,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,y,S,C,T,O]}class oR extends Se{constructor(e){super(),we(this,e,sR,lR,ye,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const rR=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),F1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function aR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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&&oe(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 q1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[uR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[fR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[cR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[dR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[pR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[mR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),m=$(),h=b("div"),j(g.$$.fragment),_=$(),y=b("div"),j(S.$$.fragment),C=$(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(g,h,null),w(e,_),w(e,y),q(S,y,null),w(e,C),w(e,T),E=!0},p(L,I){const A={};I&8&&(A.name=L[3]+".endpoint"),I&8519681&&(A.$$scope={dirty:I,ctx:L}),i.$set(A);const P={};I&8&&(P.name=L[3]+".bucket"),I&8519681&&(P.$$scope={dirty:I,ctx:L}),o.$set(P);const N={};I&8&&(N.name=L[3]+".region"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),u.$set(N);const R={};I&8&&(R.name=L[3]+".accessKey"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),d.$set(R);const z={};I&8&&(z.name=L[3]+".secret"),I&8519713&&(z.$$scope={dirty:I,ctx:L}),g.$set(z);const F={};I&8&&(F.name=L[3]+".forcePathStyle"),I&8519681&&(F.$$scope={dirty:I,ctx:L}),S.$set(F)},i(L){E||(M(i.$$.fragment,L),M(o.$$.fragment,L),M(u.$$.fragment,L),M(d.$$.fragment,L),M(g.$$.fragment,L),M(S.$$.fragment,L),L&&tt(()=>{E&&(O||(O=He(e,mt,{duration:150},!0)),O.run(1))}),E=!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&&(O||(O=He(e,mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&k(e),H(i),H(o),H(u),H(d),H(g),H(S),L&&O&&O.end()}}}function uR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),l=$(),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),he(s,n[0].endpoint),r||(a=Y(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&&he(s,u[0].endpoint)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function fR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Bucket"),l=$(),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),he(s,n[0].bucket),r||(a=Y(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&&he(s,u[0].bucket)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function cR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Region"),l=$(),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),he(s,n[0].region),r||(a=Y(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&&he(s,u[0].region)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function dR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Access key"),l=$(),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),he(s,n[0].accessKey),r||(a=Y(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&&he(s,u[0].accessKey)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function pR(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 ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Secret"),l=$(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function mR(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=$(),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=[Y(e,"change",n[16]),Me(qe.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,Ie(f)}}}function hR(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[aR,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],F1);let a=n[0].enabled&&q1(n);return{c(){j(e.$$.fragment),t=$(),r&&r.c(),i=$(),a&&a.c(),l=ve()},m(u,f){q(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,rR):Nt(u[17]),F1),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=q1(u),a.c(),M(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(M(e.$$.fragment,u),M(r,u),M(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(k(t),k(i),k(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Pa="s3_test_request";function _R(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;_e.cancelRequest(Pa),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Pa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await _e.settings.testS3(u,{$cancelKey:Pa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}ln(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function C(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function 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||Yn(r))},[o,f,c,r,a,h,s,u,i,S,C,T,O,E,L,I,A,l]}class Tk extends Se{constructor(e){super(),we(this,e,_R,hR,ye,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function gR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=$(),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"),ee(e,"btn-loading",n[2]),ee(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(qe.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(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&&ee(e,"btn-loading",a[2]),u&5&&ee(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(k(e),k(l),k(s)),n[5](null),o=!1,Ie(r)}}}const H1="upload_backup";function bR(n,e,t){const i=yt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&_n(`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=$(),d=b("form"),j(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(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),q(u,s,null),w(i,f),v(y,c,S),v(y,d,S),q(m,d,null),h=!0,g||(_=Y(d,"submit",nt(n[7])),g=!0)},p(y,S){(!h||S&2)&&oe(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),m.$set(T)},i(y){h||(M(u.$$.fragment,y),M(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)),H(u),H(m),g=!1,_()}}}function X7(n){let e,t,i,l;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),l=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){v(s,e,o),w(e,t),w(e,i),w(i,l)},p(s,o){o&2&&oe(l,s[1])},d(s){s&&k(e)}}}function Q7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=$(),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],ee(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=Y(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&&ee(l,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(l)),r=!1,a()}}}function x7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[Q7],header:[X7],default:[G7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function eR(n,e,t){let i;const l="backup_restore_"+U.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Ut({}),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 _e.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),$i(((S=C.response)==null?void 0:S.message)||C.message))}}}oo(()=>{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 tR extends Se{constructor(e){super(),we(this,e,eR,x7,ye,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function A1(n,e,t){const i=n.slice();return i[22]=e[t],i}function P1(n,e,t){const i=n.slice();return i[19]=e[t],i}function nR(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=A1(n,s,a),f=o(u);t.set(f,e[a]=R1(f,u))}let r=null;return s.length||(r=N1()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ve(),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=vt(e,u,o,1,a,s,t,i.parentNode,Bt,R1,i,A1),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=N1(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)M(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 iR(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=F1(P1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=P1(l,t,o);i[o]?i[o].p(r,s):(i[o]=F1(),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),dt(i,l)}}}function N1(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 R1(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=U.formattedFileSize(e[22].size)+"",h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V;function Z(){return e[10](e[22])}function G(){return e[11](e[22])}function de(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=$(),s=b("div"),o=b("span"),a=W(r),f=$(),c=b("span"),d=W("("),h=W(m),g=W(")"),_=$(),y=b("div"),S=b("button"),C=b("i"),O=$(),E=b("button"),L=b("i"),A=$(),P=b("button"),N=b("i"),z=$(),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(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),ee(S,"btn-loading",e[5][e[22].key]),p(L,"class","ri-restart-line"),p(E,"type","button"),p(E,"class","btn btn-sm btn-circle btn-hint btn-transparent"),E.disabled=I=e[6][e[22].key],p(E,"aria-label","Restore"),p(N,"class","ri-delete-bin-7-line"),p(P,"type","button"),p(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=R=e[6][e[22].key],p(P,"aria-label","Delete"),ee(P,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(fe,ue){v(fe,t,ue),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,C),w(y,O),w(y,E),w(E,L),w(y,A),w(y,P),w(P,N),w(t,z),B=!0,J||(V=[Me(qe.call(null,S,"Download")),Y(S,"click",nt(Z)),Me(qe.call(null,E,"Restore")),Y(E,"click",nt(G)),Me(qe.call(null,P,"Delete")),Y(P,"click",nt(de))],J=!0)},p(fe,ue){e=fe,(!B||ue&8)&&r!==(r=e[22].key+"")&&oe(a,r),(!B||ue&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ue&8)&&m!==(m=U.formattedFileSize(e[22].size)+"")&&oe(h,m),(!B||ue&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ue&40)&&ee(S,"btn-loading",e[5][e[22].key]),(!B||ue&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!B||ue&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!B||ue&72)&&ee(P,"btn-loading",e[6][e[22].key])},i(fe){B||(fe&&tt(()=>{B&&(F||(F=He(t,mt,{duration:150},!0)),F.run(1))}),B=!0)},o(fe){fe&&(F||(F=He(t,mt,{duration:150},!1)),F.run(0)),B=!1},d(fe){fe&&k(t),fe&&F&&F.end(),J=!1,Ie(V)}}}function F1(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 lR(n){let e,t,i;return{c(){e=b("span"),t=$(),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 sR(n){let e,t,i;return{c(){e=b("i"),t=$(),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 oR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g;const _=[iR,nR],y=[];function S(I,A){return I[4]?0:1}i=S(n),l=y[i]=_[i](n);function C(I,A){return I[7]?sR:lR}let T=C(n),O=T(n),E={};f=new J7({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new tR({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=$(),o=b("div"),r=b("button"),O.c(),u=$(),j(f.$$.fragment),c=$(),j(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){v(I,e,A),w(e,t),y[i].m(t,null),w(e,s),w(e,o),w(o,r),O.m(r,null),v(I,u,A),q(f,I,A),v(I,c,A),q(d,I,A),m=!0,h||(g=Y(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()),M(l,1),l.m(t,null)),T!==(T=C(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(M(l),M(f.$$.fragment,I),M(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(),O.d(),n[14](null),H(f,I),n[16](null),H(d,I),h=!1,g()}}}function rR(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 _e.backups.getFullList()),s.sort((E,L)=>E.modified<L.modified?1:E.modified>L.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(_e.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await _e.getSuperuserFileToken();U.download(_e.backups.getDownloadURL(L,E))}catch(L){L.isAbort||_e.error(L)}delete r[E],t(5,r)}}function d(E){_n(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await _e.backups.delete(E),U.removeByKey(s,"name",E),f(),tn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||_e.error(L)}delete a[E],t(6,a)}}async function h(){var E;try{const L=await _e.health.check({$autoCancel:!1}),I=u;t(7,u=((E=L==null?void 0:L.data)==null?void 0:E.canBackup)||!1),I!=u&&u&&f()}catch{}}ln(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),_=E=>l.show(E.key),y=E=>d(E.key),S=()=>i==null?void 0:i.show();function C(E){ie[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ie[E?"unshift":"push"](()=>{l=E,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,g,_,y,S,C,T,O]}class aR extends Se{constructor(e){super(),we(this,e,rR,oR,ye,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const uR=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),q1=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function fR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(l,"for",o=n[23])},m(u,f){v(u,e,f),e.checked=n[0].enabled,v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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&&oe(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 H1(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[cR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[dR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[pR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[mR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[hR,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[_R,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),c=b("div"),j(d.$$.fragment),m=$(),h=b("div"),j(g.$$.fragment),_=$(),y=b("div"),j(S.$$.fragment),C=$(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){v(L,e,I),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),q(d,c,null),w(e,m),w(e,h),q(g,h,null),w(e,_),w(e,y),q(S,y,null),w(e,C),w(e,T),E=!0},p(L,I){const A={};I&8&&(A.name=L[3]+".endpoint"),I&8519681&&(A.$$scope={dirty:I,ctx:L}),i.$set(A);const P={};I&8&&(P.name=L[3]+".bucket"),I&8519681&&(P.$$scope={dirty:I,ctx:L}),o.$set(P);const N={};I&8&&(N.name=L[3]+".region"),I&8519681&&(N.$$scope={dirty:I,ctx:L}),u.$set(N);const R={};I&8&&(R.name=L[3]+".accessKey"),I&8519681&&(R.$$scope={dirty:I,ctx:L}),d.$set(R);const z={};I&8&&(z.name=L[3]+".secret"),I&8519713&&(z.$$scope={dirty:I,ctx:L}),g.$set(z);const F={};I&8&&(F.name=L[3]+".forcePathStyle"),I&8519681&&(F.$$scope={dirty:I,ctx:L}),S.$set(F)},i(L){E||(M(i.$$.fragment,L),M(o.$$.fragment,L),M(u.$$.fragment,L),M(d.$$.fragment,L),M(g.$$.fragment,L),M(S.$$.fragment,L),L&&tt(()=>{E&&(O||(O=He(e,mt,{duration:150},!0)),O.run(1))}),E=!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&&(O||(O=He(e,mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&k(e),H(i),H(o),H(u),H(d),H(g),H(S),L&&O&&O.end()}}}function cR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),l=$(),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),he(s,n[0].endpoint),r||(a=Y(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&&he(s,u[0].endpoint)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function dR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Bucket"),l=$(),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),he(s,n[0].bucket),r||(a=Y(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&&he(s,u[0].bucket)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function pR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Region"),l=$(),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),he(s,n[0].region),r||(a=Y(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&&he(s,u[0].region)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function mR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Access key"),l=$(),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),he(s,n[0].accessKey),r||(a=Y(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&&he(s,u[0].accessKey)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function hR(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 tf({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Secret"),l=$(),j(s.$$.fragment),p(e,"for",i=n[23])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],Ce(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function _R(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=$(),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=[Y(e,"change",n[16]),Me(qe.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,Ie(f)}}}function gR(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[fR,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Lt(o,n,n[17],q1);let a=n[0].enabled&&H1(n);return{c(){j(e.$$.fragment),t=$(),r&&r.c(),i=$(),a&&a.c(),l=ve()},m(u,f){q(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,uR):Nt(u[17]),q1),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=H1(u),a.c(),M(a,1),a.m(l.parentNode,l)):a&&(re(),D(a,1,1,()=>{a=null}),ae())},i(u){s||(M(e.$$.fragment,u),M(r,u),M(a),s=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),s=!1},d(u){u&&(k(t),k(i),k(l)),H(e,u),r&&r.d(u),a&&a.d(u)}}}const Pa="s3_test_request";function bR(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;_e.cancelRequest(Pa),clearTimeout(d),d=setTimeout(()=>{_e.cancelRequest(Pa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await _e.settings.testS3(u,{$cancelKey:Pa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}ln(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function C(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function 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||Yn(r))},[o,f,c,r,a,h,s,u,i,S,C,T,O,E,L,I,A,l]}class Ck extends Se{constructor(e){super(),we(this,e,bR,gR,ye,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function yR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=$(),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"),ee(e,"btn-loading",n[2]),ee(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(qe.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(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&&ee(e,"btn-loading",a[2]),u&5&&ee(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(k(e),k(l),k(s)),n[5](null),o=!1,Ie(r)}}}const j1="upload_backup";function kR(n,e,t){const i=yt();let{class:l=""}=e,s,o=!1;function r(){s&&t(1,s.value="",s)}function a(m){m&&_n(`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 _e.backups.upload(h,{requestKey:H1}),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):_e.error(S))}r()}oo(()=>{_e.cancelRequest(H1)});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 yR extends Se{constructor(e){super(),we(this,e,bR,gR,ye,{class:0})}}function kR(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 vR(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 j1(n){var B,J,V;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[wR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&z1(n);function A(Z){n[24](Z)}function P(Z){n[25](Z)}function N(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new Tk({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&U1(n),F=n[9]&&V1(n);return{c(){e=b("form"),j(t.$$.fragment),i=$(),I&&I.c(),l=$(),s=b("div"),o=$(),j(r.$$.fragment),c=$(),d=b("div"),m=b("div"),h=$(),z&&z.c(),g=$(),F&&F.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=C=!n[9]||n[5],ee(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){v(Z,e,G),q(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,g),F&&F.m(d,null),w(d,_),w(d,y),w(y,S),O=!0,E||(L=[Y(y,"click",n[28]),Y(e,"submit",nt(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const de={};G[0]&4|G[1]&3&&(de.$$scope={dirty:G,ctx:Z}),t.$set(de),Z[2]?I?(I.p(Z,G),G[0]&4&&M(I,1)):(I=z1(Z),I.c(),M(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const fe={};G[0]&1&&(fe.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,fe.config=Z[1].backups.s3,Ce(()=>a=!1)),!u&&G[0]&128&&(u=!0,fe.isTesting=Z[7],Ce(()=>u=!1)),!f&&G[0]&256&&(f=!0,fe.testError=Z[8],Ce(()=>f=!1)),r.$set(fe),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=U1(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=V1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&C!==(C=!Z[9]||Z[5]))&&(y.disabled=C),(!O||G[0]&32)&&ee(y,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=He(e,mt,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=He(e,mt,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&k(e),H(t),I&&I.d(),H(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ie(L)}}}function wR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 z1(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[TR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[CR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(l),H(r),f&&a&&a.end()}}}function SR(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=$(),i=b("button"),i.innerHTML='<span class="txt">Every sunday at 00:00h</span>',l=$(),s=b("button"),s.innerHTML='<span class="txt">Every Mon and Wed at 00:00h</span>',o=$(),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=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(s,"click",n[21]),Y(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,Ie(u)}}}function TR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[SR]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=W("Cron expression"),l=$(),s=b("input"),a=$(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=$(),m=b("i"),h=$(),j(g.$$.fragment),_=$(),y=b("div"),S=b("p"),C=W(`Supports numeric list, steps, ranges or
+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 _e.backups.upload(h,{requestKey:j1}),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):_e.error(S))}r()}oo(()=>{_e.cancelRequest(j1)});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 vR extends Se{constructor(e){super(),we(this,e,kR,yR,ye,{class:0})}}function wR(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 SR(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 z1(n){var B,J,V;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[TR,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&U1(n);function A(Z){n[24](Z)}function P(Z){n[25](Z)}function N(Z){n[26](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new Ck({props:R}),ie.push(()=>be(r,"config",A)),ie.push(()=>be(r,"isTesting",P)),ie.push(()=>be(r,"testError",N));let z=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&V1(n),F=n[9]&&B1(n);return{c(){e=b("form"),j(t.$$.fragment),i=$(),I&&I.c(),l=$(),s=b("div"),o=$(),j(r.$$.fragment),c=$(),d=b("div"),m=b("div"),h=$(),z&&z.c(),g=$(),F&&F.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=C=!n[9]||n[5],ee(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){v(Z,e,G),q(t,e,null),w(e,i),I&&I.m(e,null),w(e,l),w(e,s),w(e,o),q(r,e,null),w(e,c),w(e,d),w(d,m),w(d,h),z&&z.m(d,null),w(d,g),F&&F.m(d,null),w(d,_),w(d,y),w(y,S),O=!0,E||(L=[Y(y,"click",n[28]),Y(e,"submit",nt(n[11]))],E=!0)},p(Z,G){var ue,Te,Ke;const de={};G[0]&4|G[1]&3&&(de.$$scope={dirty:G,ctx:Z}),t.$set(de),Z[2]?I?(I.p(Z,G),G[0]&4&&M(I,1)):(I=U1(Z),I.c(),M(I,1),I.m(e,l)):I&&(re(),D(I,1,1,()=>{I=null}),ae());const fe={};G[0]&1&&(fe.originalConfig=(ue=Z[0].backups)==null?void 0:ue.s3),!a&&G[0]&2&&(a=!0,fe.config=Z[1].backups.s3,Ce(()=>a=!1)),!u&&G[0]&128&&(u=!0,fe.isTesting=Z[7],Ce(()=>u=!1)),!f&&G[0]&256&&(f=!0,fe.testError=Z[8],Ce(()=>f=!1)),r.$set(fe),(Ke=(Te=Z[1].backups)==null?void 0:Te.s3)!=null&&Ke.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=V1(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=B1(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&C!==(C=!Z[9]||Z[5]))&&(y.disabled=C),(!O||G[0]&32)&&ee(y,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=He(e,mt,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=He(e,mt,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&k(e),H(t),I&&I.d(),H(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ie(L)}}}function TR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=$(),l=b("label"),s=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(l,"for",o=n[31])},m(u,f){v(u,e,f),e.checked=n[2],v(u,i,f),v(u,l,f),w(l,s),r||(a=Y(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 U1(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[$R,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[OR,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){v(f,e,c),w(e,t),w(t,i),q(l,i,null),w(t,s),w(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(l.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=He(e,mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(l.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=He(e,mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(l),H(r),f&&a&&a.end()}}}function CR(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=$(),i=b("button"),i.innerHTML='<span class="txt">Every sunday at 00:00h</span>',l=$(),s=b("button"),s.innerHTML='<span class="txt">Every Mon and Wed at 00:00h</span>',o=$(),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=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(s,"click",n[21]),Y(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,Ie(u)}}}function $R(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P;return g=new jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[CR]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=W("Cron expression"),l=$(),s=b("input"),a=$(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=$(),m=b("i"),h=$(),j(g.$$.fragment),_=$(),y=b("div"),S=b("p"),C=W(`Supports numeric list, steps, ranges or
                                                 `),T=b("span"),T.textContent="macros",O=W(`.
                                                 `),E=b("br"),L=W(`
                                                 The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(N,R){var z,F;v(N,e,R),w(e,t),v(N,l,R),v(N,s,R),he(s,n[1].backups.cron),v(N,a,R),v(N,u,R),w(u,f),w(f,c),w(f,d),w(f,m),w(f,h),q(g,f,null),v(N,_,R),v(N,y,R),w(y,S),w(S,C),w(S,T),w(S,O),w(S,E),w(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||s.focus(),A||(P=[Y(s,"input",n[18]),Me(qe.call(null,T,`@yearly
@@ -202,13 +202,13 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function
 @weekly
 @daily
 @midnight
-@hourly`))],A=!0)},p(N,R){var F,B;(!I||R[1]&1&&i!==(i=N[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=N[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=N[0])==null?void 0:F.backups)!=null&&B.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==N[1].backups.cron&&he(s,N[1].backups.cron);const z={};R[0]&2|R[1]&2&&(z.$$scope={dirty:R,ctx:N}),g.$set(z)},i(N){I||(M(g.$$.fragment,N),I=!0)},o(N){D(g.$$.fragment,N),I=!1},d(N){N&&(k(e),k(l),k(s),k(a),k(u),k(_),k(y)),H(g),A=!1,Ie(P)}}}function CR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=$(),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),he(s,n[1].backups.cronMaxKeep),r||(a=Y(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&&gt(s.value)!==u[1].backups.cronMaxKeep&&he(s,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function U1(n){let e;function t(s,o){return s[7]?MR:s[8]?OR:$R}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 $R(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 OR(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=qe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(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 MR(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 V1(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=Y(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 ER(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N;m=new Pu({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new yR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};y=new oR({props:R}),n[15](y);function z(V,Z){return V[6]?vR:kR}let F=z(n),B=F(n),J=n[6]&&!n[4]&&j1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[10]),r=$(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=$(),j(m.$$.fragment),h=$(),j(g.$$.fragment),_=$(),j(y.$$.fragment),S=$(),C=b("hr"),T=$(),O=b("button"),E=b("span"),E.textContent="Backups options",L=$(),B.c(),I=$(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],ee(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){v(V,e,Z),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(V,r,Z),v(V,a,Z),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(g,f,null),w(u,_),q(y,u,null),w(u,S),w(u,C),w(u,T),w(u,O),w(O,E),w(O,L),B.m(O,null),w(u,I),J&&J.m(u,null),A=!0,P||(N=[Y(O,"click",n[16]),Y(u,"submit",nt(n[11]))],P=!0)},p(V,Z){(!A||Z[0]&1024)&&oe(o,V[10]);const G={};y.$set(G),F!==(F=z(V))&&(B.d(1),B=F(V),B&&(B.c(),B.m(O,null))),(!A||Z[0]&16)&&(O.disabled=V[4]),(!A||Z[0]&16)&&ee(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=j1(V),J.c(),M(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(y.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),D(y.$$.fragment,V),D(J),A=!1},d(V){V&&(k(e),k(r),k(a)),H(m),H(g),n[15](null),H(y),B.d(),J&&J.d(),P=!1,Ie(N)}}}function DR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[ER]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function IR(n,e,t){let i,l;Qe(n,un,Z=>t(10,l=Z)),Rn(un,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 Z=await _e.settings.getAll()||{};y(Z)}catch(Z){_e.error(Z)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const Z=await _e.settings.update(U.filterRedactedProps(r));Ut({}),await C(),y(Z),tn("Successfully saved application settings.")}catch(Z){_e.error(Z)}t(5,u=!1)}}function y(Z={}){t(1,r={backups:(Z==null?void 0:Z.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 C(){return s==null?void 0:s.loadBackups()}function T(Z){ie[Z?"unshift":"push"](()=>{s=Z,t(3,s)})}const O=()=>t(6,d=!d);function E(){c=this.checked,t(2,c)}function L(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(Z){n.$$.not_equal(r.backups.s3,Z)&&(r.backups.s3=Z,t(1,r),t(2,c))}function F(Z){m=Z,t(7,m)}function B(Z){h=Z,t(8,h)}const J=()=>S(),V=()=>_();return n.$$.update=()=>{var Z;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(Z=r==null?void 0:r.backups)!=null&&Z.cron&&(Yn("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,C,f,T,O,E,L,I,A,P,N,R,z,F,B,J,V]}class LR extends Se{constructor(e){super(),we(this,e,IR,DR,ye,{},null,[-1,-1])}}function B1(n,e,t){const i=n.slice();return i[22]=e[t],i}function AR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z;o=new ce({props:{class:"form-field",$$slots:{default:[NR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=pe(n[0]);const B=J=>J[22].id;for(let J=0;J<F.length;J+=1){let V=B1(n,F,J),Z=B(V);u.set(Z,a[J]=W1(Z,V))}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=$(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=$();for(let J=0;J<a.length;J+=1)a[J].c();f=$(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=$(),_=b("pre"),y=W(n[6]),S=$(),C=b("div"),T=b("div"),O=$(),E=b("button"),L=b("i"),I=$(),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(T,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-expanded"),E.disabled=P=!n[2],p(C,"class","flex m-t-base")},m(J,V){v(J,e,V),v(J,t,V),v(J,i,V),w(i,l),w(l,s),q(o,s,null),w(l,r);for(let Z=0;Z<a.length;Z+=1)a[Z]&&a[Z].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(J,S,V),v(J,C,V),w(C,T),w(C,O),w(C,E),w(E,L),w(E,I),w(E,A),N=!0,R||(z=[Y(d,"click",n[15]),Y(c,"keydown",n[17]),Y(E,"click",n[18])],R=!0)},p(J,V){const Z={};V&33558561&&(Z.$$scope={dirty:V,ctx:J}),o.$set(Z),V&6147&&(F=pe(J[0]),re(),a=vt(a,V,B,1,J,F,u,l,Bt,W1,null,B1),ae()),(!N||V&4&&h!==(h=!J[2]))&&(d.disabled=h),(!N||V&64)&&oe(y,J[6]),(!N||V&4&&P!==(P=!J[2]))&&(E.disabled=P)},i(J){if(!N){M(o.$$.fragment,J);for(let V=0;V<F.length;V+=1)M(a[V]);N=!0}},o(J){D(o.$$.fragment,J);for(let V=0;V<a.length;V+=1)D(a[V]);N=!1},d(J){J&&(k(e),k(t),k(i),k(S),k(C)),H(o);for(let V=0;V<a.length;V+=1)a[V].d();n[16](null),R=!1,Ie(z)}}}function PR(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 NR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("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=Y(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 RR(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=$(),s=b("label"),r=W(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=Y(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+"")&&oe(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 W1(n,e){let t,i,l,s;return i=new ce({props:{class:"form-field",$$slots:{default:[RR,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=$(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function FR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[PR,AR],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=$(),s=b("div"),o=W(n[7]),r=$(),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)&&oe(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()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function qR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[FR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function HR(n,e,t){let i,l,s,o;Qe(n,un,A=>t(7,o=A)),Rn(un,o="Export collections",o);const r="export_"+U.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await _e.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=U.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;y()}catch(P){_e.error(P)}t(4,c=!1)}function m(){U.downloadJson(Object.values(f),"pb_schema")}function h(){U.copyToClipboard(i),Ks("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 C=()=>g(),T=A=>S(A),O=()=>h();function E(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const L=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,g,S,r,C,T,O,E,L,I]}class jR extends Se{constructor(e){super(),we(this,e,HR,qR,ye,{})}}function Y1(n,e,t){const i=n.slice();return i[14]=e[t],i}function K1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function J1(n,e,t){const i=n.slice();return i[14]=e[t],i}function Z1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function G1(n,e,t){const i=n.slice();return i[14]=e[t],i}function X1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Q1(n,e,t){const i=n.slice();return i[30]=e[t],i}function zR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&x1(),a=n[0].name!==n[1].name&&eb(n);return{c(){e=b("div"),r&&r.c(),t=$(),a&&a.c(),i=$(),l=b("strong"),o=W(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=x1(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=eb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&oe(o,s)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function UR(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=$(),i=b("strong"),s=W(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)+"")&&oe(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function VR(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=$(),i=b("strong"),s=W(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)+"")&&oe(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function x1(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 eb(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=$(),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+"")&&oe(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function tb(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,C,T,O,E,L;e=b("tr"),t=b("td"),i=b("span"),s=W(l),o=$(),r=b("td"),a=b("pre"),f=W(u),c=$(),d=b("td"),m=b("pre"),g=W(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),ee(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),ee(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),ee(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),ee(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,C){v(S,e,C),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,C){var T,O,E,L,I,A,P,N;C[0]&512&&l!==(l=S[30]+"")&&oe(s,l),C[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&oe(f,u),C[0]&2563&&ee(r,"changed-old-col",!S[11]&&Pn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),C[0]&2048&&ee(r,"changed-none-col",S[11]),C[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&oe(g,h),C[0]&547&&ee(d,"changed-new-col",!S[5]&&Pn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),C[0]&32&&ee(d,"changed-none-col",S[5]),C[0]&515&&ee(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&k(e)}}}function nb(n){let e,t=pe(n[6]),i=[];for(let l=0;l<t.length;l+=1)i[l]=lb(G1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=G1(l,t,o);i[o]?i[o].p(r,s):(i[o]=lb(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),dt(i,l)}}}function ib(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=W(i),s=$(),o=b("td"),r=b("pre"),u=W(a),f=$(),c=b("td"),d=$(),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]+"")&&oe(l,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&oe(u,a)},d(m){m&&k(e)}}}function lb(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])),C=[];for(let T=0;T<S.length;T+=1)C[T]=ib(X1(n,S,T));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),a=b("span"),u=W("Deleted - "),f=b("small"),c=W("All stored data related to "),d=b("strong"),h=W(m),g=W(" will be deleted!"),_=$();for(let T=0;T<C.length;T+=1)C[T].c();y=ve(),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(T,O){v(T,e,O),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(T,_,O);for(let E=0;E<C.length;E+=1)C[E]&&C[E].m(T,O);v(T,y,O)},p(T,O){if(O[0]&64&&s!==(s=T[14].name+"")&&oe(o,s),O[0]&64&&m!==(m=T[14].name+"")&&oe(h,m),O[0]&4160){S=pe(Object.entries(T[14]));let E;for(E=0;E<S.length;E+=1){const L=X1(T,S,E);C[E]?C[E].p(L,O):(C[E]=ib(L),C[E].c(),C[E].m(y.parentNode,y))}for(;E<C.length;E+=1)C[E].d(1);C.length=S.length}},d(T){T&&(k(e),k(_),k(y)),dt(C,T)}}}function sb(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 ob(n){var g;let e,t,i=n[17]+"",l,s,o,r,a=n[12]((g=Xn(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=W(i),s=$(),o=b("td"),r=b("pre"),u=W(a),f=$(),c=b("td"),d=b("pre"),h=W(m),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","svelte-qs0w8h"),ee(o,"changed-old-col",Pn((_=Xn(n[3],n[14].id))==null?void 0:_[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-qs0w8h"),ee(c,"changed-new-col",Pn((y=Xn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((S=Xn(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,C,T,O;y[0]&128&&i!==(i=_[17]+"")&&oe(l,i),y[0]&136&&a!==(a=_[12]((S=Xn(_[3],_[14].id))==null?void 0:S[_[17]])+"")&&oe(u,a),y[0]&136&&ee(o,"changed-old-col",Pn((C=Xn(_[3],_[14].id))==null?void 0:C[_[17]],_[23])),y[0]&128&&m!==(m=_[12](_[23])+"")&&oe(h,m),y[0]&136&&ee(c,"changed-new-col",Pn((T=Xn(_[3],_[14].id))==null?void 0:T[_[17]],_[23])),y[0]&136&&ee(e,"txt-primary",Pn((O=Xn(_[3],_[14].id))==null?void 0:O[_[17]],_[23]))},d(_){_&&k(e)}}}function rb(n){let e,t,i,l,s=n[14].name+"",o,r,a=Pn(Xn(n[3],n[14].id),Xn(n[4],n[14].id)),u,f,c=a&&sb(),d=pe(Object.entries(n[14])),m=[];for(let h=0;h<d.length;h+=1)m[h]=ob(Z1(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),c&&c.c(),u=$();for(let h=0;h<m.length;h+=1)m[h].c();f=ve(),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+"")&&oe(o,s),g[0]&152&&(a=Pn(Xn(h[3],h[14].id),Xn(h[4],h[14].id))),a?c||(c=sb(),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=Z1(h,d,_);m[_]?m[_].p(y,g):(m[_]=ob(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(),dt(m,h)}}}function ab(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=W(i),s=$(),o=b("td"),r=$(),a=b("td"),u=b("pre"),c=W(f),d=$(),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]+"")&&oe(l,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&oe(c,f)},d(m){m&&k(e)}}}function ub(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]=ab(K1(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),a=b("span"),a.textContent="Added",u=$();for(let m=0;m<d.length;m+=1)d[m].c();f=ve(),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+"")&&oe(o,s),h[0]&4352){c=pe(Object.entries(m[14]));let g;for(g=0;g<c.length;g+=1){const _=K1(m,c,g);d[g]?d[g].p(_,h):(d[g]=ab(_),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)),dt(d,m)}}}function BR(n){let e,t,i,l,s,o,r,a,u;function f(T,O){var E,L;return(E=T[0])!=null&&E.id?(L=T[1])!=null&&L.id?zR:UR:VR}let c=f(n),d=c(n),m=pe(n[9]),h=[];for(let T=0;T<m.length;T+=1)h[T]=tb(Q1(n,m,T));let g=(n[2]||n[5])&&nb(n),_=pe(n[7]),y=[];for(let T=0;T<_.length;T+=1)y[T]=rb(J1(n,_,T));let S=pe(n[8]),C=[];for(let T=0;T<S.length;T+=1)C[T]=ub(Y1(n,S,T));return{c(){e=b("div"),d.c(),t=$(),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=$(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=$(),g&&g.c(),a=$();for(let T=0;T<y.length;T+=1)y[T].c();u=$();for(let T=0;T<C.length;T+=1)C[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-qs0w8h")},m(T,O){v(T,e,O),d.m(e,null),v(T,t,O),v(T,i,O),w(i,l),w(i,s),w(i,o);for(let E=0;E<h.length;E+=1)h[E]&&h[E].m(o,null);w(o,r),g&&g.m(o,null),w(o,a);for(let E=0;E<y.length;E+=1)y[E]&&y[E].m(o,null);w(o,u);for(let E=0;E<C.length;E+=1)C[E]&&C[E].m(o,null)},p(T,O){if(c===(c=f(T))&&d?d.p(T,O):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),O[0]&6691){m=pe(T[9]);let E;for(E=0;E<m.length;E+=1){const L=Q1(T,m,E);h[E]?h[E].p(L,O):(h[E]=tb(L),h[E].c(),h[E].m(o,r))}for(;E<h.length;E+=1)h[E].d(1);h.length=m.length}if(T[2]||T[5]?g?g.p(T,O):(g=nb(T),g.c(),g.m(o,a)):g&&(g.d(1),g=null),O[0]&4248){_=pe(T[7]);let E;for(E=0;E<_.length;E+=1){const L=J1(T,_,E);y[E]?y[E].p(L,O):(y[E]=rb(L),y[E].c(),y[E].m(o,u))}for(;E<y.length;E+=1)y[E].d(1);y.length=_.length}if(O[0]&4352){S=pe(T[8]);let E;for(E=0;E<S.length;E+=1){const L=Y1(T,S,E);C[E]?C[E].p(L,O):(C[E]=ub(L),C[E].c(),C[E].m(o,null))}for(;E<C.length;E+=1)C[E].d(1);C.length=S.length}},i:te,o:te,d(T){T&&(k(e),k(t),k(i)),d.d(),dt(h,T),g&&g.d(),dt(y,T),dt(C,T)}}}function Xn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function Pn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function WR(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"?"":U.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=U.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=U.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 YR extends Se{constructor(e){super(),we(this,e,WR,BR,ye,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function fb(n,e,t){const i=n.slice();return i[17]=e[t],i}function cb(n){let e,t;return e=new YR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KR(n){let e,t,i=pe(n[2]),l=[];for(let o=0;o<i.length;o+=1)l[o]=cb(fb(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=ve()},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=fb(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=cb(u),l[a].c(),M(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)M(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),dt(l,o)}}}function JR(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 ZR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=W("Close"),i=$(),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],ee(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=[Y(e,"click",n[0]),Y(l,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(l.disabled=a[4]),u&16&&ee(l,"btn-loading",a[4])},d(a){a&&(k(e),k(i),k(l)),o=!1,Ie(r)}}}function GR(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[ZR],header:[JR],default:[KR]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&1048604&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function XR(n,e,t){const i=yt();let l,s=[],o=[],r=[],a=!1,u=!1;function f(T,O,E=!1){t(7,s=T),t(8,o=O),t(3,a=E),l==null||l.show()}function c(){return l==null?void 0:l.hide()}function d(){t(2,r=[]);for(const T of s){const O=U.findByKey(o,"id",T.id)||null;(a&&!(O!=null&&O.id)||O!=null&&O.id&&U.hasCollectionChanges(T,O,a))&&r.push({old:T,new:O})}for(const T of o){const O=U.findByKey(s,"id",T.id)||null;O!=null&&O.id||r.push({old:O,new:T})}}function m(){const T=[];if(a)for(const O of s){const E=U.findByKey(o,"id",O.id);if(!E)T.push(O.name+".*");else{const L=Array.isArray(O.fields)?O.fields:[];for(const I of L)U.findByKey(E.fields,"id",I.id)||T.push(`${O.name}.${I.name} (${I.id})`)}}T.length?_n(`Do you really want to delete the following collection fields and their related records data:
+@hourly`))],A=!0)},p(N,R){var F,B;(!I||R[1]&1&&i!==(i=N[31]))&&p(e,"for",i),(!I||R[1]&1&&o!==(o=N[31]))&&p(s,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=N[0])==null?void 0:F.backups)!=null&&B.cron)))&&(s.autofocus=r),R[0]&2&&s.value!==N[1].backups.cron&&he(s,N[1].backups.cron);const z={};R[0]&2|R[1]&2&&(z.$$scope={dirty:R,ctx:N}),g.$set(z)},i(N){I||(M(g.$$.fragment,N),I=!0)},o(N){D(g.$$.fragment,N),I=!1},d(N){N&&(k(e),k(l),k(s),k(a),k(u),k(_),k(y)),H(g),A=!1,Ie(P)}}}function OR(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),l=$(),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),he(s,n[1].backups.cronMaxKeep),r||(a=Y(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&&gt(s.value)!==u[1].backups.cronMaxKeep&&he(s,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function V1(n){let e;function t(s,o){return s[7]?DR:s[8]?ER:MR}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 MR(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 ER(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=qe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(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 DR(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 B1(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=Y(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 IR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N;m=new Nu({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new vR({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};y=new aR({props:R}),n[15](y);function z(V,Z){return V[6]?SR:wR}let F=z(n),B=F(n),J=n[6]&&!n[4]&&z1(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[10]),r=$(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=$(),j(m.$$.fragment),h=$(),j(g.$$.fragment),_=$(),j(y.$$.fragment),S=$(),C=b("hr"),T=$(),O=b("button"),E=b("span"),E.textContent="Backups options",L=$(),B.c(),I=$(),J&&J.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],ee(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){v(V,e,Z),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(V,r,Z),v(V,a,Z),w(a,u),w(u,f),w(f,c),w(f,d),q(m,f,null),w(f,h),q(g,f,null),w(u,_),q(y,u,null),w(u,S),w(u,C),w(u,T),w(u,O),w(O,E),w(O,L),B.m(O,null),w(u,I),J&&J.m(u,null),A=!0,P||(N=[Y(O,"click",n[16]),Y(u,"submit",nt(n[11]))],P=!0)},p(V,Z){(!A||Z[0]&1024)&&oe(o,V[10]);const G={};y.$set(G),F!==(F=z(V))&&(B.d(1),B=F(V),B&&(B.c(),B.m(O,null))),(!A||Z[0]&16)&&(O.disabled=V[4]),(!A||Z[0]&16)&&ee(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=z1(V),J.c(),M(J,1),J.m(u,null)):J&&(re(),D(J,1,1,()=>{J=null}),ae())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(y.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),D(y.$$.fragment,V),D(J),A=!1},d(V){V&&(k(e),k(r),k(a)),H(m),H(g),n[15](null),H(y),B.d(),J&&J.d(),P=!1,Ie(N)}}}function LR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[IR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function AR(n,e,t){let i,l;Qe(n,un,Z=>t(10,l=Z)),Rn(un,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 Z=await _e.settings.getAll()||{};y(Z)}catch(Z){_e.error(Z)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const Z=await _e.settings.update(U.filterRedactedProps(r));Ut({}),await C(),y(Z),tn("Successfully saved application settings.")}catch(Z){_e.error(Z)}t(5,u=!1)}}function y(Z={}){t(1,r={backups:(Z==null?void 0:Z.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 C(){return s==null?void 0:s.loadBackups()}function T(Z){ie[Z?"unshift":"push"](()=>{s=Z,t(3,s)})}const O=()=>t(6,d=!d);function E(){c=this.checked,t(2,c)}function L(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},A=()=>{t(1,r.backups.cron="0 0 * * 0",r)},P=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},N=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function R(){r.backups.cronMaxKeep=gt(this.value),t(1,r),t(2,c)}function z(Z){n.$$.not_equal(r.backups.s3,Z)&&(r.backups.s3=Z,t(1,r),t(2,c))}function F(Z){m=Z,t(7,m)}function B(Z){h=Z,t(8,h)}const J=()=>S(),V=()=>_();return n.$$.update=()=>{var Z;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(Z=r==null?void 0:r.backups)!=null&&Z.cron&&(Yn("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,C,f,T,O,E,L,I,A,P,N,R,z,F,B,J,V]}class PR extends Se{constructor(e){super(),we(this,e,AR,LR,ye,{},null,[-1,-1])}}function W1(n,e,t){const i=n.slice();return i[22]=e[t],i}function NR(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I,A,P,N,R,z;o=new ce({props:{class:"form-field",$$slots:{default:[FR,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=pe(n[0]);const B=J=>J[22].id;for(let J=0;J<F.length;J+=1){let V=W1(n,F,J),Z=B(V);u.set(Z,a[J]=Y1(Z,V))}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=$(),i=b("div"),l=b("div"),s=b("div"),j(o.$$.fragment),r=$();for(let J=0;J<a.length;J+=1)a[J].c();f=$(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",g=$(),_=b("pre"),y=W(n[6]),S=$(),C=b("div"),T=b("div"),O=$(),E=b("button"),L=b("i"),I=$(),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(T,"class","flex-fill"),p(L,"class","ri-download-line"),p(A,"class","txt"),p(E,"type","button"),p(E,"class","btn btn-expanded"),E.disabled=P=!n[2],p(C,"class","flex m-t-base")},m(J,V){v(J,e,V),v(J,t,V),v(J,i,V),w(i,l),w(l,s),q(o,s,null),w(l,r);for(let Z=0;Z<a.length;Z+=1)a[Z]&&a[Z].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(J,S,V),v(J,C,V),w(C,T),w(C,O),w(C,E),w(E,L),w(E,I),w(E,A),N=!0,R||(z=[Y(d,"click",n[15]),Y(c,"keydown",n[17]),Y(E,"click",n[18])],R=!0)},p(J,V){const Z={};V&33558561&&(Z.$$scope={dirty:V,ctx:J}),o.$set(Z),V&6147&&(F=pe(J[0]),re(),a=vt(a,V,B,1,J,F,u,l,Bt,Y1,null,W1),ae()),(!N||V&4&&h!==(h=!J[2]))&&(d.disabled=h),(!N||V&64)&&oe(y,J[6]),(!N||V&4&&P!==(P=!J[2]))&&(E.disabled=P)},i(J){if(!N){M(o.$$.fragment,J);for(let V=0;V<F.length;V+=1)M(a[V]);N=!0}},o(J){D(o.$$.fragment,J);for(let V=0;V<a.length;V+=1)D(a[V]);N=!1},d(J){J&&(k(e),k(t),k(i),k(S),k(C)),H(o);for(let V=0;V<a.length;V+=1)a[V].d();n[16](null),R=!1,Ie(z)}}}function RR(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 FR(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("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=Y(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 qR(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=$(),s=b("label"),r=W(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=Y(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+"")&&oe(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 Y1(n,e){let t,i,l,s;return i=new ce({props:{class:"form-field",$$slots:{default:[qR,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),j(i.$$.fragment),l=$(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){v(o,t,r),q(i,t,null),w(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(M(i.$$.fragment,o),s=!0)},o(o){D(i.$$.fragment,o),s=!1},d(o){o&&k(t),H(i)}}}function HR(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[RR,NR],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=$(),s=b("div"),o=W(n[7]),r=$(),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)&&oe(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()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function jR(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[HR]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}function zR(n,e,t){let i,l,s,o;Qe(n,un,A=>t(7,o=A)),Rn(un,o="Export collections",o);const r="export_"+U.randomString(5);let a,u=[],f={},c=!1;d();async function d(){var A;t(4,c=!0);try{t(0,u=await _e.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=U.sortCollections(u));for(let P of u)delete P.created,delete P.updated,(A=P.oauth2)==null||delete A.providers;y()}catch(P){_e.error(P)}t(4,c=!1)}function m(){U.downloadJson(Object.values(f),"pb_schema")}function h(){U.copyToClipboard(i),Ks("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 C=()=>g(),T=A=>S(A),O=()=>h();function E(A){ie[A?"unshift":"push"](()=>{a=A,t(3,a)})}const L=A=>{if(A.ctrlKey&&A.code==="KeyA"){A.preventDefault();const P=window.getSelection(),N=document.createRange();N.selectNodeContents(a),P.removeAllRanges(),P.addRange(N)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,g,S,r,C,T,O,E,L,I]}class UR extends Se{constructor(e){super(),we(this,e,zR,jR,ye,{})}}function K1(n,e,t){const i=n.slice();return i[14]=e[t],i}function J1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Z1(n,e,t){const i=n.slice();return i[14]=e[t],i}function G1(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function X1(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 x1(n,e,t){const i=n.slice();return i[30]=e[t],i}function VR(n){let e,t,i,l,s=n[1].name+"",o,r=n[10]&&eb(),a=n[0].name!==n[1].name&&tb(n);return{c(){e=b("div"),r&&r.c(),t=$(),a&&a.c(),i=$(),l=b("strong"),o=W(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=eb(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=tb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&oe(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=$(),i=b("strong"),s=W(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)+"")&&oe(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function WR(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=$(),i=b("strong"),s=W(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)+"")&&oe(s,l)},d(r){r&&(k(e),k(t),k(i))}}}function eb(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 tb(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=$(),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+"")&&oe(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function nb(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,C,T,O,E,L;e=b("tr"),t=b("td"),i=b("span"),s=W(l),o=$(),r=b("td"),a=b("pre"),f=W(u),c=$(),d=b("td"),m=b("pre"),g=W(h),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),ee(r,"changed-old-col",!n[11]&&Pn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),ee(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),ee(d,"changed-new-col",!n[5]&&Pn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),ee(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,C){v(S,e,C),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,C){var T,O,E,L,I,A,P,N;C[0]&512&&l!==(l=S[30]+"")&&oe(s,l),C[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&oe(f,u),C[0]&2563&&ee(r,"changed-old-col",!S[11]&&Pn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),C[0]&2048&&ee(r,"changed-none-col",S[11]),C[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&oe(g,h),C[0]&547&&ee(d,"changed-new-col",!S[5]&&Pn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),C[0]&32&&ee(d,"changed-none-col",S[5]),C[0]&515&&ee(e,"txt-primary",Pn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&k(e)}}}function ib(n){let e,t=pe(n[6]),i=[];for(let l=0;l<t.length;l+=1)i[l]=sb(X1(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},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=X1(l,t,o);i[o]?i[o].p(r,s):(i[o]=sb(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),dt(i,l)}}}function lb(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=W(i),s=$(),o=b("td"),r=b("pre"),u=W(a),f=$(),c=b("td"),d=$(),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]+"")&&oe(l,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&oe(u,a)},d(m){m&&k(e)}}}function sb(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])),C=[];for(let T=0;T<S.length;T+=1)C[T]=lb(Q1(n,S,T));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),a=b("span"),u=W("Deleted - "),f=b("small"),c=W("All stored data related to "),d=b("strong"),h=W(m),g=W(" will be deleted!"),_=$();for(let T=0;T<C.length;T+=1)C[T].c();y=ve(),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(T,O){v(T,e,O),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(T,_,O);for(let E=0;E<C.length;E+=1)C[E]&&C[E].m(T,O);v(T,y,O)},p(T,O){if(O[0]&64&&s!==(s=T[14].name+"")&&oe(o,s),O[0]&64&&m!==(m=T[14].name+"")&&oe(h,m),O[0]&4160){S=pe(Object.entries(T[14]));let E;for(E=0;E<S.length;E+=1){const L=Q1(T,S,E);C[E]?C[E].p(L,O):(C[E]=lb(L),C[E].c(),C[E].m(y.parentNode,y))}for(;E<C.length;E+=1)C[E].d(1);C.length=S.length}},d(T){T&&(k(e),k(_),k(y)),dt(C,T)}}}function ob(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 rb(n){var g;let e,t,i=n[17]+"",l,s,o,r,a=n[12]((g=Xn(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=W(i),s=$(),o=b("td"),r=b("pre"),u=W(a),f=$(),c=b("td"),d=b("pre"),h=W(m),p(t,"class","min-width field-key-col svelte-qs0w8h"),p(r,"class","txt"),p(o,"class","svelte-qs0w8h"),ee(o,"changed-old-col",Pn((_=Xn(n[3],n[14].id))==null?void 0:_[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-qs0w8h"),ee(c,"changed-new-col",Pn((y=Xn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-qs0w8h"),ee(e,"txt-primary",Pn((S=Xn(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,C,T,O;y[0]&128&&i!==(i=_[17]+"")&&oe(l,i),y[0]&136&&a!==(a=_[12]((S=Xn(_[3],_[14].id))==null?void 0:S[_[17]])+"")&&oe(u,a),y[0]&136&&ee(o,"changed-old-col",Pn((C=Xn(_[3],_[14].id))==null?void 0:C[_[17]],_[23])),y[0]&128&&m!==(m=_[12](_[23])+"")&&oe(h,m),y[0]&136&&ee(c,"changed-new-col",Pn((T=Xn(_[3],_[14].id))==null?void 0:T[_[17]],_[23])),y[0]&136&&ee(e,"txt-primary",Pn((O=Xn(_[3],_[14].id))==null?void 0:O[_[17]],_[23]))},d(_){_&&k(e)}}}function ab(n){let e,t,i,l,s=n[14].name+"",o,r,a=Pn(Xn(n[3],n[14].id),Xn(n[4],n[14].id)),u,f,c=a&&ob(),d=pe(Object.entries(n[14])),m=[];for(let h=0;h<d.length;h+=1)m[h]=rb(G1(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),c&&c.c(),u=$();for(let h=0;h<m.length;h+=1)m[h].c();f=ve(),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+"")&&oe(o,s),g[0]&152&&(a=Pn(Xn(h[3],h[14].id),Xn(h[4],h[14].id))),a?c||(c=ob(),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=G1(h,d,_);m[_]?m[_].p(y,g):(m[_]=rb(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(),dt(m,h)}}}function ub(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=W(i),s=$(),o=b("td"),r=$(),a=b("td"),u=b("pre"),c=W(f),d=$(),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]+"")&&oe(l,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&oe(c,f)},d(m){m&&k(e)}}}function fb(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]=ub(J1(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=W("field: "),o=W(s),r=$(),a=b("span"),a.textContent="Added",u=$();for(let m=0;m<d.length;m+=1)d[m].c();f=ve(),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+"")&&oe(o,s),h[0]&4352){c=pe(Object.entries(m[14]));let g;for(g=0;g<c.length;g+=1){const _=J1(m,c,g);d[g]?d[g].p(_,h):(d[g]=ub(_),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)),dt(d,m)}}}function YR(n){let e,t,i,l,s,o,r,a,u;function f(T,O){var E,L;return(E=T[0])!=null&&E.id?(L=T[1])!=null&&L.id?VR:BR:WR}let c=f(n),d=c(n),m=pe(n[9]),h=[];for(let T=0;T<m.length;T+=1)h[T]=nb(x1(n,m,T));let g=(n[2]||n[5])&&ib(n),_=pe(n[7]),y=[];for(let T=0;T<_.length;T+=1)y[T]=ab(Z1(n,_,T));let S=pe(n[8]),C=[];for(let T=0;T<S.length;T+=1)C[T]=fb(K1(n,S,T));return{c(){e=b("div"),d.c(),t=$(),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=$(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=$(),g&&g.c(),a=$();for(let T=0;T<y.length;T+=1)y[T].c();u=$();for(let T=0;T<C.length;T+=1)C[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-qs0w8h")},m(T,O){v(T,e,O),d.m(e,null),v(T,t,O),v(T,i,O),w(i,l),w(i,s),w(i,o);for(let E=0;E<h.length;E+=1)h[E]&&h[E].m(o,null);w(o,r),g&&g.m(o,null),w(o,a);for(let E=0;E<y.length;E+=1)y[E]&&y[E].m(o,null);w(o,u);for(let E=0;E<C.length;E+=1)C[E]&&C[E].m(o,null)},p(T,O){if(c===(c=f(T))&&d?d.p(T,O):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),O[0]&6691){m=pe(T[9]);let E;for(E=0;E<m.length;E+=1){const L=x1(T,m,E);h[E]?h[E].p(L,O):(h[E]=nb(L),h[E].c(),h[E].m(o,r))}for(;E<h.length;E+=1)h[E].d(1);h.length=m.length}if(T[2]||T[5]?g?g.p(T,O):(g=ib(T),g.c(),g.m(o,a)):g&&(g.d(1),g=null),O[0]&4248){_=pe(T[7]);let E;for(E=0;E<_.length;E+=1){const L=Z1(T,_,E);y[E]?y[E].p(L,O):(y[E]=ab(L),y[E].c(),y[E].m(o,u))}for(;E<y.length;E+=1)y[E].d(1);y.length=_.length}if(O[0]&4352){S=pe(T[8]);let E;for(E=0;E<S.length;E+=1){const L=K1(T,S,E);C[E]?C[E].p(L,O):(C[E]=fb(L),C[E].c(),C[E].m(o,null))}for(;E<C.length;E+=1)C[E].d(1);C.length=S.length}},i:te,o:te,d(T){T&&(k(e),k(t),k(i)),d.d(),dt(h,T),g&&g.d(),dt(y,T),dt(C,T)}}}function Xn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function Pn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function KR(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"?"":U.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=U.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=U.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 JR extends Se{constructor(e){super(),we(this,e,KR,YR,ye,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function cb(n,e,t){const i=n.slice();return i[17]=e[t],i}function db(n){let e,t;return e=new JR({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZR(n){let e,t,i=pe(n[2]),l=[];for(let o=0;o<i.length;o+=1)l[o]=db(cb(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=ve()},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=cb(o,i,a);l[a]?(l[a].p(u,r),M(l[a],1)):(l[a]=db(u),l[a].c(),M(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)M(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),dt(l,o)}}}function GR(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 XR(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=W("Close"),i=$(),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],ee(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=[Y(e,"click",n[0]),Y(l,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(l.disabled=a[4]),u&16&&ee(l,"btn-loading",a[4])},d(a){a&&(k(e),k(i),k(l)),o=!1,Ie(r)}}}function QR(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[XR],header:[GR],default:[ZR]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){j(e.$$.fragment)},m(l,s){q(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&1048604&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(M(e.$$.fragment,l),t=!0)},o(l){D(e.$$.fragment,l),t=!1},d(l){n[11](null),H(e,l)}}}function xR(n,e,t){const i=yt();let l,s=[],o=[],r=[],a=!1,u=!1;function f(T,O,E=!1){t(7,s=T),t(8,o=O),t(3,a=E),l==null||l.show()}function c(){return l==null?void 0:l.hide()}function d(){t(2,r=[]);for(const T of s){const O=U.findByKey(o,"id",T.id)||null;(a&&!(O!=null&&O.id)||O!=null&&O.id&&U.hasCollectionChanges(T,O,a))&&r.push({old:T,new:O})}for(const T of o){const O=U.findByKey(s,"id",T.id)||null;O!=null&&O.id||r.push({old:O,new:T})}}function m(){const T=[];if(a)for(const O of s){const E=U.findByKey(o,"id",O.id);if(!E)T.push(O.name+".*");else{const L=Array.isArray(O.fields)?O.fields:[];for(const I of L)U.findByKey(E.fields,"id",I.id)||T.push(`${O.name}.${I.name} (${I.id})`)}}T.length?_n(`Do you really want to delete the following collection fields and their related records data:
 - ${T.join(`
-- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await _e.collections.import(o,a),tn("Successfully imported collections configuration."),i("submit")}catch(T){_e.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function y(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,y,S,C]}class QR extends Se{constructor(e){super(),we(this,e,XR,GR,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function db(n,e,t){const i=n.slice();return i[34]=e[t],i}function pb(n,e,t){const i=n.slice();return i[37]=e[t],i}function mb(n,e,t){const i=n.slice();return i[34]=e[t],i}function xR(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[tF,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&_b(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&gb(),R=n[6]&&n[1].length&&n[7]&&bb(n),z=n[13].length&&Eb(n),F=!!n[0]&&Db(n);return{c(){e=b("input"),t=$(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or
-                        `),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=$(),j(a.$$.fragment),u=$(),A&&A.c(),f=$(),c=$(),N&&N.c(),d=$(),R&&R.c(),m=$(),z&&z.c(),h=$(),g=b("div"),F&&F.c(),_=$(),y=b("div"),S=$(),C=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ee(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p(T,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){v(B,e,J),n[22](e),v(B,t,J),v(B,i,J),w(i,l),w(l,s),w(l,o),v(B,r,J),q(a,B,J),v(B,u,J),A&&A.m(B,J),v(B,f,J),v(B,c,J),N&&N.m(B,J),v(B,d,J),R&&R.m(B,J),v(B,m,J),z&&z.m(B,J),v(B,h,J),v(B,g,J),F&&F.m(g,null),w(g,_),w(g,y),w(g,S),w(g,C),w(C,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y(C,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&ee(o,"btn-loading",B[12]);const V={};J[0]&64&&(V.class="form-field "+(B[6]?"":"field-error")),J[0]&65|J[1]&6144&&(V.$$scope={dirty:J,ctx:B}),a.$set(V),B[1].length?A?(A.p(B,J),J[0]&2&&M(A,1)):(A=_b(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),B[6]&&B[1].length&&!B[7]?N||(N=gb(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),B[6]&&B[1].length&&B[7]?R?R.p(B,J):(R=bb(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?z?z.p(B,J):(z=Eb(B),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),B[0]?F?F.p(B,J):(F=Db(B),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&(C.disabled=O)},i(B){E||(M(a.$$.fragment,B),M(A),M(P),E=!0)},o(B){D(a.$$.fragment,B),D(A),D(P),E=!1},d(B){B&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(m),k(h),k(g)),n[22](null),H(a,B),A&&A.d(B),N&&N.d(B),R&&R.d(B),z&&z.d(B),F&&F.d(),L=!1,Ie(I)}}}function eF(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 hb(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 tF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&hb();return{c(){e=b("label"),t=W("Collections"),l=$(),s=b("textarea"),r=$(),c&&c.c(),a=ve(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),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),he(s,n[0]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=Y(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&he(s,d[0]),d[0]&&!d[6]?c||(c=hb(),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 _b(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[nF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){v(f,e,c),e.checked=n[5],v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function gb(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 bb(n){let e,t,i,l,s,o=n[9].length&&yb(n),r=n[3].length&&wb(n),a=n[8].length&&$b(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=$(),i=b("div"),o&&o.c(),l=$(),r&&r.c(),s=$(),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=yb(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=wb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=$b(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 yb(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=mb(n,l,o),a=s(r);t.set(a,e[o]=vb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,vb,i,mb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function kb(n){let e,t=n[34].id+"",i;return{c(){e=b("small"),i=W(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[34].id+"")&&oe(i,t)},d(l){l&&k(e)}}}function vb(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&kb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",l=$(),s=b("div"),o=b("strong"),a=W(r),u=$(),c&&c.c(),f=$(),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[34].name+"")&&oe(a,r),e[34].id?c?c.p(e,m):(c=kb(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&k(t),c&&c.d()}}}function wb(n){let e=[],t=new Map,i,l=pe(n[3]);const s=o=>o[37].old.id+o[37].new.id;for(let o=0;o<l.length;o+=1){let r=pb(n,l,o),a=s(r);t.set(a,e[o]=Cb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,Cb,i,pb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Sb(n){let e,t=n[37].old.name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=$(),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[37].old.name+"")&&oe(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function Tb(n){let e,t=n[37].new.id+"",i;return{c(){e=b("small"),i=W(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[37].new.id+"")&&oe(i,t)},d(l){l&&k(e)}}}function Cb(n,e){let t,i,l,s,o,r,a=e[37].new.name+"",u,f,c,d=e[37].old.name!==e[37].new.name&&Sb(e),m=e[37].new.id&&Tb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",l=$(),s=b("div"),d&&d.c(),o=$(),r=b("strong"),u=W(a),f=$(),m&&m.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[37].old.name!==e[37].new.name?d?d.p(e,g):(d=Sb(e),d.c(),d.m(s,o)):d&&(d.d(1),d=null),g[0]&8&&a!==(a=e[37].new.name+"")&&oe(u,a),e[37].new.id?m?m.p(e,g):(m=Tb(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 $b(n){let e=[],t=new Map,i,l=pe(n[8]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=db(n,l,o),a=s(r);t.set(a,e[o]=Mb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,Mb,i,db))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Ob(n){let e,t=n[34].id+"",i;return{c(){e=b("small"),i=W(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[34].id+"")&&oe(i,t)},d(l){l&&k(e)}}}function Mb(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&Ob(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",l=$(),s=b("div"),o=b("strong"),a=W(r),u=$(),c&&c.c(),f=$(),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[34].name+"")&&oe(a,r),e[34].id?c?c.p(e,m):(c=Ob(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&k(t),c&&c.d()}}}function Eb(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=$(),l=b("div"),l.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
+- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await _e.collections.import(o,a),tn("Successfully imported collections configuration."),i("submit")}catch(T){_e.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function y(T){ie[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Pe.call(this,n,T)}function C(T){Pe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,g,_,y,S,C]}class eF extends Se{constructor(e){super(),we(this,e,xR,QR,ye,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function pb(n,e,t){const i=n.slice();return i[34]=e[t],i}function mb(n,e,t){const i=n.slice();return i[37]=e[t],i}function hb(n,e,t){const i=n.slice();return i[34]=e[t],i}function tF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T,O,E,L,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[iF,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&gb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&bb(),R=n[6]&&n[1].length&&n[7]&&yb(n),z=n[13].length&&Db(n),F=!!n[0]&&Ib(n);return{c(){e=b("input"),t=$(),i=b("div"),l=b("p"),s=W(`Paste below the collections configuration you want to import or
+                        `),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=$(),j(a.$$.fragment),u=$(),A&&A.c(),f=$(),c=$(),N&&N.c(),d=$(),R&&R.c(),m=$(),z&&z.c(),h=$(),g=b("div"),F&&F.c(),_=$(),y=b("div"),S=$(),C=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ee(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p(T,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){v(B,e,J),n[22](e),v(B,t,J),v(B,i,J),w(i,l),w(l,s),w(l,o),v(B,r,J),q(a,B,J),v(B,u,J),A&&A.m(B,J),v(B,f,J),v(B,c,J),N&&N.m(B,J),v(B,d,J),R&&R.m(B,J),v(B,m,J),z&&z.m(B,J),v(B,h,J),v(B,g,J),F&&F.m(g,null),w(g,_),w(g,y),w(g,S),w(g,C),w(C,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y(C,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&ee(o,"btn-loading",B[12]);const V={};J[0]&64&&(V.class="form-field "+(B[6]?"":"field-error")),J[0]&65|J[1]&6144&&(V.$$scope={dirty:J,ctx:B}),a.$set(V),B[1].length?A?(A.p(B,J),J[0]&2&&M(A,1)):(A=gb(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(re(),D(A,1,1,()=>{A=null}),ae()),B[6]&&B[1].length&&!B[7]?N||(N=bb(),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),B[6]&&B[1].length&&B[7]?R?R.p(B,J):(R=yb(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?z?z.p(B,J):(z=Db(B),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),B[0]?F?F.p(B,J):(F=Ib(B),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&(C.disabled=O)},i(B){E||(M(a.$$.fragment,B),M(A),M(P),E=!0)},o(B){D(a.$$.fragment,B),D(A),D(P),E=!1},d(B){B&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(m),k(h),k(g)),n[22](null),H(a,B),A&&A.d(B),N&&N.d(B),R&&R.d(B),z&&z.d(B),F&&F.d(),L=!1,Ie(I)}}}function nF(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 _b(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 iF(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&_b();return{c(){e=b("label"),t=W("Collections"),l=$(),s=b("textarea"),r=$(),c&&c.c(),a=ve(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),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),he(s,n[0]),v(d,r,m),c&&c.m(d,m),v(d,a,m),u||(f=Y(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&he(s,d[0]),d[0]&&!d[6]?c||(c=_b(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function gb(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[lF,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function lF(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=$(),s=b("label"),o=W("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){v(f,e,c),e.checked=n[5],v(f,l,c),v(f,s,c),w(s,o),a||(u=Y(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(k(e),k(l),k(s)),a=!1,u()}}}function bb(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 yb(n){let e,t,i,l,s,o=n[9].length&&kb(n),r=n[3].length&&Sb(n),a=n[8].length&&Ob(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=$(),i=b("div"),o&&o.c(),l=$(),r&&r.c(),s=$(),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=kb(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Sb(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Ob(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 kb(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=hb(n,l,o),a=s(r);t.set(a,e[o]=wb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,wb,i,hb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function vb(n){let e,t=n[34].id+"",i;return{c(){e=b("small"),i=W(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[34].id+"")&&oe(i,t)},d(l){l&&k(e)}}}function wb(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&vb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",l=$(),s=b("div"),o=b("strong"),a=W(r),u=$(),c&&c.c(),f=$(),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[34].name+"")&&oe(a,r),e[34].id?c?c.p(e,m):(c=vb(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&k(t),c&&c.d()}}}function Sb(n){let e=[],t=new Map,i,l=pe(n[3]);const s=o=>o[37].old.id+o[37].new.id;for(let o=0;o<l.length;o+=1){let r=mb(n,l,o),a=s(r);t.set(a,e[o]=$b(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,$b,i,mb))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Tb(n){let e,t=n[37].old.name+"",i,l,s;return{c(){e=b("strong"),i=W(t),l=$(),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[37].old.name+"")&&oe(i,t)},d(o){o&&(k(e),k(l),k(s))}}}function Cb(n){let e,t=n[37].new.id+"",i;return{c(){e=b("small"),i=W(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[37].new.id+"")&&oe(i,t)},d(l){l&&k(e)}}}function $b(n,e){let t,i,l,s,o,r,a=e[37].new.name+"",u,f,c,d=e[37].old.name!==e[37].new.name&&Tb(e),m=e[37].new.id&&Cb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",l=$(),s=b("div"),d&&d.c(),o=$(),r=b("strong"),u=W(a),f=$(),m&&m.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[37].old.name!==e[37].new.name?d?d.p(e,g):(d=Tb(e),d.c(),d.m(s,o)):d&&(d.d(1),d=null),g[0]&8&&a!==(a=e[37].new.name+"")&&oe(u,a),e[37].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 Ob(n){let e=[],t=new Map,i,l=pe(n[8]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=pb(n,l,o),a=s(r);t.set(a,e[o]=Eb(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ve()},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=vt(e,r,s,1,o,l,t,i.parentNode,di,Eb,i,pb))},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[34].id+"",i;return{c(){e=b("small"),i=W(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[34].id+"")&&oe(i,t)},d(l){l&&k(e)}}}function Eb(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&Mb(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",l=$(),s=b("div"),o=b("strong"),a=W(r),u=$(),c&&c.c(),f=$(),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[34].name+"")&&oe(a,r),e[34].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 Db(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=$(),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=$(),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=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&k(e),r=!1,a()}}}function Db(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=Y(e,"click",n[29]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function iF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[eF,xR],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=$(),s=b("div"),o=W(n[15]),r=$(),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)&&oe(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()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function lF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[iF]},$$scope:{ctx:n}}});let r={};return s=new QR({props:r}),n[30](s),s.$on("submit",n[31]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function sF(n,e,t){let i,l,s,o,r,a,u;Qe(n,un,fe=>t(15,u=fe)),Rn(un,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,y=[],S=!1,C=!1;T();async function T(){var fe;t(4,S=!0);try{t(21,g=await _e.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(fe=ue.oauth2)==null||delete fe.providers}catch(ue){_e.error(ue)}t(4,S=!1)}function O(){if(t(3,y=[]),!!i)for(let fe of h){const ue=U.findByKey(g,"id",fe.id);!(ue!=null&&ue.id)||!U.hasCollectionChanges(ue,fe,_)||y.push({new:fe,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=U.filterDuplicatesByKey(h)):t(1,h=[]);for(let fe of h)delete fe.created,delete fe.updated,fe.fields=U.filterDuplicatesByKey(fe.fields)}function L(){var fe;for(let ue of h){const Te=U.findByKey(g,"name",ue.name)||U.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=U.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((fe=ue.indexes)==null?void 0:fe.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(fe){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await dn(),h.length||($i("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),$i("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(fe)}function A(){t(0,d=""),t(10,f.value="",f),Ut({})}function P(){const fe=C?U.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,fe,_)}function N(fe){ie[fe?"unshift":"push"](()=>{f=fe,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function B(){C=this.checked,t(5,C)}function J(){_=this.checked,t(2,_)}const V=()=>L(),Z=()=>A();function G(fe){ie[fe?"unshift":"push"](()=>{c=fe,t(11,c)})}const de=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&C!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(fe=>!!fe.id&&!!fe.name).length),n.$$.dirty[0]&2097254&&t(9,l=g.filter(fe=>i&&!C&&_&&!U.findByKey(h,"id",fe.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(fe=>i&&!U.findByKey(g,"id",fe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&O(),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]&2097154&&t(13,a=h.filter(fe=>{let ue=U.findByKey(g,"name",fe.name)||U.findByKey(g,"id",fe.id);if(!ue)return!1;if(ue.id!=fe.id)return!0;const Te=Array.isArray(ue.fields)?ue.fields:[],Ke=Array.isArray(fe.fields)?fe.fields:[];for(const Je of Ke){if(U.findByKey(Te,"id",Je.id))continue;const et=U.findByKey(Te,"name",Je.name);if(et&&Je.id!=et.id)return!0}return!1}))},[d,h,_,y,S,C,i,o,s,l,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,B,J,V,Z,G,de]}class oF extends Se{constructor(e){super(),we(this,e,sF,lF,ye,{},null,[-1,-1])}}function rF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[uF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[fF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[cF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&Ib(n);function _(C,T){return C[6]?wF:vF}let y=_(n),S=y(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),j(a.$$.fragment),u=$(),g&&g.c(),f=$(),c=b("div"),d=b("div"),m=$(),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(C,T){v(C,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),v(C,r,T),q(a,C,T),v(C,u,T),g&&g.m(C,T),v(C,f,T),v(C,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p(C,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:C}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:C}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:C}),a.$set(L),C[0].smtp.enabled?g?(g.p(C,T),T[0]&1&&M(g,1)):(g=Ib(C),g.c(),M(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y===(y=_(C))&&S?S.p(C,T):(S.d(1),S=y(C),S&&(S.c(),S.m(c,null)))},i(C){h||(M(i.$$.fragment,C),M(o.$$.fragment,C),M(a.$$.fragment,C),M(g),h=!0)},o(C){D(i.$$.fragment,C),D(o.$$.fragment,C),D(a.$$.fragment,C),D(g),h=!1},d(C){C&&(k(e),k(r),k(u),k(f),k(c)),H(i),H(o),H(a,C),g&&g.d(C),S.d()}}}function aF(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 uF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender name"),l=$(),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),he(s,n[0].meta.senderName),r||(a=Y(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&&he(s,u[0].meta.senderName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function fF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender address"),l=$(),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),he(s,n[0].meta.senderAddress),r||(a=Y(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&&he(s,u[0].meta.senderAddress)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function cF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=$(),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=[Y(e,"change",n[16]),Me(qe.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,Ie(f)}}}function Ib(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[dF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[pF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[mF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[hF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?gF:_F}let E=O(n),L=E(n),I=n[5]&&Lb(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),h=$(),g=b("button"),L.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),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,C||(T=Y(g,"click",nt(n[22])),C=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),E!==(E=O(A))&&(L.d(1),L=E(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&M(I,1)):(I=Lb(A),I.c(),M(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(M(l.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(I),A&&tt(()=>{S&&(y||(y=He(e,mt,{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=He(e,mt,{duration:150},!1)),y.run(0)),S=!1},d(A){A&&k(e),H(l),H(r),H(f),H(m),L.d(),I&&I.d(),A&&y&&y.end(),C=!1,T()}}}function dF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),l=$(),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),he(s,n[0].smtp.host),r||(a=Y(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&&he(s,u[0].smtp.host)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function pF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Port"),l=$(),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),he(s,n[0].smtp.port),r||(a=Y(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&&gt(s.value)!==u[0].smtp.port&&he(s,u[0].smtp.port)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function mF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Username"),l=$(),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),he(s,n[0].smtp.username),r||(a=Y(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&&he(s,u[0].smtp.username)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function hF(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 ef({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Password"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],Ce(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function _F(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=$(),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 gF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=$(),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 Lb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[bF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[yF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[kF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),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),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,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||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=He(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=He(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&k(e),H(i),H(o),H(u),h&&d&&d.end()}}}function bF(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 zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function yF(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 zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function kF(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=$(),l=b("i"),o=$(),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),he(r,n[0].smtp.localName),u||(f=[Me(qe.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"})),Y(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&&he(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function vF(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=Y(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function wF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=[Y(e,"click",n[26]),Y(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&&ee(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,Ie(a)}}}function SF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[aF,rF],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=$(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",nt(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&oe(o,T[7]);let E=d;d=C(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function TF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[SF]},$$scope:{ctx:n}}});let r={};return s=new _k({props:r}),n[30](s),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function CF(n,e,t){let i,l,s;Qe(n,un,de=>t(7,s=de));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(un,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 de=await _e.settings.getAll()||{};y(de)}catch(de){_e.error(de)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const de=await _e.settings.update(U.filterRedactedProps(f));y(de),Ut({}),tn("Successfully saved mail settings.")}catch(de){_e.error(de)}t(3,d=!1)}}function y(de={}){t(0,f={meta:(de==null?void 0:de.meta)||{},smtp:(de==null?void 0:de.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 C(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=gt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(de){m=de,t(4,m)}function P(de){n.$$.not_equal(f.smtp.password,de)&&(f.smtp.password=de,t(0,f))}const N=()=>{t(5,h=!h)};function R(de){n.$$.not_equal(f.smtp.tls,de)&&(f.smtp.tls=de,t(0,f))}function z(de){n.$$.not_equal(f.smtp.authMethod,de)&&(f.smtp.authMethod=de,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const B=()=>S(),J=()=>_(),V=()=>a==null?void 0:a.show(),Z=()=>_();function G(de){ie[de?"unshift":"push"](()=>{a=de,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,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V,Z,G]}class $F extends Se{constructor(e){super(),we(this,e,CF,TF,ye,{},null,[-1,-1])}}function OF(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 C(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[EF]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new Tk({props:T}),ie.push(()=>be(e,"config",y)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",C));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&Pb(n),E=n[6]&&Nb(n);return{c(){j(e.$$.fragment),s=$(),o=b("div"),r=b("div"),a=$(),O&&O.c(),u=$(),E&&E.c(),f=$(),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],ee(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),O&&O.m(o,null),w(o,u),E&&E.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,g||(_=Y(c,"click",n[15]),g=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,Ce(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],Ce(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],Ce(()=>l=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=Pb(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=Nb(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&ee(c,"btn-loading",I[3])},i(I){h||(M(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(k(s),k(o)),H(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function MF(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 Ab(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,C,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',l=$(),s=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually
+                                to.</string>`,s=$(),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=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&k(e),r=!1,a()}}}function Ib(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=Y(e,"click",n[29]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function sF(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[nF,tF],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=$(),s=b("div"),o=W(n[15]),r=$(),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)&&oe(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()),M(c,1),c.m(u,null))},i(_){d||(M(c),d=!0)},o(_){D(c),d=!1},d(_){_&&(k(e),k(r),k(a)),h[f].d()}}}function oF(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[sF]},$$scope:{ctx:n}}});let r={};return s=new eF({props:r}),n[30](s),s.$on("submit",n[31]),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function rF(n,e,t){let i,l,s,o,r,a,u;Qe(n,un,fe=>t(15,u=fe)),Rn(un,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,y=[],S=!1,C=!1;T();async function T(){var fe;t(4,S=!0);try{t(21,g=await _e.collections.getFullList(200));for(let ue of g)delete ue.created,delete ue.updated,(fe=ue.oauth2)==null||delete fe.providers}catch(ue){_e.error(ue)}t(4,S=!1)}function O(){if(t(3,y=[]),!!i)for(let fe of h){const ue=U.findByKey(g,"id",fe.id);!(ue!=null&&ue.id)||!U.hasCollectionChanges(ue,fe,_)||y.push({new:fe,old:ue})}}function E(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=U.filterDuplicatesByKey(h)):t(1,h=[]);for(let fe of h)delete fe.created,delete fe.updated,fe.fields=U.filterDuplicatesByKey(fe.fields)}function L(){var fe;for(let ue of h){const Te=U.findByKey(g,"name",ue.name)||U.findByKey(g,"id",ue.id);if(!Te)continue;const Ke=ue.id,Je=Te.id;ue.id=Je;const ft=Array.isArray(Te.fields)?Te.fields:[],et=Array.isArray(ue.fields)?ue.fields:[];for(const xe of et){const We=U.findByKey(ft,"name",xe.name);We&&We.id&&(xe.id=We.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let We of xe.fields)We.collectionId&&We.collectionId===Ke&&(We.collectionId=Je);for(let xe=0;xe<((fe=ue.indexes)==null?void 0:fe.length);xe++)ue.indexes[xe]=ue.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,We=>We.replace(Ke,Je))}t(0,d=JSON.stringify(h,null,4))}function I(fe){t(12,m=!0);const ue=new FileReader;ue.onload=async Te=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Te.target.result),await dn(),h.length||($i("Invalid collections configuration."),A())},ue.onerror=Te=>{console.warn(Te),$i("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(fe)}function A(){t(0,d=""),t(10,f.value="",f),Ut({})}function P(){const fe=C?U.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,fe,_)}function N(fe){ie[fe?"unshift":"push"](()=>{f=fe,t(10,f)})}const R=()=>{f.files.length&&I(f.files[0])},z=()=>{f.click()};function F(){d=this.value,t(0,d)}function B(){C=this.checked,t(5,C)}function J(){_=this.checked,t(2,_)}const V=()=>L(),Z=()=>A();function G(fe){ie[fe?"unshift":"push"](()=>{c=fe,t(11,c)})}const de=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&C!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(fe=>!!fe.id&&!!fe.name).length),n.$$.dirty[0]&2097254&&t(9,l=g.filter(fe=>i&&!C&&_&&!U.findByKey(h,"id",fe.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(fe=>i&&!U.findByKey(g,"id",fe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&O(),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]&2097154&&t(13,a=h.filter(fe=>{let ue=U.findByKey(g,"name",fe.name)||U.findByKey(g,"id",fe.id);if(!ue)return!1;if(ue.id!=fe.id)return!0;const Te=Array.isArray(ue.fields)?ue.fields:[],Ke=Array.isArray(fe.fields)?fe.fields:[];for(const Je of Ke){if(U.findByKey(Te,"id",Je.id))continue;const et=U.findByKey(Te,"name",Je.name);if(et&&Je.id!=et.id)return!0}return!1}))},[d,h,_,y,S,C,i,o,s,l,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,B,J,V,Z,G,de]}class aF extends Se{constructor(e){super(),we(this,e,rF,oF,ye,{},null,[-1,-1])}}function uF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[cF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[dF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[pF,({uniqueId:C})=>({33:C}),({uniqueId:C})=>[0,C?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&Lb(n);function _(C,T){return C[6]?TF:SF}let y=_(n),S=y(n);return{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),j(a.$$.fragment),u=$(),g&&g.c(),f=$(),c=b("div"),d=b("div"),m=$(),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(C,T){v(C,e,T),w(e,t),q(i,t,null),w(e,l),w(e,s),q(o,s,null),v(C,r,T),q(a,C,T),v(C,u,T),g&&g.m(C,T),v(C,f,T),v(C,c,T),w(c,d),w(c,m),S.m(c,null),h=!0},p(C,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:C}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:C}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:C}),a.$set(L),C[0].smtp.enabled?g?(g.p(C,T),T[0]&1&&M(g,1)):(g=Lb(C),g.c(),M(g,1),g.m(f.parentNode,f)):g&&(re(),D(g,1,1,()=>{g=null}),ae()),y===(y=_(C))&&S?S.p(C,T):(S.d(1),S=y(C),S&&(S.c(),S.m(c,null)))},i(C){h||(M(i.$$.fragment,C),M(o.$$.fragment,C),M(a.$$.fragment,C),M(g),h=!0)},o(C){D(i.$$.fragment,C),D(o.$$.fragment,C),D(a.$$.fragment,C),D(g),h=!1},d(C){C&&(k(e),k(r),k(u),k(f),k(c)),H(i),H(o),H(a,C),g&&g.d(C),S.d()}}}function fF(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 cF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender name"),l=$(),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),he(s,n[0].meta.senderName),r||(a=Y(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&&he(s,u[0].meta.senderName)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function dF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Sender address"),l=$(),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),he(s,n[0].meta.senderAddress),r||(a=Y(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&&he(s,u[0].meta.senderAddress)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function pF(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=$(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=$(),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=[Y(e,"change",n[16]),Me(qe.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,Ie(f)}}}function Lb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_,y,S,C,T;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[mF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[hF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[_F,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[gF,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?yF:bF}let E=O(n),L=E(n),I=n[5]&&Ab(n);return{c(){e=b("div"),t=b("div"),i=b("div"),j(l.$$.fragment),s=$(),o=b("div"),j(r.$$.fragment),a=$(),u=b("div"),j(f.$$.fragment),c=$(),d=b("div"),j(m.$$.fragment),h=$(),g=b("button"),L.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),q(l,i,null),w(t,s),w(t,o),q(r,o,null),w(t,a),w(t,u),q(f,u,null),w(t,c),w(t,d),q(m,d,null),w(e,h),w(e,g),L.m(g,null),w(e,_),I&&I.m(e,null),S=!0,C||(T=Y(g,"click",nt(n[22])),C=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),l.$set(N);const R={};P[0]&1|P[1]&12&&(R.$$scope={dirty:P,ctx:A}),r.$set(R);const z={};P[0]&1|P[1]&12&&(z.$$scope={dirty:P,ctx:A}),f.$set(z);const F={};P[0]&17|P[1]&12&&(F.$$scope={dirty:P,ctx:A}),m.$set(F),E!==(E=O(A))&&(L.d(1),L=E(A),L&&(L.c(),L.m(g,null))),A[5]?I?(I.p(A,P),P[0]&32&&M(I,1)):(I=Ab(A),I.c(),M(I,1),I.m(e,null)):I&&(re(),D(I,1,1,()=>{I=null}),ae())},i(A){S||(M(l.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(I),A&&tt(()=>{S&&(y||(y=He(e,mt,{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=He(e,mt,{duration:150},!1)),y.run(0)),S=!1},d(A){A&&k(e),H(l),H(r),H(f),H(m),L.d(),I&&I.d(),A&&y&&y.end(),C=!1,T()}}}function mF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),l=$(),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),he(s,n[0].smtp.host),r||(a=Y(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&&he(s,u[0].smtp.host)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function hF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Port"),l=$(),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),he(s,n[0].smtp.port),r||(a=Y(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&&gt(s.value)!==u[0].smtp.port&&he(s,u[0].smtp.port)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function _F(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Username"),l=$(),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),he(s,n[0].smtp.username),r||(a=Y(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&&he(s,u[0].smtp.username)},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function gF(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 tf({props:c}),ie.push(()=>be(s,"mask",u)),ie.push(()=>be(s,"value",f)),{c(){e=b("label"),t=W("Password"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(d,m){v(d,e,m),w(e,t),v(d,l,m),q(s,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],Ce(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,Ce(()=>r=!1)),s.$set(h)},i(d){a||(M(s.$$.fragment,d),a=!0)},o(d){D(s.$$.fragment,d),a=!1},d(d){d&&(k(e),k(l)),H(s,d)}}}function bF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=$(),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 yF(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=$(),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 Ab(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[kF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[vF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[wF,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),j(i.$$.fragment),l=$(),s=b("div"),j(o.$$.fragment),r=$(),a=b("div"),j(u.$$.fragment),f=$(),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),q(i,t,null),w(e,l),w(e,s),q(o,s,null),w(e,r),w(e,a),q(u,a,null),w(e,f),w(e,c),m=!0},p(h,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||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),h&&tt(()=>{m&&(d||(d=He(e,mt,{duration:150},!0)),d.run(1))}),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),h&&(d||(d=He(e,mt,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&k(e),H(i),H(o),H(u),h&&d&&d.end()}}}function kF(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 zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function vF(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 zn({props:u}),ie.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),l=$(),j(s.$$.fragment),p(e,"for",i=n[33])},m(f,c){v(f,e,c),w(e,t),v(f,l,c),q(s,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,Ce(()=>o=!1)),s.$set(d)},i(f){r||(M(s.$$.fragment,f),r=!0)},o(f){D(s.$$.fragment,f),r=!1},d(f){f&&(k(e),k(l)),H(s,f)}}}function wF(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=$(),l=b("i"),o=$(),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),he(r,n[0].smtp.localName),u||(f=[Me(qe.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"})),Y(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&&he(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,Ie(f)}}}function SF(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=Y(e,"click",n[28]),t=!0)},p:te,d(l){l&&k(e),t=!1,i()}}}function TF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=$(),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],ee(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=[Y(e,"click",n[26]),Y(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&&ee(l,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(l)),r=!1,Ie(a)}}}function CF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[fF,uF],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=$(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",nt(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&oe(o,T[7]);let E=d;d=C(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function $F(n){let e,t,i,l,s,o;e=new hs({}),i=new pi({props:{$$slots:{default:[CF]},$$scope:{ctx:n}}});let r={};return s=new gk({props:r}),n[30](s),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment),l=$(),j(s.$$.fragment)},m(a,u){q(e,a,u),v(a,t,u),q(i,a,u),v(a,l,u),q(s,a,u),o=!0},p(a,u){const f={};u[0]&255|u[1]&8&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(s.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(s.$$.fragment,a),o=!1},d(a){a&&(k(t),k(l)),H(e,a),H(i,a),n[30](null),H(s,a)}}}function OF(n,e,t){let i,l,s;Qe(n,un,de=>t(7,s=de));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Rn(un,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 de=await _e.settings.getAll()||{};y(de)}catch(de){_e.error(de)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const de=await _e.settings.update(U.filterRedactedProps(f));y(de),Ut({}),tn("Successfully saved mail settings.")}catch(de){_e.error(de)}t(3,d=!1)}}function y(de={}){t(0,f={meta:(de==null?void 0:de.meta)||{},smtp:(de==null?void 0:de.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 C(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=gt(this.value),t(0,f)}function I(){f.smtp.username=this.value,t(0,f)}function A(de){m=de,t(4,m)}function P(de){n.$$.not_equal(f.smtp.password,de)&&(f.smtp.password=de,t(0,f))}const N=()=>{t(5,h=!h)};function R(de){n.$$.not_equal(f.smtp.tls,de)&&(f.smtp.tls=de,t(0,f))}function z(de){n.$$.not_equal(f.smtp.authMethod,de)&&(f.smtp.authMethod=de,t(0,f))}function F(){f.smtp.localName=this.value,t(0,f)}const B=()=>S(),J=()=>_(),V=()=>a==null?void 0:a.show(),Z=()=>_();function G(de){ie[de?"unshift":"push"](()=>{a=de,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,C,T,O,E,L,I,A,P,N,R,z,F,B,J,V,Z,G]}class MF extends Se{constructor(e){super(),we(this,e,OF,$F,ye,{},null,[-1,-1])}}function EF(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 C(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[IF]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new Ck({props:T}),ie.push(()=>be(e,"config",y)),ie.push(()=>be(e,"isTesting",S)),ie.push(()=>be(e,"testError",C));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&Nb(n),E=n[6]&&Rb(n);return{c(){j(e.$$.fragment),s=$(),o=b("div"),r=b("div"),a=$(),O&&O.c(),u=$(),E&&E.c(),f=$(),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],ee(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),v(I,s,A),v(I,o,A),w(o,r),w(o,a),O&&O.m(o,null),w(o,u),E&&E.m(o,null),w(o,f),w(o,c),w(c,d),h=!0,g||(_=Y(c,"click",n[15]),g=!0)},p(I,A){var N;const P={};A&1&&(P.originalConfig=I[0].s3),A&524291&&(P.$$scope={dirty:A,ctx:I}),!t&&A&2&&(t=!0,P.config=I[1].s3,Ce(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],Ce(()=>i=!1)),!l&&A&32&&(l=!0,P.testError=I[5],Ce(()=>l=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=Nb(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=Rb(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!h||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||A&8)&&ee(c,"btn-loading",I[3])},i(I){h||(M(e.$$.fragment,I),h=!0)},o(I){D(e.$$.fragment,I),h=!1},d(I){I&&(k(s),k(o)),H(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function DF(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 Pb(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,C,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',l=$(),s=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually
                                     from the
                                     `),r=b("strong"),u=W(a),f=W(`
                                     to the
@@ -218,6 +218,6 @@ Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function
                                     `),y=b("a"),y.textContent=`rclone
                                     `,S=W(`,
                                     `),C=b("a"),C.textContent=`s5cmd
-                                    `,T=W(", etc."),O=$(),E=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(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,y),w(s,S),w(s,C),w(s,T),w(e,O),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&k(e),P&&L&&L.end()}}}function EF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Ab(n);return{c(){t&&t.c(),e=ve()},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&&M(t,1)):(t=Ab(l),t.c(),M(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 Pb(n){let e;function t(s,o){return s[4]?LF:s[5]?IF:DF}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 DF(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 IF(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=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(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 LF(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 Nb(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=Y(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&k(e),i=!1,l()}}}function AF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[MF,OF],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),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=$(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",nt(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=C(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function PF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[AF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}const NF="s3_test_request";function RF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(NF);const E=await _e.settings.update(U.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?vw("Successfully saved but failed to establish S3 connection."):tn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function y(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const C=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,y,S,C,T,O]}class FF extends Se{constructor(e){super(),we(this,e,RF,PF,ye,{})}}function Rb(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=$(),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 qF(n){let e,t,i,l=!n[0]&&Rb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=$(),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=Rb(),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||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&k(e),l&&l.d(),o&&o.d(r)}}}function HF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[qF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function jF(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 zF extends Se{constructor(e){super(),we(this,e,jF,HF,ye,{nobranding:0})}}function Fb(n){let e,t,i,l,s;return{c(){e=W("("),t=W(n[1]),i=W("/"),l=W(n[2]),s=W(")")},m(o,r){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&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(k(e),k(t),k(i),k(l),k(s))}}}function UF(n){let e,t,i,l;const s=[YF,WF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function VF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[GF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[XF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),o=b("button"),r=b("span"),u=W(a),f=$(),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"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=Y(e,"submit",nt(n[14])),m=!0)},p(g,_){const y={};_&201326625&&(y.$$scope={dirty:_,ctx:g}),t.$set(y);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&k(e),H(t),H(l),m=!1,h()}}}function BF(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 WF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&qb(n);return i=new ce({props:{class:"form-field required",name:"otpId",$$slots:{default:[KF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[JF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=$(),t=b("form"),j(i.$$.fragment),l=$(),j(s.$$.fragment),o=$(),r=b("button"),r.innerHTML='<span class="txt">Login</span> <i class="ri-arrow-right-line"></i>',a=$(),u=b("div"),f=b("button"),c=W("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,y){g&&g.m(_,y),v(_,e,y),v(_,t,y),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,y),v(_,u,y),w(u,f),w(f,c),d=!0,m||(h=[Y(t,"submit",nt(n[16])),Y(f,"click",n[22])],m=!0)},p(_,y){_[12]?g?g.p(_,y):(g=qb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};y&201328656&&(S.$$scope={dirty:y,ctx:_}),i.$set(S);const C={};y&201334784&&(C.$$scope={dirty:y,ctx:_}),s.$set(C),(!d||y&512)&&ee(r,"btn-disabled",_[9]),(!d||y&512)&&ee(r,"btn-loading",_[9]),(!d||y&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(k(e),k(t),k(a),k(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function YF(n){let e,t,i,l,s,o,r;return t=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[ZF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),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"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=Y(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&k(e),H(t),o=!1,r()}}}function qb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=W("Check your "),l=b("strong"),s=W(n[12]),o=W(` inbox and enter in the input below the received
-                        One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&k(e)}}}function KF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Id"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=Y(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function JF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("One-time password"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[13]),s.focus(),r||(a=Y(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&he(s,u[13])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function ZF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[12]),r||(a=Y(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&he(s,u[12])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function GF(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=W(t),s=$(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),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=Y(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=U.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&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 XF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),l=$(),s=b("input"),r=$(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),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),he(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[Y(s,"input",n[18]),Me(Bn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&he(s,d[6])},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),f=!1,Ie(c)}}}function QF(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&Fb(n);const f=[BF,VF,UF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login
-            `),u&&u.c(),l=$(),o&&o.c(),r=ve(),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=Fb(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()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(k(e),k(l),k(r)),u&&u.d(),~s&&c[s].d(m)}}}function xF(n){let e,t;return e=new zF({props:{$$slots:{default:[QF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function eq(n,e,t){let i;Qe(n,Au,z=>t(23,i=z));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="";C();async function C(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(B){B.status==401?(t(3,h=B.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,y=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,y=s)):B.status!=400?_e.error(B):$i("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(y);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){y=this.value,t(12,y)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.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,T,O,E,L,I,A,P,N,R]}class tq extends Se{constructor(e){super(),we(this,e,eq,xF,ye,{})}}function Zt(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 nq={"/pbinstal/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageInstaller-FV_9CRnx.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:tq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-C2RIJeZg.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-y4vpPRrL.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:jN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:E6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:H7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:$F,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:FF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:jR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:oF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:LR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CKnBpNvm.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-CKnBpNvm.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-C6uR9qGl.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-C6uR9qGl.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DsgNrJ_Y.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-DsgNrJ_Y.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-DxO2GykN.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-U4FK74Ke.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:s3,userData:{showAppSidebar:!1}})};function iq(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 Hb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=U.getInitials(n[0].email)+"",h,g,_,y,S,C,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[lq]},$$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=$(),l=b("nav"),s=b("a"),s.innerHTML='<i class="ri-database-2-line"></i>',o=$(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=$(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=$(),c=b("div"),d=b("span"),h=W(m),g=$(),j(_.$$.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(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,C||(T=[Me(Bn.call(null,t)),Me(Bn.call(null,s)),Me(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Me(qe.call(null,s,{text:"Collections",position:"right"})),Me(Bn.call(null,r)),Me(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Me(qe.call(null,r,{text:"Logs",position:"right"})),Me(Bn.call(null,u)),Me(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Me(qe.call(null,u,{text:"Settings",position:"right"}))],C=!0)},p(O,E){(!S||E&1)&&m!==(m=U.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&y!==(y=O[0].email))&&p(c,"title",y)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&k(e),H(_),C=!1,Ie(T)}}}function lq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=W(t),s=$(),o=b("hr"),r=$(),a=b("a"),a.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Manage superusers</span>',u=$(),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?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){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(Bn.call(null,a)),Y(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(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,Ie(d)}}}function jb(n){let e,t,i;return t=new $u({props:{conf:U.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function sq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=U.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&iq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&Hb(n);r=new e3({props:{routes:nq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Mw({}),c=new pw({});let y=n[1]&&!n[2]&&jb(n);return{c(){g&&g.c(),t=ve(),i=$(),l=b("div"),_&&_.c(),s=$(),o=b("div"),j(r.$$.fragment),a=$(),j(u.$$.fragment),f=$(),j(c.$$.fragment),d=$(),y&&y.c(),m=ve(),p(o,"class","app-body"),p(l,"class","app-layout")},m(C,T){g&&g.m(document.head,null),w(document.head,t),v(C,i,T),v(C,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v(C,f,T),q(c,C,T),v(C,d,T),y&&y.m(C,T),v(C,m,T),h=!0},p(C,[T]){var O;(!h||T&24)&&e!==(e=U.joinNonEmpty([C[4],C[3],"PocketBase"]," - "))&&(document.title=e),(O=C[0])!=null&&O.id&&C[1]?_?(_.p(C,T),T&3&&M(_,1)):(_=Hb(C),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),C[1]&&!C[2]?y?(y.p(C,T),T&6&&M(y,1)):(y=jb(C),y.c(),M(y,1),y.m(m.parentNode,m)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(C){h||(M(_),M(r.$$.fragment,C),M(u.$$.fragment,C),M(c.$$.fragment,C),M(y),h=!0)},o(C){D(_),D(r.$$.fragment,C),D(u.$$.fragment,C),D(c.$$.fragment,C),D(y),h=!1},d(C){C&&(k(i),k(l),k(f),k(d),k(m)),g&&g.d(C),k(t),_&&_.d(),H(r),H(u),H(c,C),y&&y.d(C)}}}function oq(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,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,y,S,C;((_=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=(C=g==null?void 0:g.detail)==null?void 0:C.location,Rn(un,o="",o),Ut({}),iy())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const y=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=y==null?void 0:y.meta)==null?void 0:g.appName)||"",l),Rn(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(){_e.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 rq extends Se{constructor(e){super(),we(this,e,oq,sq,ye,{})}}new rq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Me as C,Bn as D,re as E,zF as F,ae as G,oe as H,te as I,U as J,tn as K,ve as L,co as M,Fr as N,Qe as O,Rn as P,ln as Q,un as R,Se as S,Mn as T,yt as U,EP as V,xu as W,pe as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,qk as a1,$i as b,j as c,H as d,dn as e,ce as f,xl as g,b as h,we as i,$ as j,p as k,ee as l,q as m,v as n,w as o,_e as p,Y as q,is as r,ye as s,M as t,nt as u,k as v,Ie as w,_n as x,ie as y,W as z};
+                                    `,T=W(", etc."),O=$(),E=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(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){v(P,e,N),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),w(s,r),w(r,u),w(s,f),w(s,c),w(c,m),w(s,h),w(s,g),w(s,_),w(s,y),w(s,S),w(s,C),w(s,T),w(e,O),w(e,E),I=!0},p(P,N){var R;(!I||N&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&oe(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&oe(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=He(e,mt,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=He(e,mt,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&k(e),P&&L&&L.end()}}}function IF(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Pb(n);return{c(){t&&t.c(),e=ve()},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&&M(t,1)):(t=Pb(l),t.c(),M(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 Nb(n){let e;function t(s,o){return s[4]?PF:s[5]?AF:LF}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},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 LF(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 AF(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=qe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&It(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 PF(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 Rb(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=Y(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&k(e),i=!1,l()}}}function NF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g,_;const y=[DF,EF],S=[];function C(T,O){return T[2]?0:1}return d=C(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=$(),s=b("div"),o=W(n[7]),r=$(),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=$(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){v(T,e,O),w(e,t),w(t,i),w(t,l),w(t,s),w(s,o),v(T,r,O),v(T,a,O),w(a,u),w(u,f),w(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",nt(n[16])),g=!0)},p(T,O){(!h||O&128)&&oe(o,T[7]);let E=d;d=C(T),d===E?S[d].p(T,O):(re(),D(S[E],1,1,()=>{S[E]=null}),ae(),m=S[d],m?m.p(T,O):(m=S[d]=y[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function RF(n){let e,t,i,l;return e=new hs({}),i=new pi({props:{$$slots:{default:[NF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment),t=$(),j(i.$$.fragment)},m(s,o){q(e,s,o),v(s,t,o),q(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(M(e.$$.fragment,s),M(i.$$.fragment,s),l=!0)},o(s){D(e.$$.fragment,s),D(i.$$.fragment,s),l=!1},d(s){s&&k(t),H(e,s),H(i,s)}}}const FF="s3_test_request";function qF(n,e,t){let i,l,s;Qe(n,un,E=>t(7,s=E)),Rn(un,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await _e.settings.getAll()||{};h(E)}catch(E){_e.error(E)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{_e.cancelRequest(FF);const E=await _e.settings.update(U.filterRedactedProps(r));Ut({}),await h(E),Ls(),c?ww("Successfully saved but failed to establish S3 connection."):tn("Successfully saved files storage settings.")}catch(E){_e.error(E)}t(3,u=!1)}}async function h(E={}){t(1,r={s3:(E==null?void 0:E.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function y(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const C=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,g,i,_,y,S,C,T,O]}class HF extends Se{constructor(e){super(),we(this,e,qF,RF,ye,{})}}function Fb(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=$(),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 jF(n){let e,t,i,l=!n[0]&&Fb();const s=n[1].default,o=Lt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=$(),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=Fb(),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||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&k(e),l&&l.d(),o&&o.d(r)}}}function zF(n){let e,t;return e=new pi({props:{class:"full-page",center:!0,$$slots:{default:[jF]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UF(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 VF extends Se{constructor(e){super(),we(this,e,UF,zF,ye,{nobranding:0})}}function qb(n){let e,t,i,l,s;return{c(){e=W("("),t=W(n[1]),i=W("/"),l=W(n[2]),s=W(")")},m(o,r){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&&oe(t,o[1]),r&4&&oe(l,o[2])},d(o){o&&(k(e),k(t),k(i),k(l),k(s))}}}function BF(n){let e,t,i,l;const s=[JF,KF],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},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()),M(t,1),t.m(i.parentNode,i))},i(a){l||(M(t),l=!0)},o(a){D(t),l=!1},d(a){a&&k(i),o[e].d(a)}}}function WF(n){let e,t,i,l,s,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[QF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[xF,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),j(l.$$.fragment),s=$(),o=b("button"),r=b("span"),u=W(a),f=$(),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"),ee(o,"btn-disabled",n[7]),ee(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){v(g,e,_),q(t,e,null),w(e,i),q(l,e,null),w(e,s),w(e,o),w(o,r),w(r,u),w(o,f),w(o,c),d=!0,m||(h=Y(e,"submit",nt(n[14])),m=!0)},p(g,_){const y={};_&201326625&&(y.$$scope={dirty:_,ctx:g}),t.$set(y);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),l.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&oe(u,a),(!d||_&128)&&ee(o,"btn-disabled",g[7]),(!d||_&128)&&ee(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(l.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(l.$$.fragment,g),d=!1},d(g){g&&k(e),H(t),H(l),m=!1,h()}}}function YF(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 KF(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,g=n[12]&&Hb(n);return i=new ce({props:{class:"form-field required",name:"otpId",$$slots:{default:[ZF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[GF,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=$(),t=b("form"),j(i.$$.fragment),l=$(),j(s.$$.fragment),o=$(),r=b("button"),r.innerHTML='<span class="txt">Login</span> <i class="ri-arrow-right-line"></i>',a=$(),u=b("div"),f=b("button"),c=W("Request another OTP"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block btn-next"),ee(r,"btn-disabled",n[9]),ee(r,"btn-loading",n[9]),p(t,"class","block"),p(f,"type","button"),p(f,"class","link-hint"),f.disabled=n[9],p(u,"class","content txt-center m-t-sm")},m(_,y){g&&g.m(_,y),v(_,e,y),v(_,t,y),q(i,t,null),w(t,l),q(s,t,null),w(t,o),w(t,r),v(_,a,y),v(_,u,y),w(u,f),w(f,c),d=!0,m||(h=[Y(t,"submit",nt(n[16])),Y(f,"click",n[22])],m=!0)},p(_,y){_[12]?g?g.p(_,y):(g=Hb(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};y&201328656&&(S.$$scope={dirty:y,ctx:_}),i.$set(S);const C={};y&201334784&&(C.$$scope={dirty:y,ctx:_}),s.$set(C),(!d||y&512)&&ee(r,"btn-disabled",_[9]),(!d||y&512)&&ee(r,"btn-loading",_[9]),(!d||y&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(s.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(s.$$.fragment,_),d=!1},d(_){_&&(k(e),k(t),k(a),k(u)),g&&g.d(_),H(i),H(s),m=!1,Ie(h)}}}function JF(n){let e,t,i,l,s,o,r;return t=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[XF,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),j(t.$$.fragment),i=$(),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"),ee(l,"btn-disabled",n[8]),ee(l,"btn-loading",n[8]),p(e,"class","block")},m(a,u){v(a,e,u),q(t,e,null),w(e,i),w(e,l),s=!0,o||(r=Y(e,"submit",nt(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!s||u&256)&&ee(l,"btn-disabled",a[8]),(!s||u&256)&&ee(l,"btn-loading",a[8])},i(a){s||(M(t.$$.fragment,a),s=!0)},o(a){D(t.$$.fragment,a),s=!1},d(a){a&&k(e),H(t),o=!1,r()}}}function Hb(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("p"),i=W("Check your "),l=b("strong"),s=W(n[12]),o=W(` inbox and enter in the input below the received
+                        One-time password (OTP).`),p(e,"class","content txt-center m-b-sm")},m(r,a){v(r,e,a),w(e,t),w(t,i),w(t,l),w(l,s),w(t,o)},p(r,a){a&4096&&oe(s,r[12])},d(r){r&&k(e)}}}function ZF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Id"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","text"),p(s,"id",o=n[26]),s.value=n[4],p(s,"placeholder",n[11]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),r||(a=Y(s,"change",n[20]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&16&&s.value!==u[4]&&(s.value=u[4]),f&2048&&p(s,"placeholder",u[11])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function GF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("One-time password"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),s.required=!0,s.autofocus=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[13]),s.focus(),r||(a=Y(s,"input",n[21]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&8192&&s.value!==u[13]&&he(s,u[13])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function XF(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=W("Email"),l=$(),s=b("input"),p(e,"for",i=n[26]),p(s,"type","email"),p(s,"id",o=n[26]),s.required=!0},m(u,f){v(u,e,f),w(e,t),v(u,l,f),v(u,s,f),he(s,n[12]),r||(a=Y(s,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(s,"id",o),f&4096&&s.value!==u[12]&&he(s,u[12])},d(u){u&&(k(e),k(l),k(s)),r=!1,a()}}}function QF(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,l,s,o,r,a,u,f;return{c(){e=b("label"),i=W(t),s=$(),o=b("input"),p(e,"for",l=n[26]),p(o,"id",r=n[26]),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=Y(o,"input",n[17]),u=!0)},p(c,d){d&1&&t!==(t=U.sentenize(c[0].password.identityFields.join(" or "),!1)+"")&&oe(i,t),d&67108864&&l!==(l=c[26])&&p(e,"for",l),d&67108864&&r!==(r=c[26])&&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 xF(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),l=$(),s=b("input"),r=$(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(s,"type","password"),p(s,"id",o=n[26]),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),he(s,n[6]),v(d,r,m),v(d,a,m),w(a,u),f||(c=[Y(s,"input",n[18]),Me(Bn.call(null,u))],f=!0)},p(d,m){m&67108864&&i!==(i=d[26])&&p(e,"for",i),m&67108864&&o!==(o=d[26])&&p(s,"id",o),m&64&&s.value!==d[6]&&he(s,d[6])},d(d){d&&(k(e),k(l),k(s),k(r),k(a)),f=!1,Ie(c)}}}function eq(n){let e,t,i,l,s,o,r,a,u=n[2]>1&&qb(n);const f=[YF,WF,BF],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(s=d(n))&&(o=c[s]=f[s](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login
+            `),u&&u.c(),l=$(),o&&o.c(),r=ve(),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=qb(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()),M(o,1),o.m(r.parentNode,r)):o=null)},i(m){a||(M(o),a=!0)},o(m){D(o),a=!1},d(m){m&&(k(e),k(l),k(r)),u&&u.d(),~s&&c[s].d(m)}}}function tq(n){let e,t;return e=new VF({props:{$$slots:{default:[eq]},$$scope:{ctx:n}}}),{c(){j(e.$$.fragment)},m(i,l){q(e,i,l),t=!0},p(i,[l]){const s={};l&134234111&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function nq(n,e,t){let i;Qe(n,Pu,z=>t(23,i=z));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="";C();async function C(){if(!m){t(10,m=!0);try{t(0,r=await _e.collection("_superusers").listAuthMethods())}catch(z){_e.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await _e.collection("_superusers").authWithPassword(s,o),Ls(),Ut({}),is("/")}catch(B){B.status==401?(t(3,h=B.response.mfaId),((F=(z=r==null?void 0:r.password)==null?void 0:z.identityFields)==null?void 0:F.length)==1&&r.password.identityFields[0]=="email"?(t(12,y=s),await O()):/^[^@\s]+@[^@\s]+$/.test(s)&&t(12,y=s)):B.status!=400?_e.error(B):$i("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await _e.collection("_superusers").requestOTP(y);t(4,g=z.otpId),t(11,_=g),Ls(),Ut({})}catch(z){z.status==429&&t(4,g=_),_e.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await _e.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),Ls(),Ut({}),is("/")}catch(z){_e.error(z)}t(9,d=!1)}}const L=z=>{t(5,s=z.target.value)};function I(){o=this.value,t(6,o)}function A(){y=this.value,t(12,y)}const P=z=>{t(4,g=z.target.value||_),z.target.value=g};function N(){S=this.value,t(13,S)}const R=()=>{t(4,g="")};return n.$$.update=()=>{var z,F;n.$$.dirty&31&&(t(2,u=1),t(1,a=1),(z=r==null?void 0:r.mfa)!=null&&z.enabled&&t(2,u++,u),(F=r==null?void 0:r.otp)!=null&&F.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,T,O,E,L,I,A,P,N,R]}class iq extends Se{constructor(e){super(),we(this,e,nq,tq,ye,{})}}function Zt(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 lq={"/pbinstal/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageInstaller-CPCvh_Gv.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Fr(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Zt({component:iq,conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserRequestPasswordReset-DL6nXs9m.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageSuperuserConfirmPasswordReset-C-QLe07z.js"),[],import.meta.url),conditions:[n=>!_e.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Zt({component:UN,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Zt({component:I6,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Zt({component:z7,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Zt({component:MF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Zt({component:HF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Zt({component:UR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Zt({component:aF,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Zt({component:PR,conditions:[n=>_e.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-B5ksiewx.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmPasswordReset-B5ksiewx.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-JwH6c-NG.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmVerification-JwH6c-NG.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-CjqCY8Sq.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Zt({asyncComponent:()=>Tt(()=>import("./PageRecordConfirmEmailChange-CjqCY8Sq.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectSuccess-8Lc5-IG-.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Zt({asyncComponent:()=>Tt(()=>import("./PageOAuth2RedirectFailure-DNk27lv-.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Zt({component:r3,userData:{showAppSidebar:!1}})};function sq(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 jb(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=U.getInitials(n[0].email)+"",h,g,_,y,S,C,T;return _=new jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[oq]},$$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=$(),l=b("nav"),s=b("a"),s.innerHTML='<i class="ri-database-2-line"></i>',o=$(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=$(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=$(),c=b("div"),d=b("span"),h=W(m),g=$(),j(_.$$.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(O,E){v(O,e,E),w(e,t),w(e,i),w(e,l),w(l,s),w(l,o),w(l,r),w(l,a),w(l,u),w(e,f),w(e,c),w(c,d),w(d,h),w(c,g),q(_,c,null),S=!0,C||(T=[Me(Bn.call(null,t)),Me(Bn.call(null,s)),Me(qi.call(null,s,{path:"/collections/?.*",className:"current-route"})),Me(qe.call(null,s,{text:"Collections",position:"right"})),Me(Bn.call(null,r)),Me(qi.call(null,r,{path:"/logs/?.*",className:"current-route"})),Me(qe.call(null,r,{text:"Logs",position:"right"})),Me(Bn.call(null,u)),Me(qi.call(null,u,{path:"/settings/?.*",className:"current-route"})),Me(qe.call(null,u,{text:"Settings",position:"right"}))],C=!0)},p(O,E){(!S||E&1)&&m!==(m=U.getInitials(O[0].email)+"")&&oe(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&y!==(y=O[0].email))&&p(c,"title",y)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&k(e),H(_),C=!1,Ie(T)}}}function oq(n){let e,t=n[0].email+"",i,l,s,o,r,a,u,f,c,d;return{c(){e=b("div"),i=W(t),s=$(),o=b("hr"),r=$(),a=b("a"),a.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Manage superusers</span>',u=$(),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?collection=_superusers"),p(a,"class","dropdown-item closable"),p(a,"role","menuitem"),p(f,"type","button"),p(f,"class","dropdown-item closable"),p(f,"role","menuitem")},m(m,h){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(Bn.call(null,a)),Y(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&oe(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,Ie(d)}}}function zb(n){let e,t,i;return t=new Ou({props:{conf:U.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),j(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){v(l,e,s),q(t,e,null),i=!0},p:te,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&k(e),H(t)}}}function rq(n){var S;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;document.title=e=U.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=window.location.protocol=="https:"&&sq(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&jb(n);r=new n3({props:{routes:lq}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Ew({}),c=new mw({});let y=n[1]&&!n[2]&&zb(n);return{c(){g&&g.c(),t=ve(),i=$(),l=b("div"),_&&_.c(),s=$(),o=b("div"),j(r.$$.fragment),a=$(),j(u.$$.fragment),f=$(),j(c.$$.fragment),d=$(),y&&y.c(),m=ve(),p(o,"class","app-body"),p(l,"class","app-layout")},m(C,T){g&&g.m(document.head,null),w(document.head,t),v(C,i,T),v(C,l,T),_&&_.m(l,null),w(l,s),w(l,o),q(r,o,null),w(o,a),q(u,o,null),v(C,f,T),q(c,C,T),v(C,d,T),y&&y.m(C,T),v(C,m,T),h=!0},p(C,[T]){var O;(!h||T&24)&&e!==(e=U.joinNonEmpty([C[4],C[3],"PocketBase"]," - "))&&(document.title=e),(O=C[0])!=null&&O.id&&C[1]?_?(_.p(C,T),T&3&&M(_,1)):(_=jb(C),_.c(),M(_,1),_.m(l,s)):_&&(re(),D(_,1,1,()=>{_=null}),ae()),C[1]&&!C[2]?y?(y.p(C,T),T&6&&M(y,1)):(y=zb(C),y.c(),M(y,1),y.m(m.parentNode,m)):y&&(re(),D(y,1,1,()=>{y=null}),ae())},i(C){h||(M(_),M(r.$$.fragment,C),M(u.$$.fragment,C),M(c.$$.fragment,C),M(y),h=!0)},o(C){D(_),D(r.$$.fragment,C),D(u.$$.fragment,C),D(c.$$.fragment,C),D(y),h=!1},d(C){C&&(k(i),k(l),k(f),k(d),k(m)),g&&g.d(C),k(t),_&&_.d(),H(r),H(u),H(c,C),y&&y.d(C)}}}function aq(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,Rr,g=>t(0,s=g)),Qe(n,un,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,y,S,C;((_=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=(C=g==null?void 0:g.detail)==null?void 0:C.location,Rn(un,o="",o),Ut({}),ly())}function c(){is("/")}async function d(){var g,_;if(s!=null&&s.id)try{const y=await _e.settings.getAll({$cancelKey:"initialAppSettings"});Rn(_r,l=((g=y==null?void 0:y.meta)==null?void 0:g.appName)||"",l),Rn(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(){_e.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 uq extends Se{constructor(e){super(),we(this,e,aq,rq,ye,{})}}new uq({target:document.getElementById("app")});export{dt as $,he as A,Ks as B,Me as C,Bn as D,re as E,VF as F,ae as G,oe as H,te as I,U as J,tn as K,ve as L,co as M,Fr as N,Qe as O,Rn as P,ln as Q,un as R,Se as S,Mn as T,yt as U,IP as V,ef as W,pe as X,vt as Y,di as Z,Bt as _,D as a,zt as a0,Hk as a1,$i as b,j as c,H as d,dn as e,ce as f,xl as g,b as h,we as i,$ as j,p as k,ee as l,q as m,v as n,w as o,_e as p,Y as q,is as r,ye as s,M as t,nt as u,k as v,Ie as w,_n as x,ie as y,W as z};
diff --git a/ui/dist/index.html b/ui/dist/index.html
index 46261fd0..b4275159 100644
--- a/ui/dist/index.html
+++ b/ui/dist/index.html
@@ -37,7 +37,7 @@
         window.Prism = window.Prism || {};
         window.Prism.manual = true;
     </script>
-  <script type="module" crossorigin src="./assets/index-Bw7x2V1B.js"></script>
+  <script type="module" crossorigin src="./assets/index-DCriA6MP.js"></script>
   <link rel="stylesheet" crossorigin href="./assets/index-DsG6zVsQ.css">
 </head>
 <body>
diff --git a/ui/package-lock.json b/ui/package-lock.json
index 5c09d20b..0419535d 100644
--- a/ui/package-lock.json
+++ b/ui/package-lock.json
@@ -22,7 +22,7 @@
         "chartjs-adapter-luxon": "^1.2.0",
         "chartjs-plugin-zoom": "^2.0.1",
         "luxon": "^3.4.4",
-        "pocketbase": "^0.23.0",
+        "pocketbase": "^0.24.0",
         "sass": "^1.45.0",
         "svelte": "^4.0.0",
         "svelte-flatpickr": "^3.3.3",
@@ -45,9 +45,9 @@
       }
     },
     "node_modules/@codemirror/autocomplete": {
-      "version": "6.18.3",
-      "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.3.tgz",
-      "integrity": "sha512-1dNIOmiM0z4BIBwxmxEfA1yoxh1MF/6KPBbh20a5vphGV0ictKlgQsbJs6D6SkR6iJpGbpwRsa6PFMNlg9T9pQ==",
+      "version": "6.18.4",
+      "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.4.tgz",
+      "integrity": "sha512-sFAphGQIqyQZfP2ZBsSHV7xQvo9Py0rV0dW7W3IMRdS+zDuNb2l3no78CvUaWKGfzFjI4FTrLdUSj86IGb2hRA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -55,12 +55,6 @@
         "@codemirror/state": "^6.0.0",
         "@codemirror/view": "^6.17.0",
         "@lezer/common": "^1.0.0"
-      },
-      "peerDependencies": {
-        "@codemirror/language": "^6.0.0",
-        "@codemirror/state": "^6.0.0",
-        "@codemirror/view": "^6.0.0",
-        "@lezer/common": "^1.0.0"
       }
     },
     "node_modules/@codemirror/commands": {
@@ -151,9 +145,9 @@
       }
     },
     "node_modules/@codemirror/language": {
-      "version": "6.10.6",
-      "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.6.tgz",
-      "integrity": "sha512-KrsbdCnxEztLVbB5PycWXFxas4EOyk/fPAfruSOnDDppevQgid2XZ+KbJ9u+fDikP/e7MW7HPBTvTb8JlZK9vA==",
+      "version": "6.10.7",
+      "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.7.tgz",
+      "integrity": "sha512-aOswhVOLYhMNeqykt4P7+ukQSpGL0ynZYaEyFDVHE7fl2xgluU3yuE9MdgYNfw6EmaNidoFMIQ2iTh1ADrnT6A==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -210,9 +204,9 @@
       }
     },
     "node_modules/@codemirror/view": {
-      "version": "6.35.3",
-      "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.35.3.tgz",
-      "integrity": "sha512-ScY7L8+EGdPl4QtoBiOzE4FELp7JmNUsBvgBcCakXWM2uiv/K89VAzU3BMDscf0DsACLvTKePbd5+cFDTcei6g==",
+      "version": "6.36.1",
+      "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.1.tgz",
+      "integrity": "sha512-miD1nyT4m4uopZaDdO2uXU/LLHliKNYL9kB1C1wJHrunHLm/rpkb5QVSokqgw9hFqEZakrdlb/VGWX8aYZTslQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -1471,9 +1465,9 @@
       }
     },
     "node_modules/chokidar": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.1.tgz",
-      "integrity": "sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==",
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
+      "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -1838,9 +1832,9 @@
       }
     },
     "node_modules/pocketbase": {
-      "version": "0.23.0",
-      "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.23.0.tgz",
-      "integrity": "sha512-S9b/QSKGXsRyL55m8MoXMucPTpMvpOLlOLTSduraIOzwVt8Epp0j7V53a1qW7VbF2pL7PC579DOruxJBWqBYTg==",
+      "version": "0.24.0",
+      "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.24.0.tgz",
+      "integrity": "sha512-zcmEUsXGRT+AqRHzEMlheglOiQnhYKRxT0ew164kx38/IGsE7MLmlmEaMSkm3tUwiZe5qC3RcA5+SX0lkDUSHA==",
       "dev": true,
       "license": "MIT"
     },
diff --git a/ui/package.json b/ui/package.json
index b382f907..6f6e842a 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -29,7 +29,7 @@
     "chartjs-adapter-luxon": "^1.2.0",
     "chartjs-plugin-zoom": "^2.0.1",
     "luxon": "^3.4.4",
-    "pocketbase": "^0.23.0",
+    "pocketbase": "^0.24.0",
     "sass": "^1.45.0",
     "svelte": "^4.0.0",
     "svelte-flatpickr": "^3.3.3",