diff --git a/ui/dist/assets/AuthMethodsDocs-Ded_AT2F.js b/ui/dist/assets/AuthMethodsDocs-emhroE88.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-Ded_AT2F.js rename to ui/dist/assets/AuthMethodsDocs-emhroE88.js index d0c866e4..4c6b4b70 100644 --- a/ui/dist/assets/AuthMethodsDocs-Ded_AT2F.js +++ b/ui/dist/assets/AuthMethodsDocs-emhroE88.js @@ -1,4 +1,4 @@ -import{S as Ce,i as Be,s as Te,V as Le,X as J,h as u,d as ae,t as Q,a as G,I as N,Z as we,_ as Se,C as De,$ as Re,D as Ue,l as d,n as a,m as ne,u as c,A as y,v as k,c as ie,w as h,p as oe,J as je,k as O,o as qe,W as Ee}from"./index-ChXAaRxB.js";import{F as Fe}from"./FieldsQueryParam-BPQKDixm.js";function ye(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=y(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,$){d(v,l,$),a(l,p),a(l,b),i||(f=qe(l,"click",m),i=!0)},p(v,$){s=v,$&4&&o!==(o=s[8].code+"")&&N(p,o),$&6&&O(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ee({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ie(o.$$.fragment),p=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&O(l,"active",s[1]===s[8].code)},i(i){b||(G(o.$$.fragment,i),b=!0)},o(i){Q(o.$$.fragment,i),b=!1},d(i){i&&u(l),ae(o)}}}function He(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,$,g=n[0].name+"",V,ce,W,M,X,L,Z,A,E,re,F,S,ue,z,H=n[0].name+"",K,de,Y,D,x,P,ee,fe,te,T,le,R,se,C,U,w=[],me=new Map,pe,j,_=[],be=new Map,B;M=new Le({props:{js:` +import{S as Ce,i as Be,s as Te,V as Le,X as J,h as u,d as ae,t as Q,a as G,I as N,Z as we,_ as Se,C as De,$ as Re,D as Ue,l as d,n as a,m as ne,u as c,A as y,v as k,c as ie,w as h,p as oe,J as je,k as O,o as qe,W as Ee}from"./index-DjYVmtoM.js";import{F as Fe}from"./FieldsQueryParam-BiUsK6GB.js";function ye(n,s,l){const o=n.slice();return o[8]=s[l],o}function Me(n,s,l){const o=n.slice();return o[8]=s[l],o}function Ae(n,s){let l,o=s[8].code+"",p,b,i,f;function m(){return s[6](s[8])}return{key:n,first:null,c(){l=c("button"),p=y(o),b=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(v,$){d(v,l,$),a(l,p),a(l,b),i||(f=qe(l,"click",m),i=!0)},p(v,$){s=v,$&4&&o!==(o=s[8].code+"")&&N(p,o),$&6&&O(l,"active",s[1]===s[8].code)},d(v){v&&u(l),i=!1,f()}}}function Pe(n,s){let l,o,p,b;return o=new Ee({props:{content:s[8].body}}),{key:n,first:null,c(){l=c("div"),ie(o.$$.fragment),p=k(),h(l,"class","tab-item"),O(l,"active",s[1]===s[8].code),this.first=l},m(i,f){d(i,l,f),ne(o,l,null),a(l,p),b=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[8].body),o.$set(m),(!b||f&6)&&O(l,"active",s[1]===s[8].code)},i(i){b||(G(o.$$.fragment,i),b=!0)},o(i){Q(o.$$.fragment,i),b=!1},d(i){i&&u(l),ae(o)}}}function He(n){var ke,ge;let s,l,o=n[0].name+"",p,b,i,f,m,v,$,g=n[0].name+"",V,ce,W,M,X,L,Z,A,E,re,F,S,ue,z,H=n[0].name+"",K,de,Y,D,x,P,ee,fe,te,T,le,R,se,C,U,w=[],me=new Map,pe,j,_=[],be=new Map,B;M=new Le({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-B7jzqxzk.js b/ui/dist/assets/AuthRefreshDocs-C8u7IdT_.js similarity index 98% rename from ui/dist/assets/AuthRefreshDocs-B7jzqxzk.js rename to ui/dist/assets/AuthRefreshDocs-C8u7IdT_.js index b9791558..16fe6211 100644 --- a/ui/dist/assets/AuthRefreshDocs-B7jzqxzk.js +++ b/ui/dist/assets/AuthRefreshDocs-C8u7IdT_.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Ie,V as Ke,W as Ue,X as I,h as d,d as K,t as E,a as z,I as de,Z as Oe,_ as Qe,C as We,$ as Xe,D as Ze,l as u,n as o,m as Q,u as s,A as k,v as p,c as W,w as b,J as Ve,p as Ge,k as X,o as Ye}from"./index-ChXAaRxB.js";import{F as et}from"./FieldsQueryParam-BPQKDixm.js";function Ee(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"),X(l,"active",a[1]===a[5].code),this.first=l},m(v,w){u(v,l,w),o(l,m),o(l,_),i||(h=Ye(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&X(l,"active",a[1]===a[5].code)},d(v){v&&d(l),i=!1,h()}}}function Ne(r,a){let l,n,m,_;return n=new Ue({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),W(n.$$.fragment),m=p(),b(l,"class","tab-item"),X(l,"active",a[1]===a[5].code),this.first=l},m(i,h){u(i,l,h),Q(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)&&X(l,"active",a[1]===a[5].code)},i(i){_||(z(n.$$.fragment,i),_=!0)},o(i){E(n.$$.fragment,i),_=!1},d(i){i&&d(l),K(n)}}}function tt(r){var qe,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,D,Z,S,J,ue,N,M,pe,G,U=r[0].name+"",Y,he,fe,j,ee,q,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,A,ie,H,ce,R,L,y=[],Pe=new Map,Ae,O,$=[],Be=new Map,B;v=new Ke({props:{js:` +import{S as je,i as xe,s as Ie,V as Ke,W as Ue,X as I,h as d,d as K,t as E,a as z,I as de,Z as Oe,_ as Qe,C as We,$ as Xe,D as Ze,l as u,n as o,m as Q,u as s,A as k,v as p,c as W,w as b,J as Ve,p as Ge,k as X,o as Ye}from"./index-DjYVmtoM.js";import{F as et}from"./FieldsQueryParam-BiUsK6GB.js";function Ee(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"),X(l,"active",a[1]===a[5].code),this.first=l},m(v,w){u(v,l,w),o(l,m),o(l,_),i||(h=Ye(l,"click",g),i=!0)},p(v,w){a=v,w&4&&n!==(n=a[5].code+"")&&de(m,n),w&6&&X(l,"active",a[1]===a[5].code)},d(v){v&&d(l),i=!1,h()}}}function Ne(r,a){let l,n,m,_;return n=new Ue({props:{content:a[5].body}}),{key:r,first:null,c(){l=s("div"),W(n.$$.fragment),m=p(),b(l,"class","tab-item"),X(l,"active",a[1]===a[5].code),this.first=l},m(i,h){u(i,l,h),Q(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)&&X(l,"active",a[1]===a[5].code)},i(i){_||(z(n.$$.fragment,i),_=!0)},o(i){E(n.$$.fragment,i),_=!1},d(i){i&&d(l),K(n)}}}function tt(r){var qe,Fe;let a,l,n=r[0].name+"",m,_,i,h,g,v,w,D,Z,S,J,ue,N,M,pe,G,U=r[0].name+"",Y,he,fe,j,ee,q,te,T,oe,be,F,C,ae,me,le,_e,f,ke,P,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Re,A,ie,H,ce,R,L,y=[],Pe=new Map,Ae,O,$=[],Be=new Map,B;v=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-D0NUW2n8.js b/ui/dist/assets/AuthWithOAuth2Docs-DqJ60m_y.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-D0NUW2n8.js rename to ui/dist/assets/AuthWithOAuth2Docs-DqJ60m_y.js index 618ec684..06923e25 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-D0NUW2n8.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-DqJ60m_y.js @@ -1,4 +1,4 @@ -import{S as Je,i as xe,s as Ee,V as Ne,W as je,X as Q,h as r,d as Z,t as j,a as J,I as pe,Z as Ue,_ as Ie,C as Qe,$ as Ze,D as ze,l as c,n as a,m as z,u as o,A as _,v as h,c as K,w as p,J as Be,p as Ke,k as X,o as Xe}from"./index-ChXAaRxB.js";import{F as Ge}from"./FieldsQueryParam-BPQKDixm.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l){let n,i=l[5].code+"",f,g,d,b;function 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){c(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&&r(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new je({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),K(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){c(d,n,b),z(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||(J(i.$$.fragment,d),g=!0)},o(d){j(i.$$.fragment,d),g=!1},d(d){d&&r(n),Z(i)}}}function Ye(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,R,G,A,x,be,E,P,me,Y,N=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,L,$=[],De=new Map,Re,H,w=[],Pe=new Map,D;v=new Ne({props:{js:` +import{S as Je,i as xe,s as Ee,V as Ne,W as je,X as Q,h as r,d as Z,t as j,a as J,I as pe,Z as Ue,_ as Ie,C as Qe,$ as Ze,D as ze,l as c,n as a,m as z,u as o,A as _,v as h,c as K,w as p,J as Be,p as Ke,k as X,o as Xe}from"./index-DjYVmtoM.js";import{F as Ge}from"./FieldsQueryParam-BiUsK6GB.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function Le(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l){let n,i=l[5].code+"",f,g,d,b;function 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){c(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&&r(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new je({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),K(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){c(d,n,b),z(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||(J(i.$$.fragment,d),g=!0)},o(d){j(i.$$.fragment,d),g=!1},d(d){d&&r(n),Z(i)}}}function Ye(s){let l,n,i=s[0].name+"",f,g,d,b,k,v,O,R,G,A,x,be,E,P,me,Y,N=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,L,$=[],De=new Map,Re,H,w=[],Pe=new Map,D;v=new Ne({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithOtpDocs-8gtiEr6v.js b/ui/dist/assets/AuthWithOtpDocs-CDQM7KGQ.js similarity index 99% rename from ui/dist/assets/AuthWithOtpDocs-8gtiEr6v.js rename to ui/dist/assets/AuthWithOtpDocs-CDQM7KGQ.js index 4a936638..a1088ec7 100644 --- a/ui/dist/assets/AuthWithOtpDocs-8gtiEr6v.js +++ b/ui/dist/assets/AuthWithOtpDocs-CDQM7KGQ.js @@ -1,4 +1,4 @@ -import{S as be,i as _e,s as ve,W as ge,X as V,h as b,d as x,t as j,a as J,I as ce,Z as de,_ as je,C as ue,$ as Qe,D as he,l as _,n as s,m as ee,u as d,v as T,A as R,c as te,w as g,J as ke,k as N,o as $e,V as Ke,Y as De,p as Xe,a0 as Me}from"./index-ChXAaRxB.js";import{F as Ze}from"./FieldsQueryParam-BPQKDixm.js";function Be(a,t,e){const l=a.slice();return l[4]=t[e],l}function Ie(a,t,e){const l=a.slice();return l[4]=t[e],l}function We(a,t){let e,l=t[4].code+"",h,i,c,n;function m(){return t[3](t[4])}return{key:a,first:null,c(){e=d("button"),h=R(l),i=T(),g(e,"class","tab-item"),N(e,"active",t[1]===t[4].code),this.first=e},m(v,C){_(v,e,C),s(e,h),s(e,i),c||(n=$e(e,"click",m),c=!0)},p(v,C){t=v,C&4&&l!==(l=t[4].code+"")&&ce(h,l),C&6&&N(e,"active",t[1]===t[4].code)},d(v){v&&b(e),c=!1,n()}}}function Fe(a,t){let e,l,h,i;return l=new ge({props:{content:t[4].body}}),{key:a,first:null,c(){e=d("div"),te(l.$$.fragment),h=T(),g(e,"class","tab-item"),N(e,"active",t[1]===t[4].code),this.first=e},m(c,n){_(c,e,n),ee(l,e,null),s(e,h),i=!0},p(c,n){t=c;const m={};n&4&&(m.content=t[4].body),l.$set(m),(!i||n&6)&&N(e,"active",t[1]===t[4].code)},i(c){i||(J(l.$$.fragment,c),i=!0)},o(c){j(l.$$.fragment,c),i=!1},d(c){c&&b(e),x(l)}}}function ze(a){let t,e,l,h,i,c,n,m=a[0].name+"",v,C,F,B,I,D,Q,M,U,y,O,q,k,L,Y,A,X,E,o,$,P,z,u,p,S,w,Z,we,Te,Pe,pe,Oe,ye,le,fe,oe,me,G,ae,K=[],Se=new Map,qe,ne,H=[],Ce=new Map,se;P=new ge({props:{content:"?expand=relField1,relField2.subRelField"}}),le=new Ze({props:{prefix:"record."}});let re=V(a[2]);const Ae=r=>r[4].code;for(let r=0;rr[4].code;for(let r=0;rParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',Q=T(),M=d("div"),M.textContent="Query parameters",U=T(),y=d("table"),O=d("thead"),O.innerHTML='Param Type Description',q=T(),k=d("tbody"),L=d("tr"),Y=d("td"),Y.textContent="expand",A=T(),X=d("td"),X.innerHTML='String',E=T(),o=d("td"),$=R(`Auto expand record relations. Ex.: +import{S as be,i as _e,s as ve,W as ge,X as V,h as b,d as x,t as j,a as J,I as ce,Z as de,_ as je,C as ue,$ as Qe,D as he,l as _,n as s,m as ee,u as d,v as T,A as R,c as te,w as g,J as ke,k as N,o as $e,V as Ke,Y as De,p as Xe,a0 as Me}from"./index-DjYVmtoM.js";import{F as Ze}from"./FieldsQueryParam-BiUsK6GB.js";function Be(a,t,e){const l=a.slice();return l[4]=t[e],l}function Ie(a,t,e){const l=a.slice();return l[4]=t[e],l}function We(a,t){let e,l=t[4].code+"",h,i,c,n;function m(){return t[3](t[4])}return{key:a,first:null,c(){e=d("button"),h=R(l),i=T(),g(e,"class","tab-item"),N(e,"active",t[1]===t[4].code),this.first=e},m(v,C){_(v,e,C),s(e,h),s(e,i),c||(n=$e(e,"click",m),c=!0)},p(v,C){t=v,C&4&&l!==(l=t[4].code+"")&&ce(h,l),C&6&&N(e,"active",t[1]===t[4].code)},d(v){v&&b(e),c=!1,n()}}}function Fe(a,t){let e,l,h,i;return l=new ge({props:{content:t[4].body}}),{key:a,first:null,c(){e=d("div"),te(l.$$.fragment),h=T(),g(e,"class","tab-item"),N(e,"active",t[1]===t[4].code),this.first=e},m(c,n){_(c,e,n),ee(l,e,null),s(e,h),i=!0},p(c,n){t=c;const m={};n&4&&(m.content=t[4].body),l.$set(m),(!i||n&6)&&N(e,"active",t[1]===t[4].code)},i(c){i||(J(l.$$.fragment,c),i=!0)},o(c){j(l.$$.fragment,c),i=!1},d(c){c&&b(e),x(l)}}}function ze(a){let t,e,l,h,i,c,n,m=a[0].name+"",v,C,F,B,I,D,Q,M,U,y,O,q,k,L,Y,A,X,E,o,$,P,z,u,p,S,w,Z,we,Te,Pe,pe,Oe,ye,le,fe,oe,me,G,ae,K=[],Se=new Map,qe,ne,H=[],Ce=new Map,se;P=new ge({props:{content:"?expand=relField1,relField2.subRelField"}}),le=new Ze({props:{prefix:"record."}});let re=V(a[2]);const Ae=r=>r[4].code;for(let r=0;rr[4].code;for(let r=0;rParam Type Description
Required otpId
String The id of the OTP request.
Required password
String The one-time password.',Q=T(),M=d("div"),M.textContent="Query parameters",U=T(),y=d("table"),O=d("thead"),O.innerHTML='Param Type Description',q=T(),k=d("tbody"),L=d("tr"),Y=d("td"),Y.textContent="expand",A=T(),X=d("td"),X.innerHTML='String',E=T(),o=d("td"),$=R(`Auto expand record relations. Ex.: `),te(P.$$.fragment),z=R(` Supports up to 6-levels depth nested relations expansion. `),u=d("br"),p=R(` The expanded relations will be appended to the record under the diff --git a/ui/dist/assets/AuthWithPasswordDocs-DhLB4CTX.js b/ui/dist/assets/AuthWithPasswordDocs-CJv5XhID.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-DhLB4CTX.js rename to ui/dist/assets/AuthWithPasswordDocs-CJv5XhID.js index e8429779..22a4c38a 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-DhLB4CTX.js +++ b/ui/dist/assets/AuthWithPasswordDocs-CJv5XhID.js @@ -1,4 +1,4 @@ -import{S as kt,i as gt,s as vt,V as St,X as L,W as _t,h as c,d as ae,Y as wt,t as X,a as Z,I as z,Z as ct,_ as yt,C as $t,$ as Pt,D as Ct,l as d,n as t,m as oe,u as s,A as f,v as u,c as se,w as k,J as dt,p as Rt,k as ne,o as Ot}from"./index-ChXAaRxB.js";import{F as Tt}from"./FieldsQueryParam-BPQKDixm.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){d(a,o,n)},d(a){a&&c(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),d(r,o,h),d(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&z(m,n)},d(r){r&&(c(o),c(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($,_){d($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&z(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&c(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"),se(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){d(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||(Z(n.$$.fragment,r),b=!0)},o(r){X(n.$$.fragment,r),b=!1},d(r){r&&c(a),ae(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,G=i[1].join("/")+"",ie,De,re,We,ce,C,de,q,pe,R,x,Fe,ee,H,Me,ue,te=i[0].name+"",he,Ue,be,Y,fe,O,me,Be,j,T,_e,Le,ke,qe,V,ge,He,ve,Se,E,we,A,ye,Ye,N,D,$e,je,Pe,Ve,v,Ee,M,Ne,Ie,Je,Ce,Qe,Re,Ke,Xe,Ze,Oe,ze,Ge,U,Te,I,Ae,W,J,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;C=new St({props:{js:` +import{S as kt,i as gt,s as vt,V as St,X as L,W as _t,h as c,d as ae,Y as wt,t as X,a as Z,I as z,Z as ct,_ as yt,C as $t,$ as Pt,D as Ct,l as d,n as t,m as oe,u as s,A as f,v as u,c as se,w as k,J as dt,p as Rt,k as ne,o as Ot}from"./index-DjYVmtoM.js";import{F as Tt}from"./FieldsQueryParam-BiUsK6GB.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){d(a,o,n)},d(a){a&&c(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),d(r,o,h),d(r,a,h),t(a,m)},p(r,h){h&2&&n!==(n=r[12]+"")&&z(m,n)},d(r){r&&(c(o),c(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($,_){d($,a,_),t(a,m),t(a,b),r||(h=Ot(a,"click",g),r=!0)},p($,_){o=$,_&8&&n!==(n=o[7].code+"")&&z(m,n),_&12&&ne(a,"active",o[2]===o[7].code)},d($){$&&c(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"),se(n.$$.fragment),m=u(),k(a,"class","tab-item"),ne(a,"active",o[2]===o[7].code),this.first=a},m(r,h){d(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||(Z(n.$$.fragment,r),b=!0)},o(r){X(n.$$.fragment,r),b=!1},d(r){r&&c(a),ae(n)}}}function Dt(i){var ot,st;let o,a,n=i[0].name+"",m,b,r,h,g,$,_,G=i[1].join("/")+"",ie,De,re,We,ce,C,de,q,pe,R,x,Fe,ee,H,Me,ue,te=i[0].name+"",he,Ue,be,Y,fe,O,me,Be,j,T,_e,Le,ke,qe,V,ge,He,ve,Se,E,we,A,ye,Ye,N,D,$e,je,Pe,Ve,v,Ee,M,Ne,Ie,Je,Ce,Qe,Re,Ke,Xe,Ze,Oe,ze,Ge,U,Te,I,Ae,W,J,P=[],xe=new Map,et,Q,w=[],tt=new Map,F;C=new St({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${i[5]}'); diff --git a/ui/dist/assets/BatchApiDocs-DIiO-qIL.js b/ui/dist/assets/BatchApiDocs-C0h3bP_1.js similarity index 99% rename from ui/dist/assets/BatchApiDocs-DIiO-qIL.js rename to ui/dist/assets/BatchApiDocs-C0h3bP_1.js index ae1bdd64..6fb3da47 100644 --- a/ui/dist/assets/BatchApiDocs-DIiO-qIL.js +++ b/ui/dist/assets/BatchApiDocs-C0h3bP_1.js @@ -1,4 +1,4 @@ -import{S as St,i as At,s as Lt,V as Mt,W as Ht,X as Q,h as d,d as Re,t as Y,a as x,I as jt,Z as Pt,_ as Nt,C as Ut,$ as Jt,D as zt,l as u,n as t,m as Te,E as Wt,G as Gt,u as o,A as _,v as i,c as Pe,w as b,J as Ft,p as Kt,k as ee,o as Vt}from"./index-ChXAaRxB.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){u(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&&d(n),c=!1,y()}}}function It(a,s){let n,c,y,f;return c=new Ht({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Pe(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){u(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||(x(c.$$.fragment,r),f=!0)},o(r){Y(c.$$.fragment,r),f=!1},d(r){r&&d(n),Re(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,w,oe,O,ae,I,se,H,ne,J,ie,q,ce,Ie,re,S,z,He,k,W,Se,de,Ae,D,G,Le,ue,Me,K,je,pe,Ne,C,Ue,me,Je,ze,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ze,p,_e,Qe,ye,Ye,ke,xe,$e,et,ge,tt,ve,lt,ot,at,De,st,R,Ce,A,we,T,L,v=[],nt=new Map,it,M,$=[],ct=new Map,j,qe,rt;w=new Mt({props:{js:` +import{S as St,i as At,s as Lt,V as Mt,W as Ht,X as Q,h as d,d as Re,t as Y,a as x,I as jt,Z as Pt,_ as Nt,C as Ut,$ as Jt,D as zt,l as u,n as t,m as Te,E as Wt,G as Gt,u as o,A as _,v as i,c as Pe,w as b,J as Ft,p as Kt,k as ee,o as Vt}from"./index-DjYVmtoM.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){u(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&&d(n),c=!1,y()}}}function It(a,s){let n,c,y,f;return c=new Ht({props:{content:s[6].body}}),{key:a,first:null,c(){n=o("div"),Pe(c.$$.fragment),y=i(),b(n,"class","tab-item"),ee(n,"active",s[1]===s[6].code),this.first=n},m(r,h){u(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||(x(c.$$.fragment,r),f=!0)},o(r){Y(c.$$.fragment,r),f=!1},d(r){r&&d(n),Re(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,w,oe,O,ae,I,se,H,ne,J,ie,q,ce,Ie,re,S,z,He,k,W,Se,de,Ae,D,G,Le,ue,Me,K,je,pe,Ne,C,Ue,me,Je,ze,We,V,Ge,X,Ke,be,Ve,he,Xe,fe,Ze,p,_e,Qe,ye,Ye,ke,xe,$e,et,ge,tt,ve,lt,ot,at,De,st,R,Ce,A,we,T,L,v=[],nt=new Map,it,M,$=[],ct=new Map,j,qe,rt;w=new Mt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[2]}'); diff --git a/ui/dist/assets/CodeEditor-oVf9mPjW.js b/ui/dist/assets/CodeEditor-CTDCRa84.js similarity index 99% rename from ui/dist/assets/CodeEditor-oVf9mPjW.js rename to ui/dist/assets/CodeEditor-CTDCRa84.js index c03379af..519ce558 100644 --- a/ui/dist/assets/CodeEditor-oVf9mPjW.js +++ b/ui/dist/assets/CodeEditor-CTDCRa84.js @@ -1,4 +1,4 @@ -import{S as vt,i as Yt,s as _t,H as BO,h as zt,a1 as H,l as qt,u as Rt,w as jt,O as Vt,T as Wt,U as Gt,Q as Ct,J as Ut,y as At}from"./index-ChXAaRxB.js";import{P as Et,N as Mt,w as Lt,D as It,x as zO,T as eO,I as qO,y as Nt,z as D,A as o,L as B,B as K,F as J,G as R,H as RO,J as F,v as U,K as qe,M as X,E as q,O as Re,Q as je,R as Ve,U as Dt,V as Bt,W as Kt,X as We,Y as Jt,b as A,e as Ft,f as Ht,g as Oa,i as ea,j as ta,k as aa,l as ra,m as ia,r as sa,n as la,o as na,p as oa,C as OO,u as Qa,c as ca,d as pa,s as ua,h as da,a as ha,q as KO}from"./index-CN02J7Id.js";var JO={};class iO{constructor(O,a,t,r,s,i,l,n,c,u=0,Q){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=c,this.lookAhead=u,this.parent=Q}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new iO(O,[],a,t,t,0,[],0,r?new FO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,c)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>t;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new iO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new fa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,c=this.stack.length-l*3;if(c>=0&&O.getGoto(this.stack[c],n,!1)>=0)return l<<19|65536|n}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class FO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class fa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class sO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new sO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new sO(this.stack,this.pos,this.index)}}function L(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class tO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const HO=new tO;class $a{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=HO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=HO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class V{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ge(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?L(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ge(e,O,a,t,r,s){let i=0,l=1<0){let h=e[p];if(n.allows(h)&&(O.token.value==-1||O.token.value==h||ma(h,O.token.value,r,s))){O.acceptToken(h);break}}let u=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>1,h=c+p+(p<<1),m=e[h],g=e[h+1]||65536;if(u=g)Q=p+1;else{i=e[h+2],O.advance();continue O}}break}}function Oe(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function ma(e,O,a,t){let r=Oe(a,t,O);return r<0||Oe(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class ga{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?ee(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?ee(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof eO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new tO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let c=0;cQ.end+25&&(n=Math.max(Q.lookAhead,n)),Q.value!=0)){let f=a;if(Q.extended>-1&&(a=this.addActions(O,Q.extended,Q.end,a)),a=this.addActions(O,Q.value,Q.end,a),!u.extend&&(t=Q,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new tO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new tO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(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,a,t,r){for(let s=0;sO.bufferLength*4?new ga(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Xa(r);if(i)return b&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw b&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return b&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,n)=>n.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let c=O.curContext&&O.curContext.tracker.strict,u=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(zO.contextHash)||0)==u))return O.useNode(Q,f),b&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(Q.type.id)})`),!0;if(!(Q instanceof eO)||Q.children.length==0||Q.positions[0]>0)break;let p=Q.children[0];if(p instanceof eO&&Q.positions[0]==0)Q=p;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),b&&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 n=this.tokens.getActions(O);for(let c=0;cr?a.push(h):t.push(h)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return te(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),b&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let Q=l.split(),f=u;for(let p=0;Q.forceReduce()&&p<10&&(b&&console.log(f+this.stackID(Q)+" (via force-reduce)"),!this.advanceFully(Q,t));p++)b&&(f=this.stackID(Q)+" -> ");for(let p of l.recoverByInsert(n))b&&console.log(u+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(c==l.pos&&(c++,n=0),l.recoverByDelete(n,c),b&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),te(l,t)):(!r||r.scoree;class Ce{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 Y extends Et{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[c++]);else{let Q=l[c+-u];for(let f=-u;f>0;f--)s(l[c++],n,Q);c++}}}this.nodeSet=new Mt(a.map((l,n)=>Lt.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=It;let i=L(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new V(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,a,t){let r=new Sa(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&t)return n;for(let c=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=a(v(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=v(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(Y.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=ae(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const ka=55,ba=1,xa=56,ya=2,Ta=57,wa=3,re=4,va=5,jO=6,Ue=7,Ae=8,Ee=9,Me=10,Ya=11,_a=12,za=13,hO=58,qa=14,Ra=15,ie=59,Le=21,ja=23,Ie=24,Va=25,bO=27,Ne=28,Wa=29,Ga=32,Ca=35,Ua=37,Aa=38,Ea=0,Ma=1,La={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},Ia={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},se={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let le=null,ne=null,oe=0;function xO(e,O){let a=e.pos+O;if(oe==a&&ne==e)return le;let t=e.peek(O),r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return ne=e,oe=a,le=r?r.toLowerCase():t==Da||t==Ba?void 0:null}const De=60,nO=62,VO=47,Da=63,Ba=33,Ka=45;function Qe(e,O){this.name=e,this.parent=O}const Ja=[jO,Me,Ue,Ae,Ee],Fa=new Ce({start:null,shift(e,O,a,t){return Ja.indexOf(O)>-1?new Qe(xO(t,1)||"",e):e},reduce(e,O){return O==Le&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==jO||r==Ua?new Qe(xO(t,1)||"",e):e},strict:!1}),Ha=new k((e,O)=>{if(e.next!=De){e.next<0&&O.context&&e.acceptToken(hO);return}e.advance();let a=e.next==VO;a&&e.advance();let t=xO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Ra:qa);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ya);if(r&&Ia[r])return e.acceptToken(hO,-2);if(O.dialectEnabled(Ea))return e.acceptToken(_a);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(za)}else{if(t=="script")return e.acceptToken(Ue);if(t=="style")return e.acceptToken(Ae);if(t=="textarea")return e.acceptToken(Ee);if(La.hasOwnProperty(t))return e.acceptToken(Me);r&&se[r]&&se[r][t]?e.acceptToken(hO,-1):e.acceptToken(jO)}},{contextual:!0}),Or=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(ie);break}if(e.next==Ka)O++;else if(e.next==nO&&O>=2){a>=3&&e.acceptToken(ie,-2);break}else O=0;e.advance()}});function er(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const tr=new k((e,O)=>{if(e.next==VO&&e.peek(1)==nO){let a=O.dialectEnabled(Ma)||er(O.context);e.acceptToken(a?va:re,2)}else e.next==nO&&e.acceptToken(re,1)});function WO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==De||s==1&&r.next==VO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const ar=WO("script",ka,ba),rr=WO("style",xa,ya),ir=WO("textarea",Ta,wa),sr=D({"Text RawText IncompleteTag IncompleteCloseTag":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),lr=Y.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^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 IncompleteTag 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:68,context:Fa,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[sr],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[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!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@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@TalWOX@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!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@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!_DsbiSlWc!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!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$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_kiSaPlW!b`!dpOX$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_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$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!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*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!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,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!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!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!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=l.type.id;if(c==Wa)return fO(l,n,a);if(c==Ga)return fO(l,n,t);if(c==Ca)return fO(l,n,r);if(c==Le&&s.length){let u=l.node,Q=u.firstChild,f=Q&&ce(Q,n),p;if(f){for(let h of s)if(h.tag==f&&(!h.attrs||h.attrs(p||(p=Be(Q,n))))){let m=u.lastChild,g=m.type.id==Aa?m.from:u.to;if(g>Q.to)return{parser:h.parser,overlay:[{from:Q.to,to:g}]}}}}if(i&&c==Ie){let u=l.node,Q;if(Q=u.firstChild){let f=i[n.read(Q.from,Q.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=ce(u.parent,n))continue;let h=u.lastChild;if(h.type.id==bO){let m=h.from+1,g=h.lastChild,Z=h.to-(g&&g.isError?0:1);if(Z>m)return{parser:p.parser,overlay:[{from:m,to:Z}]}}else if(h.type.id==Ne)return{parser:p.parser,overlay:[{from:h.from,to:h.to}]}}}}return null})}const nr=122,pe=1,or=123,Qr=124,Je=2,cr=125,pr=3,ur=4,Fe=[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],dr=58,hr=40,He=95,fr=91,aO=45,$r=46,mr=35,gr=37,Pr=38,Sr=92,Zr=10,Xr=42;function I(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function GO(e){return e>=48&&e<=57}function ue(e){return GO(e)||e>=97&&e<=102||e>=65&&e<=70}const Ot=(e,O,a)=>(t,r)=>{for(let s=!1,i=0,l=0;;l++){let{next:n}=t;if(I(n)||n==aO||n==He||s&&GO(n))!s&&(n!=aO||l>0)&&(s=!0),i===l&&n==aO&&i++,t.advance();else if(n==Sr&&t.peek(1)!=Zr){if(t.advance(),ue(t.next)){do t.advance();while(ue(t.next));t.next==32&&t.advance()}else t.next>-1&&t.advance();s=!0}else{s&&t.acceptToken(i==2&&r.canShift(Je)?O:n==hr?a:e);break}}},kr=new k(Ot(or,Je,Qr)),br=new k(Ot(cr,pr,ur)),xr=new k(e=>{if(Fe.includes(e.peek(-1))){let{next:O}=e;(I(O)||O==He||O==mr||O==$r||O==Xr||O==fr||O==dr&&I(e.peek(1))||O==aO||O==Pr)&&e.acceptToken(nr)}}),yr=new k(e=>{if(!Fe.includes(e.peek(-1))){let{next:O}=e;if(O==gr&&(e.advance(),e.acceptToken(pe)),I(O)){do e.advance();while(I(e.next)||GO(e.next));e.acceptToken(pe)}}}),Tr=D({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,"MatchOp CompareOp":o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),wr={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},vr={__proto__:null,or:98,and:98,not:106,only:106,layer:170},Yr={__proto__:null,selector:112,layer:166},_r={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},zr={__proto__:null,to:207},qr=Y.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hwr[e]||-1},{term:125,get:e=>vr[e]||-1},{term:4,get:e=>Yr[e]||-1},{term:25,get:e=>_r[e]||-1},{term:123,get:e=>zr[e]||-1}],tokenPrec:1963});let $O=null;function mO(){if(!$O&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));$O=O.sort().map(t=>({type:"property",label:t,apply:t+": "}))}return $O||[]}const de=["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})),he=["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}))),Rr=["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})),jr=["@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-]*|)$/,Vr=/^-(-[\w-]*)?$/;function Wr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const fe=new qe,Gr=["Declaration"];function Cr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function et(e,O,a){if(O.to-O.from>4096){let t=fe.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(qO.IncludeAnonymous);if(i.firstChild())do for(let l of et(e,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Gr)&&((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),t.push({label:l,type:"variable"}))}}),t}}const Ur=e=>O=>{let{state:a,pos:t}=O,r=U(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:he,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:de,validFor:w};if(e(r)||(O.explicit||s)&&Wr(r,a.doc))return{from:e(r)||s?r.from:t,options:et(a.doc,Cr(r),e),validFor:Vr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:w};return{from:r.from,options:Rr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:jr,validFor:w};if(!O.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:de,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:he,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:w}:null},Ar=Ur(e=>e.name=="VariableName"),oO=B.define({name:"css",parser:qr.configure({props:[K.add({Declaration:R()}),J.add({"Block KeyframeList":RO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Er(){return new F(oO,oO.data.of({autocomplete:Ar}))}const Mr=316,Lr=317,$e=1,Ir=2,Nr=3,Dr=4,Br=318,Kr=320,Jr=321,Fr=5,Hr=6,Oi=0,yO=[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],tt=125,ei=59,TO=47,ti=42,ai=43,ri=45,ii=60,si=44,li=63,ni=46,oi=91,Qi=new Ce({start:!1,shift(e,O){return O==Fr||O==Hr||O==Kr?e:O==Jr},strict:!1}),ci=new k((e,O)=>{let{next:a}=e;(a==tt||a==-1||O.context)&&e.acceptToken(Br)},{contextual:!0,fallback:!0}),pi=new k((e,O)=>{let{next:a}=e,t;yO.indexOf(a)>-1||a==TO&&((t=e.peek(1))==TO||t==ti)||a!=tt&&a!=ei&&a!=-1&&!O.context&&e.acceptToken(Mr)},{contextual:!0}),ui=new k((e,O)=>{e.next==oi&&!O.context&&e.acceptToken(Lr)},{contextual:!0}),di=new k((e,O)=>{let{next:a}=e;if(a==ai||a==ri){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift($e);e.acceptToken(t?$e:Ir)}}else a==li&&e.peek(1)==ni&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Nr))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const hi=new k((e,O)=>{if(e.next!=ii||!O.dialectEnabled(Oi)||(e.advance(),e.next==TO))return;let a=0;for(;yO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;yO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==si)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(Dr,-a)}),fi=D({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case defer":o.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),"NewExpression/VariableName":o.className,PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer asserts":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),$i={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},mi={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},gi={__proto__:null,"<":193},Pi=Y.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&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%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out 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 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 defer 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:380,context:Qi,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[fi],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!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$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(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(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/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(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!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`$i&j!p),Q(Wp(Z!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`#v(Ch$i&j(Wp(Z!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_#v(Ch$i&j(Wp(Z!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_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&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(Z!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$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`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(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`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(Z!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^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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_!g$b$i&j$O)Lv(Wp(Z!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$i&j(Wp(Z!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#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!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_!q7`$i&j(Wp(Z!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|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$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$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$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:[pi,ui,di,hi,2,3,4,5,6,7,8,9,10,11,12,13,14,ci,new lO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!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(c~~",141,340),new lO("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>$i[e]||-1},{term:343,get:e=>mi[e]||-1},{term:95,get:e=>gi[e]||-1}],tokenPrec:15201}),at=[X("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),X("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),X("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),X("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),X(`try { +import{S as vt,i as Yt,s as _t,H as BO,h as zt,a1 as H,l as qt,u as Rt,w as jt,O as Vt,T as Wt,U as Gt,Q as Ct,J as Ut,y as At}from"./index-DjYVmtoM.js";import{P as Et,N as Mt,w as Lt,D as It,x as zO,T as eO,I as qO,y as Nt,z as D,A as o,L as B,B as K,F as J,G as R,H as RO,J as F,v as U,K as qe,M as X,E as q,O as Re,Q as je,R as Ve,U as Dt,V as Bt,W as Kt,X as We,Y as Jt,b as A,e as Ft,f as Ht,g as Oa,i as ea,j as ta,k as aa,l as ra,m as ia,r as sa,n as la,o as na,p as oa,C as OO,u as Qa,c as ca,d as pa,s as ua,h as da,a as ha,q as KO}from"./index-CN02J7Id.js";var JO={};class iO{constructor(O,a,t,r,s,i,l,n,c,u=0,Q){this.p=O,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=n,this.curContext=c,this.lookAhead=u,this.parent=Q}toString(){return`[${this.stack.filter((O,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(O,a,t=0){let r=O.parser.context;return new iO(O,[],a,t,t,0,[],0,r?new FO(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(O,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=O}reduce(O){var a;let t=O>>19,r=O&65535,{parser:s}=this.p,i=this.reducePos=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizen;)this.stack.pop();this.reduceContext(r,c)}storeNode(O,a,t,r=4,s=!1){if(O==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(O,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0){let l=!1;for(let n=i;n>0&&this.buffer[n-2]>t;n-=4)if(this.buffer[n-1]>=0){l=!0;break}if(l)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=O,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(O,a,t,r){if(O&131072)this.pushState(O&65535,this.pos);else if(O&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=O,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(O,a,t,r){O&65536?this.reduce(O):this.shift(O,a,t,r)}useNode(O,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=O)&&(this.p.reused.push(O),t++);let r=this.pos;this.reducePos=this.pos=r+O.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,O,this,this.p.stream.reset(this.pos-O.length)))}split(){let O=this,a=O.buffer.length;for(;a>0&&O.buffer[a-2]>O.reducePos;)a-=4;let t=O.buffer.slice(a),r=O.bufferBase+a;for(;O&&r==O.bufferBase;)O=O.parent;return new iO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,O)}recoverByDelete(O,a){let t=O<=this.p.parser.maxNode;t&&this.storeNode(O,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(O){for(let a=new fa(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,O);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(O){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;sn&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||O.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:O}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),O.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let n=i&65535,c=this.stack.length-l*3;if(c>=0&&O.getGoto(this.stack[c],n,!1)>=0)return l<<19|65536|n}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:O}=this.p;return O.data[O.stateSlot(this.state,1)]==65535&&!O.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(O){if(this.state!=O.state||this.stack.length!=O.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=O)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class FO{constructor(O,a){this.tracker=O,this.context=a,this.hash=O.strict?O.hash(a):0}}class fa{constructor(O){this.start=O,this.state=O.state,this.stack=O.stack,this.base=this.stack.length}reduce(O){let a=O&65535,t=O>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class sO{constructor(O,a,t){this.stack=O,this.pos=a,this.index=t,this.buffer=O.buffer,this.index==0&&this.maybeNext()}static create(O,a=O.bufferBase+O.buffer.length){return new sO(O,a,a-O.bufferBase)}maybeNext(){let O=this.stack.parent;O!=null&&(this.index=this.stack.bufferBase-O.bufferBase,this.stack=O,this.buffer=O.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new sO(this.stack,this.pos,this.index)}}function L(e,O=Uint16Array){if(typeof e!="string")return e;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let n=i-32;if(n>=46&&(n-=46,l=!0),s+=n,l)break;s*=46}a?a[r++]=s:a=new O(s)}return a}class tO{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const HO=new tO;class $a{constructor(O,a){this.input=O,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=HO,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(O,a){let t=this.range,r=this.rangeIndex,s=this.pos+O;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(O){if(O>=this.range.from&&OO)return Math.max(O,a.from);return this.end}peek(O){let a=this.chunkOff+O,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(O,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?O.slice(0,this.range.to-this.pos):O,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(O=1){for(this.chunkOff+=O;this.pos+O>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();O-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=O,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(O,a){if(a?(this.token=a,a.start=O,a.lookAhead=O+1,a.value=a.extended=-1):this.token=HO,this.pos!=O){if(this.pos=O,O==this.end)return this.setDone(),this;for(;O=this.range.to;)this.range=this.ranges[++this.rangeIndex];O>=this.chunkPos&&O=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(O-this.chunkPos,a-this.chunkPos);if(O>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(O-this.chunk2Pos,a-this.chunk2Pos);if(O>=this.range.from&&a<=this.range.to)return this.input.read(O,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>O&&(t+=this.input.read(Math.max(r.from,O),Math.min(r.to,a)))}return t}}class V{constructor(O,a){this.data=O,this.id=a}token(O,a){let{parser:t}=a.p;Ge(this.data,O,a,this.id,t.data,t.tokenPrecTable)}}V.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class lO{constructor(O,a,t){this.precTable=a,this.elseToken=t,this.data=typeof O=="string"?L(O):O}token(O,a){let t=O.pos,r=0;for(;;){let s=O.next<0,i=O.resolveOffset(1,1);if(Ge(this.data,O,a,0,this.data,this.precTable),O.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;O.reset(i,O.token)}r&&(O.reset(t,O.token),O.acceptToken(this.elseToken,r))}}lO.prototype.contextual=V.prototype.fallback=V.prototype.extend=!1;class k{constructor(O,a={}){this.token=O,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function Ge(e,O,a,t,r,s){let i=0,l=1<0){let h=e[p];if(n.allows(h)&&(O.token.value==-1||O.token.value==h||ma(h,O.token.value,r,s))){O.acceptToken(h);break}}let u=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>1,h=c+p+(p<<1),m=e[h],g=e[h+1]||65536;if(u=g)Q=p+1;else{i=e[h+2],O.advance();continue O}}break}}function Oe(e,O,a){for(let t=O,r;(r=e[t])!=65535;t++)if(r==a)return t-O;return-1}function ma(e,O,a,t){let r=Oe(a,t,O);return r<0||Oe(a,t,e)O)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,O-25)):Math.min(e.length,Math.max(t.from+1,O+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:e.length}}class ga{constructor(O,a){this.fragments=O,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let O=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(O){for(this.safeFrom=O.openStart?ee(O.tree,O.from+O.offset,1)-O.offset:O.from,this.safeTo=O.openEnd?ee(O.tree,O.to+O.offset,-1)-O.offset:O.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(O.tree),this.start.push(-O.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(O){if(OO)return this.nextStart=i,null;if(s instanceof eO){if(i==O){if(i=Math.max(this.safeFrom,O)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class Pa{constructor(O,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=O.tokenizers.map(t=>new tO)}getActions(O){let a=0,t=null,{parser:r}=O.p,{tokenizers:s}=r,i=r.stateSlot(O.state,3),l=O.curContext?O.curContext.hash:0,n=0;for(let c=0;cQ.end+25&&(n=Math.max(Q.lookAhead,n)),Q.value!=0)){let f=a;if(Q.extended>-1&&(a=this.addActions(O,Q.extended,Q.end,a)),a=this.addActions(O,Q.value,Q.end,a),!u.extend&&(t=Q,a>f))break}}for(;this.actions.length>a;)this.actions.pop();return n&&O.setLookAhead(n),!t&&O.pos==this.stream.end&&(t=new tO,t.value=O.p.parser.eofTerm,t.start=t.end=O.pos,a=this.addActions(O,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(O){if(this.mainToken)return this.mainToken;let a=new tO,{pos:t,p:r}=O;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(O,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,O),t),O.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(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,a,t,r){for(let s=0;sO.bufferLength*4?new ga(t,O.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let O=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&O.length==1){let[i]=O;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,O))continue;{r||(r=[],s=[]),r.push(l);let n=this.tokens.getMainToken(l);s.push(n.value,n.end)}}break}}if(!t.length){let i=r&&Xa(r);if(i)return b&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw b&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return b&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,n)=>n.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){O:for(let i=0;i500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)t.splice(n--,1);else{t.splice(i--,1);continue O}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return O.forceReduce()?O:null;if(this.fragments){let c=O.curContext&&O.curContext.tracker.strict,u=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(zO.contextHash)||0)==u))return O.useNode(Q,f),b&&console.log(i+this.stackID(O)+` (via reuse of ${s.getName(Q.type.id)})`),!0;if(!(Q instanceof eO)||Q.children.length==0||Q.positions[0]>0)break;let p=Q.children[0];if(p instanceof eO&&Q.positions[0]==0)Q=p;else break}}let l=s.stateSlot(O.state,4);if(l>0)return O.reduce(l),b&&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 n=this.tokens.getActions(O);for(let c=0;cr?a.push(h):t.push(h)}return!1}advanceFully(O,a){let t=O.pos;for(;;){if(!this.advanceStack(O,null,null))return!1;if(O.pos>t)return te(O,a),!0}}runRecovery(O,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),b&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let Q=l.split(),f=u;for(let p=0;Q.forceReduce()&&p<10&&(b&&console.log(f+this.stackID(Q)+" (via force-reduce)"),!this.advanceFully(Q,t));p++)b&&(f=this.stackID(Q)+" -> ");for(let p of l.recoverByInsert(n))b&&console.log(u+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(c==l.pos&&(c++,n=0),l.recoverByDelete(n,c),b&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(n)})`),te(l,t)):(!r||r.scoree;class Ce{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 Y extends Et{constructor(O){if(super(),this.wrappers=[],O.version!=14)throw new RangeError(`Parser version (${O.version}) doesn't match runtime version (14)`);let a=O.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;lO.topRules[l][1]),r=[];for(let l=0;l=0)s(u,n,l[c++]);else{let Q=l[c+-u];for(let f=-u;f>0;f--)s(l[c++],n,Q);c++}}}this.nodeSet=new Mt(a.map((l,n)=>Lt.define({name:n>=this.minRepeatTerm?void 0:l,id:n,props:r[n],top:t.indexOf(n)>-1,error:n==0,skipped:O.skippedNodes&&O.skippedNodes.indexOf(n)>-1}))),O.propSources&&(this.nodeSet=this.nodeSet.extend(...O.propSources)),this.strict=!1,this.bufferLength=It;let i=L(O.tokenData);this.context=O.context,this.specializerSpecs=O.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new V(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,a,t){let r=new Sa(this,O,a,t);for(let s of this.wrappers)r=s(r,O,a,t);return r}getGoto(O,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,n=r[s++];if(l&&t)return n;for(let c=s+(i>>1);s0}validAction(O,a){return!!this.allActions(O,t=>t==a?!0:null)}allActions(O,a){let t=this.stateSlot(O,4),r=t?a(t):void 0;for(let s=this.stateSlot(O,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=v(this.data,s+2);else break;r=a(v(this.data,s+1))}return r}nextStates(O){let a=[];for(let t=this.stateSlot(O,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=v(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(O){let a=Object.assign(Object.create(Y.prototype),this);if(O.props&&(a.nodeSet=this.nodeSet.extend(...O.props)),O.top){let t=this.topRules[O.top];if(!t)throw new RangeError(`Invalid top rule name ${O.top}`);a.top=t}return O.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=O.tokenizers.find(s=>s.from==t);return r?r.to:t})),O.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=O.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=ae(i),i})),O.contextTracker&&(a.context=O.contextTracker),O.dialect&&(a.dialect=this.parseDialect(O.dialect)),O.strict!=null&&(a.strict=O.strict),O.wrap&&(a.wrappers=a.wrappers.concat(O.wrap)),O.bufferLength!=null&&(a.bufferLength=O.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(O){return this.termNames?this.termNames[O]:String(O<=this.maxNode&&this.nodeSet.types[O].name||O)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(O){let a=this.dynamicPrecedences;return a==null?0:a[O]||0}parseDialect(O){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(O)for(let s of O.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!O||O.scoree.external(a,t)<<1|O}return e.get}const ka=55,ba=1,xa=56,ya=2,Ta=57,wa=3,re=4,va=5,jO=6,Ue=7,Ae=8,Ee=9,Me=10,Ya=11,_a=12,za=13,hO=58,qa=14,Ra=15,ie=59,Le=21,ja=23,Ie=24,Va=25,bO=27,Ne=28,Wa=29,Ga=32,Ca=35,Ua=37,Aa=38,Ea=0,Ma=1,La={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},Ia={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},se={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Na(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let le=null,ne=null,oe=0;function xO(e,O){let a=e.pos+O;if(oe==a&&ne==e)return le;let t=e.peek(O),r="";for(;Na(t);)r+=String.fromCharCode(t),t=e.peek(++O);return ne=e,oe=a,le=r?r.toLowerCase():t==Da||t==Ba?void 0:null}const De=60,nO=62,VO=47,Da=63,Ba=33,Ka=45;function Qe(e,O){this.name=e,this.parent=O}const Ja=[jO,Me,Ue,Ae,Ee],Fa=new Ce({start:null,shift(e,O,a,t){return Ja.indexOf(O)>-1?new Qe(xO(t,1)||"",e):e},reduce(e,O){return O==Le&&e?e.parent:e},reuse(e,O,a,t){let r=O.type.id;return r==jO||r==Ua?new Qe(xO(t,1)||"",e):e},strict:!1}),Ha=new k((e,O)=>{if(e.next!=De){e.next<0&&O.context&&e.acceptToken(hO);return}e.advance();let a=e.next==VO;a&&e.advance();let t=xO(e,0);if(t===void 0)return;if(!t)return e.acceptToken(a?Ra:qa);let r=O.context?O.context.name:null;if(a){if(t==r)return e.acceptToken(Ya);if(r&&Ia[r])return e.acceptToken(hO,-2);if(O.dialectEnabled(Ea))return e.acceptToken(_a);for(let s=O.context;s;s=s.parent)if(s.name==t)return;e.acceptToken(za)}else{if(t=="script")return e.acceptToken(Ue);if(t=="style")return e.acceptToken(Ae);if(t=="textarea")return e.acceptToken(Ee);if(La.hasOwnProperty(t))return e.acceptToken(Me);r&&se[r]&&se[r][t]?e.acceptToken(hO,-1):e.acceptToken(jO)}},{contextual:!0}),Or=new k(e=>{for(let O=0,a=0;;a++){if(e.next<0){a&&e.acceptToken(ie);break}if(e.next==Ka)O++;else if(e.next==nO&&O>=2){a>=3&&e.acceptToken(ie,-2);break}else O=0;e.advance()}});function er(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const tr=new k((e,O)=>{if(e.next==VO&&e.peek(1)==nO){let a=O.dialectEnabled(Ma)||er(O.context);e.acceptToken(a?va:re,2)}else e.next==nO&&e.acceptToken(re,1)});function WO(e,O,a){let t=2+e.length;return new k(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(O);break}if(s==0&&r.next==De||s==1&&r.next==VO||s>=2&&si?r.acceptToken(O,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(O,1);break}else s=i=0;r.advance()}})}const ar=WO("script",ka,ba),rr=WO("style",xa,ya),ir=WO("textarea",Ta,wa),sr=D({"Text RawText IncompleteTag IncompleteCloseTag":o.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":o.angleBracket,TagName:o.tagName,"MismatchedCloseTag/TagName":[o.tagName,o.invalid],AttributeName:o.attributeName,"AttributeValue UnquotedAttributeValue":o.attributeValue,Is:o.definitionOperator,"EntityReference CharacterReference":o.character,Comment:o.blockComment,ProcessingInst:o.processingInstruction,DoctypeDecl:o.documentMeta}),lr=Y.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^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 IncompleteTag 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:68,context:Fa,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[sr],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[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!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@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@TalWOX@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!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@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!_DsbiSlWc!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!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$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_kiSaPlW!b`!dpOX$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_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$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!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*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!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,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!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!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!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=l.type.id;if(c==Wa)return fO(l,n,a);if(c==Ga)return fO(l,n,t);if(c==Ca)return fO(l,n,r);if(c==Le&&s.length){let u=l.node,Q=u.firstChild,f=Q&&ce(Q,n),p;if(f){for(let h of s)if(h.tag==f&&(!h.attrs||h.attrs(p||(p=Be(Q,n))))){let m=u.lastChild,g=m.type.id==Aa?m.from:u.to;if(g>Q.to)return{parser:h.parser,overlay:[{from:Q.to,to:g}]}}}}if(i&&c==Ie){let u=l.node,Q;if(Q=u.firstChild){let f=i[n.read(Q.from,Q.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=ce(u.parent,n))continue;let h=u.lastChild;if(h.type.id==bO){let m=h.from+1,g=h.lastChild,Z=h.to-(g&&g.isError?0:1);if(Z>m)return{parser:p.parser,overlay:[{from:m,to:Z}]}}else if(h.type.id==Ne)return{parser:p.parser,overlay:[{from:h.from,to:h.to}]}}}}return null})}const nr=122,pe=1,or=123,Qr=124,Je=2,cr=125,pr=3,ur=4,Fe=[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],dr=58,hr=40,He=95,fr=91,aO=45,$r=46,mr=35,gr=37,Pr=38,Sr=92,Zr=10,Xr=42;function I(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function GO(e){return e>=48&&e<=57}function ue(e){return GO(e)||e>=97&&e<=102||e>=65&&e<=70}const Ot=(e,O,a)=>(t,r)=>{for(let s=!1,i=0,l=0;;l++){let{next:n}=t;if(I(n)||n==aO||n==He||s&&GO(n))!s&&(n!=aO||l>0)&&(s=!0),i===l&&n==aO&&i++,t.advance();else if(n==Sr&&t.peek(1)!=Zr){if(t.advance(),ue(t.next)){do t.advance();while(ue(t.next));t.next==32&&t.advance()}else t.next>-1&&t.advance();s=!0}else{s&&t.acceptToken(i==2&&r.canShift(Je)?O:n==hr?a:e);break}}},kr=new k(Ot(or,Je,Qr)),br=new k(Ot(cr,pr,ur)),xr=new k(e=>{if(Fe.includes(e.peek(-1))){let{next:O}=e;(I(O)||O==He||O==mr||O==$r||O==Xr||O==fr||O==dr&&I(e.peek(1))||O==aO||O==Pr)&&e.acceptToken(nr)}}),yr=new k(e=>{if(!Fe.includes(e.peek(-1))){let{next:O}=e;if(O==gr&&(e.advance(),e.acceptToken(pe)),I(O)){do e.advance();while(I(e.next)||GO(e.next));e.acceptToken(pe)}}}),Tr=D({"AtKeyword import charset namespace keyframes media supports":o.definitionKeyword,"from to selector":o.keyword,NamespaceName:o.namespace,KeyframeName:o.labelName,KeyframeRangeName:o.operatorKeyword,TagName:o.tagName,ClassName:o.className,PseudoClassName:o.constant(o.className),IdName:o.labelName,"FeatureName PropertyName":o.propertyName,AttributeName:o.attributeName,NumberLiteral:o.number,KeywordQuery:o.keyword,UnaryQueryOp:o.operatorKeyword,"CallTag ValueName":o.atom,VariableName:o.variableName,Callee:o.operatorKeyword,Unit:o.unit,"UniversalSelector NestingSelector":o.definitionOperator,"MatchOp CompareOp":o.compareOperator,"ChildOp SiblingOp, LogicOp":o.logicOperator,BinOp:o.arithmeticOperator,Important:o.modifier,Comment:o.blockComment,ColorLiteral:o.color,"ParenthesizedContent StringLiteral":o.string,":":o.punctuation,"PseudoOp #":o.derefOperator,"; ,":o.separator,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace}),wr={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},vr={__proto__:null,or:98,and:98,not:106,only:106,layer:170},Yr={__proto__:null,selector:112,layer:166},_r={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},zr={__proto__:null,to:207},qr=Y.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mOPQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!hO[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hyS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!hwr[e]||-1},{term:125,get:e=>vr[e]||-1},{term:4,get:e=>Yr[e]||-1},{term:25,get:e=>_r[e]||-1},{term:123,get:e=>zr[e]||-1}],tokenPrec:1963});let $O=null;function mO(){if(!$O&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],a=new Set;for(let t in e)t!="cssText"&&t!="cssFloat"&&typeof e[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(O.push(t),a.add(t)));$O=O.sort().map(t=>({type:"property",label:t,apply:t+": "}))}return $O||[]}const de=["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})),he=["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}))),Rr=["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})),jr=["@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-]*|)$/,Vr=/^-(-[\w-]*)?$/;function Wr(e,O){var a;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let t=(a=e.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:O.sliceString(t.from,t.to)=="var"}const fe=new qe,Gr=["Declaration"];function Cr(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function et(e,O,a){if(O.to-O.from>4096){let t=fe.get(O);if(t)return t;let r=[],s=new Set,i=O.cursor(qO.IncludeAnonymous);if(i.firstChild())do for(let l of et(e,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return fe.set(O,r),r}else{let t=[],r=new Set;return O.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Gr)&&((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),t.push({label:l,type:"variable"}))}}),t}}const Ur=e=>O=>{let{state:a,pos:t}=O,r=U(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:mO(),validFor:w};if(r.name=="ValueName")return{from:r.from,options:he,validFor:w};if(r.name=="PseudoClassName")return{from:r.from,options:de,validFor:w};if(e(r)||(O.explicit||s)&&Wr(r,a.doc))return{from:e(r)||s?r.from:t,options:et(a.doc,Cr(r),e),validFor:Vr};if(r.name=="TagName"){for(let{parent:n}=r;n;n=n.parent)if(n.name=="Block")return{from:r.from,options:mO(),validFor:w};return{from:r.from,options:Rr,validFor:w}}if(r.name=="AtKeyword")return{from:r.from,options:jr,validFor:w};if(!O.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:de,validFor:w}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:he,validFor:w}:i.name=="Block"||i.name=="Styles"?{from:t,options:mO(),validFor:w}:null},Ar=Ur(e=>e.name=="VariableName"),oO=B.define({name:"css",parser:qr.configure({props:[K.add({Declaration:R()}),J.add({"Block KeyframeList":RO})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Er(){return new F(oO,oO.data.of({autocomplete:Ar}))}const Mr=316,Lr=317,$e=1,Ir=2,Nr=3,Dr=4,Br=318,Kr=320,Jr=321,Fr=5,Hr=6,Oi=0,yO=[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],tt=125,ei=59,TO=47,ti=42,ai=43,ri=45,ii=60,si=44,li=63,ni=46,oi=91,Qi=new Ce({start:!1,shift(e,O){return O==Fr||O==Hr||O==Kr?e:O==Jr},strict:!1}),ci=new k((e,O)=>{let{next:a}=e;(a==tt||a==-1||O.context)&&e.acceptToken(Br)},{contextual:!0,fallback:!0}),pi=new k((e,O)=>{let{next:a}=e,t;yO.indexOf(a)>-1||a==TO&&((t=e.peek(1))==TO||t==ti)||a!=tt&&a!=ei&&a!=-1&&!O.context&&e.acceptToken(Mr)},{contextual:!0}),ui=new k((e,O)=>{e.next==oi&&!O.context&&e.acceptToken(Lr)},{contextual:!0}),di=new k((e,O)=>{let{next:a}=e;if(a==ai||a==ri){if(e.advance(),a==e.next){e.advance();let t=!O.context&&O.canShift($e);e.acceptToken(t?$e:Ir)}}else a==li&&e.peek(1)==ni&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(Nr))},{contextual:!0});function gO(e,O){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!O&&e>=48&&e<=57}const hi=new k((e,O)=>{if(e.next!=ii||!O.dialectEnabled(Oi)||(e.advance(),e.next==TO))return;let a=0;for(;yO.indexOf(e.next)>-1;)e.advance(),a++;if(gO(e.next,!0)){for(e.advance(),a++;gO(e.next,!1);)e.advance(),a++;for(;yO.indexOf(e.next)>-1;)e.advance(),a++;if(e.next==si)return;for(let t=0;;t++){if(t==7){if(!gO(e.next,!0))return;break}if(e.next!="extends".charCodeAt(t))break;e.advance(),a++}}e.acceptToken(Dr,-a)}),fi=D({"get set async static":o.modifier,"for while do if else switch try catch finally return throw break continue default case defer":o.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":o.operatorKeyword,"let var const using function class extends":o.definitionKeyword,"import export from":o.moduleKeyword,"with debugger new":o.keyword,TemplateString:o.special(o.string),super:o.atom,BooleanLiteral:o.bool,this:o.self,null:o.null,Star:o.modifier,VariableName:o.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":o.function(o.variableName),VariableDefinition:o.definition(o.variableName),Label:o.labelName,PropertyName:o.propertyName,PrivatePropertyName:o.special(o.propertyName),"CallExpression/MemberExpression/PropertyName":o.function(o.propertyName),"FunctionDeclaration/VariableDefinition":o.function(o.definition(o.variableName)),"ClassDeclaration/VariableDefinition":o.definition(o.className),"NewExpression/VariableName":o.className,PropertyDefinition:o.definition(o.propertyName),PrivatePropertyDefinition:o.definition(o.special(o.propertyName)),UpdateOp:o.updateOperator,"LineComment Hashbang":o.lineComment,BlockComment:o.blockComment,Number:o.number,String:o.string,Escape:o.escape,ArithOp:o.arithmeticOperator,LogicOp:o.logicOperator,BitOp:o.bitwiseOperator,CompareOp:o.compareOperator,RegExp:o.regexp,Equals:o.definitionOperator,Arrow:o.function(o.punctuation),": Spread":o.punctuation,"( )":o.paren,"[ ]":o.squareBracket,"{ }":o.brace,"InterpolationStart InterpolationEnd":o.special(o.brace),".":o.derefOperator,", ;":o.separator,"@":o.meta,TypeName:o.typeName,TypeDefinition:o.definition(o.typeName),"type enum interface implements namespace module declare":o.definitionKeyword,"abstract global Privacy readonly override":o.modifier,"is keyof unique infer asserts":o.operatorKeyword,JSXAttributeValue:o.attributeValue,JSXText:o.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":o.angleBracket,"JSXIdentifier JSXNameSpacedName":o.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":o.attributeName,"JSXBuiltin/JSXIdentifier":o.standard(o.tagName)}),$i={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},mi={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},gi={__proto__:null,"<":193},Pi=Y.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&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%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'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%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out 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 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 defer 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:380,context:Qi,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[fi],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!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$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(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(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/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(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!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`$i&j!p),Q(Wp(Z!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`#v(Ch$i&j(Wp(Z!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_#v(Ch$i&j(Wp(Z!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_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&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(Z!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$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`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(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`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(Z!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^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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$i&j(Wp(Z!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$i&j(Wp(Z!bs'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_!g$b$i&j$O)Lv(Wp(Z!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$i&j(Wp(Z!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#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!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_!q7`$i&j(Wp(Z!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|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$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$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$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:[pi,ui,di,hi,2,3,4,5,6,7,8,9,10,11,12,13,14,ci,new lO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!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(c~~",141,340),new lO("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:e=>$i[e]||-1},{term:343,get:e=>mi[e]||-1},{term:95,get:e=>gi[e]||-1}],tokenPrec:15201}),at=[X("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),X("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),X("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),X("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),X("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),X(`try { \${} } catch (\${error}) { \${} diff --git a/ui/dist/assets/CreateApiDocs-lXFE62xH.js b/ui/dist/assets/CreateApiDocs-ChXbrqJd.js similarity index 99% rename from ui/dist/assets/CreateApiDocs-lXFE62xH.js rename to ui/dist/assets/CreateApiDocs-ChXbrqJd.js index 81f0e88b..58e90a6b 100644 --- a/ui/dist/assets/CreateApiDocs-lXFE62xH.js +++ b/ui/dist/assets/CreateApiDocs-ChXbrqJd.js @@ -1,4 +1,4 @@ -import{S as $t,i as qt,s as Tt,V as St,X as ce,W as Ct,h as o,d as $e,t as he,a as ve,I as ae,Z as Ne,_ as pt,C as Mt,$ as Pt,D as Lt,l as r,n as i,m as qe,u as a,A as b,v as p,c as Te,w,J as we,p as Ft,k as Se,o as Ht,L as Ot,H as fe}from"./index-ChXAaRxB.js";import{F as Rt}from"./FieldsQueryParam-BPQKDixm.js";function mt(s,e,t){const l=s.slice();return l[10]=e[t],l}function bt(s,e,t){const l=s.slice();return l[10]=e[t],l}function _t(s,e,t){const l=s.slice();return l[15]=e[t],l}function kt(s){let e;return{c(){e=a("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function yt(s){let e,t,l,c,f,u,_,m,q,y,g,B,S,$,R,P,I,D,M,W,L,T,k,F,ee,z,U,oe,K,X,Y;function ue(h,C){var N,x,O;return C&1&&(u=null),u==null&&(u=!!((O=(x=(N=h[0])==null?void 0:N.fields)==null?void 0:x.find(Yt))!=null&&O.required)),u?Bt:At}let te=ue(s,-1),E=te(s);function Z(h,C){var N,x,O;return C&1&&(I=null),I==null&&(I=!!((O=(x=(N=h[0])==null?void 0:N.fields)==null?void 0:x.find(Xt))!=null&&O.required)),I?Nt:Vt}let G=Z(s,-1),H=G(s);return{c(){e=a("tr"),e.innerHTML='Auth specific fields',t=p(),l=a("tr"),c=a("td"),f=a("div"),E.c(),_=p(),m=a("span"),m.textContent="email",q=p(),y=a("td"),y.innerHTML='String',g=p(),B=a("td"),B.textContent="Auth record email address.",S=p(),$=a("tr"),R=a("td"),P=a("div"),H.c(),D=p(),M=a("span"),M.textContent="emailVisibility",W=p(),L=a("td"),L.innerHTML='Boolean',T=p(),k=a("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",F=p(),ee=a("tr"),ee.innerHTML='
Required password
String Auth record password.',z=p(),U=a("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',oe=p(),K=a("tr"),K.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not. +import{S as $t,i as qt,s as Tt,V as St,X as ce,W as Ct,h as o,d as $e,t as he,a as ve,I as ae,Z as Ne,_ as pt,C as Mt,$ as Pt,D as Lt,l as r,n as i,m as qe,u as a,A as b,v as p,c as Te,w,J as we,p as Ft,k as Se,o as Ht,L as Ot,H as fe}from"./index-DjYVmtoM.js";import{F as Rt}from"./FieldsQueryParam-BiUsK6GB.js";function mt(s,e,t){const l=s.slice();return l[10]=e[t],l}function bt(s,e,t){const l=s.slice();return l[10]=e[t],l}function _t(s,e,t){const l=s.slice();return l[15]=e[t],l}function kt(s){let e;return{c(){e=a("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",w(e,"class","txt-hint txt-sm txt-right")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function yt(s){let e,t,l,c,f,u,_,m,q,y,g,B,S,$,R,P,I,D,M,W,L,T,k,F,ee,z,U,oe,K,X,Y;function ue(h,C){var N,x,O;return C&1&&(u=null),u==null&&(u=!!((O=(x=(N=h[0])==null?void 0:N.fields)==null?void 0:x.find(Yt))!=null&&O.required)),u?Bt:At}let te=ue(s,-1),E=te(s);function Z(h,C){var N,x,O;return C&1&&(I=null),I==null&&(I=!!((O=(x=(N=h[0])==null?void 0:N.fields)==null?void 0:x.find(Xt))!=null&&O.required)),I?Nt:Vt}let G=Z(s,-1),H=G(s);return{c(){e=a("tr"),e.innerHTML='Auth specific fields',t=p(),l=a("tr"),c=a("td"),f=a("div"),E.c(),_=p(),m=a("span"),m.textContent="email",q=p(),y=a("td"),y.innerHTML='String',g=p(),B=a("td"),B.textContent="Auth record email address.",S=p(),$=a("tr"),R=a("td"),P=a("div"),H.c(),D=p(),M=a("span"),M.textContent="emailVisibility",W=p(),L=a("td"),L.innerHTML='Boolean',T=p(),k=a("td"),k.textContent="Whether to show/hide the auth record email when fetching the record data.",F=p(),ee=a("tr"),ee.innerHTML='
Required password
String Auth record password.',z=p(),U=a("tr"),U.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',oe=p(),K=a("tr"),K.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
This field can be set only by superusers or auth records with "Manage" access.`,X=p(),Y=a("tr"),Y.innerHTML='Other fields',w(f,"class","inline-flex"),w(P,"class","inline-flex")},m(h,C){r(h,e,C),r(h,t,C),r(h,l,C),i(l,c),i(c,f),E.m(f,null),i(f,_),i(f,m),i(l,q),i(l,y),i(l,g),i(l,B),r(h,S,C),r(h,$,C),i($,R),i(R,P),H.m(P,null),i(P,D),i(P,M),i($,W),i($,L),i($,T),i($,k),r(h,F,C),r(h,ee,C),r(h,z,C),r(h,U,C),r(h,oe,C),r(h,K,C),r(h,X,C),r(h,Y,C)},p(h,C){te!==(te=ue(h,C))&&(E.d(1),E=te(h),E&&(E.c(),E.m(f,_))),G!==(G=Z(h,C))&&(H.d(1),H=G(h),H&&(H.c(),H.m(P,D)))},d(h){h&&(o(e),o(t),o(l),o(S),o($),o(F),o(ee),o(z),o(U),o(oe),o(K),o(X),o(Y)),E.d(),H.d()}}}function At(s){let e;return{c(){e=a("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function Bt(s){let e;return{c(){e=a("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function Vt(s){let e;return{c(){e=a("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function Nt(s){let e;return{c(){e=a("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function jt(s){let e;return{c(){e=a("span"),e.textContent="Required",w(e,"class","label label-success")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function Jt(s){let e;return{c(){e=a("span"),e.textContent="Optional",w(e,"class","label label-warning")},m(t,l){r(t,e,l)},d(t){t&&o(e)}}}function Dt(s){let e,t=s[15].maxSelect===1?"id":"ids",l,c;return{c(){e=b("Relation record "),l=b(t),c=b(".")},m(f,u){r(f,e,u),r(f,l,u),r(f,c,u)},p(f,u){u&32&&t!==(t=f[15].maxSelect===1?"id":"ids")&&ae(l,t)},d(f){f&&(o(e),o(l),o(c))}}}function Et(s){let e,t,l,c,f,u,_,m,q;return{c(){e=b("File object."),t=a("br"),l=b(` Set to empty value (`),c=a("code"),c.textContent="null",f=b(", "),u=a("code"),u.textContent='""',_=b(" or "),m=a("code"),m.textContent="[]",q=b(`) to delete diff --git a/ui/dist/assets/DeleteApiDocs-CtgDyQsc.js b/ui/dist/assets/DeleteApiDocs-Lgq-jakm.js similarity index 98% rename from ui/dist/assets/DeleteApiDocs-CtgDyQsc.js rename to ui/dist/assets/DeleteApiDocs-Lgq-jakm.js index c56262b2..c6a16980 100644 --- a/ui/dist/assets/DeleteApiDocs-CtgDyQsc.js +++ b/ui/dist/assets/DeleteApiDocs-Lgq-jakm.js @@ -1,4 +1,4 @@ -import{S as Re,i as Ee,s as Pe,V as Te,X as j,h as p,d as De,t as te,a as le,I as ee,Z as he,_ as Be,C as Ie,$ as Oe,D as Ae,l as f,n as i,m as Ce,u as c,A as $,v as k,c as we,w as m,J as Me,p as qe,k as z,o as Le,W as Se}from"./index-ChXAaRxB.js";function ke(a,l,s){const n=a.slice();return n[6]=l[s],n}function ge(a,l,s){const n=a.slice();return n[6]=l[s],n}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,n){f(s,l,n)},d(s){s&&p(l)}}}function $e(a,l){let s,n,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(o,d){f(o,s,d),n||(h=Le(s,"click",r),n=!0)},p(o,d){l=o,d&20&&z(s,"active",l[2]===l[6].code)},d(o){o&&p(s),n=!1,h()}}}function ye(a,l){let s,n,h,r;return n=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),we(n.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(o,d){f(o,s,d),Ce(n,s,null),i(s,h),r=!0},p(o,d){l=o,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(o){r||(le(n.$$.fragment,o),r=!0)},o(o){te(n.$$.fragment,o),r=!1},d(o){o&&p(s),De(n)}}}function He(a){var fe,me;let l,s,n=a[0].name+"",h,r,o,d,y,D,F,q=a[0].name+"",J,se,K,C,N,P,V,g,L,ae,S,E,ne,W,H=a[0].name+"",X,oe,Z,ie,G,T,Q,B,Y,I,x,w,O,v=[],ce=new Map,re,A,b=[],de=new Map,R;C=new Te({props:{js:` +import{S as Re,i as Ee,s as Pe,V as Te,X as j,h as p,d as De,t as te,a as le,I as ee,Z as he,_ as Be,C as Ie,$ as Oe,D as Ae,l as f,n as i,m as Ce,u as c,A as $,v as k,c as we,w as m,J as Me,p as qe,k as z,o as Le,W as Se}from"./index-DjYVmtoM.js";function ke(a,l,s){const n=a.slice();return n[6]=l[s],n}function ge(a,l,s){const n=a.slice();return n[6]=l[s],n}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires superuser Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,n){f(s,l,n)},d(s){s&&p(l)}}}function $e(a,l){let s,n,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(o,d){f(o,s,d),n||(h=Le(s,"click",r),n=!0)},p(o,d){l=o,d&20&&z(s,"active",l[2]===l[6].code)},d(o){o&&p(s),n=!1,h()}}}function ye(a,l){let s,n,h,r;return n=new Se({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),we(n.$$.fragment),h=k(),m(s,"class","tab-item"),z(s,"active",l[2]===l[6].code),this.first=s},m(o,d){f(o,s,d),Ce(n,s,null),i(s,h),r=!0},p(o,d){l=o,(!r||d&20)&&z(s,"active",l[2]===l[6].code)},i(o){r||(le(n.$$.fragment,o),r=!0)},o(o){te(n.$$.fragment,o),r=!1},d(o){o&&p(s),De(n)}}}function He(a){var fe,me;let l,s,n=a[0].name+"",h,r,o,d,y,D,F,q=a[0].name+"",J,se,K,C,N,P,V,g,L,ae,S,E,ne,W,H=a[0].name+"",X,oe,Z,ie,G,T,Q,B,Y,I,x,w,O,v=[],ce=new Map,re,A,b=[],de=new Map,R;C=new Te({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/EmailChangeDocs-BH4CkQJs.js b/ui/dist/assets/EmailChangeDocs-DckvBZz5.js similarity index 99% rename from ui/dist/assets/EmailChangeDocs-BH4CkQJs.js rename to ui/dist/assets/EmailChangeDocs-DckvBZz5.js index 1008daca..2536a2dc 100644 --- a/ui/dist/assets/EmailChangeDocs-BH4CkQJs.js +++ b/ui/dist/assets/EmailChangeDocs-DckvBZz5.js @@ -1,4 +1,4 @@ -import{S as se,i as oe,s as ie,X as K,h as g,t as X,a as V,I as F,Z as le,_ as Re,C as ne,$ as Se,D as ae,l as v,n as u,u as p,v as y,A as U,w as b,k as Y,o as ce,W as Oe,d as x,m as ee,c as te,V as Me,Y as _e,J as Be,p as De,a0 as be}from"./index-ChXAaRxB.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(k,q){v(k,t,q),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,q){e=k,q&4&&l!==(l=e[4].code+"")&&F(d,l),q&6&&Y(t,"active",e[1]===e[4].code)},d(k){k&&g(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"),te(l.$$.fragment),d=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(r,a){v(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&Y(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&g(t),x(l)}}}function Ne(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,q,G,H,J,L,z,B,D,S,N,A=[],O=new Map,P,j,T=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);W.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=y(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),q=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",J=y(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as oe,s as ie,X as K,h as g,t as X,a as V,I as F,Z as le,_ as Re,C as ne,$ as Se,D as ae,l as v,n as u,u as p,v as y,A as U,w as b,k as Y,o as ce,W as Oe,d as x,m as ee,c as te,V as Me,Y as _e,J as Be,p as De,a0 as be}from"./index-DjYVmtoM.js";function ge(n,e,t){const l=n.slice();return l[4]=e[t],l}function ve(n,e,t){const l=n.slice();return l[4]=e[t],l}function ke(n,e){let t,l=e[4].code+"",d,i,r,a;function m(){return e[3](e[4])}return{key:n,first:null,c(){t=p("button"),d=U(l),i=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(k,q){v(k,t,q),u(t,d),u(t,i),r||(a=ce(t,"click",m),r=!0)},p(k,q){e=k,q&4&&l!==(l=e[4].code+"")&&F(d,l),q&6&&Y(t,"active",e[1]===e[4].code)},d(k){k&&g(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"),te(l.$$.fragment),d=y(),b(t,"class","tab-item"),Y(t,"active",e[1]===e[4].code),this.first=t},m(r,a){v(r,t,a),ee(l,t,null),u(t,d),i=!0},p(r,a){e=r;const m={};a&4&&(m.content=e[4].body),l.$set(m),(!i||a&6)&&Y(t,"active",e[1]===e[4].code)},i(r){i||(V(l.$$.fragment,r),i=!0)},o(r){X(l.$$.fragment,r),i=!1},d(r){r&&g(t),x(l)}}}function Ne(n){let e,t,l,d,i,r,a,m=n[0].name+"",k,q,G,H,J,L,z,B,D,S,N,A=[],O=new Map,P,j,T=[],W=new Map,w,E=K(n[2]);const M=c=>c[4].code;for(let c=0;cc[4].code;for(let c=0;c<_.length;c+=1){let f=ge(n,_,c),s=Z(f);W.set(s,T[c]=$e(s,f))}return{c(){e=p("div"),t=p("strong"),t.textContent="POST",l=y(),d=p("div"),i=p("p"),r=U("/api/collections/"),a=p("strong"),k=U(m),q=U("/confirm-email-change"),G=y(),H=p("div"),H.textContent="Body Parameters",J=y(),L=p("table"),L.innerHTML='Param Type Description
Required token
String The token from the change email request email.
Required password
String The account password to confirm the email change.',z=y(),B=p("div"),B.textContent="Responses",D=y(),S=p("div"),N=p("div");for(let c=0;ct(1,d=a.code);return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},t(2,i=[{code:204,body:"null"},{code:400,body:` { "status": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/FieldsQueryParam-BPQKDixm.js b/ui/dist/assets/FieldsQueryParam-BiUsK6GB.js similarity index 96% rename from ui/dist/assets/FieldsQueryParam-BPQKDixm.js rename to ui/dist/assets/FieldsQueryParam-BiUsK6GB.js index 52c795f1..8e4c4c81 100644 --- a/ui/dist/assets/FieldsQueryParam-BPQKDixm.js +++ b/ui/dist/assets/FieldsQueryParam-BiUsK6GB.js @@ -1,4 +1,4 @@ -import{S as J,i as N,s as O,W as P,h as Q,d as R,t as W,a as j,I as z,l as D,n as e,m as G,u as t,v as c,A as i,c as K,w as U}from"./index-ChXAaRxB.js";function V(f){let n,o,u,d,k,s,p,w,g,y,r,F,_,S,b,E,C,a,$,L,q,H,I,M,m,T,v,A,x;return r=new P({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response +import{S as J,i as N,s as O,W as P,h as Q,d as R,t as W,a as j,I as z,l as D,n as e,m as G,u as t,v as c,A as i,c as K,w as U}from"./index-DjYVmtoM.js";function V(f){let n,o,u,d,k,s,p,w,g,y,r,F,_,S,b,E,C,a,$,L,q,H,I,M,m,T,v,A,x;return r=new P({props:{content:"?fields=*,"+f[0]+"expand.relField.name"}}),{c(){n=t("tr"),o=t("td"),o.textContent="fields",u=c(),d=t("td"),d.innerHTML='String',k=c(),s=t("td"),p=t("p"),w=i(`Comma separated string of the fields to return in the JSON response `),g=t("em"),g.textContent="(by default returns all fields)",y=i(`. Ex.: `),K(r.$$.fragment),F=c(),_=t("p"),_.innerHTML="* targets all keys from the specific depth level.",S=c(),b=t("p"),b.textContent="In addition, the following field modifiers are also supported:",E=c(),C=t("ul"),a=t("li"),$=t("code"),$.textContent=":excerpt(maxLength, withEllipsis?)",L=c(),q=t("br"),H=i(` Returns a short plain text version of the field string value. diff --git a/ui/dist/assets/FilterAutocompleteInput-OQbEqM-k.js b/ui/dist/assets/FilterAutocompleteInput-D6GbKUeb.js similarity index 99% rename from ui/dist/assets/FilterAutocompleteInput-OQbEqM-k.js rename to ui/dist/assets/FilterAutocompleteInput-D6GbKUeb.js index a269d03d..73afc130 100644 --- a/ui/dist/assets/FilterAutocompleteInput-OQbEqM-k.js +++ b/ui/dist/assets/FilterAutocompleteInput-D6GbKUeb.js @@ -1 +1 @@ -import{S as $,i as ee,s as te,H as T,h as ne,l as re,u as ie,w as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-ChXAaRxB.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,C as R,q as G,t as qe,S as Oe,u as We,v as _e}from"./index-CN02J7Id.js";function ve(e){return new Worker(""+new URL("autocomplete.worker-C40-XsHE.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Te(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;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,H=new R,J=new R,A=new R,O=new ve,I=[],M=[],B=[],C="",W="";function _(){d==null||d.focus()}let v=null;O.onmessage=n=>{B=n.data.baseKeys||[],I=n.data.requestKeys||[],M=n.data.collectionJoinKeys||[]};function V(){clearTimeout(v),v=setTimeout(()=>{O.postMessage({baseCollection:s,collections:X(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function X(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",_)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function j(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(I||[])),c&&(l=l.concat(M||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(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:"@yesterday"},{label:"@tomorrow"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=j(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return Oe.define(Te({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)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(qe),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),A.of(G(o)),H.of(E.editable.of(!i)),J.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(v),F(),d==null||d.destroy(),O.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!i&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),V()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[H.reconfigure(E.editable.of(!i)),J.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:[A.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,_,d,q,C,W,Y]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Me,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{Pe as default}; +import{S as $,i as ee,s as te,H as T,h as ne,l as re,u as ie,w as ae,O as oe,T as le,U as se,Q as de,J as u,y as ce}from"./index-DjYVmtoM.js";import{c as fe,d as ue,s as ge,h as he,a as ye,E,b as S,e as pe,f as ke,g as me,i as xe,j as be,k as we,l as Ee,m as Se,r as Ce,n as Ke,o as Re,p as Le,C as R,q as G,t as qe,S as Oe,u as We,v as _e}from"./index-CN02J7Id.js";function ve(e){return new Worker(""+new URL("autocomplete.worker-C40-XsHE.js",import.meta.url).href,{name:e==null?void 0:e.name})}function Te(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;i2&&a.token&&typeof a.token!="string"){t.pending=[];for(var s=2;s-1)return null;var h=t.indent.length-1,f=e[t.state];e:for(;;){for(var a=0;at(21,g=n));const h=se();let{id:f=""}=r,{value:a=""}=r,{disabled:i=!1}=r,{placeholder:o=""}=r,{baseCollection:s=null}=r,{singleLine:y=!1}=r,{extraAutocompleteKeys:L=[]}=r,{disableRequestKeys:b=!1}=r,{disableCollectionJoinKeys:m=!1}=r,d,p,q=i,D=new R,H=new R,J=new R,A=new R,O=new ve,I=[],M=[],B=[],C="",W="";function _(){d==null||d.focus()}let v=null;O.onmessage=n=>{B=n.data.baseKeys||[],I=n.data.requestKeys||[],M=n.data.collectionJoinKeys||[]};function V(){clearTimeout(v),v=setTimeout(()=>{O.postMessage({baseCollection:s,collections:X(g),disableRequestKeys:b,disableCollectionJoinKeys:m})},250)}function X(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",_)}function N(){if(!f)return;F();const n=document.querySelectorAll('[for="'+f+'"]');for(let c of n)c.addEventListener("click",_)}function j(n=!0,c=!0){let l=[].concat(L);return l=l.concat(B||[]),n&&(l=l.concat(I||[])),c&&(l=l.concat(M||[])),l}function z(n){var w;let c=n.matchBefore(/[\'\"\@\w\.]*/);if(c&&c.from==c.to&&!n.explicit)return null;let l=_e(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:"@yesterday"},{label:"@tomorrow"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];m||x.push({label:"@collection.*",apply:"@collection."});let K=j(!b&&c.text.startsWith("@r"),!m&&c.text.startsWith("@c"));for(const k of K)x.push({label:k.endsWith(".")?k+"*":k,apply:k,boost:k.indexOf("_via_")>0?-1:0});return{from:c.from,options:x}}function P(){return Oe.define(Te({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)}};N();let c=[n,...fe,...ue,ge.find(l=>l.key==="Mod-d"),...he,...ye];return y||c.push(qe),t(11,d=new E({parent:p,state:S.create({doc:a,extensions:[pe(),ke(),me(),xe(),be(),S.allowMultipleSelections.of(!0),we(We,{fallback:!0}),Ee(),Se(),Ce(),Ke(),Re.of(c),E.lineWrapping,Le({override:[z],icons:!1}),A.of(G(o)),H.of(E.editable.of(!i)),J.of(S.readOnly.of(i)),D.of(P()),S.transactionFilter.of(l=>{var x,K,w;if(y&&l.newDoc.lines>1){if(!((w=(K=(x=l.changes)==null?void 0:x.inserted)==null?void 0:K.filter(k=>!!k.text.find(Z=>Z)))!=null&&w.length))return[];l.newDoc.text=[l.newDoc.text.join(" ")]}return l}),E.updateListener.of(l=>{!l.docChanged||i||(t(1,a=l.state.doc.toString()),U())})]})})),()=>{clearTimeout(v),F(),d==null||d.destroy(),O.terminate()}});function Y(n){ce[n?"unshift":"push"](()=>{p=n,t(0,p)})}return e.$$set=n=>{"id"in n&&t(2,f=n.id),"value"in n&&t(1,a=n.value),"disabled"in n&&t(3,i=n.disabled),"placeholder"in n&&t(4,o=n.placeholder),"baseCollection"in n&&t(5,s=n.baseCollection),"singleLine"in n&&t(6,y=n.singleLine),"extraAutocompleteKeys"in n&&t(7,L=n.extraAutocompleteKeys),"disableRequestKeys"in n&&t(8,b=n.disableRequestKeys),"disableCollectionJoinKeys"in n&&t(9,m=n.disableCollectionJoinKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&t(13,C=Be(s)),e.$$.dirty[0]&25352&&!i&&(W!=C||b!==-1||m!==-1)&&(t(14,W=C),V()),e.$$.dirty[0]&4&&f&&N(),e.$$.dirty[0]&2080&&d&&s!=null&&s.fields&&d.dispatch({effects:[D.reconfigure(P())]}),e.$$.dirty[0]&6152&&d&&q!=i&&(d.dispatch({effects:[H.reconfigure(E.editable.of(!i)),J.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:[A.reconfigure(G(o))]})},[p,a,f,i,o,s,y,L,b,m,_,d,q,C,W,Y]}class Pe extends ${constructor(r){super(),ee(this,r,Ue,Me,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{Pe as default}; diff --git a/ui/dist/assets/Leaflet-D3mFU3hI.js b/ui/dist/assets/Leaflet-U8ucILHG.js similarity index 99% rename from ui/dist/assets/Leaflet-D3mFU3hI.js rename to ui/dist/assets/Leaflet-U8ucILHG.js index 24860442..ec141155 100644 --- a/ui/dist/assets/Leaflet-D3mFU3hI.js +++ b/ui/dist/assets/Leaflet-U8ucILHG.js @@ -1,4 +1,4 @@ -import{a2 as ss,a3 as rs,S as as,i as hs,s as us,H as Ee,h as ae,z as Cn,w as Y,l as he,n as gt,o as _i,u as vt,v as Ae,Q as ls,X as kn,Y as cs,y as fs,j as ds,I as _s,E as ms,a4 as ps,A as gs}from"./index-ChXAaRxB.js";var di={exports:{}};/* @preserve +import{a2 as ss,a3 as rs,S as as,i as hs,s as us,H as Ee,h as ae,z as Cn,w as Y,l as he,n as gt,o as _i,u as vt,v as Ae,Q as ls,X as kn,Y as cs,y as fs,j as ds,I as _s,E as ms,a4 as ps,A as gs}from"./index-DjYVmtoM.js";var di={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */(function(C,g){(function(u,v){v(g)})(rs,function(u){var v="1.9.4";function c(t){var e,i,n,o;for(i=1,n=arguments.length;i"u"||!L||!L.Mixin)){t=J(t)?t:[t];for(var e=0;e0?Math.floor(t):Math.ceil(t)};w.prototype={clone:function(){return new w(this.x,this.y)},add:function(t){return this.clone()._add(y(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(y(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new w(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new w(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=mi(this.x),this.y=mi(this.y),this},distanceTo:function(t){t=y(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=y(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=y(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+H(this.x)+", "+H(this.y)+")"}};function y(t,e,i){return t instanceof w?t:J(t)?new w(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new w(t.x,t.y):new w(t,e,i)}function R(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=tt(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>=e.x&&n.x<=i.x,r=o.y>=e.y&&n.y<=i.y;return s&&r},overlaps:function(t){t=tt(t);var e=this.min,i=this.max,n=t.min,o=t.max,s=o.x>e.x&&n.xe.y&&n.y=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},intersects:function(t){t=W(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=e.lat&&n.lat<=i.lat,r=o.lng>=e.lng&&n.lng<=i.lng;return s&&r},overlaps:function(t){t=W(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>e.lat&&n.late.lng&&n.lng1,Kn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",A,e),window.removeEventListener("testPassiveEventSupport",A,e)}catch{}return t}(),jn=function(){return!!document.createElement("canvas").getContext}(),He=!!(document.createElementNS&&gi("svg").createSVGRect),Jn=!!He&&function(){var t=document.createElement("div");return t.innerHTML="",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Yn=!He&&function(){try{var t=document.createElement("div");t.innerHTML='';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&typeof e.adj=="object"}catch{return!1}}(),Xn=navigator.platform.indexOf("Mac")===0,Qn=navigator.platform.indexOf("Linux")===0;function dt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var d={ie:ce,ielt9:Bn,edge:yi,webkit:Ne,android:wi,android23:xi,androidStock:Nn,opera:Re,chrome:Pi,gecko:Li,safari:Rn,phantom:bi,opera12:Ti,win:Dn,ie3d:Mi,webkit3d:De,gecko3d:Ci,any3d:Hn,mobile:jt,mobileWebkit:Fn,mobileWebkit3d:Wn,msPointer:ki,pointer:Si,touch:Un,touchNative:zi,mobileOpera:Vn,mobileGecko:qn,retina:Gn,passiveEvents:Kn,canvas:jn,svg:He,vml:Yn,inlineSvg:Jn,mac:Xn,linux:Qn},Ai=d.msPointer?"MSPointerDown":"pointerdown",Ei=d.msPointer?"MSPointerMove":"pointermove",Oi=d.msPointer?"MSPointerUp":"pointerup",Zi=d.msPointer?"MSPointerCancel":"pointercancel",Fe={touchstart:Ai,touchmove:Ei,touchend:Oi,touchcancel:Zi},Bi={touchstart:oo,touchmove:fe,touchend:fe,touchcancel:fe},Bt={},Ii=!1;function $n(t,e,i){return e==="touchstart"&&no(),Bi[e]?(i=Bi[e].bind(this,i),t.addEventListener(Fe[e],i,!1),i):(console.warn("wrong event specified:",e),A)}function to(t,e,i){if(!Fe[e]){console.warn("wrong event specified:",e);return}t.removeEventListener(Fe[e],i,!1)}function eo(t){Bt[t.pointerId]=t}function io(t){Bt[t.pointerId]&&(Bt[t.pointerId]=t)}function Ni(t){delete Bt[t.pointerId]}function no(){Ii||(document.addEventListener(Ai,eo,!0),document.addEventListener(Ei,io,!0),document.addEventListener(Oi,Ni,!0),document.addEventListener(Zi,Ni,!0),Ii=!0)}function fe(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in Bt)e.touches.push(Bt[i]);e.changedTouches=[e],t(e)}}function oo(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&j(e),fe(t,e)}function so(t){var e={},i,n;for(n in t)i=t[n],e[n]=i&&i.bind?i.bind(t):i;return t=e,e.type="dblclick",e.detail=2,e.isTrusted=!1,e._simulated=!0,e}var ro=200;function ao(t,e){t.addEventListener("dblclick",e);var i=0,n;function o(s){if(s.detail!==1){n=s.detail;return}if(!(s.pointerType==="mouse"||s.sourceCapabilities&&!s.sourceCapabilities.firesTouchEvents)){var r=Wi(s);if(!(r.some(function(h){return h instanceof HTMLLabelElement&&h.attributes.for})&&!r.some(function(h){return h instanceof HTMLInputElement||h instanceof HTMLSelectElement}))){var a=Date.now();a-i<=ro?(n++,n===2&&e(so(s))):n=1,i=a}}}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function ho(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var We=me(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Jt=me(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Ri=Jt==="webkitTransition"||Jt==="OTransition"?Jt+"End":"transitionend";function Di(t){return typeof t=="string"?document.getElementById(t):t}function Yt(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||i==="auto")&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return i==="auto"?null:i}function z(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function D(t){var e=t.parentNode;e&&e.removeChild(t)}function de(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function It(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Nt(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function Ue(t,e){if(t.classList!==void 0)return t.classList.contains(e);var i=_e(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function T(t,e){if(t.classList!==void 0)for(var i=Z(e),n=0,o=i.length;n0?2*window.devicePixelRatio:1;function Vi(t){return d.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/co:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function ei(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch{return!1}return i!==t}var fo={__proto__:null,on:x,off:O,stopPropagation:zt,disableScrollPropagation:ti,disableClickPropagation:te,preventDefault:j,stop:At,getPropagationPath:Wi,getMousePosition:Ui,getWheelDelta:Vi,isExternalTarget:ei,addListener:x,removeListener:O},qi=Gt.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=St(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=q(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=this._duration*1e3;ethis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,W(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){e=e||{};var i=y(e.paddingTopLeft||e.padding||[0,0]),n=y(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),s=this.project(t),r=this.getPixelBounds(),a=tt([r.min.add(i),r.max.subtract(n)]),h=a.getSize();if(!a.contains(s)){this._enforcingBounds=!0;var l=s.subtract(a.getCenter()),f=a.extend(s).getSize().subtract(h);o.x+=l.x<0?-f.x:f.x,o.y+=l.y<0?-f.y:f.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=c({animate:!1,pan:!0},t===!0?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),o=i.divideBy(2).round(),s=n.subtract(o);return!s.x&&!s.y?this:(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(_(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=c({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=_(this._handleGeolocationResponse,this),i=_(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(e===1?"permission denied":e===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=t.coords.latitude,i=t.coords.longitude,n=new E(e,i),o=n.toBounds(t.coords.accuracy*2),s=this._locateOptions;if(s.setView){var r=this.getBoundsZoom(o);this.setView(n,s.maxZoom?Math.min(r,s.maxZoom):r)}var a={latlng:n,bounds:o,timestamp:t.timestamp};for(var h in t.coords)typeof t.coords[h]=="number"&&(a[h]=t.coords[h]);this.fire("locationfound",a)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),D(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(at(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)D(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),n=z("div",i,e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new et(e,i)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=W(t),i=y(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),l=tt(this.project(a,n),this.project(r,n)).getSize(),f=d.any3d?this.options.zoomSnap:1,p=h.x/l.x,M=h.y/l.y,Q=e?Math.max(p,M):Math.min(p,M);return n=this.getScaleZoom(Q,n),f&&(n=Math.round(n/(f/100))*(f/100),n=e?Math.ceil(n/f)*f:Math.floor(n/f)*f),Math.max(o,Math.min(s,n))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new w(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new R(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=e===void 0?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=e===void 0?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.latLngToPoint(k(t),e)},unproject:function(t,e){return e=e===void 0?this._zoom:e,this.options.crs.pointToLatLng(y(t),e)},layerPointToLatLng:function(t){var e=y(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){var e=this.project(k(t))._round();return e._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(k(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(W(t))},distance:function(t,e){return this.options.crs.distance(k(t),k(e))},containerPointToLayerPoint:function(t){return y(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return y(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(y(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(k(t)))},mouseEventToContainerPoint:function(t){return Ui(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=Di(t);if(e){if(e._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");x(e,"scroll",this._onScroll,this),this._containerId=m(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&d.any3d,T(t,"leaflet-container"+(d.touch?" leaflet-touch":"")+(d.retina?" leaflet-retina":"")+(d.ielt9?" leaflet-oldie":"")+(d.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=Yt(t,"position");e!=="absolute"&&e!=="relative"&&e!=="fixed"&&e!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),U(this._mapPane,new w(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(T(t.markerPane,"leaflet-zoom-hide"),T(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){U(this._mapPane,new w(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){e===void 0&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return at(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){U(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[m(this._container)]=this;var e=t?O:x;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),d.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){at(this._resizeRequest),this._resizeRequest=q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i=[],n,o=e==="mouseout"||e==="mouseover",s=t.target||t.srcElement,r=!1;s;){if(n=this._targets[m(s)],n&&(e==="click"||e==="preclick")&&this._draggableMoved(n)){r=!0;break}if(n&&n.listens(e,!0)&&(o&&!ei(s,t)||(i.push(n),o))||s===this._container)break;s=s.parentNode}return!i.length&&!r&&!o&&this.listens(e,!0)&&(i=[this]),i},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(e))){var i=t.type;i==="mousedown"&&Je(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){if(t.type==="click"){var n=c({},t);n.type="preclick",this._fireDOMEvent(n,n.type,i)}var o=this._findEventTargets(t,e);if(i){for(var s=[],r=0;r0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=d.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){F(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return(e&&e.animate)!==!0&&!this.getSize().contains(i)?!1:(this.panBy(i,e),!0)},_createAnimProxy:function(){var t=this._proxy=z("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(e){var i=We,n=this._proxy.style[i];kt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[i]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){D(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();kt(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||i.animate===!1||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return i.animate!==!0&&!this.getSize().contains(o)?!1:(q(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this),!0)},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,T(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(_(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&F(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function _o(t,e){return new S(t,e)}var ct=yt.extend({options:{position:"topright"},initialize:function(t){b(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return T(e,"leaflet-control"),i.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(D(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ee=function(t){return new ct(t)};S.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=z("div",e+"control-container",this._container);function n(o,s){var r=e+o+" "+e+s;t[o+s]=z("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)D(this._controlCorners[t]);D(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Gi=ct.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(m(t.target)),i=e.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e=document.createElement("label"),i=this._map.hasLayer(t.layer),n;t.overlay?(n=document.createElement("input"),n.type="checkbox",n.className="leaflet-control-layers-selector",n.defaultChecked=i):n=this._createRadioElement("leaflet-base-layers_"+m(this),i),this._layerControlInputs.push(n),n.layerId=m(t.layer),x(n,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("span");e.appendChild(s),s.appendChild(n),s.appendChild(o);var r=t.overlay?this._overlaysList:this._baseLayersList;return r.appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,e,i,n=[],o=[];this._handlingClick=!0;for(var s=t.length-1;s>=0;s--)e=t[s],i=this._getLayer(e.layerId).layer,e.checked?n.push(i):e.checked||o.push(i);for(s=0;s=0;o--)e=t[o],i=this._getLayer(e.layerId).layer,e.disabled=i.options.minZoom!==void 0&&ni.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,x(t,"click",j),this.expand();var e=this;setTimeout(function(){O(t,"click",j),e._preventClick=!1})}}),mo=function(t,e,i){return new Gi(t,e,i)},ii=ct.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=z("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var s=z("a",i,n);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),te(s),x(s,"click",At),x(s,"click",o,this),x(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";F(this._zoomInButton,e),F(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(T(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(T(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});S.mergeOptions({zoomControl:!0}),S.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new ii,this.addControl(this.zoomControl))});var po=function(t){return new ii(t)},Ki=ct.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=z("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=z("div",e,i)),t.imperial&&(this._iScale=z("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e=t*3.2808399,i,n,o;e>5280?(i=e/5280,n=this._getRoundNum(i),this._updateScale(this._iScale,n+" mi",n/i)):(o=this._getRoundNum(e),this._updateScale(this._iScale,o+" ft",o/e))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),go=function(t){return new Ki(t)},vo='',ni=ct.extend({options:{position:"bottomright",prefix:''+(d.inlineSvg?vo+" ":"")+"Leaflet"},initialize:function(t){b(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=z("div","leaflet-control-attribution"),te(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' ')}}});S.mergeOptions({attributionControl:!0}),S.addInitHook(function(){this.options.attributionControl&&new ni().addTo(this)});var yo=function(t){return new ni(t)};ct.Layers=Gi,ct.Zoom=ii,ct.Scale=Ki,ct.Attribution=ni,ee.layers=mo,ee.zoom=po,ee.scale=go,ee.attribution=yo;var mt=yt.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});mt.addTo=function(t,e){return t.addHandler(e,this),this};var wo={Events:rt},ji=d.touch?"touchstart mousedown":"mousedown",Mt=Gt.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){b(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(x(this._dragStartTarget,ji,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Mt._dragging===this&&this.finishDrag(!0),O(this._dragStartTarget,ji,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!Ue(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Mt._dragging===this&&this.finishDrag();return}if(!(Mt._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Mt._dragging=this,this._preventOutline&&Je(this._element),Ge(),Xt(),!this._moving)){this.fire("down");var e=t.touches?t.touches[0]:t,i=Hi(this._element);this._startPoint=new w(e.clientX,e.clientY),this._startPos=St(this._element),this._parentScale=Ye(i);var n=t.type==="mousedown";x(document,n?"mousemove":"touchmove",this._onMove,this),x(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var e=t.touches&&t.touches.length===1?t.touches[0]:t,i=new w(e.clientX,e.clientY)._subtract(this._startPoint);!i.x&&!i.y||Math.abs(i.x)+Math.abs(i.y)s&&(r=a,s=h);s>i&&(e[r]=1,si(t,e,i,n,r),si(t,e,i,r,o))}function bo(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;ne&&(i.push(t[n]),o=n);return oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function To(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function ie(t,e,i,n){var o=e.x,s=e.y,r=i.x-o,a=i.y-s,h=r*r+a*a,l;return h>0&&(l=((t.x-o)*r+(t.y-s)*a)/h,l>1?(o=i.x,s=i.y):l>0&&(o+=r*l,s+=a*l)),r=t.x-o,a=t.y-s,n?r*r+a*a:new w(o,s)}function ut(t){return!J(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function en(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),ut(t)}function nn(t,e){var i,n,o,s,r,a,h,l;if(!t||t.length===0)throw new Error("latlngs not passed");ut(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var f=k([0,0]),p=W(t),M=p.getNorthWest().distanceTo(p.getSouthWest())*p.getNorthEast().distanceTo(p.getNorthWest());M<1700&&(f=oi(t));var Q=t.length,G=[];for(i=0;in){h=(s-n)/o,l=[a.x-h*(a.x-r.x),a.y-h*(a.y-r.y)];break}var it=e.unproject(y(l));return k([it.lat+f.lat,it.lng+f.lng])}var Mo={__proto__:null,simplify:Xi,pointToSegmentDistance:Qi,closestPointOnSegment:Po,clipSegment:tn,_getEdgeIntersection:ve,_getBitCode:Et,_sqClosestPointOnSegment:ie,isFlat:ut,_flat:en,polylineCenter:nn},ri={project:function(t){return new w(t.lng,t.lat)},unproject:function(t){return new E(t.y,t.x)},bounds:new R([-180,-90],[180,90])},ai={R:6378137,R_MINOR:6356752314245179e-9,bounds:new R([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,s=Math.sqrt(1-o*o),r=s*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-r)/(1+r),s/2);return n=-i*Math.log(Math.max(a,1e-10)),new w(t.lng*e*i,n)},unproject:function(t){for(var e=180/Math.PI,i=this.R,n=this.R_MINOR/i,o=Math.sqrt(1-n*n),s=Math.exp(-t.y/i),r=Math.PI/2-2*Math.atan(s),a=0,h=.1,l;a<15&&Math.abs(h)>1e-7;a++)l=o*Math.sin(r),l=Math.pow((1-l)/(1+l),o/2),h=Math.PI/2-2*Math.atan(s*l)-r,r+=h;return new E(r*e,t.x*e/i)}},Co={__proto__:null,LonLat:ri,Mercator:ai,SphericalMercator:Oe},ko=c({},Tt,{code:"EPSG:3395",projection:ai,transformation:function(){var t=.5/(Math.PI*ai.R);return Kt(t,.5,-t,.5)}()}),on=c({},Tt,{code:"EPSG:4326",projection:ri,transformation:Kt(1/180,1,-1/180,.5)}),So=c({},wt,{projection:ri,transformation:Kt(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});wt.Earth=Tt,wt.EPSG3395=ko,wt.EPSG3857=Be,wt.EPSG900913=Zn,wt.EPSG4326=on,wt.Simple=So;var ft=Gt.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[m(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[m(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",function(){e.off(i,this)},this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});S.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=m(t);return this._layers[e]?this:(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var e=m(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return m(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){t=t?J(t)?t:[t]:[];for(var e=0,i=t.length;ethis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&e[0]instanceof E&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){Pt.prototype._setLatLngs.call(this,t),ut(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return ut(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new w(e,e);if(t=new R(t.min.subtract(i),t.max.add(i)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var n=0,o=this._rings.length,s;nt.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(e=!e);return e||Pt.prototype._containsPoint.call(this,t,!0)}});function No(t,e){return new Ht(t,e)}var Lt=xt.extend({initialize:function(t,e){b(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e=J(t)?t:t.features,i,n,o;if(e){for(i=0,n=e.length;i0&&o.push(o[0].slice()),o}function Ft(t,e){return t.feature?c({},t.feature,{geometry:e}):be(e)}function be(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var ci={toGeoJSON:function(t){return Ft(this,{type:"Point",coordinates:li(this.getLatLng(),t)})}};ye.include(ci),hi.include(ci),we.include(ci),Pt.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=Le(this._latlngs,e?1:0,!1,t);return Ft(this,{type:(e?"Multi":"")+"LineString",coordinates:i})}}),Ht.include({toGeoJSON:function(t){var e=!ut(this._latlngs),i=e&&!ut(this._latlngs[0]),n=Le(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),Ft(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Rt.include({toMultiPoint:function(t){var e=[];return this.eachLayer(function(i){e.push(i.toGeoJSON(t).geometry.coordinates)}),Ft(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(e==="MultiPoint")return this.toMultiPoint(t);var i=e==="GeometryCollection",n=[];return this.eachLayer(function(o){if(o.toGeoJSON){var s=o.toGeoJSON(t);if(i)n.push(s.geometry);else{var r=be(s);r.type==="FeatureCollection"?n.push.apply(n,r.features):n.push(r)}}}),i?Ft(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});function an(t,e){return new Lt(t,e)}var Ro=an,Te=ft.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=W(e),b(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(T(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){D(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&It(this._image),this},bringToBack:function(){return this._map&&Nt(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=W(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",e=this._image=t?this._url:z("img");if(T(e,"leaflet-image-layer"),this._zoomAnimated&&T(e,"leaflet-zoom-animated"),this.options.className&&T(e,this.options.className),e.onselectstart=A,e.onmousemove=A,e.onload=_(this.fire,this,"load"),e.onerror=_(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(e.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=e.src;return}e.src=this._url,e.alt=this.options.alt},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;kt(this._image,i,e)},_reset:function(){var t=this._image,e=new R(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();U(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){ht(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Do=function(t,e,i){return new Te(t,e,i)},hn=Te.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",e=this._image=t?this._url:z("video");if(T(e,"leaflet-image-layer"),this._zoomAnimated&&T(e,"leaflet-zoom-animated"),this.options.className&&T(e,this.options.className),e.onselectstart=A,e.onmousemove=A,e.onloadeddata=_(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o0?n:[e.src];return}J(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;so?(e.height=o+"px",T(t,s)):F(t,s),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();U(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,e=parseInt(Yt(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new w(this._containerLeft,-i-this._containerBottom);o._add(St(this._container));var s=t.layerPointToContainerPoint(o),r=y(this.options.autoPanPadding),a=y(this.options.autoPanPaddingTopLeft||r),h=y(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),f=0,p=0;s.x+n+h.x>l.x&&(f=s.x+n-l.x+h.x),s.x-f-a.x<0&&(f=s.x-a.x),s.y+i+h.y>l.y&&(p=s.y+i-l.y+h.y),s.y-p-a.y<0&&(p=s.y-a.y),(f||p)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([f,p]))}},_getAnchor:function(){return y(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Wo=function(t,e){return new Me(t,e)};S.mergeOptions({closePopupOnClick:!0}),S.include({openPopup:function(t,e,i){return this._initOverlay(Me,t,e,i).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),ft.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Me,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof xt||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){At(t);var e=t.layer||t.target;if(this._popup._source===e&&!(e instanceof Ct)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=e,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Ce=pt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){pt.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){pt.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=pt.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",e=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=z("div",e),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+m(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,s=n.latLngToContainerPoint(n.getCenter()),r=n.layerPointToContainerPoint(t),a=this.options.direction,h=o.offsetWidth,l=o.offsetHeight,f=y(this.options.offset),p=this._getAnchor();a==="top"?(e=h/2,i=l):a==="bottom"?(e=h/2,i=0):a==="center"?(e=h/2,i=l/2):a==="right"?(e=0,i=l/2):a==="left"?(e=h,i=l/2):r.xthis.options.maxZoom||in?this._retainParent(o,s,r,n):!1)},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new w(o,s);r.z=i+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];if(h&&h.active){h.retain=!0;continue}else h&&h.loaded&&(h.retain=!0);i+1this.options.maxZoom||this.options.minZoom!==void 0&&o1){this._setView(t,i);return}for(var p=o.min.y;p<=o.max.y;p++)for(var M=o.min.x;M<=o.max.x;M++){var Q=new w(M,p);if(Q.z=this._tileZoom,!!this._isValidTile(Q)){var G=this._tiles[this._tileCoordsToKey(Q)];G?G.current=!0:r.push(Q)}}if(r.sort(function(it,Ut){return it.distanceTo(s)-Ut.distanceTo(s)}),r.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var lt=document.createDocumentFragment();for(M=0;Mi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return W(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i),s=e.unproject(n,t.z),r=e.unproject(o,t.z);return[s,r]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new et(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new w(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(D(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){T(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=A,t.onmousemove=A,d.ielt9&&this.options.opacity<1&&ht(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),_(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&q(_(this._tileReady,this,t,null,o)),U(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);i=this._tiles[n],i&&(i.loaded=+new Date,this._map._fadeAnimated?(ht(i.el,0),at(this._fadeFrame),this._fadeFrame=q(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(T(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),d.ielt9||!this._map._fadeAnimated?q(this._pruneTiles,this):setTimeout(_(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new w(this._wrapX?X(t.x,this._wrapX):t.x,this._wrapY?X(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new R(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function qo(t){return new oe(t)}var Wt=oe.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,e=b(this,e),e.detectRetina&&d.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),typeof e.subdomains=="string"&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&e===void 0&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return x(i,"load",_(this._tileOnLoad,this,e,i)),x(i,"error",_(this._tileOnError,this,e,i)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(i.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:d.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=i),e["-y"]=i}return ue(this._url,c(e,this.options))},_tileOnLoad:function(t,e){d.ielt9?setTimeout(_(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom,i=this.options.zoomReverse,n=this.options.zoomOffset;return i&&(t=e-t),t+n},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(e=this._tiles[t].el,e.onload=A,e.onerror=A,!e.complete)){e.src=Zt;var i=this._tiles[t].coords;D(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",Zt),oe.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(!(!this._map||i&&i.getAttribute("src")===Zt))return oe.prototype._tileReady.call(this,t,e,i)}});function cn(t,e){return new Wt(t,e)}var fn=Wt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i=c({},this.defaultWmsParams);for(var n in e)n in this.options||(i[n]=e[n]);e=b(this,e);var o=e.detectRetina&&d.retina?2:1,s=this.getTileSize();i.width=s.x*o,i.height=s.y*o,this.wmsParams=i},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,Wt.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=tt(i.project(e[0]),i.project(e[1])),o=n.min,s=n.max,r=(this._wmsVersion>=1.3&&this._crs===on?[o.y,o.x,s.y,s.x]:[o.x,o.y,s.x,s.y]).join(","),a=Wt.prototype.getTileUrl.call(this,t);return a+I(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return c(this.wmsParams,t),e||this.redraw(),this}});function Go(t,e){return new fn(t,e)}Wt.WMS=fn,cn.wms=Go;var bt=ft.extend({options:{padding:.1},initialize:function(t){b(this,t),m(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),T(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),s=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));d.any3d?kt(this._container,s,i):U(this._container,s)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new R(i,i.add(e.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),dn=bt.extend({options:{tolerance:0},getEvents:function(){var t=bt.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bt.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");x(t,"mousemove",this._onMouseMove,this),x(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),x(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){at(this._redrawRequest),delete this._ctx,D(this._container),O(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var e in this._layers)t=this._layers[e],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bt.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=d.retina?2:1;U(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",d.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){bt.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[m(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[m(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var e=t.options.dashArray.split(/[, ]+/),i=[],n,o;for(o=0;o')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Ko={_initContainer:function(){this._container=z("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bt.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=se("shape");T(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=se("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;D(e),t.removeInteractiveTarget(e),delete this._layers[m(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=se("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=J(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=se("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,"+65535*360)},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){It(t._container)},_bringToBack:function(t){Nt(t._container)}},ke=d.vml?se:gi,re=bt.extend({_initContainer:function(){this._container=ke("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ke("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){D(this._container),O(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bt.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;(!this._svgSize||!this._svgSize.equals(e))&&(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),U(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=ke("path");t.options.className&&T(e,t.options.className),t.options.interactive&&T(e,"leaflet-interactive"),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){D(t._path),t.removeInteractiveTarget(t._path),delete this._layers[m(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,vi(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n=Math.max(Math.round(t._radiusY),1)||i,o="a"+i+","+n+" 0 1,0 ",s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+i*2+",0 "+o+-i*2+",0 ";this._setPath(t,s)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){It(t._path)},_bringToBack:function(t){Nt(t._path)}});d.vml&&re.include(Ko);function mn(t){return d.svg||d.vml?new re(t):null}S.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var e=this._paneRenderers[t];return e===void 0&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&_n(t)||mn(t)}});var pn=Ht.extend({initialize:function(t,e){Ht.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=W(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function jo(t,e){return new pn(t,e)}re.create=ke,re.pointsToPath=vi,Lt.geometryToLayer=xe,Lt.coordsToLatLng=ui,Lt.coordsToLatLngs=Pe,Lt.latLngToCoords=li,Lt.latLngsToCoords=Le,Lt.getFeature=Ft,Lt.asFeature=be,S.mergeOptions({boxZoom:!0});var gn=mt.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){x(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){O(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){D(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Xt(),Ge(),this._startPoint=this._map.mouseEventToContainerPoint(t),x(document,{contextmenu:At,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=z("div","leaflet-zoom-box",this._container),T(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new R(this._point,this._startPoint),i=e.getSize();U(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(D(this._box),F(this._container,"leaflet-crosshair")),Qt(),Ke(),O(document,{contextmenu:At,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(_(this._resetState,this),0);var e=new et(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});S.addInitHook("addHandler","boxZoom",gn),S.mergeOptions({doubleClickZoom:!0});var vn=mt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;e.options.doubleClickZoom==="center"?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});S.addInitHook("addHandler","doubleClickZoom",vn),S.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yn=mt.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Mt(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}T(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){F(this._map._container,"leaflet-grab"),F(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=W(this._map.options.maxBounds);this._offsetLimit=tt(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.xe.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,s=(n+e+i)%t-e-i,r=Math.abs(o+i)0?s:-s))-e;this._delta=0,this._startTime=null,r&&(t.options.scrollWheelZoom==="center"?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});S.addInitHook("addHandler","scrollWheelZoom",xn);var Jo=600;S.mergeOptions({tapHold:d.touchNative&&d.safari&&d.mobile,tapTolerance:15});var Pn=mt.extend({addHooks:function(){x(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){O(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var e=t.touches[0];this._startPos=this._newPos=new w(e.clientX,e.clientY),this._holdTimeout=setTimeout(_(function(){this._cancel(),this._isTapValid()&&(x(document,"touchend",j),x(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),Jo),x(document,"touchend touchcancel contextmenu",this._cancel,this),x(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){O(document,"touchend",j),O(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),O(document,"touchend touchcancel contextmenu",this._cancel,this),O(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new w(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});S.addInitHook("addHandler","tapHold",Pn),S.mergeOptions({touchZoom:d.touch,bounceAtZoomLimits:!0});var Ln=mt.extend({addHooks:function(){T(this._map._container,"leaflet-touch-zoom"),x(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){F(this._map._container,"leaflet-touch-zoom"),O(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(!(!t.touches||t.touches.length!==2||e._animatingZoom||this._zooming)){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),e.options.touchZoom!=="center"&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),x(document,"touchmove",this._onTouchMove,this),x(document,"touchend touchcancel",this._onTouchEnd,this),j(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoome.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),e.options.touchZoom==="center"){if(this._center=this._startLatLng,o===1)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(o===1&&s.x===0&&s.y===0)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),at(this._animRequest);var r=_(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=q(r,this,!0),j(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,at(this._animRequest),O(document,"touchmove",this._onTouchMove,this),O(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});S.addInitHook("addHandler","touchZoom",Ln),S.BoxZoom=gn,S.DoubleClickZoom=vn,S.Drag=yn,S.Keyboard=wn,S.ScrollWheelZoom=xn,S.TapHold=Pn,S.TouchZoom=Ln,u.Bounds=R,u.Browser=d,u.CRS=wt,u.Canvas=dn,u.Circle=hi,u.CircleMarker=we,u.Class=yt,u.Control=ct,u.DivIcon=ln,u.DivOverlay=pt,u.DomEvent=fo,u.DomUtil=lo,u.Draggable=Mt,u.Evented=Gt,u.FeatureGroup=xt,u.GeoJSON=Lt,u.GridLayer=oe,u.Handler=mt,u.Icon=Dt,u.ImageOverlay=Te,u.LatLng=E,u.LatLngBounds=et,u.Layer=ft,u.LayerGroup=Rt,u.LineUtil=Mo,u.Map=S,u.Marker=ye,u.Mixin=wo,u.Path=Ct,u.Point=w,u.PolyUtil=xo,u.Polygon=Ht,u.Polyline=Pt,u.Popup=Me,u.PosAnimation=qi,u.Projection=Co,u.Rectangle=pn,u.Renderer=bt,u.SVG=re,u.SVGOverlay=un,u.TileLayer=Wt,u.Tooltip=Ce,u.Transformation=Ze,u.Util=En,u.VideoOverlay=hn,u.bind=_,u.bounds=tt,u.canvas=_n,u.circle=Bo,u.circleMarker=Zo,u.control=ee,u.divIcon=Vo,u.extend=c,u.featureGroup=Ao,u.geoJSON=an,u.geoJson=Ro,u.gridLayer=qo,u.icon=Eo,u.imageOverlay=Do,u.latLng=k,u.latLngBounds=W,u.layerGroup=zo,u.map=_o,u.marker=Oo,u.point=y,u.polygon=No,u.polyline=Io,u.popup=Wo,u.rectangle=jo,u.setOptions=b,u.stamp=m,u.svg=mn,u.svgOverlay=Fo,u.tileLayer=cn,u.tooltip=Uo,u.transformation=Kt,u.version=v,u.videoOverlay=Ho;var Yo=window.L;u.noConflict=function(){return window.L=Yo,this},window.L=u})})(di,di.exports);var vs=di.exports;const Ot=ss(vs),ys="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",ws="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",xs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC";function Sn(C,g,u){const v=C.slice();return v[21]=g[u],v[23]=u,v}function Ps(C){let g,u,v,c;return{c(){g=vt("div"),u=vt("button"),u.innerHTML='',Y(u,"type","button"),Y(u,"class","btn btn-circle btn-xs btn-transparent"),Y(g,"class","form-field-addon")},m(P,_){he(P,g,_),gt(g,u),v||(c=_i(u,"click",C[5]),v=!0)},p:Ee,d(P){P&&ae(g),v=!1,c()}}}function Ls(C){let g;return{c(){g=vt("div"),g.innerHTML='',Y(g,"class","form-field-addon")},m(u,v){he(u,g,v)},p:Ee,d(u){u&&ae(g)}}}function zn(C){let g,u=kn(C[4]),v=[];for(let c=0;c{B==null||B.setLatLng([c.lat,c.lon]),P==null||P.panInside([c.lat,c.lon],{padding:[20,40]})},N)}function b(){const N=[ze(c.lat),ze(c.lon)];P=Ot.map(_,{zoomControl:!1}).setView(N,Ts),Ot.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap'}).addTo(P),Ot.Icon.Default.prototype.options.iconUrl=ys,Ot.Icon.Default.prototype.options.iconRetinaUrl=ws,Ot.Icon.Default.prototype.options.shadowUrl=xs,Ot.Icon.Default.imagePath="",B=Ot.marker(N,{draggable:!0,autoPan:!0}).addTo(P),B.bindTooltip("drag or right click anywhere on the map to move"),B.on("moveend",st=>{var $;($=st.sourceTarget)!=null&&$._latlng&&J(st.sourceTarget._latlng.lat,st.sourceTarget._latlng.lng,!1)}),P.on("contextmenu",st=>{J(st.latlng.lat,st.latlng.lng,!1)})}function I(){ot(),B==null||B.remove(),P==null||P.remove()}function ot(){H==null||H.abort(),clearTimeout(A),u(3,m=!1),u(4,X=[]),u(1,K="")}function ue(N,st=1100){if(u(3,m=!0),u(4,X=[]),clearTimeout(A),H==null||H.abort(),!N){u(3,m=!1);return}A=setTimeout(async()=>{H=new AbortController;try{const $=await fetch("https://nominatim.openstreetmap.org/search.php?format=jsonv2&q="+encodeURIComponent(N),{signal:H.signal});if($.status!=200)throw new Error("OpenStreetMap API error "+$.status);const le=await $.json();for(const q of le)X.push({lat:q.lat,lon:q.lon,name:q.display_name})}catch($){console.warn("[address search failed]",$)}u(4,X),u(3,m=!1)},st)}function J(N,st,$=!0){u(7,c.lat=ze(N),c),u(7,c.lon=ze(st),c),$&&(B==null||B.setLatLng([c.lat,c.lon]),P==null||P.panTo([c.lat,c.lon],{animate:!1})),ot()}ls(()=>(b(),()=>{I()}));function Vt(){K=this.value,u(1,K)}const Zt=N=>J(N.lat,N.lon);function qt(N){fs[N?"unshift":"push"](()=>{_=N,u(2,_)})}return C.$$set=N=>{"height"in N&&u(0,v=N.height),"point"in N&&u(7,c=N.point)},C.$$.update=()=>{C.$$.dirty&2&&ue(K),C.$$.dirty&128&&c.lat&&c.lon&&Z()},[v,K,_,m,X,ot,J,c,Vt,Zt,qt]}class ks extends as{constructor(g){super(),hs(this,g,Ms,bs,us,{height:0,point:7})}}export{ks as default}; diff --git a/ui/dist/assets/ListApiDocs-CcCzYz3p.js b/ui/dist/assets/ListApiDocs-DcR09AiE.js similarity index 99% rename from ui/dist/assets/ListApiDocs-CcCzYz3p.js rename to ui/dist/assets/ListApiDocs-DcR09AiE.js index 5e75dfc3..f1fe020d 100644 --- a/ui/dist/assets/ListApiDocs-CcCzYz3p.js +++ b/ui/dist/assets/ListApiDocs-DcR09AiE.js @@ -1,4 +1,4 @@ -import{S as el,i as ll,s as sl,H as ze,h as m,l as h,o as nl,u as e,v as s,L as ol,w as a,n as t,A as g,V as al,W as Le,X as ae,d as Kt,Y as il,t as Ct,a as kt,I as ve,Z as Je,_ as rl,C as cl,$ as dl,D as pl,m as Qt,c as Vt,J as Te,p as fl,k as Ae}from"./index-ChXAaRxB.js";import{F as ul}from"./FieldsQueryParam-BPQKDixm.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){h(f,n,b),h(f,o,b),h(f,i,b)},d(f){f&&(m(n),m(o),m(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){h(f,n,b),h(f,o,b),h(f,i,b)},d(f){f&&(m(n),m(o),m(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,E,Xt,D,it,P,Z,ie,j,U,re,rt,vt,tt,Ft,ce,ct,dt,et,N,Yt,Lt,k,lt,At,Zt,Tt,z,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,H,St,nt,Et,F,ut,fe,J,Nt,ee,qt,le,Dt,ue,L,mt,me,ht,he,M,be,T,Ht,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,Ut,Ce,G,ke,wt,se,R,xt,V,W,O,zt,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 ze,h as m,l as h,o as nl,u as e,v as s,L as ol,w as a,n as t,A as g,V as al,W as Le,X as ae,d as Kt,Y as il,t as Ct,a as kt,I as ve,Z as Je,_ as rl,C as cl,$ as dl,D as pl,m as Qt,c as Vt,J as Te,p as fl,k as Ae}from"./index-DjYVmtoM.js";import{F as ul}from"./FieldsQueryParam-BiUsK6GB.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){h(f,n,b),h(f,o,b),h(f,i,b)},d(f){f&&(m(n),m(o),m(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){h(f,n,b),h(f,o,b),h(f,i,b)},d(f){f&&(m(n),m(o),m(i))}}}function Ke(r){let n,o,i,f,b,p,u,C,_,x,d,Y,yt,Wt,E,Xt,D,it,P,Z,ie,j,U,re,rt,vt,tt,Ft,ce,ct,dt,et,N,Yt,Lt,k,lt,At,Zt,Tt,z,st,Pt,te,Rt,v,pt,Ot,de,ft,pe,H,St,nt,Et,F,ut,fe,J,Nt,ee,qt,le,Dt,ue,L,mt,me,ht,he,M,be,T,Ht,ot,Mt,K,bt,ge,I,It,y,Bt,at,Gt,_e,Q,gt,we,_t,xe,jt,$e,B,Ut,Ce,G,ke,wt,se,R,xt,V,W,O,zt,ne,X;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,b=s(),p=e("li"),u=e("code"),u.textContent="OPERATOR",C=g(` - is one of: `),_=e("br"),x=s(),d=e("ul"),Y=e("li"),yt=e("code"),yt.textContent="=",Wt=s(),E=e("span"),E.textContent="Equal",Xt=s(),D=e("li"),it=e("code"),it.textContent="!=",P=s(),Z=e("span"),Z.textContent="NOT equal",ie=s(),j=e("li"),U=e("code"),U.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"),N=e("code"),N.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",z=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-DfKhEmI8.js b/ui/dist/assets/PageInstaller-BfzyXDSy.js similarity index 98% rename from ui/dist/assets/PageInstaller-DfKhEmI8.js rename to ui/dist/assets/PageInstaller-BfzyXDSy.js index cc64c1f5..68e9a38c 100644 --- a/ui/dist/assets/PageInstaller-DfKhEmI8.js +++ b/ui/dist/assets/PageInstaller-BfzyXDSy.js @@ -1,3 +1,3 @@ -import{S as W,i as G,s as J,F as Q,d as S,t as E,a as O,m as j,c as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as m,j as Z,k as z,l as h,n as T,o as I,q as x,u as k,v as q,w as r,x as ee,y as U,z as A,A as N,B as te}from"./index-ChXAaRxB.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){h(a,t,i),T(t,o),h(a,n,i),h(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&&(m(t),m(n),m(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){h(c,t,g),T(t,o),h(c,n,g),h(c,e,g),A(e,s[3]),h(c,_,g),h(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&&(m(t),m(n),m(e),m(_),m(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){h(a,t,i),T(t,o),h(a,n,i),h(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&&(m(t),m(n),m(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="

Create your first superuser account in order to continue

",u=q(),D(n.$$.fragment),e=q(),D(p.$$.fragment),_=q(),D(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',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){h(l,t,b),T(t,o),T(t,u),j(n,t,null),T(t,e),j(p,t,null),T(t,_),j(d,t,null),T(t,a),T(t,i),h(l,c,b),h(l,g,b),h(l,B,b),h(l,w,b),h(l,F,b),h(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",x(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){E(n.$$.fragment,l),E(p.$$.fragment,l),E(d.$$.fragment,l),v=!1},d(l){l&&(m(t),m(c),m(g),m(B),m(w),m(F),m($)),S(n),S(p),S(d),s[15](null),y=!1,Z(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){D(t.$$.fragment)},m(u,n){j(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){E(t.$$.fragment,u),o=!1},d(u){S(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,d as S,t as E,a as O,m as j,c as D,r as M,g as V,p as C,b as X,e as Y,f as K,h as m,j as Z,k as z,l as h,n as T,o as I,q as x,u as k,v as q,w as r,x as ee,y as U,z as A,A as N,B as te}from"./index-DjYVmtoM.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){h(a,t,i),T(t,o),h(a,n,i),h(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&&(m(t),m(n),m(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){h(c,t,g),T(t,o),h(c,n,g),h(c,e,g),A(e,s[3]),h(c,_,g),h(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&&(m(t),m(n),m(e),m(_),m(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){h(a,t,i),T(t,o),h(a,n,i),h(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&&(m(t),m(n),m(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="

Create your first superuser account in order to continue

",u=q(),D(n.$$.fragment),e=q(),D(p.$$.fragment),_=q(),D(d.$$.fragment),a=q(),i=k("button"),i.innerHTML='Create superuser and login ',c=q(),g=k("hr"),B=q(),w=k("label"),w.innerHTML=' Or initialize from backup',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){h(l,t,b),T(t,o),T(t,u),j(n,t,null),T(t,e),j(p,t,null),T(t,_),j(d,t,null),T(t,a),T(t,i),h(l,c,b),h(l,g,b),h(l,B,b),h(l,w,b),h(l,F,b),h(l,$,b),s[15]($),v=!0,y||(L=[I(t,"submit",x(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){E(n.$$.fragment,l),E(p.$$.fragment,l),E(d.$$.fragment,l),v=!1},d(l){l&&(m(t),m(c),m(g),m(B),m(w),m(F),m($)),S(n),S(p),S(d),s[15](null),y=!1,Z(L)}}}function ae(s){let t,o;return t=new Q({props:{$$slots:{default:[ie]},$$scope:{ctx:s}}}),{c(){D(t.$$.fragment)},m(u,n){j(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){E(t.$$.fragment,u),o=!1},d(u){S(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-z3pLbqpQ.js b/ui/dist/assets/PageOAuth2RedirectFailure-BNMes8rk.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectFailure-z3pLbqpQ.js rename to ui/dist/assets/PageOAuth2RedirectFailure-BNMes8rk.js index bc07490d..ed225755 100644 --- a/ui/dist/assets/PageOAuth2RedirectFailure-z3pLbqpQ.js +++ b/ui/dist/assets/PageOAuth2RedirectFailure-BNMes8rk.js @@ -1 +1 @@ -import{S as r,i as c,s as l,H as n,h as u,l as h,u as p,w as d,O as f,P as m,Q as g,R as o}from"./index-ChXAaRxB.js";function _(s){let t;return{c(){t=p("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',d(t,"class","content txt-hint txt-center p-base")},m(e,a){h(e,t,a)},p:n,i:n,o:n,d(e){e&&u(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 n,h as u,l as h,u as p,w as d,O as f,P as m,Q as g,R as o}from"./index-DjYVmtoM.js";function _(s){let t;return{c(){t=p("div"),t.innerHTML='

Auth failed.

You can close this window and go back to the app to try again.
',d(t,"class","content txt-hint txt-center p-base")},m(e,a){h(e,t,a)},p:n,i:n,o:n,d(e){e&&u(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-C9LrAm5x.js b/ui/dist/assets/PageOAuth2RedirectSuccess-CTZBGWQn.js similarity index 88% rename from ui/dist/assets/PageOAuth2RedirectSuccess-C9LrAm5x.js rename to ui/dist/assets/PageOAuth2RedirectSuccess-CTZBGWQn.js index 63b0d456..5dc286ea 100644 --- a/ui/dist/assets/PageOAuth2RedirectSuccess-C9LrAm5x.js +++ b/ui/dist/assets/PageOAuth2RedirectSuccess-CTZBGWQn.js @@ -1 +1 @@ -import{S as i,i as r,s as u,H as n,h as l,l as p,u as h,w as d,O as m,P as f,Q as _,R as o}from"./index-ChXAaRxB.js";function b(a){let t;return{c(){t=h("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',d(t,"class","content txt-hint txt-center p-base")},m(e,s){p(e,t,s)},p:n,i:n,o:n,d(e){e&&l(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 n,h as l,l as p,u as h,w as d,O as m,P as f,Q as _,R as o}from"./index-DjYVmtoM.js";function b(a){let t;return{c(){t=h("div"),t.innerHTML='

Auth completed.

You can close this window and go back to the app.
',d(t,"class","content txt-hint txt-center p-base")},m(e,s){p(e,t,s)},p:n,i:n,o:n,d(e){e&&l(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-CS--tlmU.js b/ui/dist/assets/PageRecordConfirmEmailChange-eIqoWA8x.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-CS--tlmU.js rename to ui/dist/assets/PageRecordConfirmEmailChange-eIqoWA8x.js index fc39b16a..e8a42635 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-CS--tlmU.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-eIqoWA8x.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as z,F as A,d as L,t as h,a as v,m as S,c as I,J as D,h as _,D as N,l as b,L as R,M as W,g as Y,p as j,H as P,o as q,u as m,v as y,w as p,f as B,k as T,n as g,q as G,A as C,I as K,z as F,C as O}from"./index-ChXAaRxB.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new B({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=C(`Type your password to confirm changing your email address +import{S as J,i as M,s as z,F as A,d as L,t as h,a as v,m as S,c as I,J as D,h as _,D as N,l as b,L as R,M as W,g as Y,p as j,H as P,o as q,u as m,v as y,w as p,f as B,k as T,n as g,q as G,A as C,I as K,z as F,C as O}from"./index-DjYVmtoM.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new B({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=C(`Type your password to confirm changing your email address `),d&&d.c(),s=y(),I(o.$$.fragment),f=y(),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){b(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||($=q(e,"submit",G(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 E={};w&769&&(E.$$scope={dirty:w,ctx:c}),o.$set(E),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(v(o.$$.fragment,c),u=!0)},o(c){h(o.$$.fragment,c),u=!1},d(c){c&&_(e),d&&d.d(),L(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=y(),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){b(o,e,f),b(o,t,f),b(o,n,f),l||(s=q(n,"click",i[6]),l=!0)},p:P,i:P,o:P,d(o){o&&(_(e),_(t),_(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=C("to "),t=m("strong"),n=C(i[3]),p(t,"class","txt-nowrap")},m(l,s){b(l,e,s),b(l,t,s),g(t,n)},p(l,s){s&8&&K(n,l[3])},d(l){l&&(_(e),_(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=C("Password"),l=y(),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){b(r,e,u),g(e,t),b(r,l,u),b(r,s,u),F(s,i[0]),s.focus(),f||(a=q(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&&(_(e),_(l),_(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),b(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(O(),h(o[u],1,1,()=>{o[u]=null}),N(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),v(t,1),t.m(n.parentNode,n))},i(a){l||(v(t),l=!0)},o(a){h(t),l=!1},d(a){a&&_(n),o[e].d(a)}}}function Z(i){let e,t;return e=new A({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){I(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||(v(e.$$.fragment,n),t=!0)},o(n){h(e.$$.fragment,n),t=!1},d(n){L(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new 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($){j.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=D.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,z,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-BdDq85c3.js b/ui/dist/assets/PageRecordConfirmPasswordReset-Dn-6dV59.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-BdDq85c3.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-Dn-6dV59.js index 08e64946..89406cbb 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-BdDq85c3.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-Dn-6dV59.js @@ -1,2 +1,2 @@ -import{S as A,i as D,s as W,F as Y,d as H,t as P,a as q,m as L,c as N,J as j,h as _,C as B,D as E,l as m,L as G,M as K,g as O,p as Q,H as F,o as S,u as b,v as C,w as p,f as J,k as M,n as w,q as U,A as y,I as V,z as R}from"./index-ChXAaRxB.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&z(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 A,i as D,s as W,F as Y,d as H,t as P,a as q,m as L,c as N,J as j,h as _,C as B,D as E,l as m,L as G,M as K,g as O,p as Q,H as F,o as S,u as b,v as C,w as p,f as J,k as M,n as w,q as U,A as y,I as V,z as R}from"./index-DjYVmtoM.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&z(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(),N(o.$$.fragment),c=C(),N(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,$){m(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=z(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||(q(o.$$.fragment,f),q(r.$$.fragment,f),g=!0)},o(f){P(o.$$.fragment,f),P(r.$$.fragment,f),g=!1},d(f){f&&_(e),d&&d.d(),H(o),H(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){m(o,e,c),m(o,l,c),m(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(_(e),_(l),_(s)),n=!1,t()}}}function z(a){let e,l,s;return{c(){e=y("for "),l=b("strong"),s=y(a[4])},m(n,t){m(n,e,t),m(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(_(e),_(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){m(i,e,u),w(e,l),m(i,n,u),m(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&&(_(e),_(n),_(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){m(i,e,u),w(e,l),m(i,n,u),m(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&&(_(e),_(n),_(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=G()},m(r,i){o[e].m(r,i),m(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),P(o[u],1,1,()=>{o[u]=null}),E(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),q(l,1),l.m(s.parentNode,s))},i(r){n||(q(l),n=!0)},o(r){P(l),n=!1},d(r){r&&_(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){N(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||(q(e.$$.fragment,s),l=!0)},o(s){P(e.$$.fragment,s),l=!1},d(s){H(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends A{constructor(e){super(),D(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-DP-zC8Bz.js b/ui/dist/assets/PageRecordConfirmVerification-ByYtK2uy.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmVerification-DP-zC8Bz.js rename to ui/dist/assets/PageRecordConfirmVerification-ByYtK2uy.js index f7d0fb5a..c261cae1 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-DP-zC8Bz.js +++ b/ui/dist/assets/PageRecordConfirmVerification-ByYtK2uy.js @@ -1 +1 @@ -import{S as M,i as P,s as R,F as I,d as N,t as S,a as V,m as q,c as F,M as w,g as y,N as E,h as r,l as a,L as g,p as j,H as k,u,w as d,o as m,v,k as C,n as z}from"./index-ChXAaRxB.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='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){a(i,e,f),a(i,l,f),c.m(i,f),a(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&&(r(e),r(l),r(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

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

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){a(c,e,i),a(c,l,i),a(c,n,i),t||(s=m(n,"click",o[7]),t=!0)},p:k,d(c){c&&(r(e),r(l),r(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){a(l,e,n)},p:k,d(l){l&&r(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){a(t,e,s),l||(n=m(e,"click",o[9]),l=!0)},p:k,d(t){t&&r(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){a(s,e,c),z(e,l),n||(t=m(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&&r(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),a(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&&r(e),t.d(s)}}}function Q(o){let e,l;return e=new I({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){F(e.$$.fragment)},m(n,t){q(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(V(e.$$.fragment,n),l=!0)},o(n){S(e.$$.fragment,n),l=!1},d(n){N(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(_){j.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),H=()=>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)&&E(t.token))},[s,c,i,f,n,T,t,h,H,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 I,d as N,t as S,a as V,m as q,c as F,M as w,g as y,N as E,h as r,l as a,L as g,p as j,H as k,u,w as d,o as m,v,k as C,n as z}from"./index-DjYVmtoM.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='

Invalid or expired verification token.

',l=v(),c.c(),n=g(),d(e,"class","alert alert-danger")},m(i,f){a(i,e,f),a(i,l,f),c.m(i,f),a(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&&(r(e),r(l),r(n)),c.d(i)}}}function B(o){let e,l,n,t,s;return{c(){e=u("div"),e.innerHTML='

Please check your email for the new verification link.

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

Successfully verified email address.

',l=v(),n=u("button"),n.textContent="Close",d(e,"class","alert alert-success"),d(n,"type","button"),d(n,"class","btn btn-transparent btn-block")},m(c,i){a(c,e,i),a(c,l,i),a(c,n,i),t||(s=m(n,"click",o[7]),t=!0)},p:k,d(c){c&&(r(e),r(l),r(n)),t=!1,s()}}}function G(o){let e;return{c(){e=u("div"),e.innerHTML='
Please wait...
',d(e,"class","txt-center")},m(l,n){a(l,e,n)},p:k,d(l){l&&r(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){a(t,e,s),l||(n=m(e,"click",o[9]),l=!0)},p:k,d(t){t&&r(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){a(s,e,c),z(e,l),n||(t=m(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&&r(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),a(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&&r(e),t.d(s)}}}function Q(o){let e,l;return e=new I({props:{nobranding:!0,$$slots:{default:[O]},$$scope:{ctx:o}}}),{c(){F(e.$$.fragment)},m(n,t){q(e,n,t),l=!0},p(n,[t]){const s={};t&2079&&(s.$$scope={dirty:t,ctx:n}),e.$set(s)},i(n){l||(V(e.$$.fragment,n),l=!0)},o(n){S(e.$$.fragment,n),l=!1},d(n){N(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(_){j.error(_),l(2,i=!1)}l(3,f=!1)}const h=()=>window.close(),H=()=>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)&&E(t.token))},[s,c,i,f,n,T,t,h,H,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-1IyKQ6zI.js b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BUk9QWNe.js similarity index 98% rename from ui/dist/assets/PageSuperuserConfirmPasswordReset-1IyKQ6zI.js rename to ui/dist/assets/PageSuperuserConfirmPasswordReset-BUk9QWNe.js index e52a1c94..54dd87de 100644 --- a/ui/dist/assets/PageSuperuserConfirmPasswordReset-1IyKQ6zI.js +++ b/ui/dist/assets/PageSuperuserConfirmPasswordReset-BUk9QWNe.js @@ -1,2 +1,2 @@ -import{S as L,i as W,s as y,F as D,d as R,t as J,a as N,m as T,c as j,J as M,f as G,h as b,j as O,k as H,l as w,n as c,o as z,E as Q,q as U,G as V,u as _,A as P,v as h,w as f,p as I,K as X,r as Y,I as Z,z as q}from"./index-ChXAaRxB.js";function K(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){w(l,e,t),w(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(b(e),b(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){w(u,e,a),c(e,n),w(u,l,a),w(u,t,a),q(t,r[0]),t.focus(),p||(d=z(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(b(e),b(l),b(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){w(u,e,a),c(e,n),w(u,l,a),w(u,t,a),q(t,r[1]),p||(d=z(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(b(e),b(l),b(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,A,m=r[3]&&K(r);return i=new G({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new G({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 L,i as W,s as y,F as D,d as R,t as J,a as N,m as T,c as j,J as M,f as G,h as b,j as O,k as H,l as w,n as c,o as z,E as Q,q as U,G as V,u as _,A as P,v as h,w as f,p as I,K as X,r as Y,I as Z,z as q}from"./index-DjYVmtoM.js";function K(r){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(r[3]),f(n,"class","txt-nowrap")},m(l,t){w(l,e,t),w(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(b(e),b(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){w(u,e,a),c(e,n),w(u,l,a),w(u,t,a),q(t,r[0]),t.focus(),p||(d=z(t,"input",r[6]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&1&&t.value!==u[0]&&q(t,u[0])},d(u){u&&(b(e),b(l),b(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){w(u,e,a),c(e,n),w(u,l,a),w(u,t,a),q(t,r[1]),p||(d=z(t,"input",r[7]),p=!0)},p(u,a){a&256&&s!==(s=u[8])&&f(e,"for",s),a&256&&i!==(i=u[8])&&f(t,"id",i),a&2&&t.value!==u[1]&&q(t,u[1])},d(u){u&&(b(e),b(l),b(t)),p=!1,d()}}}function te(r){let e,n,s,l,t,i,p,d,u,a,g,S,C,v,k,F,A,m=r[3]&&K(r);return i=new G({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:r}}}),d=new G({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(),j(i.$$.fragment),p=h(),j(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],H(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,$){w(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),T(i,e,null),c(e,p),T(d,e,null),c(e,u),c(e,a),c(a,g),w(o,S,$),w(o,C,$),c(C,v),k=!0,F||(A=[z(e,"submit",U(r[4])),Q(V.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=K(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const B={};$&769&&(B.$$scope={dirty:$,ctx:o}),i.$set(B);const E={};$&770&&(E.$$scope={dirty:$,ctx:o}),d.$set(E),(!k||$&4)&&(a.disabled=o[2]),(!k||$&4)&&H(a,"btn-loading",o[2])},i(o){k||(N(i.$$.fragment,o),N(d.$$.fragment,o),k=!0)},o(o){J(i.$$.fragment,o),J(d.$$.fragment,o),k=!1},d(o){o&&(b(e),b(S),b(C)),m&&m.d(),R(i),R(d),F=!1,O(A)}}}function se(r){let e,n;return e=new D({props:{$$slots:{default:[te]},$$scope:{ctx:r}}}),{c(){j(e.$$.fragment)},m(s,l){T(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(N(e.$$.fragment,s),n=!0)},o(s){J(e.$$.fragment,s),n=!1},d(s){R(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 I.collection("_superusers").confirmPasswordReset(l==null?void 0:l.token,t,i),X("Successfully set a new superuser password."),Y("/")}catch(g){I.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 L{constructor(e){super(),W(this,e,le,se,y,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageSuperuserRequestPasswordReset-ZJjtPYiP.js b/ui/dist/assets/PageSuperuserRequestPasswordReset-uFdlcqFn.js similarity index 98% rename from ui/dist/assets/PageSuperuserRequestPasswordReset-ZJjtPYiP.js rename to ui/dist/assets/PageSuperuserRequestPasswordReset-uFdlcqFn.js index f6633738..b98c090c 100644 --- a/ui/dist/assets/PageSuperuserRequestPasswordReset-ZJjtPYiP.js +++ b/ui/dist/assets/PageSuperuserRequestPasswordReset-uFdlcqFn.js @@ -1 +1 @@ -import{S as M,i as T,s as z,F as A,d as E,t as w,a as y,m as H,c as L,h as g,C as B,D,l as k,n as d,E as G,G as I,v,u as m,w as p,p as C,H as F,I as N,A as h,f as j,k as P,o as R,q as J,z as S}from"./index-ChXAaRxB.js";function K(u){let e,s,n,l,t,r,c,_,i,a,b,f;return l=new j({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:o})=>({5:o}),({uniqueId:o})=>o?32:0]},$$scope:{ctx:u}}}),{c(){e=m("form"),s=m("div"),s.innerHTML='

Forgotten superuser password

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

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

Forgotten superuser password

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

',n=v(),L(l.$$.fragment),t=v(),r=m("button"),c=m("i"),_=v(),i=m("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(i,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-lg btn-block"),r.disabled=u[1],P(r,"btn-loading",u[1]),p(e,"class","m-b-base")},m(o,$){k(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",J(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)&&P(r,"btn-loading",o[1])},i(o){a||(y(l.$$.fragment,o),a=!0)},o(o){w(l.$$.fragment,o),a=!1},d(o){o&&g(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,r,c,_,i;return{c(){e=m("div"),s=m("div"),s.innerHTML='',n=v(),l=m("div"),t=m("p"),r=h("Check "),c=m("strong"),_=h(u[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(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&&N(_,a[0])},i:F,o:F,d(a){a&&g(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){k(i,e,a),d(e,s),k(i,l,a),k(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&&(g(e),g(l),g(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),k(f,n,o),k(f,l,o),d(l,t),r=!0,c||(_=G(I.call(null,t)),c=!0)},p(f,o){let $=e;e=b(f),e===$?a[e].p(f,o):(B(),w(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,o):(s=a[e]=i[e](f),s.c()),y(s,1),s.m(n.parentNode,n))},i(f){r||(y(s),r=!0)},o(f){w(s),r=!1},d(f){f&&(g(n),g(l)),a[e].d(f),c=!1,_()}}}function V(u){let e,s;return e=new A({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){L(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||(y(e.$$.fragment,n),s=!0)},o(n){w(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function r(){if(!l){s(1,l=!0);try{await C.collection("_superusers").requestPasswordReset(n),s(2,t=!0)}catch(_){C.error(_)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,r,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,z,{})}}export{Y as default}; diff --git a/ui/dist/assets/PasswordResetDocs-BKbijaSo.js b/ui/dist/assets/PasswordResetDocs-CHzwnxhE.js similarity index 99% rename from ui/dist/assets/PasswordResetDocs-BKbijaSo.js rename to ui/dist/assets/PasswordResetDocs-CHzwnxhE.js index 171e6a4e..b8558951 100644 --- a/ui/dist/assets/PasswordResetDocs-BKbijaSo.js +++ b/ui/dist/assets/PasswordResetDocs-CHzwnxhE.js @@ -1,4 +1,4 @@ -import{S as se,i as ne,s as oe,X as H,h as b,t as X,a as V,I as Z,Z as ee,_ as ye,C as te,$ as Te,D as le,l as v,n as u,u as p,v as S,A as D,w as k,k as L,o as ae,W as Ee,d as G,m as Q,c as x,V as Ce,Y as fe,J as qe,p as Oe,a0 as pe}from"./index-ChXAaRxB.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"),L(e,"active",t[1]===t[4].code),this.first=e},m(g,y){v(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&Z(d,n),y&6&&L(e,"active",t[1]===t[4].code)},d(g){g&&b(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"),x(n.$$.fragment),d=S(),k(e,"class","tab-item"),L(e,"active",t[1]===t[4].code),this.first=e},m(r,a){v(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)&&L(e,"active",t[1]===t[4].code)},i(r){c||(V(n.$$.fragment,r),c=!0)},o(r){X(n.$$.fragment,r),c=!1},d(r){r&&b(e),G(n)}}}function Ae(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,q,J,W,U,O,A,T,C,R=[],M=new Map,j,N,h=[],K=new Map,E,P=H(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',U=S(),O=p("div"),O.textContent="Responses",A=S(),T=p("div"),C=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as se,i as ne,s as oe,X as H,h as b,t as X,a as V,I as Z,Z as ee,_ as ye,C as te,$ as Te,D as le,l as v,n as u,u as p,v as S,A as D,w as k,k as L,o as ae,W as Ee,d as G,m as Q,c as x,V as Ce,Y as fe,J as qe,p as Oe,a0 as pe}from"./index-DjYVmtoM.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"),L(e,"active",t[1]===t[4].code),this.first=e},m(g,y){v(g,e,y),u(e,d),u(e,c),r||(a=ae(e,"click",f),r=!0)},p(g,y){t=g,y&4&&n!==(n=t[4].code+"")&&Z(d,n),y&6&&L(e,"active",t[1]===t[4].code)},d(g){g&&b(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"),x(n.$$.fragment),d=S(),k(e,"class","tab-item"),L(e,"active",t[1]===t[4].code),this.first=e},m(r,a){v(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)&&L(e,"active",t[1]===t[4].code)},i(r){c||(V(n.$$.fragment,r),c=!0)},o(r){X(n.$$.fragment,r),c=!1},d(r){r&&b(e),G(n)}}}function Ae(o){let t,e,n,d,c,r,a,f=o[0].name+"",g,y,F,q,J,W,U,O,A,T,C,R=[],M=new Map,j,N,h=[],K=new Map,E,P=H(o[2]);const B=l=>l[4].code;for(let l=0;ll[4].code;for(let l=0;lParam Type Description
Required token
String The token from the password reset request email.
Required password
String The new password to set.
Required passwordConfirm
String The new password confirmation.',U=S(),O=p("div"),O.textContent="Responses",A=S(),T=p("div"),C=p("div");for(let l=0;le(1,d=a.code);return o.$$set=a=>{"collection"in a&&e(0,n=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "status": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/RealtimeApiDocs-BHDoW4tn.js b/ui/dist/assets/RealtimeApiDocs-Ccu7wZvj.js similarity index 99% rename from ui/dist/assets/RealtimeApiDocs-BHDoW4tn.js rename to ui/dist/assets/RealtimeApiDocs-Ccu7wZvj.js index 343c9115..e570eecd 100644 --- a/ui/dist/assets/RealtimeApiDocs-BHDoW4tn.js +++ b/ui/dist/assets/RealtimeApiDocs-Ccu7wZvj.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 s,d as se,t as ne,a as ie,I as me,l as n,n as y,m as ce,u as p,A as I,v as a,c as le,w as u,p as de}from"./index-ChXAaRxB.js";function he(o){var B,U,W,A,L,H,T,q,J,M,j,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,w,g,C,v,E,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 s,d as se,t as ne,a as ie,I as me,l as n,n as y,m as ce,u as p,A as I,v as a,c as le,w as u,p as de}from"./index-DjYVmtoM.js";function he(o){var B,U,W,A,L,H,T,q,J,M,j,N;let i,m,c=o[0].name+"",b,d,k,h,D,f,_,l,S,$,w,g,C,v,E,r,R;return l=new pe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[1]}'); diff --git a/ui/dist/assets/UpdateApiDocs-DkcacVoU.js b/ui/dist/assets/UpdateApiDocs-D66gcPkv.js similarity index 99% rename from ui/dist/assets/UpdateApiDocs-DkcacVoU.js rename to ui/dist/assets/UpdateApiDocs-D66gcPkv.js index 98c6867a..b246fbb8 100644 --- a/ui/dist/assets/UpdateApiDocs-DkcacVoU.js +++ b/ui/dist/assets/UpdateApiDocs-D66gcPkv.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as St,V as Ot,X as se,W as Tt,h as d,d as ge,t as _e,a as he,I as ee,Z as Je,_ as bt,C as qt,$ as Rt,D as Ht,l as o,n as a,m as we,u as s,A as _,v as f,c as Ce,w as k,J as ye,p as Pt,k as Te,o as Lt,H as te}from"./index-ChXAaRxB.js";import{F as Dt}from"./FieldsQueryParam-BPQKDixm.js";function mt(r,e,t){const n=r.slice();return n[10]=e[t],n}function _t(r,e,t){const n=r.slice();return n[10]=e[t],n}function ht(r,e,t){const n=r.slice();return n[15]=e[t],n}function yt(r){let e;return{c(){e=s("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as St,V as Ot,X as se,W as Tt,h as d,d as ge,t as _e,a as he,I as ee,Z as Je,_ as bt,C as qt,$ as Rt,D as Ht,l as o,n as a,m as we,u as s,A as _,v as f,c as Ce,w as k,J as ye,p as Pt,k as Te,o as Lt,H as te}from"./index-DjYVmtoM.js";import{F as Dt}from"./FieldsQueryParam-BiUsK6GB.js";function mt(r,e,t){const n=r.slice();return n[10]=e[t],n}function _t(r,e,t){const n=r.slice();return n[10]=e[t],n}function ht(r,e,t){const n=r.slice();return n[15]=e[t],n}function yt(r){let e;return{c(){e=s("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){o(t,e,n)},d(t){t&&d(e)}}}function kt(r){let e;return{c(){e=s("p"),e.innerHTML="Requires superuser Authorization:TOKEN header",k(e,"class","txt-hint txt-sm txt-right")},m(t,n){o(t,e,n)},d(t){t&&d(e)}}}function vt(r){let e,t,n,b,p,c,u,m,S,T,H,P,$,M,q,L,J,j,O,R,D,v,g,w;function x(h,C){var le,W,ne;return C&1&&(m=null),m==null&&(m=!!((ne=(W=(le=h[0])==null?void 0:le.fields)==null?void 0:W.find(zt))!=null&&ne.required)),m?Bt:Ft}let Q=x(r,-1),B=Q(r);return{c(){e=s("tr"),e.innerHTML='Auth specific fields',t=f(),n=s("tr"),n.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/VerificationDocs-BKpmlyO1.js b/ui/dist/assets/VerificationDocs-DGrZV9bE.js similarity index 99% rename from ui/dist/assets/VerificationDocs-BKpmlyO1.js rename to ui/dist/assets/VerificationDocs-DGrZV9bE.js index ccb23430..22334aff 100644 --- a/ui/dist/assets/VerificationDocs-BKpmlyO1.js +++ b/ui/dist/assets/VerificationDocs-DGrZV9bE.js @@ -1,4 +1,4 @@ -import{S as le,i as ne,s as ie,X as F,h as b,t as j,a as U,I as Y,Z as x,_ as Te,C as ee,$ as Ce,D as te,l as h,n as u,u as m,v as y,A as M,w as v,k as K,o as oe,W as qe,d as z,m as G,c as Q,V as Ve,Y as fe,J as Ae,p as Ie,a0 as ue}from"./index-ChXAaRxB.js";function de(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function d(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(g,C){h(g,e,C),u(e,f),u(e,c),r||(a=oe(e,"click",d),r=!0)},p(g,C){t=g,C&4&&o!==(o=t[4].code+"")&&Y(f,o),C&6&&K(e,"active",t[1]===t[4].code)},d(g){g&&b(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new qe({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Q(o.$$.fragment),f=y(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(r,a){h(r,e,a),G(o,e,null),u(e,f),c=!0},p(r,a){t=r;const d={};a&4&&(d.content=t[4].body),o.$set(d),(!c||a&6)&&K(e,"active",t[1]===t[4].code)},i(r){c||(U(o.$$.fragment,r),c=!0)},o(r){j(o.$$.fragment,r),c=!1},d(r){r&&b(e),z(o)}}}function Pe(s){let t,e,o,f,c,r,a,d=s[0].name+"",g,C,D,P,L,R,B,O,N,q,V,$=[],J=new Map,H,I,p=[],T=new Map,A,_=F(s[2]);const X=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=X(i);J.set(n,$[l]=pe(n,i))}let E=F(s[2]);const W=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),O=m("div"),O.textContent="Responses",N=y(),q=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();H=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` +import{S as le,i as ne,s as ie,X as F,h as b,t as j,a as U,I as Y,Z as x,_ as Te,C as ee,$ as Ce,D as te,l as h,n as u,u as m,v as y,A as M,w as v,k as K,o as oe,W as qe,d as z,m as G,c as Q,V as Ve,Y as fe,J as Ae,p as Ie,a0 as ue}from"./index-DjYVmtoM.js";function de(s,t,e){const o=s.slice();return o[4]=t[e],o}function me(s,t,e){const o=s.slice();return o[4]=t[e],o}function pe(s,t){let e,o=t[4].code+"",f,c,r,a;function d(){return t[3](t[4])}return{key:s,first:null,c(){e=m("button"),f=M(o),c=y(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(g,C){h(g,e,C),u(e,f),u(e,c),r||(a=oe(e,"click",d),r=!0)},p(g,C){t=g,C&4&&o!==(o=t[4].code+"")&&Y(f,o),C&6&&K(e,"active",t[1]===t[4].code)},d(g){g&&b(e),r=!1,a()}}}function _e(s,t){let e,o,f,c;return o=new qe({props:{content:t[4].body}}),{key:s,first:null,c(){e=m("div"),Q(o.$$.fragment),f=y(),v(e,"class","tab-item"),K(e,"active",t[1]===t[4].code),this.first=e},m(r,a){h(r,e,a),G(o,e,null),u(e,f),c=!0},p(r,a){t=r;const d={};a&4&&(d.content=t[4].body),o.$set(d),(!c||a&6)&&K(e,"active",t[1]===t[4].code)},i(r){c||(U(o.$$.fragment,r),c=!0)},o(r){j(o.$$.fragment,r),c=!1},d(r){r&&b(e),z(o)}}}function Pe(s){let t,e,o,f,c,r,a,d=s[0].name+"",g,C,D,P,L,R,B,O,N,q,V,$=[],J=new Map,H,I,p=[],T=new Map,A,_=F(s[2]);const X=l=>l[4].code;for(let l=0;l<_.length;l+=1){let i=me(s,_,l),n=X(i);J.set(n,$[l]=pe(n,i))}let E=F(s[2]);const W=l=>l[4].code;for(let l=0;lParam Type Description
Required token
String The token from the verification request email.',B=y(),O=m("div"),O.textContent="Responses",N=y(),q=m("div"),V=m("div");for(let l=0;l<$.length;l+=1)$[l].c();H=y(),I=m("div");for(let l=0;le(1,f=a.code);return s.$$set=a=>{"collection"in a&&e(0,o=a.collection)},e(2,c=[{code:204,body:"null"},{code:400,body:` { "status": 400, "message": "An error occurred while validating the submitted data.", diff --git a/ui/dist/assets/ViewApiDocs-B2y8Uo6-.js b/ui/dist/assets/ViewApiDocs-jOgeApYb.js similarity index 98% rename from ui/dist/assets/ViewApiDocs-B2y8Uo6-.js rename to ui/dist/assets/ViewApiDocs-jOgeApYb.js index e0dec2dd..9ca2f135 100644 --- a/ui/dist/assets/ViewApiDocs-B2y8Uo6-.js +++ b/ui/dist/assets/ViewApiDocs-jOgeApYb.js @@ -1,4 +1,4 @@ -import{S as lt,i as st,s as nt,V as at,W as tt,X as K,h as r,d as W,t as V,a as j,I as ve,Z as Ge,_ as ot,C as it,$ as rt,D as dt,l as d,n as l,m as X,u as a,A as _,v as b,c as Z,w as m,J as Ke,p as ct,k as Y,o as pt}from"./index-ChXAaRxB.js";import{F as ut}from"./FieldsQueryParam-BPQKDixm.js";function We(o,s,n){const i=o.slice();return i[6]=s[n],i}function Xe(o,s,n){const i=o.slice();return i[6]=s[n],i}function Ze(o){let s;return{c(){s=a("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){d(n,s,i)},d(n){n&&r(s)}}}function Ye(o,s){let n,i,v;function p(){return s[5](s[6])}return{key:o,first:null,c(){n=a("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Y(n,"active",s[2]===s[6].code),this.first=n},m(c,f){d(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Y(n,"active",s[2]===s[6].code)},d(c){c&&r(n),i=!1,v()}}}function et(o,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:o,first:null,c(){n=a("div"),Z(i.$$.fragment),v=b(),m(n,"class","tab-item"),Y(n,"active",s[2]===s[6].code),this.first=n},m(c,f){d(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Y(n,"active",s[2]===s[6].code)},i(c){p||(j(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&r(n),W(i)}}}function ft(o){var Je,Ne;let s,n,i=o[0].name+"",v,p,c,f,w,C,ee,J=o[0].name+"",te,$e,le,F,se,B,ne,$,N,ye,Q,T,we,ae,z=o[0].name+"",oe,Ce,ie,Fe,re,I,de,S,ce,x,pe,R,ue,Re,M,D,fe,De,be,Oe,h,Pe,E,Te,Ee,Ae,me,Be,_e,Ie,Se,xe,he,Me,qe,A,ke,q,ge,O,H,y=[],He=new Map,Le,L,k=[],Ue=new Map,P;F=new at({props:{js:` +import{S as lt,i as st,s as nt,V as at,W as tt,X as K,h as r,d as W,t as V,a as j,I as ve,Z as Ge,_ as ot,C as it,$ as rt,D as dt,l as d,n as l,m as X,u as a,A as _,v as b,c as Z,w as m,J as Ke,p as ct,k as Y,o as pt}from"./index-DjYVmtoM.js";import{F as ut}from"./FieldsQueryParam-BiUsK6GB.js";function We(o,s,n){const i=o.slice();return i[6]=s[n],i}function Xe(o,s,n){const i=o.slice();return i[6]=s[n],i}function Ze(o){let s;return{c(){s=a("p"),s.innerHTML="Requires superuser Authorization:TOKEN header",m(s,"class","txt-hint txt-sm txt-right")},m(n,i){d(n,s,i)},d(n){n&&r(s)}}}function Ye(o,s){let n,i,v;function p(){return s[5](s[6])}return{key:o,first:null,c(){n=a("button"),n.textContent=`${s[6].code} `,m(n,"class","tab-item"),Y(n,"active",s[2]===s[6].code),this.first=n},m(c,f){d(c,n,f),i||(v=pt(n,"click",p),i=!0)},p(c,f){s=c,f&20&&Y(n,"active",s[2]===s[6].code)},d(c){c&&r(n),i=!1,v()}}}function et(o,s){let n,i,v,p;return i=new tt({props:{content:s[6].body}}),{key:o,first:null,c(){n=a("div"),Z(i.$$.fragment),v=b(),m(n,"class","tab-item"),Y(n,"active",s[2]===s[6].code),this.first=n},m(c,f){d(c,n,f),X(i,n,null),l(n,v),p=!0},p(c,f){s=c,(!p||f&20)&&Y(n,"active",s[2]===s[6].code)},i(c){p||(j(i.$$.fragment,c),p=!0)},o(c){V(i.$$.fragment,c),p=!1},d(c){c&&r(n),W(i)}}}function ft(o){var Je,Ne;let s,n,i=o[0].name+"",v,p,c,f,w,C,ee,J=o[0].name+"",te,$e,le,F,se,B,ne,$,N,ye,Q,T,we,ae,z=o[0].name+"",oe,Ce,ie,Fe,re,I,de,S,ce,x,pe,R,ue,Re,M,D,fe,De,be,Oe,h,Pe,E,Te,Ee,Ae,me,Be,_e,Ie,Se,xe,he,Me,qe,A,ke,q,ge,O,H,y=[],He=new Map,Le,L,k=[],Ue=new Map,P;F=new at({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/index-ChXAaRxB.js b/ui/dist/assets/index-DjYVmtoM.js similarity index 74% rename from ui/dist/assets/index-ChXAaRxB.js rename to ui/dist/assets/index-DjYVmtoM.js index dcc72c4e..c1433eb6 100644 --- a/ui/dist/assets/index-ChXAaRxB.js +++ b/ui/dist/assets/index-DjYVmtoM.js @@ -1,132 +1,132 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-OQbEqM-k.js","./index-CN02J7Id.js","./ListApiDocs-CcCzYz3p.js","./FieldsQueryParam-BPQKDixm.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-B2y8Uo6-.js","./CreateApiDocs-lXFE62xH.js","./UpdateApiDocs-DkcacVoU.js","./AuthMethodsDocs-Ded_AT2F.js","./AuthWithPasswordDocs-DhLB4CTX.js","./AuthWithOAuth2Docs-D0NUW2n8.js","./AuthWithOtpDocs-8gtiEr6v.js","./AuthRefreshDocs-B7jzqxzk.js","./CodeEditor-oVf9mPjW.js","./Leaflet-D3mFU3hI.js","./Leaflet-DCQr6yJv.css"])))=>i.map(i=>d[i]); -var tv=Object.defineProperty;var nv=(n,e,t)=>e in n?tv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>nv(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function te(){}const so=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function iv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function u0(n){return n()}function bf(){return Object.create(null)}function Ee(n){n.forEach(u0)}function Lt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function wn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function lv(n){return Object.keys(n).length===0}function ku(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 f0(n){let e;return ku(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ku(e,t))}function Nt(n,e,t,i){if(n){const s=c0(n,e,t,i);return n[0](s)}}function c0(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Rt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),yu=d0?n=>requestAnimationFrame(n):te;const Gl=new Set;function p0(n){Gl.forEach(e=>{e.c(n)||(Gl.delete(e),e.f())}),Gl.size!==0&&yu(p0)}function Tr(n){let e;return Gl.size===0&&yu(p0),{promise:new Promise(t=>{Gl.add(e={c:n,f:t})}),abort(){Gl.delete(e)}}}function v(n,e){n.appendChild(e)}function m0(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function sv(n){const e=b("style");return e.textContent="/* empty */",ov(m0(n),e),e.sheet}function ov(n,e){return v(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function it(n){return function(e){return e.preventDefault(),n.call(this,e)}}function tn(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 rv=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&rv.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function av(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 mt(n){return n===""?null:+n}function uv(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function me(n,e){n.value=e??""}function h0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function _0(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ht(n,e){return new n(e)}const rr=new Map;let ar=0;function fv(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function cv(n,e){const t={stylesheet:sv(e),rules:{}};return rr.set(n,t),t}function Vs(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ -`;for(let h=0;h<=1;h+=a){const k=e+(t-e)*l(h);u+=h*100+`%{${o(k,1-k)}} +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-D6GbKUeb.js","./index-CN02J7Id.js","./ListApiDocs-DcR09AiE.js","./FieldsQueryParam-BiUsK6GB.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-jOgeApYb.js","./CreateApiDocs-ChXbrqJd.js","./UpdateApiDocs-D66gcPkv.js","./AuthMethodsDocs-emhroE88.js","./AuthWithPasswordDocs-CJv5XhID.js","./AuthWithOAuth2Docs-DqJ60m_y.js","./AuthWithOtpDocs-CDQM7KGQ.js","./AuthRefreshDocs-C8u7IdT_.js","./CodeEditor-CTDCRa84.js","./Leaflet-U8ucILHG.js","./Leaflet-DCQr6yJv.css"])))=>i.map(i=>d[i]); +var nv=Object.defineProperty;var iv=(n,e,t)=>e in n?nv(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var pt=(n,e,t)=>iv(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function te(){}const so=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function lv(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function f0(n){return n()}function bf(){return Object.create(null)}function Ee(n){n.forEach(f0)}function Lt(n){return typeof n=="function"}function be(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let So;function wn(n,e){return n===e?!0:(So||(So=document.createElement("a")),So.href=e,n===So.href)}function sv(n){return Object.keys(n).length===0}function ku(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 c0(n){let e;return ku(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ku(e,t))}function Nt(n,e,t,i){if(n){const s=d0(n,e,t,i);return n[0](s)}}function d0(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Rt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),yu=p0?n=>requestAnimationFrame(n):te;const Gl=new Set;function m0(n){Gl.forEach(e=>{e.c(n)||(Gl.delete(e),e.f())}),Gl.size!==0&&yu(m0)}function Tr(n){let e;return Gl.size===0&&yu(m0),{promise:new Promise(t=>{Gl.add(e={c:n,f:t})}),abort(){Gl.delete(e)}}}function v(n,e){n.appendChild(e)}function h0(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function ov(n){const e=b("style");return e.textContent="/* empty */",rv(h0(n),e),e.sheet}function rv(n,e){return v(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function y(n){n.parentNode&&n.parentNode.removeChild(n)}function dt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function it(n){return function(e){return e.preventDefault(),n.call(this,e)}}function tn(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 av=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&av.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function uv(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 mt(n){return n===""?null:+n}function fv(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function me(n,e){n.value=e??""}function _0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function g0(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Ht(n,e){return new n(e)}const rr=new Map;let ar=0;function cv(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function dv(n,e){const t={stylesheet:ov(e),rules:{}};return rr.set(n,t),t}function Vs(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ +`;for(let _=0;_<=1;_+=a){const k=e+(t-e)*l(_);u+=_*100+`%{${o(k,1-k)}} `}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${fv(f)}_${r}`,d=m0(n),{stylesheet:m,rules:_}=rr.get(d)||cv(d,n);_[c]||(_[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 ${s}ms 1 both`,ar+=1,c}function Bs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ar-=s,ar||dv())}function dv(){yu(()=>{ar||(rr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&y(e)}),rr.clear())})}function pv(n,e,t,i){if(!e)return te;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return te;const{delay:l=0,duration:o=300,easing:r=so,start:a=Sr()+l,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,_;function g(){c&&(_=Vs(n,0,1,o,l,r,c)),l||(m=!0)}function h(){c&&Bs(n,_),d=!1}return Tr(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),h()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),h}function mv(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,g0(n,s)}}function g0(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Ws;function ji(n){Ws=n}function oo(){if(!Ws)throw new Error("Function called outside component initialization");return Ws}function un(n){oo().$$.on_mount.push(n)}function hv(n){oo().$$.after_update.push(n)}function ro(n){oo().$$.on_destroy.push(n)}function wt(){const n=oo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=_0(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Le(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Jl=[],ne=[];let Xl=[];const qa=[],b0=Promise.resolve();let ja=!1;function k0(){ja||(ja=!0,b0.then(vu))}function _n(){return k0(),b0}function tt(n){Xl.push(n)}function $e(n){qa.push(n)}const Zr=new Set;let Ul=0;function vu(){if(Ul!==0)return;const n=Ws;do{try{for(;Uln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Xl=e}let ks;function wu(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function Ol(n,e,t){n.dispatchEvent(_0(`${e?"intro":"outro"}${t}`))}const Zo=new Set;let Ti;function oe(){Ti={r:0,c:[],p:Ti}}function re(){Ti.r||Ee(Ti.c),Ti=Ti.p}function M(n,e){n&&n.i&&(Zo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Zo.has(n))return;Zo.add(n),Ti.c.push(()=>{Zo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const Su={duration:0};function y0(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&Bs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:_=so,tick:g=te,css:h}=s||Su;h&&(o=Vs(n,0,1,m,d,_,h,a++)),g(0,1);const k=Sr()+d,S=k+m;r&&r.abort(),l=!0,tt(()=>Ol(n,!0,"start")),r=Tr($=>{if(l){if($>=S)return g(1,0),Ol(n,!0,"end"),u(),l=!1;if($>=k){const T=_(($-k)/m);g(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,Bs(n),Lt(s)?(s=s(i),wu().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function Tu(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Ti;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=so,tick:m=te,css:_}=s||Su;_&&(o=Vs(n,1,0,c,f,d,_));const g=Sr()+f,h=g+c;tt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Tr(k=>{if(l){if(k>=h)return m(0,1),Ol(n,!1,"end"),--r.r||Ee(r.c),!1;if(k>=g){const S=d((k-g)/c);m(1-S,S)}}return l})}return Lt(s)?wu().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&Bs(n,o),l=!1)}}}function qe(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Bs(n,u)}function d(_,g){const h=_.b-o;return g*=Math.abs(h),{a:o,b:_.b,d:h,duration:g,start:_.start,end:_.start+g,group:_.group}}function m(_){const{delay:g=0,duration:h=300,easing:k=so,tick:S=te,css:$}=l||Su,T={start:Sr()+g,b:_};_||(T.group=Ti,Ti.r+=1),"inert"in n&&(_?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Vs(n,o,_,h,g,k,$)),_&&S(0,1),r=d(T,h),tt(()=>Ol(n,_,"start")),Tr(O=>{if(a&&O>a.start&&(r=d(a,h),a=null,Ol(n,r.b,"start"),$&&(c(),u=Vs(n,o,r.b,r.duration,0,k,l.css))),r){if(O>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||Ee(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(_){Lt(l)?wu().then(()=>{l=l({direction:_?"in":"out"}),m(_)}):m(_)},end(){c(),r=a=null}}}function yf(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(oe(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),re())}):e.block.d(1),u.c(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&vu()}if(iv(n)){const s=oo();if(n.then(l=>{ji(s),i(e.then,1,e.value,l),ji(null)},l=>{if(ji(s),i(e.catch,2,e.error,l),ji(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function bv(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ce(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function li(n,e){n.d(1),e.delete(n.key)}function Yt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function kv(n,e){n.f(),Yt(n,e)}function kt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,_=d;const g={};for(;_--;)g[n[_].key]=_;const h=[],k=new Map,S=new Map,$=[];for(_=m;_--;){const L=c(s,l,_),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.set(I,h[_]=A),I in g&&S.set(I,Math.abs(_-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=h[m-1],I=n[d-1],A=L.key,P=I.key;L===I?(f=L.first,d--,m--):k.has(P)?!o.has(A)||T.has(A)?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];k.has(L.key)||a(L,o)}for(;m;)E(h[m-1]);return Ee($),h}function vt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function At(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),tt(()=>{const l=n.$$.on_mount.map(u0).filter(Lt);n.$$.on_destroy?n.$$.on_destroy.push(...l):Ee(l),n.$$.on_mount=[]}),s.forEach(tt)}function j(n,e){const t=n.$$;t.fragment!==null&&(gv(t.after_update),Ee(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function yv(n,e){n.$$.dirty[0]===-1&&(Jl.push(n),k0(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const _=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=_)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](_),f&&yv(n,c)),d}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=uv(e.target);u.fragment&&u.fragment.l(c),c.forEach(y)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),vu()}ji(a)}class ve{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){j(this,1),this.$destroy=te}$on(e,t){if(!Lt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!lv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const vv="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(vv);class Pl extends Error{}class wv extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Sv extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Tv extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zl extends Pl{}class v0 extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class gn extends Pl{}class Ki extends Pl{constructor(){super("Zone is an abstract class")}}const ze="numeric",pi="short",Bn="long",ur={year:ze,month:ze,day:ze},w0={year:ze,month:pi,day:ze},$v={year:ze,month:pi,day:ze,weekday:pi},S0={year:ze,month:Bn,day:ze},T0={year:ze,month:Bn,day:ze,weekday:Bn},$0={hour:ze,minute:ze},C0={hour:ze,minute:ze,second:ze},O0={hour:ze,minute:ze,second:ze,timeZoneName:pi},M0={hour:ze,minute:ze,second:ze,timeZoneName:Bn},E0={hour:ze,minute:ze,hourCycle:"h23"},D0={hour:ze,minute:ze,second:ze,hourCycle:"h23"},I0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:pi},L0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Bn},A0={year:ze,month:ze,day:ze,hour:ze,minute:ze},P0={year:ze,month:ze,day:ze,hour:ze,minute:ze,second:ze},N0={year:ze,month:pi,day:ze,hour:ze,minute:ze},R0={year:ze,month:pi,day:ze,hour:ze,minute:ze,second:ze},Cv={year:ze,month:pi,day:ze,weekday:pi,hour:ze,minute:ze},F0={year:ze,month:Bn,day:ze,hour:ze,minute:ze,timeZoneName:pi},q0={year:ze,month:Bn,day:ze,hour:ze,minute:ze,second:ze,timeZoneName:pi},j0={year:ze,month:Bn,day:ze,weekday:Bn,hour:ze,minute:ze,timeZoneName:Bn},H0={year:ze,month:Bn,day:ze,weekday:Bn,hour:ze,minute:ze,second:ze,timeZoneName:Bn};class ao{get type(){throw new Ki}get name(){throw new Ki}get ianaName(){return this.name}get isUniversal(){throw new Ki}offsetName(e,t){throw new Ki}formatOffset(e,t){throw new Ki}offset(e){throw new Ki}equals(e){throw new Ki}get isValid(){throw new Ki}}let Gr=null;class $r extends ao{static get instance(){return Gr===null&&(Gr=new $r),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return X0(e,t,i)}formatOffset(e,t){return Ls(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Ha=new Map;function Ov(n){let e=Ha.get(n);return e===void 0&&(e=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"}),Ha.set(n,e)),e}const Mv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ev(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function Dv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?_:1e3+_,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let vf={};function Iv(n,e={}){const t=JSON.stringify([n,e]);let i=vf[t];return i||(i=new Intl.ListFormat(n,e),vf[t]=i),i}const za=new Map;function Ua(n,e={}){const t=JSON.stringify([n,e]);let i=za.get(t);return i===void 0&&(i=new Intl.DateTimeFormat(n,e),za.set(t,i)),i}const Va=new Map;function Lv(n,e={}){const t=JSON.stringify([n,e]);let i=Va.get(t);return i===void 0&&(i=new Intl.NumberFormat(n,e),Va.set(t,i)),i}const Ba=new Map;function Av(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Ba.get(s);return l===void 0&&(l=new Intl.RelativeTimeFormat(n,e),Ba.set(s,l)),l}let Cs=null;function Pv(){return Cs||(Cs=new Intl.DateTimeFormat().resolvedOptions().locale,Cs)}const Wa=new Map;function z0(n){let e=Wa.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Wa.set(n,e)),e}const Ya=new Map;function Nv(n){let e=Ya.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...U0,...e}),Ya.set(n,e)}return e}function Rv(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,s;try{i=Ua(n).resolvedOptions(),s=n}catch{const a=n.substring(0,t);i=Ua(a).resolvedOptions(),s=a}const{numberingSystem:l,calendar:o}=i;return[s,l,o]}}function Fv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function qv(n){const e=[];for(let t=1;t<=12;t++){const i=Xe.utc(2009,t,1);e.push(n(i))}return e}function jv(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 To(n,e,t,i){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):i(e)}function Hv(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||z0(n.locale).numberingSystem==="latn"}class zv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Lv(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):Eu(e,3);return sn(t,this.padTo)}}}class Uv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let s;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?(s=r,this.dt=e):(s="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,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const l={...this.opts};l.timeZone=l.timeZone||s,this.dtf=Ua(t,l)}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 Vv{constructor(e,t,i){this.opts={style:"long",...i},!t&&Z0()&&(this.rtf=Av(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):c2(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const U0={firstDay:1,minimalDays:4,weekend:[6,7]};class Dt{static fromOpts(e){return Dt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,s,l=!1){const o=e||xt.defaultLocale,r=o||(l?"en-US":Pv()),a=t||xt.defaultNumberingSystem,u=i||xt.defaultOutputCalendar,f=Ja(s)||xt.defaultWeekSettings;return new Dt(r,a,u,f,o)}static resetCache(){Cs=null,za.clear(),Va.clear(),Ba.clear(),Wa.clear(),Ya.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:s}={}){return Dt.create(e,t,i,s)}constructor(e,t,i,s,l){const[o,r,a]=Rv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=s,this.intl=Fv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,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:Dt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Ja(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return To(this,e,ek,()=>{const i=this.intl==="ja"||this.intl.startsWith("ja-");t&=!i;const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";if(!this.monthsCache[l][e]){const o=i?r=>this.dtFormatter(r,s).format():r=>this.extract(r,s,"month");this.monthsCache[l][e]=qv(o)}return this.monthsCache[l][e]})}weekdays(e,t=!1){return To(this,e,ik,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=jv(l=>this.extract(l,i,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return To(this,void 0,()=>lk,()=>{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 To(this,e,sk,()=>{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 s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new zv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Uv(e,this.intl,t)}relFormatter(e={}){return new Vv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Iv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||z0(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:G0()?Nv(this.locale):U0}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 Qr=null;class Mn extends ao{static get utcInstance(){return Qr===null&&(Qr=new Mn(0)),Qr}static instance(e){return e===0?Mn.utcInstance:new Mn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Mn(Mr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ls(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 Bv extends ao{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Xi(n,e){if(st(n)||n===null)return e;if(n instanceof ao)return n;if(Gv(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?$r.instance:t==="utc"||t==="gmt"?Mn.utcInstance:Mn.parseSpecifier(t)||Hi.create(n)}else return nl(n)?Mn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Bv(n)}const $u={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wf={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=$u.hanidec.replace(/[\[|\]]/g,"").split("");function Yv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}const Ka=new Map;function Kv(){Ka.clear()}function ai({numberingSystem:n},e=""){const t=n||"latn";let i=Ka.get(t);i===void 0&&(i=new Map,Ka.set(t,i));let s=i.get(e);return s===void 0&&(s=new RegExp(`${$u[t]}${e}`),i.set(e,s)),s}let Sf=()=>Date.now(),Tf="system",$f=null,Cf=null,Of=null,Mf=60,Ef,Df=null;class xt{static get now(){return Sf}static set now(e){Sf=e}static set defaultZone(e){Tf=e}static get defaultZone(){return Xi(Tf,$r.instance)}static get defaultLocale(){return $f}static set defaultLocale(e){$f=e}static get defaultNumberingSystem(){return Cf}static set defaultNumberingSystem(e){Cf=e}static get defaultOutputCalendar(){return Of}static set defaultOutputCalendar(e){Of=e}static get defaultWeekSettings(){return Df}static set defaultWeekSettings(e){Df=Ja(e)}static get twoDigitCutoffYear(){return Mf}static set twoDigitCutoffYear(e){Mf=e%100}static get throwOnInvalid(){return Ef}static set throwOnInvalid(e){Ef=e}static resetCaches(){Dt.resetCache(),Hi.resetCache(),Xe.resetCache(),Kv()}}class fi{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const V0=[0,31,59,90,120,151,181,212,243,273,304,334],B0=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(n,e){return new fi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cu(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function W0(n,e,t){return t+(uo(n)?B0:V0)[e-1]}function Y0(n,e){const t=uo(n)?B0:V0,i=t.findIndex(l=>lYs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Er(n)}}function If(n,e=4,t=1){const{weekYear:i,weekNumber:s,weekday:l}=n,o=Ou(Cu(i,1,e),t),r=Ql(i);let a=s*7+l-o-7+e,u;a<1?(u=i-1,a+=Ql(u)):a>r?(u=i+1,a-=Ql(i)):u=i;const{month:f,day:c}=Y0(u,a);return{year:u,month:f,day:c,...Er(n)}}function xr(n){const{year:e,month:t,day:i}=n,s=W0(e,t,i);return{year:e,ordinal:s,...Er(n)}}function Lf(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Y0(e,t);return{year:e,month:i,day:s,...Er(n)}}function Af(n,e){if(!st(n.localWeekday)||!st(n.localWeekNumber)||!st(n.localWeekYear)){if(!st(n.weekday)||!st(n.weekNumber)||!st(n.weekYear))throw new Zl("Cannot mix locale-based week fields with ISO-based week fields");return st(n.localWeekday)||(n.weekday=n.localWeekday),st(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),st(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 Jv(n,e=4,t=1){const i=Cr(n.weekYear),s=ti(n.weekNumber,1,Ys(n.weekYear,e,t)),l=ti(n.weekday,1,7);return i?s?l?!1:ei("weekday",n.weekday):ei("week",n.weekNumber):ei("weekYear",n.weekYear)}function Zv(n){const e=Cr(n.year),t=ti(n.ordinal,1,Ql(n.year));return e?t?!1:ei("ordinal",n.ordinal):ei("year",n.year)}function K0(n){const e=Cr(n.year),t=ti(n.month,1,12),i=ti(n.day,1,cr(n.year,n.month));return e?t?i?!1:ei("day",n.day):ei("month",n.month):ei("year",n.year)}function J0(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ti(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ti(t,0,59),r=ti(i,0,59),a=ti(s,0,999);return l?o?r?a?!1:ei("millisecond",s):ei("second",i):ei("minute",t):ei("hour",e)}function st(n){return typeof n>"u"}function nl(n){return typeof n=="number"}function Cr(n){return typeof n=="number"&&n%1===0}function Gv(n){return typeof n=="string"}function Xv(n){return Object.prototype.toString.call(n)==="[object Date]"}function Z0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function G0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Qv(n){return Array.isArray(n)?n:[n]}function Pf(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function xv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function is(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ja(n){if(n==null)return null;if(typeof n!="object")throw new gn("Week settings must be an object");if(!ti(n.firstDay,1,7)||!ti(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!ti(e,1,7)))throw new gn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function ti(n,e,t){return Cr(n)&&n>=e&&n<=t}function e2(n,e){return n-e*Math.floor(n/e)}function sn(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Zi(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function hl(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function Mu(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Eu(n,e,t="round"){const i=10**e;switch(t){case"expand":return n>0?Math.ceil(n*i)/i:Math.floor(n*i)/i;case"trunc":return Math.trunc(n*i)/i;case"round":return Math.round(n*i)/i;case"floor":return Math.floor(n*i)/i;case"ceil":return Math.ceil(n*i)/i;default:throw new RangeError(`Value rounding ${t} is out of range`)}}function uo(n){return n%4===0&&(n%100!==0||n%400===0)}function Ql(n){return uo(n)?366:365}function cr(n,e){const t=e2(e-1,12)+1,i=n+(e-t)/12;return t===2?uo(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Or(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 Nf(n,e,t){return-Ou(Cu(n,1,e),t)+e-1}function Ys(n,e=4,t=1){const i=Nf(n,e,t),s=Nf(n+1,e,t);return(Ql(n)-i+s)/7}function Za(n){return n>99?n:n>xt.twoDigitCutoffYear?1900+n:2e3+n}function X0(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Mr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function Q0(n){const e=Number(n);if(typeof n=="boolean"||n===""||!Number.isFinite(e))throw new gn(`Invalid unit value ${n}`);return e}function dr(n,e){const t={};for(const i in n)if(is(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Q0(s)}return t}function Ls(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${sn(t,2)}:${sn(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${sn(t,2)}${sn(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Er(n){return xv(n,["hour","minute","second","millisecond"])}const t2=["January","February","March","April","May","June","July","August","September","October","November","December"],x0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n2=["J","F","M","A","M","J","J","A","S","O","N","D"];function ek(n){switch(n){case"narrow":return[...n2];case"short":return[...x0];case"long":return[...t2];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 tk=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],nk=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],i2=["M","T","W","T","F","S","S"];function ik(n){switch(n){case"narrow":return[...i2];case"short":return[...nk];case"long":return[...tk];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const lk=["AM","PM"],l2=["Before Christ","Anno Domini"],s2=["BC","AD"],o2=["B","A"];function sk(n){switch(n){case"narrow":return[...o2];case"short":return[...s2];case"long":return[...l2];default:return null}}function r2(n){return lk[n.hour<12?0:1]}function a2(n,e){return ik(e)[n.weekday-1]}function u2(n,e){return ek(e)[n.month-1]}function f2(n,e){return sk(e)[n.year<0?0:1]}function c2(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Rf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const d2={D:ur,DD:w0,DDD:S0,DDDD:T0,t:$0,tt:C0,ttt:O0,tttt:M0,T:E0,TT:D0,TTT:I0,TTTT:L0,f:A0,ff:N0,fff:F0,ffff:j0,F:P0,FF:R0,FFF:q0,FFFF:H0};class kn{static create(e,t={}){return new kn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0||s)&&l.push({literal:s||/^\s+$/.test(i),val:i===""?"'":i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s||/^\s+$/.test(i),val:i}),l}static macroTokenToFormatOpts(e){return d2[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,i=void 0){if(this.opts.forceSimple)return sn(e,t);const s={...this.opts};return t>0&&(s.padTo=t),i&&(s.signDisplay=i),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,_)=>this.loc.extract(e,m,_),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?r2(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,_)=>i?u2(e,m):l(_?{month:m}:{month:m,day:"numeric"},"month"),u=(m,_)=>i?a2(e,m):l(_?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const _=kn.macroTokenToFormatOpts(m);return _?this.formatWithSystemDefault(e,_):m},c=m=>i?f2(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"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 Rf(kn.parseFormat(t),d)}formatDurationFromString(e,t){const i=this.opts.signMode==="negativeLargestOnly"?-1:1,s=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},l=(f,c)=>d=>{const m=s(d);if(m){const _=c.isNegativeDuration&&m!==c.largestUnit?i:1;let g;return this.opts.signMode==="negativeLargestOnly"&&m!==c.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(f.get(m)*_,d.length,g)}else return d},o=kn.parseFormat(t),r=o.reduce((f,{literal:c,val:d})=>c?f:f.concat(d),[]),a=e.shiftTo(...r.map(s).filter(f=>f)),u={isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]};return Rf(o,l(a,u))}}const ok=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function us(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function fs(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function cs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function rk(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(_||m&&f)?-m:m;return[{years:d(hl(t)),months:d(hl(i)),weeks:d(hl(s)),days:d(hl(l)),hours:d(hl(o)),minutes:d(hl(r)),seconds:d(hl(a),a==="-0"),milliseconds:d(Mu(u),c)}]}const $2={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 Lu(n,e,t,i,s,l,o){const r={year:e.length===2?Za(Zi(e)):Zi(e),month:x0.indexOf(t)+1,day:Zi(i),hour:Zi(s),minute:Zi(l)};return o&&(r.second=Zi(o)),n&&(r.weekday=n.length>3?tk.indexOf(n)+1:nk.indexOf(n)+1),r}const C2=/^(?:(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 O2(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Lu(e,s,i,t,l,o,r);let m;return a?m=$2[a]:u?m=0:m=Mr(f,c),[d,new Mn(m)]}function M2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const E2=/^(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$/,D2=/^(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$/,I2=/^(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 Ff(n){const[,e,t,i,s,l,o,r]=n;return[Lu(e,s,i,t,l,o,r),Mn.utcInstance]}function L2(n){const[,e,t,i,s,l,o,r]=n;return[Lu(e,r,t,i,s,l,o),Mn.utcInstance]}const A2=us(m2,Iu),P2=us(h2,Iu),N2=us(_2,Iu),R2=us(uk),ck=fs(v2,ds,fo,co),F2=fs(g2,ds,fo,co),q2=fs(b2,ds,fo,co),j2=fs(ds,fo,co);function H2(n){return cs(n,[A2,ck],[P2,F2],[N2,q2],[R2,j2])}function z2(n){return cs(M2(n),[C2,O2])}function U2(n){return cs(n,[E2,Ff],[D2,Ff],[I2,L2])}function V2(n){return cs(n,[S2,T2])}const B2=fs(ds);function W2(n){return cs(n,[w2,B2])}const Y2=us(k2,y2),K2=us(fk),J2=fs(ds,fo,co);function Z2(n){return cs(n,[Y2,ck],[K2,J2])}const qf="Invalid Duration",dk={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},G2={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...dk},Gn=146097/400,Vl=146097/4800,X2={years:{quarters:4,months:12,weeks:Gn/7,days:Gn,hours:Gn*24,minutes:Gn*24*60,seconds:Gn*24*60*60,milliseconds:Gn*24*60*60*1e3},quarters:{months:3,weeks:Gn/28,days:Gn/4,hours:Gn*24/4,minutes:Gn*24*60/4,seconds:Gn*24*60*60/4,milliseconds:Gn*24*60*60*1e3/4},months:{weeks:Vl/7,days:Vl,hours:Vl*24,minutes:Vl*24*60,seconds:Vl*24*60*60,milliseconds:Vl*24*60*60*1e3},...dk},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Q2=Tl.slice(0).reverse();function Pi(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 Tt(i)}function pk(n,e){let t=e.milliseconds??0;for(const i of Q2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function jf(n,e){const t=pk(n,e)<0?-1:1;Tl.reduceRight((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]*t,o=n[s][i],r=Math.floor(l/o);e[s]+=r*t,e[i]-=r*o*t}return s},null),Tl.reduce((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]%1;e[i]-=l,e[s]+=l*n[i][s]}return s},null)}function Hf(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class Tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?X2:G2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Dt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return Tt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new gn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Tt({values:dr(e,Tt.normalizeUnit),loc:Dt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(nl(e))return Tt.fromMillis(e);if(Tt.isDuration(e))return e;if(typeof e=="object")return Tt.fromObject(e);throw new gn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=V2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=W2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the Duration is invalid");const i=e instanceof fi?e:new fi(e,t);if(xt.throwOnInvalid)throw new Tv(i);return new Tt({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 v0(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?kn.create(this.loc,i).formatDurationFromString(this,e):qf}toHuman(e={}){if(!this.isValid)return qf;const t=e.showZeros!==!1,i=Tl.map(s=>{const l=this.values[s];return st(l)||l===0&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(l)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}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+=Eu(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?pk(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e),i={};for(const s of Tl)(is(t.values,s)||is(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Pi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=Tt.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]=Q0(e(this.values[i],i));return Pi(this,{values:t},!0)}get(e){return this[Tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...dr(e,Tt.normalizeUnit)};return Pi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:s}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:i};return Pi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return jf(this.matrix,e),Pi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Hf(this.normalize().shiftToAll().toObject());return Pi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>Tt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Tl)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;nl(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else nl(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return jf(this.matrix,t),Pi(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 Pi(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=Hf(this.values);return Pi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Tl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Bl="Invalid Interval";function x2(n,e){return!n||!n.isValid?Qt.invalid("missing or invalid start"):!e||!e.isValid?Qt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Qt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ys).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=Tt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Qt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Qt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Qt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Qt.fromDateTimes(t,a.time)),t=null);return Qt.merge(s)}difference(...e){return Qt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Bl}[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=ur,t={}){return this.isValid?kn.create(this.s.loc.clone(t),e).formatInterval(this):Bl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Bl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Bl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Bl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Bl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Tt.invalid(this.invalidReason)}mapEndpoints(e){return Qt.fromDateTimes(e(this.s),e(this.e))}}class $o{static hasDST(e=xt.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 Xi(e,xt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Dt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Dt.create(t,null,"gregory").eras(e)}static features(){return{relative:Z0(),localeWeek:G0()}}}function zf(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(Tt.fromMillis(i).as("days"))}function ew(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=zf(a,u);return(f-f%7)/7}],["days",zf]],s={},l=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,s[a]=u(n,e),r=l.plus(s),r>e?(s[a]--,n=l.plus(s),n>e&&(r=n,s[a]--,n=l.plus(s))):n=r);return[n,s,r,o]}function tw(n,e,t,i){let[s,l,o,r]=ew(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?Tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const nw="missing Intl.DateTimeFormat.formatToParts support";function Ot(n,e=t=>t){return{regex:n,deser:([t])=>e(Yv(t))}}const iw=" ",mk=`[ ${iw}]`,hk=new RegExp(mk,"g");function lw(n){return n.replace(/\./g,"\\.?").replace(hk,mk)}function Uf(n){return n.replace(/\./g,"").replace(hk," ").toLowerCase()}function ui(n,e){return n===null?null:{regex:RegExp(n.map(lw).join("|")),deser:([t])=>n.findIndex(i=>Uf(t)===Uf(i))+e}}function Vf(n,e){return{regex:n,deser:([,t,i])=>Mr(t,i),groups:e}}function Co(n){return{regex:n,deser:([e])=>e}}function sw(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ow(n,e){const t=ai(e),i=ai(e,"{2}"),s=ai(e,"{3}"),l=ai(e,"{4}"),o=ai(e,"{6}"),r=ai(e,"{1,2}"),a=ai(e,"{1,3}"),u=ai(e,"{1,6}"),f=ai(e,"{1,9}"),c=ai(e,"{2,4}"),d=ai(e,"{4,6}"),m=h=>({regex:RegExp(sw(h.val)),deser:([k])=>k,literal:!0}),g=(h=>{if(n.literal)return m(h);switch(h.val){case"G":return ui(e.eras("short"),0);case"GG":return ui(e.eras("long"),0);case"y":return Ot(u);case"yy":return Ot(c,Za);case"yyyy":return Ot(l);case"yyyyy":return Ot(d);case"yyyyyy":return Ot(o);case"M":return Ot(r);case"MM":return Ot(i);case"MMM":return ui(e.months("short",!0),1);case"MMMM":return ui(e.months("long",!0),1);case"L":return Ot(r);case"LL":return Ot(i);case"LLL":return ui(e.months("short",!1),1);case"LLLL":return ui(e.months("long",!1),1);case"d":return Ot(r);case"dd":return Ot(i);case"o":return Ot(a);case"ooo":return Ot(s);case"HH":return Ot(i);case"H":return Ot(r);case"hh":return Ot(i);case"h":return Ot(r);case"mm":return Ot(i);case"m":return Ot(r);case"q":return Ot(r);case"qq":return Ot(i);case"s":return Ot(r);case"ss":return Ot(i);case"S":return Ot(a);case"SSS":return Ot(s);case"u":return Co(f);case"uu":return Co(r);case"uuu":return Ot(t);case"a":return ui(e.meridiems(),0);case"kkkk":return Ot(l);case"kk":return Ot(c,Za);case"W":return Ot(r);case"WW":return Ot(i);case"E":case"c":return Ot(t);case"EEE":return ui(e.weekdays("short",!1),1);case"EEEE":return ui(e.weekdays("long",!1),1);case"ccc":return ui(e.weekdays("short",!0),1);case"cccc":return ui(e.weekdays("long",!0),1);case"Z":case"ZZ":return Vf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Vf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Co(/[a-z_+-/]{1,256}?/i);case" ":return Co(/[^\S\n\r]/);default:return m(h)}})(n)||{invalidReason:nw};return g.token=n,g}const rw={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 aw(n,e,t){const{type:i,value:s}=n;if(i==="literal"){const a=/^\s+$/.test(s);return{literal:!a,val:a?" ":s}}const l=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=rw[o];if(typeof r=="object"&&(r=r[l]),r)return{literal:!1,val:r}}function uw(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function fw(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(is(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function cw(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=Hi.create(n.z)),st(n.Z)||(t||(t=new Mn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(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),st(n.u)||(n.S=Mu(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ea=null;function dw(){return ea||(ea=Xe.fromMillis(1555555555555)),ea}function pw(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val),i=kk(t,e);return i==null||i.includes(void 0)?n:i}function _k(n,e){return Array.prototype.concat(...n.map(t=>pw(t,e)))}class gk{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=_k(kn.parseFormat(t),e),this.units=this.tokens.map(i=>ow(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,s]=uw(this.units);this.regex=RegExp(i,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,i]=fw(e,this.regex,this.handlers),[s,l,o]=i?cw(i):[null,null,void 0];if(is(i,"a")&&is(i,"H"))throw new Zl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:s,zone:l,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 bk(n,e,t){return new gk(n,t).explainFromTokens(e)}function mw(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=bk(n,e,t);return[i,s,l,o]}function kk(n,e){if(!n)return null;const i=kn.create(e,n).dtFormatter(dw()),s=i.formatToParts(),l=i.resolvedOptions();return s.map(o=>aw(o,n,l))}const ta="Invalid DateTime",Bf=864e13;function Os(n){return new fi("unsupported zone",`the zone "${n.name}" is not supported`)}function na(n){return n.weekData===null&&(n.weekData=fr(n.c)),n.weekData}function ia(n){return n.localWeekData===null&&(n.localWeekData=fr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function _l(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function yk(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Oo(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 Go(n,e,t){return yk(Or(n),e,t)}function Wf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,cr(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=Tt.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=Or(l);let[a,u]=yk(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Wl(n,e,t,i,s,l){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:l});return o?u:u.setZone(r)}else return Xe.invalid(new fi("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Mo(n,e,t=!0){return n.isValid?kn.create(Dt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function la(n,e,t){const i=n.c.year>9999||n.c.year<0;let s="";if(i&&n.c.year>=0&&(s+="+"),s+=sn(n.c.year,i?6:4),t==="year")return s;if(e){if(s+="-",s+=sn(n.c.month),t==="month")return s;s+="-"}else if(s+=sn(n.c.month),t==="month")return s;return s+=sn(n.c.day),s}function Yf(n,e,t,i,s,l,o){let r=!t||n.c.millisecond!==0||n.c.second!==0,a="";switch(o){case"day":case"month":case"year":break;default:if(a+=sn(n.c.hour),o==="hour")break;if(e){if(a+=":",a+=sn(n.c.minute),o==="minute")break;r&&(a+=":",a+=sn(n.c.second))}else{if(a+=sn(n.c.minute),o==="minute")break;r&&(a+=sn(n.c.second))}if(o==="second")break;r&&(!i||n.c.millisecond!==0)&&(a+=".",a+=sn(n.c.millisecond,3))}return s&&(n.isOffsetFixed&&n.offset===0&&!l?a+="Z":n.o<0?(a+="-",a+=sn(Math.trunc(-n.o/60)),a+=":",a+=sn(Math.trunc(-n.o%60))):(a+="+",a+=sn(Math.trunc(n.o/60)),a+=":",a+=sn(Math.trunc(n.o%60)))),l&&(a+="["+n.zone.ianaName+"]"),a}const vk={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},hw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_w={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Xo=["year","month","day","hour","minute","second","millisecond"],gw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bw=["year","ordinal","hour","minute","second","millisecond"];function Qo(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 v0(n);return e}function Kf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Qo(n)}}function kw(n){if(Ms===void 0&&(Ms=xt.now()),n.type!=="iana")return n.offset(Ms);const e=n.name;let t=Ga.get(e);return t===void 0&&(t=n.offset(Ms),Ga.set(e,t)),t}function Jf(n,e){const t=Xi(e.zone,xt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Dt.fromObject(e);let s,l;if(st(n.year))s=xt.now();else{for(const a of Xo)st(n[a])&&(n[a]=vk[a]);const o=K0(n)||J0(n);if(o)return Xe.invalid(o);const r=kw(t);[s,l]=Go(n,r,t)}return new Xe({ts:s,zone:t,loc:i,o:l})}function Zf(n,e,t){const i=st(t.round)?!0:t.round,s=st(t.rounding)?"trunc":t.rounding,l=(r,a)=>(r=Eu(r,i||t.calendary?0:2,t.calendary?"round":s),e.loc.clone(t).relFormatter(t).format(r,a)),o=r=>t.calendary?e.hasSame(n,r)?0:e.startOf(r).diff(n.startOf(r),r).get(r):e.diff(n,r).get(r);if(t.unit)return l(o(t.unit),t.unit);for(const r of t.units){const a=o(r);if(Math.abs(a)>=1)return l(a,r)}return l(n>e?-0:0,t.units[t.units.length-1])}function Gf(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 Ms;const Ga=new Map;class Xe{constructor(e){const t=e.zone||xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new fi("invalid input"):null)||(t.isValid?null:Os(t));this.ts=st(e.ts)?xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=nl(e.o)&&!e.old?e.o:t.offset(this.ts);s=Oo(this.ts,r),i=Number.isNaN(s.year)?new fi("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Dt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Gf(arguments),[i,s,l,o,r,a,u]=t;return Jf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Gf(arguments),[i,s,l,o,r,a,u]=t;return e.zone=Mn.utcInstance,Jf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Xv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const s=Xi(t.zone,xt.defaultZone);return s.isValid?new Xe({ts:i,zone:s,loc:Dt.fromObject(t)}):Xe.invalid(Os(s))}static fromMillis(e,t={}){if(nl(e))return e<-Bf||e>Bf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new gn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(nl(e))return new Xe({ts:e*1e3,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new gn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Xi(t.zone,xt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const s=Dt.fromObject(t),l=dr(e,Kf),{minDaysInFirstWeek:o,startOfWeek:r}=Af(l,s),a=xt.now(),u=st(t.specificOffset)?i.offset(a):t.specificOffset,f=!st(l.ordinal),c=!st(l.year),d=!st(l.month)||!st(l.day),m=c||d,_=l.weekYear||l.weekNumber;if((m||f)&&_)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Zl("Can't mix ordinal dates with month/day");const g=_||l.weekday&&!m;let h,k,S=Oo(a,u);g?(h=gw,k=hw,S=fr(S,o,r)):f?(h=bw,k=_w,S=xr(S)):(h=Xo,k=vk);let $=!1;for(const P of h){const N=l[P];st(N)?$?l[P]=k[P]:l[P]=S[P]:$=!0}const T=g?Jv(l,o,r):f?Zv(l):K0(l),O=T||J0(l);if(O)return Xe.invalid(O);const E=g?If(l,o,r):f?Lf(l):l,[L,I]=Go(E,u,i),A=new Xe({ts:L,zone:i,o:I,loc:s});return l.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,s]=H2(e);return Wl(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=z2(e);return Wl(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=U2(e);return Wl(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new gn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=mw(o,e,t);return f?Xe.invalid(f):Wl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Z2(e);return Wl(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the DateTime is invalid");const i=e instanceof fi?e:new fi(e,t);if(xt.throwOnInvalid)throw new wv(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=kk(e,Dt.fromObject(t));return i?i.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return _k(kn.parseFormat(e),Dt.fromObject(t)).map(s=>s.val).join("")}static resetCache(){Ms=void 0,Ga.clear()}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?na(this).weekYear:NaN}get weekNumber(){return this.isValid?na(this).weekNumber:NaN}get weekday(){return this.isValid?na(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ia(this).weekday:NaN}get localWeekNumber(){return this.isValid?ia(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ia(this).weekYear:NaN}get ordinal(){return this.isValid?xr(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=Or(this.c),s=this.zone.offset(i-e),l=this.zone.offset(i+e),o=this.zone.offset(i-s*t),r=this.zone.offset(i-l*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Oo(a,o),c=Oo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[_l(this,{ts:a}),_l(this,{ts:u})]:[this]}get isInLeapYear(){return uo(this.year)}get daysInMonth(){return cr(this.year,this.month)}get daysInYear(){return this.isValid?Ql(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ys(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ys(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Mn.instance(e),t)}toLocal(){return this.setZone(xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Xi(e,xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=Go(o,l,e)}return _l(this,{ts:s,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return _l(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=dr(e,Kf),{minDaysInFirstWeek:i,startOfWeek:s}=Af(t,this.loc),l=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),o=!st(t.ordinal),r=!st(t.year),a=!st(t.month)||!st(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Zl("Can't mix ordinal dates with month/day");let c;l?c=If({...fr(this.c,i,s),...t},i,s):st(t.ordinal)?(c={...this.toObject(),...t},st(t.day)&&(c.day=Math.min(cr(c.year,c.month),c.day))):c=Lf({...xr(this.c),...t});const[d,m]=Go(c,this.o,this.zone);return _l(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e);return _l(this,Wf(this,t))}minus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e).negate();return _l(this,Wf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},s=Tt.normalizeUnit(e);switch(s){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(s==="weeks")if(t){const l=this.loc.getStartOfWeek(),{weekday:o}=this;o=3&&(a+="T"),a+=Yf(this,r,t,i,s,l,o),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?la(this,e==="extended",Qo(t)):null}toISOWeekDate(){return Mo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended",precision:r="milliseconds"}={}){return this.isValid?(r=Qo(r),(s&&Xo.indexOf(r)>=3?"T":"")+Yf(this,o==="extended",t,e,i,l,r)):null}toRFC2822(){return Mo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?la(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Mo(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ta}[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 Tt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=Qv(t).map(Tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=tw(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Qt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const s=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t,i)<=s&&s<=l.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new gn("max requires all arguments be DateTimes");return Pf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return bk(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:s=null}=t,l=Dt.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});return new gk(l,e)}static fromFormatParser(e,t,i={}){if(st(e)||st(t))throw new gn("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});if(!o.equals(t.locale))throw new gn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Wl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return ur}static get DATE_MED(){return w0}static get DATE_MED_WITH_WEEKDAY(){return $v}static get DATE_FULL(){return S0}static get DATE_HUGE(){return T0}static get TIME_SIMPLE(){return $0}static get TIME_WITH_SECONDS(){return C0}static get TIME_WITH_SHORT_OFFSET(){return O0}static get TIME_WITH_LONG_OFFSET(){return M0}static get TIME_24_SIMPLE(){return E0}static get TIME_24_WITH_SECONDS(){return D0}static get TIME_24_WITH_SHORT_OFFSET(){return I0}static get TIME_24_WITH_LONG_OFFSET(){return L0}static get DATETIME_SHORT(){return A0}static get DATETIME_SHORT_WITH_SECONDS(){return P0}static get DATETIME_MED(){return N0}static get DATETIME_MED_WITH_SECONDS(){return R0}static get DATETIME_MED_WITH_WEEKDAY(){return Cv}static get DATETIME_FULL(){return F0}static get DATETIME_FULL_WITH_SECONDS(){return q0}static get DATETIME_HUGE(){return j0}static get DATETIME_HUGE_WITH_SECONDS(){return H0}}function ys(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&nl(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new gn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const yw=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],vw=[".mp4",".avi",".mov",".3gp",".wmv"],ww=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Sw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],Tw=["relation","file","select"],$w=["text","email","url","editor"],wk=[{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 s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=U.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!U.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!U.isObject(s)&&!Array.isArray(s)||!U.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):U.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||U.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return U.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),U.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", ",i=!0){e=e||[];const s=[],l=t.length>1?t.trim():t;for(let o of e)o=typeof o=="string"?o.trim():"",!U.isEmpty(o)&&(i&&(o=o.replaceAll(l,"\\"+l)),s.push(o));return s.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(typeof e=="object")try{e=JSON.stringify(e,null,2)}catch{}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"}),s=window.URL.createObjectURL(i);U.download(s,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||"",!!yw.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!vw.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!ww.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Sw.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(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)U.addValueToFormData(e,t,s);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 l;const i=(e==null?void 0:e.fields)||[],s={};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=(l=o==null?void 0:o.values)==null?void 0:l[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])):o.type=="geoPoint"?r={lon:0,lat:0}:r="test";s[o.name]=r}return s}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){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";case"geoPoint":return"ri-map-pin-2-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"geoPoint":return"Object";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="geoPoint"?'{"lon":0,"lat":0}':(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 s=Array.isArray(e.fields)?e.fields:[],l=Array.isArray(t.fields)?t.fields:[],o=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=U.isObject(u)&&U.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.nameo.id==e.collectionId);if(!l)return s;for(const o of l.fields){if(!o.presentable||o.type!="relation"||i<=0)continue;const r=U.getExpandPresentableRelFields(o,t,i-1);for(const a of r)s.push(e.name+"."+a)}return s.length||s.push(e.name),s}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,enableSeconds:!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(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}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:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,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],_=d.create(c,u,m);d.add(_),s(_.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.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(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=U.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){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/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of U.extractColumnsFromQuery(e.viewQuery))U.pushUnique(i,t+l);const s=e.fields||[];for(const l of s)l.type=="geoPoint"?(U.pushUnique(i,t+l.name+".lon"),U.pushUnique(i,t+l.name+".lat")):U.pushUnique(i,t+l.name);return i}static getCollectionAutocompleteKeys(e,t,i="",s=0){let l=e.find(r=>r.name==t||r.id==t);if(!l||s>=4)return[];l.fields=l.fields||[];let o=U.getAllCollectionIdentifiers(l,i);for(const r of l.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=U.getCollectionAutocompleteKeys(e,r.collectionId,a+".",s+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&Tw.includes(r.type)?(o.push(a+":each"),o.push(a+":length")):$w.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==l.id){const u=i+r.name+"_via_"+a.name,f=U.getCollectionAutocompleteKeys(e,r.id,u+".",s+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,s;for(const l of e)if(!l.system){i="@collection."+l.name+".",s=U.getCollectionAutocompleteKeys(e,l.name,i);for(const o of s)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 s=e.filter(l=>l.type==="auth");for(const l of s){if(l.system)continue;const o=U.getCollectionAutocompleteKeys(e,l.id,"@request.auth.");for(const r of o)U.pushUnique(i,r)}if(t){const l=U.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of l){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:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!U.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((g==null?void 0:g.length)!=4)continue;const h=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");h&&t.columns.push({name:h,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+U.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` +}`,c=`__svelte_${cv(f)}_${r}`,d=h0(n),{stylesheet:m,rules:h}=rr.get(d)||dv(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 ${s}ms 1 both`,ar+=1,c}function Bs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ar-=s,ar||pv())}function pv(){yu(()=>{ar||(rr.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&y(e)}),rr.clear())})}function mv(n,e,t,i){if(!e)return te;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return te;const{delay:l=0,duration:o=300,easing:r=so,start:a=Sr()+l,end:u=a+o,tick:f=te,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function g(){c&&(h=Vs(n,0,1,o,l,r,c)),l||(m=!0)}function _(){c&&Bs(n,h),d=!1}return Tr(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),g(),f(0,1),_}function hv(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,b0(n,s)}}function b0(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Ws;function ji(n){Ws=n}function oo(){if(!Ws)throw new Error("Function called outside component initialization");return Ws}function un(n){oo().$$.on_mount.push(n)}function _v(n){oo().$$.after_update.push(n)}function ro(n){oo().$$.on_destroy.push(n)}function wt(){const n=oo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=g0(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Le(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Jl=[],ne=[];let Xl=[];const qa=[],k0=Promise.resolve();let ja=!1;function y0(){ja||(ja=!0,k0.then(vu))}function _n(){return y0(),k0}function tt(n){Xl.push(n)}function $e(n){qa.push(n)}const Zr=new Set;let Ul=0;function vu(){if(Ul!==0)return;const n=Ws;do{try{for(;Uln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Xl=e}let ks;function wu(){return ks||(ks=Promise.resolve(),ks.then(()=>{ks=null})),ks}function Ol(n,e,t){n.dispatchEvent(g0(`${e?"intro":"outro"}${t}`))}const Zo=new Set;let Ti;function oe(){Ti={r:0,c:[],p:Ti}}function re(){Ti.r||Ee(Ti.c),Ti=Ti.p}function M(n,e){n&&n.i&&(Zo.delete(n),n.i(e))}function D(n,e,t,i){if(n&&n.o){if(Zo.has(n))return;Zo.add(n),Ti.c.push(()=>{Zo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const Su={duration:0};function v0(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&Bs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=so,tick:g=te,css:_}=s||Su;_&&(o=Vs(n,0,1,m,d,h,_,a++)),g(0,1);const k=Sr()+d,S=k+m;r&&r.abort(),l=!0,tt(()=>Ol(n,!0,"start")),r=Tr($=>{if(l){if($>=S)return g(1,0),Ol(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);g(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,Bs(n),Lt(s)?(s=s(i),wu().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function Tu(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Ti;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=so,tick:m=te,css:h}=s||Su;h&&(o=Vs(n,1,0,c,f,d,h));const g=Sr()+f,_=g+c;tt(()=>Ol(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Tr(k=>{if(l){if(k>=_)return m(0,1),Ol(n,!1,"end"),--r.r||Ee(r.c),!1;if(k>=g){const S=d((k-g)/c);m(1-S,S)}}return l})}return Lt(s)?wu().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&Bs(n,o),l=!1)}}}function qe(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&Bs(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:k=so,tick:S=te,css:$}=l||Su,T={start:Sr()+g,b:h};h||(T.group=Ti,Ti.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=Vs(n,o,h,_,g,k,$)),h&&S(0,1),r=d(T,_),tt(()=>Ol(n,h,"start")),Tr(O=>{if(a&&O>a.start&&(r=d(a,_),a=null,Ol(n,r.b,"start"),$&&(c(),u=Vs(n,o,r.b,r.duration,0,k,l.css))),r){if(O>=r.end)S(o=r.b,1-o),Ol(n,r.b,"end"),a||(r.b?c():--r.group.r||Ee(r.group.c)),r=null;else if(O>=r.start){const E=O-r.start;o=r.a+r.d*k(E/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Lt(l)?wu().then(()=>{l=l({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function yf(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(oe(),D(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),re())}):e.block.d(1),u.c(),M(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&vu()}if(lv(n)){const s=oo();if(n.then(l=>{ji(s),i(e.then,1,e.value,l),ji(null)},l=>{if(ji(s),i(e.catch,2,e.error,l),ji(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function kv(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function ce(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function li(n,e){n.d(1),e.delete(n.key)}function Yt(n,e){D(n,1,1,()=>{e.delete(n.key)})}function yv(n,e){n.f(),Yt(n,e)}function kt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],k=new Map,S=new Map,$=[];for(h=m;h--;){const L=c(s,l,h),I=t(L);let A=o.get(I);A?$.push(()=>A.p(L,e)):(A=u(I,L),A.c()),k.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--):k.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];k.has(L.key)||a(L,o)}for(;m;)E(_[m-1]);return Ee($),_}function vt(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function At(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function q(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),tt(()=>{const l=n.$$.on_mount.map(f0).filter(Lt);n.$$.on_destroy?n.$$.on_destroy.push(...l):Ee(l),n.$$.on_mount=[]}),s.forEach(tt)}function j(n,e){const t=n.$$;t.fragment!==null&&(bv(t.after_update),Ee(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function vv(n,e){n.$$.dirty[0]===-1&&(Jl.push(n),y0(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&vv(n,c)),d}):[],u.update(),f=!0,Ee(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=fv(e.target);u.fragment&&u.fragment.l(c),c.forEach(y)}else u.fragment&&u.fragment.c();e.intro&&M(n.$$.fragment),q(n,e.target,e.anchor),vu()}ji(a)}class ve{constructor(){pt(this,"$$");pt(this,"$$set")}$destroy(){j(this,1),this.$destroy=te}$on(e,t){if(!Lt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!sv(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const wv="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(wv);class Pl extends Error{}class Sv extends Pl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Tv extends Pl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class $v extends Pl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zl extends Pl{}class w0 extends Pl{constructor(e){super(`Invalid unit ${e}`)}}class gn extends Pl{}class Ki extends Pl{constructor(){super("Zone is an abstract class")}}const ze="numeric",pi="short",Bn="long",ur={year:ze,month:ze,day:ze},S0={year:ze,month:pi,day:ze},Cv={year:ze,month:pi,day:ze,weekday:pi},T0={year:ze,month:Bn,day:ze},$0={year:ze,month:Bn,day:ze,weekday:Bn},C0={hour:ze,minute:ze},O0={hour:ze,minute:ze,second:ze},M0={hour:ze,minute:ze,second:ze,timeZoneName:pi},E0={hour:ze,minute:ze,second:ze,timeZoneName:Bn},D0={hour:ze,minute:ze,hourCycle:"h23"},I0={hour:ze,minute:ze,second:ze,hourCycle:"h23"},L0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:pi},A0={hour:ze,minute:ze,second:ze,hourCycle:"h23",timeZoneName:Bn},P0={year:ze,month:ze,day:ze,hour:ze,minute:ze},N0={year:ze,month:ze,day:ze,hour:ze,minute:ze,second:ze},R0={year:ze,month:pi,day:ze,hour:ze,minute:ze},F0={year:ze,month:pi,day:ze,hour:ze,minute:ze,second:ze},Ov={year:ze,month:pi,day:ze,weekday:pi,hour:ze,minute:ze},q0={year:ze,month:Bn,day:ze,hour:ze,minute:ze,timeZoneName:pi},j0={year:ze,month:Bn,day:ze,hour:ze,minute:ze,second:ze,timeZoneName:pi},H0={year:ze,month:Bn,day:ze,weekday:Bn,hour:ze,minute:ze,timeZoneName:Bn},z0={year:ze,month:Bn,day:ze,weekday:Bn,hour:ze,minute:ze,second:ze,timeZoneName:Bn};class ao{get type(){throw new Ki}get name(){throw new Ki}get ianaName(){return this.name}get isUniversal(){throw new Ki}offsetName(e,t){throw new Ki}formatOffset(e,t){throw new Ki}offset(e){throw new Ki}equals(e){throw new Ki}get isValid(){throw new Ki}}let Gr=null;class $r extends ao{static get instance(){return Gr===null&&(Gr=new $r),Gr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Q0(e,t,i)}formatOffset(e,t){return Ls(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Ha=new Map;function Mv(n){let e=Ha.get(n);return e===void 0&&(e=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"}),Ha.set(n,e)),e}const Ev={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Dv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function Iv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let vf={};function Lv(n,e={}){const t=JSON.stringify([n,e]);let i=vf[t];return i||(i=new Intl.ListFormat(n,e),vf[t]=i),i}const za=new Map;function Ua(n,e={}){const t=JSON.stringify([n,e]);let i=za.get(t);return i===void 0&&(i=new Intl.DateTimeFormat(n,e),za.set(t,i)),i}const Va=new Map;function Av(n,e={}){const t=JSON.stringify([n,e]);let i=Va.get(t);return i===void 0&&(i=new Intl.NumberFormat(n,e),Va.set(t,i)),i}const Ba=new Map;function Pv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Ba.get(s);return l===void 0&&(l=new Intl.RelativeTimeFormat(n,e),Ba.set(s,l)),l}let Cs=null;function Nv(){return Cs||(Cs=new Intl.DateTimeFormat().resolvedOptions().locale,Cs)}const Wa=new Map;function U0(n){let e=Wa.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Wa.set(n,e)),e}const Ya=new Map;function Rv(n){let e=Ya.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...V0,...e}),Ya.set(n,e)}return e}function Fv(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,s;try{i=Ua(n).resolvedOptions(),s=n}catch{const a=n.substring(0,t);i=Ua(a).resolvedOptions(),s=a}const{numberingSystem:l,calendar:o}=i;return[s,l,o]}}function qv(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function jv(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 To(n,e,t,i){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):i(e)}function zv(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||U0(n.locale).numberingSystem==="latn"}class Uv{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=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):Eu(e,3);return sn(t,this.padTo)}}}class Vv{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let s;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?(s=r,this.dt=e):(s="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,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const l={...this.opts};l.timeZone=l.timeZone||s,this.dtf=Ua(t,l)}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&&G0()&&(this.rtf=Pv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):d2(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const V0={firstDay:1,minimalDays:4,weekend:[6,7]};class Dt{static fromOpts(e){return Dt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,s,l=!1){const o=e||xt.defaultLocale,r=o||(l?"en-US":Nv()),a=t||xt.defaultNumberingSystem,u=i||xt.defaultOutputCalendar,f=Ja(s)||xt.defaultWeekSettings;return new Dt(r,a,u,f,o)}static resetCache(){Cs=null,za.clear(),Va.clear(),Ba.clear(),Wa.clear(),Ya.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:s}={}){return Dt.create(e,t,i,s)}constructor(e,t,i,s,l){const[o,r,a]=Fv(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=s,this.intl=qv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=zv(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:Dt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Ja(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return To(this,e,tk,()=>{const i=this.intl==="ja"||this.intl.startsWith("ja-");t&=!i;const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";if(!this.monthsCache[l][e]){const o=i?r=>this.dtFormatter(r,s).format():r=>this.extract(r,s,"month");this.monthsCache[l][e]=jv(o)}return this.monthsCache[l][e]})}weekdays(e,t=!1){return To(this,e,lk,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=Hv(l=>this.extract(l,i,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return To(this,void 0,()=>sk,()=>{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 To(this,e,ok,()=>{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 s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Uv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Vv(e,this.intl,t)}relFormatter(e={}){return new Bv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Lv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||U0(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:X0()?Rv(this.locale):V0}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 Qr=null;class Mn extends ao{static get utcInstance(){return Qr===null&&(Qr=new Mn(0)),Qr}static instance(e){return e===0?Mn.utcInstance:new Mn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Mn(Mr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Ls(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 Wv extends ao{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Xi(n,e){if(st(n)||n===null)return e;if(n instanceof ao)return n;if(Xv(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?$r.instance:t==="utc"||t==="gmt"?Mn.utcInstance:Mn.parseSpecifier(t)||Hi.create(n)}else return nl(n)?Mn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Wv(n)}const $u={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},wf={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]},Yv=$u.hanidec.replace(/[\[|\]]/g,"").split("");function Kv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}const Ka=new Map;function Jv(){Ka.clear()}function ai({numberingSystem:n},e=""){const t=n||"latn";let i=Ka.get(t);i===void 0&&(i=new Map,Ka.set(t,i));let s=i.get(e);return s===void 0&&(s=new RegExp(`${$u[t]}${e}`),i.set(e,s)),s}let Sf=()=>Date.now(),Tf="system",$f=null,Cf=null,Of=null,Mf=60,Ef,Df=null;class xt{static get now(){return Sf}static set now(e){Sf=e}static set defaultZone(e){Tf=e}static get defaultZone(){return Xi(Tf,$r.instance)}static get defaultLocale(){return $f}static set defaultLocale(e){$f=e}static get defaultNumberingSystem(){return Cf}static set defaultNumberingSystem(e){Cf=e}static get defaultOutputCalendar(){return Of}static set defaultOutputCalendar(e){Of=e}static get defaultWeekSettings(){return Df}static set defaultWeekSettings(e){Df=Ja(e)}static get twoDigitCutoffYear(){return Mf}static set twoDigitCutoffYear(e){Mf=e%100}static get throwOnInvalid(){return Ef}static set throwOnInvalid(e){Ef=e}static resetCaches(){Dt.resetCache(),Hi.resetCache(),Xe.resetCache(),Jv()}}class fi{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],W0=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(n,e){return new fi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cu(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function Y0(n,e,t){return t+(uo(n)?W0:B0)[e-1]}function K0(n,e){const t=uo(n)?W0:B0,i=t.findIndex(l=>lYs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Er(n)}}function If(n,e=4,t=1){const{weekYear:i,weekNumber:s,weekday:l}=n,o=Ou(Cu(i,1,e),t),r=Ql(i);let a=s*7+l-o-7+e,u;a<1?(u=i-1,a+=Ql(u)):a>r?(u=i+1,a-=Ql(i)):u=i;const{month:f,day:c}=K0(u,a);return{year:u,month:f,day:c,...Er(n)}}function xr(n){const{year:e,month:t,day:i}=n,s=Y0(e,t,i);return{year:e,ordinal:s,...Er(n)}}function Lf(n){const{year:e,ordinal:t}=n,{month:i,day:s}=K0(e,t);return{year:e,month:i,day:s,...Er(n)}}function Af(n,e){if(!st(n.localWeekday)||!st(n.localWeekNumber)||!st(n.localWeekYear)){if(!st(n.weekday)||!st(n.weekNumber)||!st(n.weekYear))throw new Zl("Cannot mix locale-based week fields with ISO-based week fields");return st(n.localWeekday)||(n.weekday=n.localWeekday),st(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),st(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 Zv(n,e=4,t=1){const i=Cr(n.weekYear),s=ti(n.weekNumber,1,Ys(n.weekYear,e,t)),l=ti(n.weekday,1,7);return i?s?l?!1:ei("weekday",n.weekday):ei("week",n.weekNumber):ei("weekYear",n.weekYear)}function Gv(n){const e=Cr(n.year),t=ti(n.ordinal,1,Ql(n.year));return e?t?!1:ei("ordinal",n.ordinal):ei("year",n.year)}function J0(n){const e=Cr(n.year),t=ti(n.month,1,12),i=ti(n.day,1,cr(n.year,n.month));return e?t?i?!1:ei("day",n.day):ei("month",n.month):ei("year",n.year)}function Z0(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ti(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ti(t,0,59),r=ti(i,0,59),a=ti(s,0,999);return l?o?r?a?!1:ei("millisecond",s):ei("second",i):ei("minute",t):ei("hour",e)}function st(n){return typeof n>"u"}function nl(n){return typeof n=="number"}function Cr(n){return typeof n=="number"&&n%1===0}function Xv(n){return typeof n=="string"}function Qv(n){return Object.prototype.toString.call(n)==="[object Date]"}function G0(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function X0(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function xv(n){return Array.isArray(n)?n:[n]}function Pf(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function e2(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function is(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ja(n){if(n==null)return null;if(typeof n!="object")throw new gn("Week settings must be an object");if(!ti(n.firstDay,1,7)||!ti(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!ti(e,1,7)))throw new gn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function ti(n,e,t){return Cr(n)&&n>=e&&n<=t}function t2(n,e){return n-e*Math.floor(n/e)}function sn(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Zi(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function hl(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function Mu(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Eu(n,e,t="round"){const i=10**e;switch(t){case"expand":return n>0?Math.ceil(n*i)/i:Math.floor(n*i)/i;case"trunc":return Math.trunc(n*i)/i;case"round":return Math.round(n*i)/i;case"floor":return Math.floor(n*i)/i;case"ceil":return Math.ceil(n*i)/i;default:throw new RangeError(`Value rounding ${t} is out of range`)}}function uo(n){return n%4===0&&(n%100!==0||n%400===0)}function Ql(n){return uo(n)?366:365}function cr(n,e){const t=t2(e-1,12)+1,i=n+(e-t)/12;return t===2?uo(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Or(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 Nf(n,e,t){return-Ou(Cu(n,1,e),t)+e-1}function Ys(n,e=4,t=1){const i=Nf(n,e,t),s=Nf(n+1,e,t);return(Ql(n)-i+s)/7}function Za(n){return n>99?n:n>xt.twoDigitCutoffYear?1900+n:2e3+n}function Q0(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Mr(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function x0(n){const e=Number(n);if(typeof n=="boolean"||n===""||!Number.isFinite(e))throw new gn(`Invalid unit value ${n}`);return e}function dr(n,e){const t={};for(const i in n)if(is(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=x0(s)}return t}function Ls(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${sn(t,2)}:${sn(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${sn(t,2)}${sn(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Er(n){return e2(n,["hour","minute","second","millisecond"])}const n2=["January","February","March","April","May","June","July","August","September","October","November","December"],ek=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i2=["J","F","M","A","M","J","J","A","S","O","N","D"];function tk(n){switch(n){case"narrow":return[...i2];case"short":return[...ek];case"long":return[...n2];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 nk=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ik=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],l2=["M","T","W","T","F","S","S"];function lk(n){switch(n){case"narrow":return[...l2];case"short":return[...ik];case"long":return[...nk];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const sk=["AM","PM"],s2=["Before Christ","Anno Domini"],o2=["BC","AD"],r2=["B","A"];function ok(n){switch(n){case"narrow":return[...r2];case"short":return[...o2];case"long":return[...s2];default:return null}}function a2(n){return sk[n.hour<12?0:1]}function u2(n,e){return lk(e)[n.weekday-1]}function f2(n,e){return tk(e)[n.month-1]}function c2(n,e){return ok(e)[n.year<0?0:1]}function d2(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Rf(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const p2={D:ur,DD:S0,DDD:T0,DDDD:$0,t:C0,tt:O0,ttt:M0,tttt:E0,T:D0,TT:I0,TTT:L0,TTTT:A0,f:P0,ff:R0,fff:q0,ffff:H0,F:N0,FF:F0,FFF:j0,FFFF:z0};class kn{static create(e,t={}){return new kn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0||s)&&l.push({literal:s||/^\s+$/.test(i),val:i===""?"'":i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s||/^\s+$/.test(i),val:i}),l}static macroTokenToFormatOpts(e){return p2[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,i=void 0){if(this.opts.forceSimple)return sn(e,t);const s={...this.opts};return t>0&&(s.padTo=t),i&&(s.signDisplay=i),this.loc.numberFormatter(s).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(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?a2(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?f2(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?u2(e,m):l(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=kn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?c2(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"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 Rf(kn.parseFormat(t),d)}formatDurationFromString(e,t){const i=this.opts.signMode==="negativeLargestOnly"?-1:1,s=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},l=(f,c)=>d=>{const m=s(d);if(m){const h=c.isNegativeDuration&&m!==c.largestUnit?i:1;let g;return this.opts.signMode==="negativeLargestOnly"&&m!==c.largestUnit?g="never":this.opts.signMode==="all"?g="always":g="auto",this.num(f.get(m)*h,d.length,g)}else return d},o=kn.parseFormat(t),r=o.reduce((f,{literal:c,val:d})=>c?f:f.concat(d),[]),a=e.shiftTo(...r.map(s).filter(f=>f)),u={isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]};return Rf(o,l(a,u))}}const rk=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function us(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function fs(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function cs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function ak(...n){return(e,t)=>{const i={};let s;for(s=0;sm!==void 0&&(h||m&&f)?-m:m;return[{years:d(hl(t)),months:d(hl(i)),weeks:d(hl(s)),days:d(hl(l)),hours:d(hl(o)),minutes:d(hl(r)),seconds:d(hl(a),a==="-0"),milliseconds:d(Mu(u),c)}]}const C2={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 Lu(n,e,t,i,s,l,o){const r={year:e.length===2?Za(Zi(e)):Zi(e),month:ek.indexOf(t)+1,day:Zi(i),hour:Zi(s),minute:Zi(l)};return o&&(r.second=Zi(o)),n&&(r.weekday=n.length>3?nk.indexOf(n)+1:ik.indexOf(n)+1),r}const O2=/^(?:(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 M2(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Lu(e,s,i,t,l,o,r);let m;return a?m=C2[a]:u?m=0:m=Mr(f,c),[d,new Mn(m)]}function E2(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const D2=/^(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$/,I2=/^(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$/,L2=/^(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 Ff(n){const[,e,t,i,s,l,o,r]=n;return[Lu(e,s,i,t,l,o,r),Mn.utcInstance]}function A2(n){const[,e,t,i,s,l,o,r]=n;return[Lu(e,r,t,i,s,l,o),Mn.utcInstance]}const P2=us(h2,Iu),N2=us(_2,Iu),R2=us(g2,Iu),F2=us(fk),dk=fs(w2,ds,fo,co),q2=fs(b2,ds,fo,co),j2=fs(k2,ds,fo,co),H2=fs(ds,fo,co);function z2(n){return cs(n,[P2,dk],[N2,q2],[R2,j2],[F2,H2])}function U2(n){return cs(E2(n),[O2,M2])}function V2(n){return cs(n,[D2,Ff],[I2,Ff],[L2,A2])}function B2(n){return cs(n,[T2,$2])}const W2=fs(ds);function Y2(n){return cs(n,[S2,W2])}const K2=us(y2,v2),J2=us(ck),Z2=fs(ds,fo,co);function G2(n){return cs(n,[K2,dk],[J2,Z2])}const qf="Invalid Duration",pk={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}},X2={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},...pk},Gn=146097/400,Vl=146097/4800,Q2={years:{quarters:4,months:12,weeks:Gn/7,days:Gn,hours:Gn*24,minutes:Gn*24*60,seconds:Gn*24*60*60,milliseconds:Gn*24*60*60*1e3},quarters:{months:3,weeks:Gn/28,days:Gn/4,hours:Gn*24/4,minutes:Gn*24*60/4,seconds:Gn*24*60*60/4,milliseconds:Gn*24*60*60*1e3/4},months:{weeks:Vl/7,days:Vl,hours:Vl*24,minutes:Vl*24*60,seconds:Vl*24*60*60,milliseconds:Vl*24*60*60*1e3},...pk},Tl=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],x2=Tl.slice(0).reverse();function Pi(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 Tt(i)}function mk(n,e){let t=e.milliseconds??0;for(const i of x2.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function jf(n,e){const t=mk(n,e)<0?-1:1;Tl.reduceRight((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]*t,o=n[s][i],r=Math.floor(l/o);e[s]+=r*t,e[i]-=r*o*t}return s},null),Tl.reduce((i,s)=>{if(st(e[s]))return i;if(i){const l=e[i]%1;e[i]-=l,e[s]+=l*n[i][s]}return s},null)}function Hf(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class Tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?Q2:X2;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||Dt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return Tt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new gn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Tt({values:dr(e,Tt.normalizeUnit),loc:Dt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(nl(e))return Tt.fromMillis(e);if(Tt.isDuration(e))return e;if(typeof e=="object")return Tt.fromObject(e);throw new gn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=B2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Y2(e);return i?Tt.fromObject(i,t):Tt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the Duration is invalid");const i=e instanceof fi?e:new fi(e,t);if(xt.throwOnInvalid)throw new $v(i);return new Tt({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 w0(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?kn.create(this.loc,i).formatDurationFromString(this,e):qf}toHuman(e={}){if(!this.isValid)return qf;const t=e.showZeros!==!1,i=Tl.map(s=>{const l=this.values[s];return st(l)||l===0&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:s.slice(0,-1)}).format(l)}).filter(s=>s);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}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+=Eu(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?mk(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e),i={};for(const s of Tl)(is(t.values,s)||is(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Pi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=Tt.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]=x0(e(this.values[i],i));return Pi(this,{values:t},!0)}get(e){return this[Tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...dr(e,Tt.normalizeUnit)};return Pi(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:s}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:i};return Pi(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return jf(this.matrix,e),Pi(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Hf(this.normalize().shiftToAll().toObject());return Pi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>Tt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Tl)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;nl(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else nl(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return jf(this.matrix,t),Pi(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 Pi(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=Hf(this.values);return Pi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Tl)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Bl="Invalid Interval";function ew(n,e){return!n||!n.isValid?Qt.invalid("missing or invalid start"):!e||!e.isValid?Qt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Qt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ys).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=Tt.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Qt.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Qt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Qt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Qt.fromDateTimes(t,a.time)),t=null);return Qt.merge(s)}difference(...e){return Qt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Bl}[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=ur,t={}){return this.isValid?kn.create(this.s.loc.clone(t),e).formatInterval(this):Bl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Bl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Bl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Bl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Bl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Tt.invalid(this.invalidReason)}mapEndpoints(e){return Qt.fromDateTimes(e(this.s),e(this.e))}}class $o{static hasDST(e=xt.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 Xi(e,xt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Dt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Dt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Dt.create(t,null,"gregory").eras(e)}static features(){return{relative:G0(),localeWeek:X0()}}}function zf(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(Tt.fromMillis(i).as("days"))}function tw(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=zf(a,u);return(f-f%7)/7}],["days",zf]],s={},l=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,s[a]=u(n,e),r=l.plus(s),r>e?(s[a]--,n=l.plus(s),n>e&&(r=n,s[a]--,n=l.plus(s))):n=r);return[n,s,r,o]}function nw(n,e,t,i){let[s,l,o,r]=tw(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?Tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const iw="missing Intl.DateTimeFormat.formatToParts support";function Ot(n,e=t=>t){return{regex:n,deser:([t])=>e(Kv(t))}}const lw=" ",hk=`[ ${lw}]`,_k=new RegExp(hk,"g");function sw(n){return n.replace(/\./g,"\\.?").replace(_k,hk)}function Uf(n){return n.replace(/\./g,"").replace(_k," ").toLowerCase()}function ui(n,e){return n===null?null:{regex:RegExp(n.map(sw).join("|")),deser:([t])=>n.findIndex(i=>Uf(t)===Uf(i))+e}}function Vf(n,e){return{regex:n,deser:([,t,i])=>Mr(t,i),groups:e}}function Co(n){return{regex:n,deser:([e])=>e}}function ow(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function rw(n,e){const t=ai(e),i=ai(e,"{2}"),s=ai(e,"{3}"),l=ai(e,"{4}"),o=ai(e,"{6}"),r=ai(e,"{1,2}"),a=ai(e,"{1,3}"),u=ai(e,"{1,6}"),f=ai(e,"{1,9}"),c=ai(e,"{2,4}"),d=ai(e,"{4,6}"),m=_=>({regex:RegExp(ow(_.val)),deser:([k])=>k,literal:!0}),g=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return ui(e.eras("short"),0);case"GG":return ui(e.eras("long"),0);case"y":return Ot(u);case"yy":return Ot(c,Za);case"yyyy":return Ot(l);case"yyyyy":return Ot(d);case"yyyyyy":return Ot(o);case"M":return Ot(r);case"MM":return Ot(i);case"MMM":return ui(e.months("short",!0),1);case"MMMM":return ui(e.months("long",!0),1);case"L":return Ot(r);case"LL":return Ot(i);case"LLL":return ui(e.months("short",!1),1);case"LLLL":return ui(e.months("long",!1),1);case"d":return Ot(r);case"dd":return Ot(i);case"o":return Ot(a);case"ooo":return Ot(s);case"HH":return Ot(i);case"H":return Ot(r);case"hh":return Ot(i);case"h":return Ot(r);case"mm":return Ot(i);case"m":return Ot(r);case"q":return Ot(r);case"qq":return Ot(i);case"s":return Ot(r);case"ss":return Ot(i);case"S":return Ot(a);case"SSS":return Ot(s);case"u":return Co(f);case"uu":return Co(r);case"uuu":return Ot(t);case"a":return ui(e.meridiems(),0);case"kkkk":return Ot(l);case"kk":return Ot(c,Za);case"W":return Ot(r);case"WW":return Ot(i);case"E":case"c":return Ot(t);case"EEE":return ui(e.weekdays("short",!1),1);case"EEEE":return ui(e.weekdays("long",!1),1);case"ccc":return ui(e.weekdays("short",!0),1);case"cccc":return ui(e.weekdays("long",!0),1);case"Z":case"ZZ":return Vf(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Vf(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Co(/[a-z_+-/]{1,256}?/i);case" ":return Co(/[^\S\n\r]/);default:return m(_)}})(n)||{invalidReason:iw};return g.token=n,g}const aw={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 uw(n,e,t){const{type:i,value:s}=n;if(i==="literal"){const a=/^\s+$/.test(s);return{literal:!a,val:a?" ":s}}const l=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=aw[o];if(typeof r=="object"&&(r=r[l]),r)return{literal:!1,val:r}}function fw(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function cw(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(is(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function dw(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=Hi.create(n.z)),st(n.Z)||(t||(t=new Mn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(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),st(n.u)||(n.S=Mu(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ea=null;function pw(){return ea||(ea=Xe.fromMillis(1555555555555)),ea}function mw(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val),i=yk(t,e);return i==null||i.includes(void 0)?n:i}function gk(n,e){return Array.prototype.concat(...n.map(t=>mw(t,e)))}class bk{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=gk(kn.parseFormat(t),e),this.units=this.tokens.map(i=>rw(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,s]=fw(this.units);this.regex=RegExp(i,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,i]=cw(e,this.regex,this.handlers),[s,l,o]=i?dw(i):[null,null,void 0];if(is(i,"a")&&is(i,"H"))throw new Zl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:s,zone:l,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 kk(n,e,t){return new bk(n,t).explainFromTokens(e)}function hw(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=kk(n,e,t);return[i,s,l,o]}function yk(n,e){if(!n)return null;const i=kn.create(e,n).dtFormatter(pw()),s=i.formatToParts(),l=i.resolvedOptions();return s.map(o=>uw(o,n,l))}const ta="Invalid DateTime",Bf=864e13;function Os(n){return new fi("unsupported zone",`the zone "${n.name}" is not supported`)}function na(n){return n.weekData===null&&(n.weekData=fr(n.c)),n.weekData}function ia(n){return n.localWeekData===null&&(n.localWeekData=fr(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function _l(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Xe({...t,...e,old:t})}function vk(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Oo(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 Go(n,e,t){return vk(Or(n),e,t)}function Wf(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,cr(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=Tt.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=Or(l);let[a,u]=vk(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Wl(n,e,t,i,s,l){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:l});return o?u:u.setZone(r)}else return Xe.invalid(new fi("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Mo(n,e,t=!0){return n.isValid?kn.create(Dt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function la(n,e,t){const i=n.c.year>9999||n.c.year<0;let s="";if(i&&n.c.year>=0&&(s+="+"),s+=sn(n.c.year,i?6:4),t==="year")return s;if(e){if(s+="-",s+=sn(n.c.month),t==="month")return s;s+="-"}else if(s+=sn(n.c.month),t==="month")return s;return s+=sn(n.c.day),s}function Yf(n,e,t,i,s,l,o){let r=!t||n.c.millisecond!==0||n.c.second!==0,a="";switch(o){case"day":case"month":case"year":break;default:if(a+=sn(n.c.hour),o==="hour")break;if(e){if(a+=":",a+=sn(n.c.minute),o==="minute")break;r&&(a+=":",a+=sn(n.c.second))}else{if(a+=sn(n.c.minute),o==="minute")break;r&&(a+=sn(n.c.second))}if(o==="second")break;r&&(!i||n.c.millisecond!==0)&&(a+=".",a+=sn(n.c.millisecond,3))}return s&&(n.isOffsetFixed&&n.offset===0&&!l?a+="Z":n.o<0?(a+="-",a+=sn(Math.trunc(-n.o/60)),a+=":",a+=sn(Math.trunc(-n.o%60))):(a+="+",a+=sn(Math.trunc(n.o/60)),a+=":",a+=sn(Math.trunc(n.o%60)))),l&&(a+="["+n.zone.ianaName+"]"),a}const wk={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},_w={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},gw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Xo=["year","month","day","hour","minute","second","millisecond"],bw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],kw=["year","ordinal","hour","minute","second","millisecond"];function Qo(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 w0(n);return e}function Kf(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Qo(n)}}function yw(n){if(Ms===void 0&&(Ms=xt.now()),n.type!=="iana")return n.offset(Ms);const e=n.name;let t=Ga.get(e);return t===void 0&&(t=n.offset(Ms),Ga.set(e,t)),t}function Jf(n,e){const t=Xi(e.zone,xt.defaultZone);if(!t.isValid)return Xe.invalid(Os(t));const i=Dt.fromObject(e);let s,l;if(st(n.year))s=xt.now();else{for(const a of Xo)st(n[a])&&(n[a]=wk[a]);const o=J0(n)||Z0(n);if(o)return Xe.invalid(o);const r=yw(t);[s,l]=Go(n,r,t)}return new Xe({ts:s,zone:t,loc:i,o:l})}function Zf(n,e,t){const i=st(t.round)?!0:t.round,s=st(t.rounding)?"trunc":t.rounding,l=(r,a)=>(r=Eu(r,i||t.calendary?0:2,t.calendary?"round":s),e.loc.clone(t).relFormatter(t).format(r,a)),o=r=>t.calendary?e.hasSame(n,r)?0:e.startOf(r).diff(n.startOf(r),r).get(r):e.diff(n,r).get(r);if(t.unit)return l(o(t.unit),t.unit);for(const r of t.units){const a=o(r);if(Math.abs(a)>=1)return l(a,r)}return l(n>e?-0:0,t.units[t.units.length-1])}function Gf(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 Ms;const Ga=new Map;class Xe{constructor(e){const t=e.zone||xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new fi("invalid input"):null)||(t.isValid?null:Os(t));this.ts=st(e.ts)?xt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=nl(e.o)&&!e.old?e.o:t.offset(this.ts);s=Oo(this.ts,r),i=Number.isNaN(s.year)?new fi("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Dt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Xe({})}static local(){const[e,t]=Gf(arguments),[i,s,l,o,r,a,u]=t;return Jf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Gf(arguments),[i,s,l,o,r,a,u]=t;return e.zone=Mn.utcInstance,Jf({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Qv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Xe.invalid("invalid input");const s=Xi(t.zone,xt.defaultZone);return s.isValid?new Xe({ts:i,zone:s,loc:Dt.fromObject(t)}):Xe.invalid(Os(s))}static fromMillis(e,t={}){if(nl(e))return e<-Bf||e>Bf?Xe.invalid("Timestamp out of range"):new Xe({ts:e,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new gn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(nl(e))return new Xe({ts:e*1e3,zone:Xi(t.zone,xt.defaultZone),loc:Dt.fromObject(t)});throw new gn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Xi(t.zone,xt.defaultZone);if(!i.isValid)return Xe.invalid(Os(i));const s=Dt.fromObject(t),l=dr(e,Kf),{minDaysInFirstWeek:o,startOfWeek:r}=Af(l,s),a=xt.now(),u=st(t.specificOffset)?i.offset(a):t.specificOffset,f=!st(l.ordinal),c=!st(l.year),d=!st(l.month)||!st(l.day),m=c||d,h=l.weekYear||l.weekNumber;if((m||f)&&h)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new Zl("Can't mix ordinal dates with month/day");const g=h||l.weekday&&!m;let _,k,S=Oo(a,u);g?(_=bw,k=_w,S=fr(S,o,r)):f?(_=kw,k=gw,S=xr(S)):(_=Xo,k=wk);let $=!1;for(const P of _){const N=l[P];st(N)?$?l[P]=k[P]:l[P]=S[P]:$=!0}const T=g?Zv(l,o,r):f?Gv(l):J0(l),O=T||Z0(l);if(O)return Xe.invalid(O);const E=g?If(l,o,r):f?Lf(l):l,[L,I]=Go(E,u,i),A=new Xe({ts:L,zone:i,o:I,loc:s});return l.weekday&&m&&e.weekday!==A.weekday?Xe.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${A.toISO()}`):A.isValid?A:Xe.invalid(A.invalid)}static fromISO(e,t={}){const[i,s]=z2(e);return Wl(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=U2(e);return Wl(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=V2(e);return Wl(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new gn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=hw(o,e,t);return f?Xe.invalid(f):Wl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Xe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=G2(e);return Wl(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new gn("need to specify a reason the DateTime is invalid");const i=e instanceof fi?e:new fi(e,t);if(xt.throwOnInvalid)throw new Sv(i);return new Xe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=yk(e,Dt.fromObject(t));return i?i.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return gk(kn.parseFormat(e),Dt.fromObject(t)).map(s=>s.val).join("")}static resetCache(){Ms=void 0,Ga.clear()}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?na(this).weekYear:NaN}get weekNumber(){return this.isValid?na(this).weekNumber:NaN}get weekday(){return this.isValid?na(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ia(this).weekday:NaN}get localWeekNumber(){return this.isValid?ia(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ia(this).weekYear:NaN}get ordinal(){return this.isValid?xr(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=Or(this.c),s=this.zone.offset(i-e),l=this.zone.offset(i+e),o=this.zone.offset(i-s*t),r=this.zone.offset(i-l*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Oo(a,o),c=Oo(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[_l(this,{ts:a}),_l(this,{ts:u})]:[this]}get isInLeapYear(){return uo(this.year)}get daysInMonth(){return cr(this.year,this.month)}get daysInYear(){return this.isValid?Ql(this.year):NaN}get weeksInWeekYear(){return this.isValid?Ys(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Ys(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Mn.instance(e),t)}toLocal(){return this.setZone(xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Xi(e,xt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=Go(o,l,e)}return _l(this,{ts:s,zone:e})}else return Xe.invalid(Os(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return _l(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=dr(e,Kf),{minDaysInFirstWeek:i,startOfWeek:s}=Af(t,this.loc),l=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),o=!st(t.ordinal),r=!st(t.year),a=!st(t.month)||!st(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new Zl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new Zl("Can't mix ordinal dates with month/day");let c;l?c=If({...fr(this.c,i,s),...t},i,s):st(t.ordinal)?(c={...this.toObject(),...t},st(t.day)&&(c.day=Math.min(cr(c.year,c.month),c.day))):c=Lf({...xr(this.c),...t});const[d,m]=Go(c,this.o,this.zone);return _l(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e);return _l(this,Wf(this,t))}minus(e){if(!this.isValid)return this;const t=Tt.fromDurationLike(e).negate();return _l(this,Wf(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},s=Tt.normalizeUnit(e);switch(s){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(s==="weeks")if(t){const l=this.loc.getStartOfWeek(),{weekday:o}=this;o=3&&(a+="T"),a+=Yf(this,r,t,i,s,l,o),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?la(this,e==="extended",Qo(t)):null}toISOWeekDate(){return Mo(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended",precision:r="milliseconds"}={}){return this.isValid?(r=Qo(r),(s&&Xo.indexOf(r)>=3?"T":"")+Yf(this,o==="extended",t,e,i,l,r)):null}toRFC2822(){return Mo(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mo(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?la(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Mo(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ta}[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 Tt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=xv(t).map(Tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=nw(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Xe.now(),e,t)}until(e){return this.isValid?Qt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const s=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t,i)<=s&&s<=l.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Xe.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Xe.isDateTime))throw new gn("max requires all arguments be DateTimes");return Pf(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return kk(o,e,t)}static fromStringExplain(e,t,i={}){return Xe.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:s=null}=t,l=Dt.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});return new bk(l,e)}static fromFormatParser(e,t,i={}){if(st(e)||st(t))throw new gn("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});if(!o.equals(t.locale))throw new gn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?Xe.invalid(f):Wl(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return ur}static get DATE_MED(){return S0}static get DATE_MED_WITH_WEEKDAY(){return Cv}static get DATE_FULL(){return T0}static get DATE_HUGE(){return $0}static get TIME_SIMPLE(){return C0}static get TIME_WITH_SECONDS(){return O0}static get TIME_WITH_SHORT_OFFSET(){return M0}static get TIME_WITH_LONG_OFFSET(){return E0}static get TIME_24_SIMPLE(){return D0}static get TIME_24_WITH_SECONDS(){return I0}static get TIME_24_WITH_SHORT_OFFSET(){return L0}static get TIME_24_WITH_LONG_OFFSET(){return A0}static get DATETIME_SHORT(){return P0}static get DATETIME_SHORT_WITH_SECONDS(){return N0}static get DATETIME_MED(){return R0}static get DATETIME_MED_WITH_SECONDS(){return F0}static get DATETIME_MED_WITH_WEEKDAY(){return Ov}static get DATETIME_FULL(){return q0}static get DATETIME_FULL_WITH_SECONDS(){return j0}static get DATETIME_HUGE(){return H0}static get DATETIME_HUGE_WITH_SECONDS(){return z0}}function ys(n){if(Xe.isDateTime(n))return n;if(n&&n.valueOf&&nl(n.valueOf()))return Xe.fromJSDate(n);if(n&&typeof n=="object")return Xe.fromObject(n);throw new gn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const vw=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],ww=[".mp4",".avi",".mov",".3gp",".wmv"],Sw=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Tw=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],$w=["relation","file","select"],Cw=["text","email","url","editor"],Sk=[{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 s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=U.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!U.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!U.isObject(l)&&!Array.isArray(l)||!U.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!U.isObject(s)&&!Array.isArray(s)||!U.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):U.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||U.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||U.isObject(e)&&Object.keys(e).length>0)&&U.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return U.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),U.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", ",i=!0){e=e||[];const s=[],l=t.length>1?t.trim():t;for(let o of e)o=typeof o=="string"?o.trim():"",!U.isEmpty(o)&&(i&&(o=o.replaceAll(l,"\\"+l)),s.push(o));return s.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(typeof e=="object")try{e=JSON.stringify(e,null,2)}catch{}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"}),s=window.URL.createObjectURL(i);U.download(s,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||"",!!vw.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!ww.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Sw.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(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(U.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)U.addValueToFormData(e,t,s);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 l;const i=(e==null?void 0:e.fields)||[],s={};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=(l=o==null?void 0:o.values)==null?void 0:l[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])):o.type=="geoPoint"?r={lon:0,lat:0}:r="test";s[o.name]=r}return s}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){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";case"geoPoint":return"ri-map-pin-2-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"geoPoint":return"Object";case"file":return"File";case"select":case"relation":return(e==null?void 0:e.maxSelect)==1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="geoPoint"?'{"lon":0,"lat":0}':(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 s=Array.isArray(e.fields)?e.fields:[],l=Array.isArray(t.fields)?t.fields:[],o=s.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!U.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=U.isObject(u)&&U.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.nameo.id==e.collectionId);if(!l)return s;for(const o of l.fields){if(!o.presentable||o.type!="relation"||i<=0)continue;const r=U.getExpandPresentableRelFields(o,t,i-1);for(const a of r)s.push(e.name+"."+a)}return s.length||s.push(e.name),s}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,enableSeconds:!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(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}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:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,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),s(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.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(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=U.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){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/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of U.extractColumnsFromQuery(e.viewQuery))U.pushUnique(i,t+l);const s=e.fields||[];for(const l of s)l.type=="geoPoint"?(U.pushUnique(i,t+l.name+".lon"),U.pushUnique(i,t+l.name+".lat")):U.pushUnique(i,t+l.name);return i}static getCollectionAutocompleteKeys(e,t,i="",s=0){let l=e.find(r=>r.name==t||r.id==t);if(!l||s>=4)return[];l.fields=l.fields||[];let o=U.getAllCollectionIdentifiers(l,i);for(const r of l.fields){const a=i+r.name;if(r.type=="relation"&&r.collectionId){const u=U.getCollectionAutocompleteKeys(e,r.collectionId,a+".",s+1);u.length&&(o=o.concat(u))}r.maxSelect!=1&&$w.includes(r.type)?(o.push(a+":each"),o.push(a+":length")):Cw.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==l.id){const u=i+r.name+"_via_"+a.name,f=U.getCollectionAutocompleteKeys(e,r.id,u+".",s+2);f.length&&(o=o.concat(f))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];let i,s;for(const l of e)if(!l.system){i="@collection."+l.name+".",s=U.getCollectionAutocompleteKeys(e,l.name,i);for(const o of s)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 s=e.filter(l=>l.type==="auth");for(const l of s){if(l.system)continue;const o=U.getCollectionAutocompleteKeys(e,l.id,"@request.auth.");for(const r of o)U.pushUnique(i,r)}if(t){const l=U.getCollectionAutocompleteKeys(e,t,"@request.body.");for(const o of l){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:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!U.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const 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(l,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+U.randomString(10)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=U.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?U.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static 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 s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?l.delete(a):l.set(a,u)}t=l.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 Xa,gl;const Qa="app-tooltip";function Xf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function il(){return gl=gl||document.querySelector("."+Qa),gl||(gl=document.createElement("div"),gl.classList.add(Qa),document.body.appendChild(gl)),gl}function Sk(n,e){let t=il();if(!t.classList.contains("active")||!(e!=null&&e.text)){xa();return}t.textContent=e.text,t.className=Qa+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function xa(){clearTimeout(Xa),il().classList.remove("active"),il().activeNode=void 0}function Cw(n,e){il().activeNode=n,clearTimeout(Xa),Xa=setTimeout(()=>{il().classList.add("active"),Sk(n,e)},isNaN(e.delay)?0:e.delay)}function Re(n,e){let t=Xf(e);function i(){Cw(n,t)}function s(){xa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",s),il(),{update(l){var o,r;t=Xf(l),(r=(o=il())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Sk(n,t)},destroy(){var l,o;(o=(l=il())==null?void 0:l.activeNode)!=null&&o.contains(n)&&xa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Dr(n){const e=n-1;return e*e*e+1}function Ks(n,{delay:e=0,duration:t=400,easing:i=so}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Hn(n,{delay:e=0,duration:t=400,easing:i=Dr,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=kf(s),[m,_]=kf(l);return{delay:e,duration:t,easing:i,css:(g,h)=>` - transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${_}); - opacity: ${a-f*h}`}}function ht(n,{delay:e=0,duration:t=400,easing:i=Dr,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),h=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*h}px;`}}function Ct(n,{delay:e=0,duration:t=400,easing:i=Dr,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` +`),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 s=U.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?U.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static 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 s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?l.delete(a):l.set(a,u)}t=l.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 Xa,gl;const Qa="app-tooltip";function Xf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function il(){return gl=gl||document.querySelector("."+Qa),gl||(gl=document.createElement("div"),gl.classList.add(Qa),document.body.appendChild(gl)),gl}function Tk(n,e){let t=il();if(!t.classList.contains("active")||!(e!=null&&e.text)){xa();return}t.textContent=e.text,t.className=Qa+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function xa(){clearTimeout(Xa),il().classList.remove("active"),il().activeNode=void 0}function Ow(n,e){il().activeNode=n,clearTimeout(Xa),Xa=setTimeout(()=>{il().classList.add("active"),Tk(n,e)},isNaN(e.delay)?0:e.delay)}function Re(n,e){let t=Xf(e);function i(){Ow(n,t)}function s(){xa()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",s),il(),{update(l){var o,r;t=Xf(l),(r=(o=il())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Tk(n,t)},destroy(){var l,o;(o=(l=il())==null?void 0:l.activeNode)!=null&&o.contains(n)&&xa(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Dr(n){const e=n-1;return e*e*e+1}function Ks(n,{delay:e=0,duration:t=400,easing:i=so}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Hn(n,{delay:e=0,duration:t=400,easing:i=Dr,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=kf(s),[m,h]=kf(l);return{delay:e,duration:t,easing:i,css:(g,_)=>` + transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*m}${h}); + opacity: ${a-f*_}`}}function ht(n,{delay:e=0,duration:t=400,easing:i=Dr,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),h=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*h}px;border-${u[0]}-width: ${k*g}px;border-${u[1]}-width: ${k*_}px;`}}function Ct(n,{delay:e=0,duration:t=400,easing:i=Dr,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` transform: ${a} scale(${1-u*d}); opacity: ${r-f*d} - `}}const Ow=n=>({}),Qf=n=>({}),Mw=n=>({}),xf=n=>({});function ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$=n[4]&&!n[2]&&tc(n);const T=n[19].header,O=Nt(T,n,n[18],xf);let E=n[4]&&n[2]&&nc(n);const L=n[19].default,I=Nt(L,n,n[18],null),A=n[19].footer,P=Nt(A,n,n[18],Qf);return{c(){e=b("div"),t=b("div"),s=C(),l=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(N,R){w(N,e,R),v(e,t),v(e,s),v(e,l),v(l,o),$&&$.m(o,null),v(o,r),O&&O.m(o,null),v(o,a),E&&E.m(o,null),v(l,u),v(l,f),I&&I.m(f,null),n[21](f),v(l,c),v(l,d),P&&P.m(d,null),h=!0,k||(S=[Y(t,"click",it(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=tc(n),$.c(),M($,1),$.m(o,r)):$&&(oe(),D($,1,1,()=>{$=null}),re()),O&&O.p&&(!h||R[0]&262144)&&Ft(O,T,n,n[18],h?Rt(T,n[18],R,Mw):qt(n[18]),xf),n[4]&&n[2]?E?E.p(n,R):(E=nc(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!h||R[0]&262144)&&Ft(I,L,n,n[18],h?Rt(L,n[18],R,null):qt(n[18]),null),P&&P.p&&(!h||R[0]&262144)&&Ft(P,A,n,n[18],h?Rt(A,n[18],R,Ow):qt(n[18]),Qf),(!h||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!h||R[0]&262)&&x(l,"popup",n[2]),(!h||R[0]&4)&&x(e,"padded",n[2]),(!h||R[0]&1)&&x(e,"active",n[0])},i(N){h||(N&&tt(()=>{h&&(i||(i=qe(t,Ks,{duration:Gi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{h&&(g&&g.end(1),_=y0(l,Hn,n[2]?{duration:Gi,y:-10}:{duration:Gi,x:50}),_.start())}),h=!0)},o(N){N&&(i||(i=qe(t,Ks,{duration:Gi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),_&&_.invalidate(),N&&(g=Tu(l,Hn,n[2]?{duration:Gi,y:10}:{duration:Gi,x:50})),h=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ee(S)}}}function tc(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",it(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ks,{duration:Gi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ks,{duration:Gi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function nc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[5])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Ew(n){let e,t,i,s,l=n[0]&&ec(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=ec(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&y(e),l&&l.d(),n[23](null),i=!1,Ee(s)}}}let bl,sa=[];function Tk(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Gi=150;function ic(){return 1e3+Tk().querySelectorAll(".overlay-panel-container.active").length}function Dw(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=wt(),_="op_"+U.randomString(10);let g,h,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await _n(),A()}function A(){g&&(o?t(6,g.style.zIndex=ic(),g):t(6,g.style="",g))}function P(){U.pushUnique(sa,_),document.body.classList.add("overlay-active")}function N(){U.removeByValue(sa,_),sa.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!U.isInput(G.target)&&g&&g.style.zIndex==ic()&&(G.preventDefault(),E())}function z(G){o&&F(h)}function F(G,de){de&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}un(()=>{Tk().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const B=()=>a?E():!0;function J(G){ne[G?"unshift":"push"](()=>{h=G,t(7,h)})}const V=G=>F(G.target);function Z(G){ne[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,l=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,s=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&I(o),n.$$.dirty[0]&128&&F(h,!0),n.$$.dirty[0]&64&&g&&A(),n.$$.dirty[0]&1&&(o?P():N())},[o,l,r,a,u,E,g,h,$,R,z,F,f,c,d,O,L,T,s,i,B,J,V,Z]}class ln extends ve{constructor(e){super(),ye(this,e,Dw,Ew,be,{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 Yl=[];function $k(n,e){return{subscribe:zn(n,e).subscribe}}function zn(n,e=te){let t;const i=new Set;function s(r){if(be(n,r)&&(n=r,t)){const a=!Yl.length;for(const u of i)u[1](),Yl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Ck(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return $k(t,(o,r)=>{let a=!1;const u=[];let f=0,c=te;const d=()=>{if(f)return;c();const _=e(i?u[0]:u,o,r);l?o(_):c=Lt(_)?_:te},m=s.map((_,g)=>ku(_,h=>{u[g]=h,f&=~(1<{f|=1<t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){ne[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await _n(),t(3,o=!1),Ok()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class Nw extends ve{constructor(e){super(),ye(this,e,Pw,Aw,be,{})}}function Rw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),h0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function Fw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function qw(n){let e;function t(l,o){return l[1]?Fw:Rw}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[16](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:te,o:te,d(l){l&&y(e),s.d(),n[16](null)}}}function jw(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,s,l){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=s,o.onload=()=>{l()},i.head&&i.head.appendChild(o)}function t(i,s,l){n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let Hw=jw();function oa(){return window&&window.tinymce?window.tinymce:null}function zw(n,e,t){let{id:i="tinymce_svelte"+U.randomString(7)}=e,{inline:s=void 0}=e,{disabled:l=!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 _,g,h,k=u,S=l;const $=wt();function T(){const I={...r,target:g,inline:s!==void 0?s:r.inline!==void 0?r.inline:!1,readonly:l,setup:A=>{t(11,h=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),oa().init(I)}un(()=>(oa()!==null?T():Hw.load(_.ownerDocument,o,()=>{_&&T()}),()=>{var I,A;try{h&&((I=h.dom)==null||I.unbind(document),(A=oa())==null||A.remove(h))}catch{}}));function O(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ne[I?"unshift":"push"](()=>{_=I,t(3,_)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,s=I.inline),"disabled"in I&&t(7,l=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{h&&k!==u&&(h.setContent(u),t(6,f=h.getContent({format:"text"}))),h&&l!==S&&(t(13,S=l),typeof((I=h.mode)==null?void 0:I.set)=="function"?h.mode.set(l?"readonly":"design"):h.setMode(l?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,s,c,_,g,u,f,l,o,r,a,h,k,S,O,E,L]}class Pu extends ve{constructor(e){super(),ye(this,e,zw,qw,be,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Uw(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Dr}=i;return{delay:f,duration:Lt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,_)=>{const g=_*a,h=_*u,k=m+_*e.width/t.width,S=m+_*e.height/t.height;return`transform: ${l} translate(${g}px, ${h}px) scale(${k}, ${S});`}}}const Ir=zn([]);function Js(n,e=4e3){return Nu(n,"info",e)}function nn(n,e=3e3){return Nu(n,"success",e)}function Mi(n,e=4500){return Nu(n,"error",e)}function Nu(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Mk(i)},t)};Ir.update(s=>(Ru(s,i.message),U.pushOrReplaceByKey(s,i,"message"),s))}function Mk(n){Ir.update(e=>(Ru(e,n),e))}function As(){Ir.update(n=>{for(let e of n)Ru(n,e);return[]})}function Ru(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 lc(n,e,t){const i=n.slice();return i[2]=e[t],i}function Vw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Bw(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Yw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function sc(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m,_=te,g,h,k;function S(E,L){return E[2].type==="info"?Yw:E[2].type==="success"?Ww:E[2].type==="warning"?Bw:Vw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=C(),l=b("div"),r=W(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){w(E,t,L),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),g=!0,h||(k=Y(u,"click",it(O)),h=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&se(r,o),(!g||L&1)&&x(t,"alert-info",e[2].type=="info"),(!g||L&1)&&x(t,"alert-success",e[2].type=="success"),(!g||L&1)&&x(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){mv(t),_(),g0(t,m)},a(){_(),_=pv(t,m,Uw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=y0(t,ht,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=Tu(t,Ks,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),h=!1,k()}}}function Kw(n){let e,t=[],i=new Map,s,l=ce(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Mk(l)]}class Zw extends ve{constructor(e){super(),ye(this,e,Jw,Kw,be,{})}}function oc(n){let e,t,i;const s=n[18].default,l=Nt(s,n,n[17],null);return{c(){e=b("div"),l&&l.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),i=!0},p(o,r){l&&l.p&&(!i||r[0]&131072)&&Ft(l,s,o,o[17],i?Rt(s,o[17],r,null):qt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,Hn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),l&&l.d(o),n[19](null),o&&t&&t.end()}}}function Gw(n){let e,t,i,s,l=n[0]&&oc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),l&&l.m(e,null),n[20](e),t=!0,i||(s=[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]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=oc(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&y(e),l&&l.d(),n[20](null),i=!1,Ee(s)}}}function Xw(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,_,g,h=!1;const k=wt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){o&&(t(0,o=!1),h=!1,clearTimeout(_),clearTimeout(g))}function T(){clearTimeout(g),clearTimeout(_),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),_=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function O(){o?$():T()}function E(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(_),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)&&$()}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(),$())}function B(G){o&&(h=!(c!=null&&c.contains(G.target)))}function J(G){var de;o&&h&&!(c!=null&&c.contains(G.target))&&!(m!=null&&m.contains(G.target))&&!((de=G.target)!=null&&de.closest(".flatpickr-calendar"))&&$()}un(()=>(L(),()=>I()));function V(G){ne[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ne[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,l=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,s=G.$$scope)},n.$$.update=()=>{var G,de;n.$$.dirty[0]&260&&c&&L(l),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((de=m==null?void 0:m.classList)==null||de.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,B,J,l,r,a,u,S,$,T,O,m,s,i,V,Z]}class Dn extends ve{constructor(e){super(),ye(this,e,Xw,Gw,be,{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 an=zn(""),pr=zn(""),Il=zn(!1),Tn=zn({});function Jt(n){Tn.set(n||{})}function Wn(n){Tn.update(e=>(U.deleteByPath(e,n),e))}const Lr=zn({});function rc(n){Lr.set(n||{})}class jn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,jn.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 jn||(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.":(l=(s=(i=this.originalError)==null?void 0:i.cause)==null?void 0:s.message)!=null&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Eo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Qw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||xw;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}Ek=typeof atob!="function"||t3?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const uc="pb_auth";class Fu{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!Ar(this.token)}get isSuperuser(){var t,i;let e=es(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"),es(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=uc){const i=Qw(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.record||s.model||null)}exportToCookie(e,t=uc){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=es(this.token);i.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const l={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=ac(t,JSON.stringify(l),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(l.record&&r>4096){l.record={id:(a=l.record)==null?void 0:a.id,email:(u=l.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(l.record[c]=this.record[c]);o=ac(t,JSON.stringify(l),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 Dk extends Fu{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 zi{constructor(e){this.client=e}}class n3 extends zi{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,s){return s=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},s),this.client.send("/api/settings/test/email",s).then(()=>!0)}async generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const i3=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function qu(n){if(n){n.query=n.query||{};for(let e in n)i3.includes(e)||(n.query[e]=n[e],delete n[e])}}function Ik(n){const e=[];for(const t in n){const i=encodeURIComponent(t),s=Array.isArray(n[t])?n[t]:[n[t]];for(let l of s)l=l3(l),l!==null&&e.push(i+"="+l)}return e.join("&")}function l3(n){return n==null?null:n instanceof Date?encodeURIComponent(n.toISOString().replace("T"," ")):encodeURIComponent(typeof n=="object"?JSON.stringify(n):n)}class Lk extends zi{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 s=e;if(i){qu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));s+=(s.includes("?")?"&":"?")+r}const l=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(l),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(s,l):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,l)}async unsubscribe(e){var i;let t=!1;if(e){const s=this.getSubscriptionsByTopic(e);for(let l in s)if(this.hasSubscriptionListeners(l)){for(let o of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,o);delete this.subscriptions[l],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let s in this.subscriptions)if((s+"?").startsWith(e)){t=!0;for(let l of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,l);delete this.subscriptions[s]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var l;let i=!1;const s=this.getSubscriptionsByTopic(e);for(let o in s){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),(l=this.eventSource)==null||l.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 s in this.subscriptions)if((i=this.subscriptions[s])!=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 s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in i)for(let l of i[s])l(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 jn(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 Ak extends zi{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(s=>{var l;return s.items=((l=s.items)==null?void 0:l.map(o=>this.decode(o)))||[],s})}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 s;if(!((s=i==null?void 0:i.items)!=null&&s.length))throw new jn({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 jn({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(s=>this.decode(s))}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=[],s=async l=>this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i});return s(1)}}function Ji(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ra(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class s3 extends Ak{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(s=>{var l,o,r;if(((l=this.client.authStore.record)==null?void 0:l.id)===(s==null?void 0:s.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,s);a&&(u.expand=Object.assign(a,s.expand)),this.client.authStore.save(this.client.authStore.token,u)}return s})}async delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.record)==null?void 0:s.id)!==e||((l=this.client.authStore.record)==null?void 0:l.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 s;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(s=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||ra(this.client));let l=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return l=this.authResponse(l),s&&this.isSuperusers&&function(r,a,u,f){ra(r);const c=r.beforeSend,d=r.authStore.record,m=r.authStore.onChange((_,g)=>{(!_||(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))&&ra(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(_,g)=>{var $;const h=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(_,g):{url:_,sendOptions:g};let k=r.authStore.isValid;if(k&&Ar(r.authStore.token,a))try{await u()}catch{k=!1}k||await f();const S=g.headers||{};for(let T in S)if(T.toLowerCase()=="authorization"&&h==S[T]&&r.authStore.token){S[T]=r.authStore.token;break}return g.headers=S,c?c(_,g):{url:_,sendOptions:g}}}(this.client,s,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),l}async authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:s,createData:l}};return a=Ji("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=fc(void 0));const s=new Lk(this.client);function l(){i==null||i.close(),s.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 jn(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=()=>{l()}),new Promise(async(m,_)=>{var g;try{await s.subscribe("@oauth2",async $=>{var O;const T=s.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){_(new jn(E))}l()});const h={state:s.clientId};(g=t.scopes)!=null&&g.length&&(h.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,h);await(t.urlCallback||function($){i?i.location.href=$:i=fc($)})(k)}catch(h){l(),_(new jn(h))}})}).catch(a=>{throw l(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ji("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(s=>this.authResponse(s))}async requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ji("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Ji("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const l=es(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===l.id&&o.collectionId===l.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Ji("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Ji("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>{const o=es(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 s=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(s.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(s=>this.authResponse(s))}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 s=new po(this.client.baseURL,new Fu,this.client.lang),l=await s.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return s.authStore.save(l==null?void 0:l.token,this.decode((l==null?void 0:l.record)||{})),s}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function fc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new jn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class o3 extends Ak{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 r3 extends zi{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 jn({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 a3 extends zi{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class u3 extends zi{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 s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildURL(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}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 f3 extends zi{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)}`)}}class c3 extends zi{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/crons",e)}async run(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/crons/${encodeURIComponent(e)}`,t).then(()=>!0)}}function eu(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 tu(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function cc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(eu(i))return!0}return!1}const d3=/^[\-\.\d]+$/;function dc(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")&&d3.test(n)){let e=+n;if(""+e===n)return e}return n}class p3 extends zi{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new m3(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let s=0;s{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(dc(r))):o[a]=dc(r)}),o}(i));for(const s in i){const l=i[s];if(eu(l))e.files[s]=e.files[s]||[],e.files[s].push(l);else if(Array.isArray(l)){const o=[],r=[];for(const a of l)eu(a)?o.push(a):r.push(a);if(o.length>0&&o.length==l.length){e.files[s]=e.files[s]||[];for(let a of o)e.files[s].push(a)}else if(e.json[s]=r,o.length>0){let a=s;s.startsWith("+")||s.endsWith("+")||(a+="+"),e.files[a]=e.files[a]||[];for(let u of o)e.files[a].push(u)}}else e.json[s]=l}}}class po{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Fu:this.authStore=new Dk,this.collections=new o3(this),this.files=new u3(this),this.logs=new r3(this),this.settings=new n3(this),this.realtime=new Lk(this),this.health=new a3(this),this.backups=new f3(this),this.crons=new c3(this)}get admins(){return this.collection("_superusers")}createBatch(){return new p3(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new s3(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 s=t[i];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",s)}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 s=Object.assign({},await this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=Ik(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),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 s=>{let l={};try{l=await s.json()}catch{}if(this.afterSend&&(l=await this.afterSend(s,l,t)),s.status>=400)throw new jn({url:s.url,status:s.status,data:l});return l}).catch(s=>{throw new jn(s)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(s){if(typeof FormData>"u"||s===void 0||typeof s!="object"||s===null||tu(s)||!cc(s))return s;const l=new FormData;for(const o in s){const r=s[o];if(typeof r!="object"||cc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)l.append(o,u)}else{let a={};a[o]=r,l.append("@jsonPayload",JSON.stringify(a))}}return l}(t.body),qu(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||tu(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 s=new AbortController;this.cancelControllers[i]=s,t.signal=s.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 In=zn([]),ii=zn({}),Zs=zn(!1),Pk=zn({}),Pr=zn({});let Ps;typeof BroadcastChannel<"u"&&(Ps=new BroadcastChannel("collections"),Ps.onmessage=()=>{var n;ju((n=f0(ii))==null?void 0:n.id)});function Nk(){Ps==null||Ps.postMessage("reload")}function h3(n){In.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ii.set(t):e.length&&ii.set(e.find(i=>!i.system)||e[0]),e})}function _3(n){ii.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),In.update(e=>(U.pushOrReplaceByKey(e,n,"id"),Hu(),Nk(),U.sortCollections(e)))}function g3(n){In.update(e=>(U.removeByKey(e,"id",n.id),ii.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Hu(),Nk(),e))}async function b3(){Pr.set(await he.collections.getScaffolds())}async function ju(n=null){Zs.set(!0);try{const e=[];e.push(he.collections.getScaffolds()),e.push(he.collections.getFullList());let[t,i]=await Promise.all(e);Pr.set(t),i=U.sortCollections(i),In.set(i);const s=n&&i.find(l=>l.id==n||l.name==n);s?ii.set(s):i.length&&ii.set(i.find(l=>!l.system)||i[0]),Hu()}catch(e){he.error(e)}Zs.set(!1)}function Hu(){Pk.update(n=>(In.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(s=>s.type=="file"&&s.protected));return e}),n))}function Rk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function k3(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[7]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&4?vt(s,[At(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&&y(t),e&&j(e,r)}}}function y3(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[6]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&6?vt(s,[a&2&&{params:r[1]},a&4&&At(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&&y(t),e&&j(e,r)}}}function v3(n){let e,t,i,s;const l=[y3,k3],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function pc(){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 Nr=$k(null,function(e){e(pc());const t=()=>{e(pc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Ck(Nr,n=>n.location);const zu=Ck(Nr,n=>n.querystring),mc=zn(void 0);async function ls(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await _n();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 Fn(n,e){if(e=_c(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return hc(n,e),{update(t){t=_c(t),hc(n,t)}}}function w3(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function hc(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||S3(i.currentTarget.getAttribute("href"))})}function _c(n){return n&&typeof n=="string"?{href:n}:n||{}}function S3(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:s=""}=e,{restoreScrollState:l=!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}=Rk(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(s){if(typeof s=="string")if(O.startsWith(s))O=O.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const A=O.match(s);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{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=wt();async function d(T,O){await _n(),c(T,O)}let m=null,_=null;l&&(_=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",_),hv(()=>{w3(m)}));let g=null,h=null;const k=Nr.subscribe(async T=>{g=T;let O=0;for(;O{mc.set(u)});return}t(0,a=null),h=null,mc.set(void 0)});ro(()=>{k(),_&&window.removeEventListener("popstate",_)});function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,$]}class $3 extends ve{constructor(e){super(),ye(this,e,T3,v3,be,{routes:3,prefix:4,restoreScrollState:5})}}const aa="pb_superuser_file_token";po.prototype.logout=function(n=!0){this.authStore.clear(),n&&ls("/login")};po.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Mi(l),U.isEmpty(s.data)||Jt(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),ls("/")};po.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=f0(Pk);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(aa)||"";return(!t||Ar(t,10))&&(t&&localStorage.removeItem(aa),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(aa,t),this._superuserFileTokenRequest=null),t};class C3 extends Dk{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"&&rc(t)}clear(){super.clear(),rc(null)}}const he=new po("../",new C3);he.authStore.isValid&&he.collection(he.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)&&he.authStore.clear()});const xo=[];let Fk;function qk(n){const e=n.pattern.test(Fk);gc(n,n.className,e),gc(n,n.inactiveClassName,!e)}function gc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Nr.subscribe(n=>{Fk=n.location+(n.querystring?"?"+n.querystring:""),xo.map(qk)});function Si(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"?Rk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return xo.push(i),qk(i),{destroy(){xo.splice(xo.indexOf(i),1)}}}const O3="modulepreload",M3=function(n,e){return new URL(n,e).href},bc={},$t=function(e,t,i){let s=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"));s=Promise.allSettled(t.map(u=>{if(u=M3(u,i),u in bc)return;bc[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let _=o.length-1;_>=0;_--){const g=o[_];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":O3,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((_,g)=>{m.addEventListener("load",_),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return s.then(o=>{for(const r of o||[])r.status==="rejected"&&l(r.reason);return e().catch(l)})};function E3(n){e();function e(){he.authStore.isValid?ls("/collections"):he.logout()}return[]}class D3 extends ve{constructor(e){super(),ye(this,e,E3,null,be,{})}}function kc(n,e,t){const i=n.slice();return i[12]=e[t],i}const I3=n=>({}),yc=n=>({uniqueId:n[4]});function L3(n){let e,t,i=ce(n[3]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o({}),Qf=n=>({}),Ew=n=>({}),xf=n=>({});function ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[4]&&!n[2]&&tc(n);const T=n[19].header,O=Nt(T,n,n[18],xf);let E=n[4]&&n[2]&&nc(n);const L=n[19].default,I=Nt(L,n,n[18],null),A=n[19].footer,P=Nt(A,n,n[18],Qf);return{c(){e=b("div"),t=b("div"),s=C(),l=b("div"),o=b("div"),$&&$.c(),r=C(),O&&O.c(),a=C(),E&&E.c(),u=C(),f=b("div"),I&&I.c(),c=C(),d=b("div"),P&&P.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(N,R){w(N,e,R),v(e,t),v(e,s),v(e,l),v(l,o),$&&$.m(o,null),v(o,r),O&&O.m(o,null),v(o,a),E&&E.m(o,null),v(l,u),v(l,f),I&&I.m(f,null),n[21](f),v(l,c),v(l,d),P&&P.m(d,null),_=!0,k||(S=[Y(t,"click",it(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,R){n=N,n[4]&&!n[2]?$?($.p(n,R),R[0]&20&&M($,1)):($=tc(n),$.c(),M($,1),$.m(o,r)):$&&(oe(),D($,1,1,()=>{$=null}),re()),O&&O.p&&(!_||R[0]&262144)&&Ft(O,T,n,n[18],_?Rt(T,n[18],R,Ew):qt(n[18]),xf),n[4]&&n[2]?E?E.p(n,R):(E=nc(n),E.c(),E.m(o,null)):E&&(E.d(1),E=null),I&&I.p&&(!_||R[0]&262144)&&Ft(I,L,n,n[18],_?Rt(L,n[18],R,null):qt(n[18]),null),P&&P.p&&(!_||R[0]&262144)&&Ft(P,A,n,n[18],_?Rt(A,n[18],R,Mw):qt(n[18]),Qf),(!_||R[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!_||R[0]&262)&&x(l,"popup",n[2]),(!_||R[0]&4)&&x(e,"padded",n[2]),(!_||R[0]&1)&&x(e,"active",n[0])},i(N){_||(N&&tt(()=>{_&&(i||(i=qe(t,Ks,{duration:Gi,opacity:0},!0)),i.run(1))}),M($),M(O,N),M(I,N),M(P,N),N&&tt(()=>{_&&(g&&g.end(1),h=v0(l,Hn,n[2]?{duration:Gi,y:-10}:{duration:Gi,x:50}),h.start())}),_=!0)},o(N){N&&(i||(i=qe(t,Ks,{duration:Gi,opacity:0},!1)),i.run(0)),D($),D(O,N),D(I,N),D(P,N),h&&h.invalidate(),N&&(g=Tu(l,Hn,n[2]?{duration:Gi,y:10}:{duration:Gi,x:50})),_=!1},d(N){N&&y(e),N&&i&&i.end(),$&&$.d(),O&&O.d(N),E&&E.d(),I&&I.d(N),n[21](null),P&&P.d(N),N&&g&&g.end(),k=!1,Ee(S)}}}function tc(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",it(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ks,{duration:Gi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ks,{duration:Gi},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function nc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[5])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Dw(n){let e,t,i,s,l=n[0]&&ec(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=ec(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&y(e),l&&l.d(),n[23](null),i=!1,Ee(s)}}}let bl,sa=[];function $k(){return bl=bl||document.querySelector(".overlays"),bl||(bl=document.createElement("div"),bl.classList.add("overlays"),document.body.appendChild(bl)),bl}let Gi=150;function ic(){return 1e3+$k().querySelectorAll(".overlay-panel-container.active").length}function Iw(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=wt(),h="op_"+U.randomString(10);let g,_,k,S,$="",T=o;function O(){typeof c=="function"&&c()===!1||t(0,o=!0)}function E(){typeof d=="function"&&d()===!1||t(0,o=!1)}function L(){return o}async function I(G){t(17,T=G),G?(k=document.activeElement,m("show"),g==null||g.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await _n(),A()}function A(){g&&(o?t(6,g.style.zIndex=ic(),g):t(6,g.style="",g))}function P(){U.pushUnique(sa,h),document.body.classList.add("overlay-active")}function N(){U.removeByValue(sa,h),sa.length||document.body.classList.remove("overlay-active")}function R(G){o&&f&&G.code=="Escape"&&!U.isInput(G.target)&&g&&g.style.zIndex==ic()&&(G.preventDefault(),E())}function z(G){o&&F(_)}function F(G,de){de&&t(8,$=""),!(!G||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}G.scrollTop==0?t(8,$+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}un(()=>{$k().appendChild(g);let G=g;return()=>{clearTimeout(S),N(),G==null||G.remove()}});const B=()=>a?E():!0;function J(G){ne[G?"unshift":"push"](()=>{_=G,t(7,_)})}const V=G=>F(G.target);function Z(G){ne[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,l=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,s=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,l,r,a,u,E,g,_,$,R,z,F,f,c,d,O,L,T,s,i,B,J,V,Z]}class ln extends ve{constructor(e){super(),ye(this,e,Iw,Dw,be,{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 Yl=[];function Ck(n,e){return{subscribe:zn(n,e).subscribe}}function zn(n,e=te){let t;const i=new Set;function s(r){if(be(n,r)&&(n=r,t)){const a=!Yl.length;for(const u of i)u[1](),Yl.push(u,n);if(a){for(let u=0;u{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Ok(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return Ck(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);l?o(h):c=Lt(h)?h:te},m=s.map((h,g)=>ku(h,_=>{u[g]=_,f&=~(1<{f|=1<t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){ne[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await _n(),t(3,o=!1),Mk()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class Rw extends ve{constructor(e){super(),ye(this,e,Nw,Pw,be,{})}}function Fw(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),_0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[15](null)}}}function qw(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&y(e),n[14](null)}}}function jw(n){let e;function t(l,o){return l[1]?qw:Fw}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[16](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:te,o:te,d(l){l&&y(e),s.d(),n[16](null)}}}function Hw(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,s,l){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=s,o.onload=()=>{l()},i.head&&i.head.appendChild(o)}function t(i,s,l){n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let zw=Hw();function oa(){return window&&window.tinymce?window.tinymce:null}function Uw(n,e,t){let{id:i="tinymce_svelte"+U.randomString(7)}=e,{inline:s=void 0}=e,{disabled:l=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,A)=>{d.forEach(P=>{I.on(P,N=>{A(P.toLowerCase(),{eventName:P,event:N,editor:I})})})};let h,g,_,k=u,S=l;const $=wt();function T(){const I={...r,target:g,inline:s!==void 0?s:r.inline!==void 0?r.inline:!1,readonly:l,setup:A=>{t(11,_=A),A.on("init",()=>{A.setContent(u),A.on(a,()=>{t(12,k=A.getContent()),k!==u&&(t(5,u=k),t(6,f=A.getContent({format:"text"})))})}),m(A,$),typeof r.setup=="function"&&r.setup(A)}};t(4,g.style.visibility="",g),oa().init(I)}un(()=>(oa()!==null?T():zw.load(h.ownerDocument,o,()=>{h&&T()}),()=>{var I,A;try{_&&((I=_.dom)==null||I.unbind(document),(A=oa())==null||A.remove(_))}catch{}}));function O(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function E(I){ne[I?"unshift":"push"](()=>{g=I,t(4,g)})}function L(I){ne[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,s=I.inline),"disabled"in I&&t(7,l=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{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&l!==S&&(t(13,S=l),typeof((I=_.mode)==null?void 0:I.set)=="function"?_.mode.set(l?"readonly":"design"):_.setMode(l?"readonly":"design"))}catch(A){console.warn("TinyMCE reactive error:",A)}},[i,s,c,h,g,u,f,l,o,r,a,_,k,S,O,E,L]}class Pu extends ve{constructor(e){super(),ye(this,e,Uw,jw,be,{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 s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Dr}=i;return{delay:f,duration:Lt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,_=h*u,k=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${l} translate(${g}px, ${_}px) scale(${k}, ${S});`}}}const Ir=zn([]);function Js(n,e=4e3){return Nu(n,"info",e)}function nn(n,e=3e3){return Nu(n,"success",e)}function Mi(n,e=4500){return Nu(n,"error",e)}function Nu(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ek(i)},t)};Ir.update(s=>(Ru(s,i.message),U.pushOrReplaceByKey(s,i,"message"),s))}function Ek(n){Ir.update(e=>(Ru(e,n),e))}function As(){Ir.update(n=>{for(let e of n)Ru(n,e);return[]})}function Ru(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 lc(n,e,t){const i=n.slice();return i[2]=e[t],i}function Bw(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Ww(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Yw(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Kw(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function sc(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m,h=te,g,_,k;function S(E,L){return E[2].type==="info"?Kw:E[2].type==="success"?Yw:E[2].type==="warning"?Ww:Bw}let $=S(e),T=$(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),s=C(),l=b("div"),r=W(o),a=C(),u=b("button"),u.innerHTML='',f=C(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(E,L){w(E,t,L),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),g=!0,_||(k=Y(u,"click",it(O)),_=!0)},p(E,L){e=E,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!g||L&1)&&o!==(o=e[2].message+"")&&se(r,o),(!g||L&1)&&x(t,"alert-info",e[2].type=="info"),(!g||L&1)&&x(t,"alert-success",e[2].type=="success"),(!g||L&1)&&x(t,"alert-danger",e[2].type=="error"),(!g||L&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){hv(t),h(),b0(t,m)},a(){h(),h=mv(t,m,Vw,{duration:150})},i(E){g||(E&&tt(()=>{g&&(d&&d.end(1),c=v0(t,ht,{duration:150}),c.start())}),g=!0)},o(E){c&&c.invalidate(),E&&(d=Tu(t,Ks,{duration:150})),g=!1},d(E){E&&y(t),T.d(),E&&d&&d.end(),_=!1,k()}}}function Jw(n){let e,t=[],i=new Map,s,l=ce(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Ek(l)]}class Gw extends ve{constructor(e){super(),ye(this,e,Zw,Jw,be,{})}}function oc(n){let e,t,i;const s=n[18].default,l=Nt(s,n,n[17],null);return{c(){e=b("div"),l&&l.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),i=!0},p(o,r){l&&l.p&&(!i||r[0]&131072)&&Ft(l,s,o,o[17],i?Rt(s,o[17],r,null):qt(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,Hn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&y(e),l&&l.d(o),n[19](null),o&&t&&t.end()}}}function Xw(n){let e,t,i,s,l=n[0]&&oc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),l&&l.m(e,null),n[20](e),t=!0,i||(s=[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]?l?(l.p(o,r),r[0]&1&&M(l,1)):(l=oc(o),l.c(),M(l,1),l.m(e,null)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){t||(M(l),t=!0)},o(o){D(l),t=!1},d(o){o&&y(e),l&&l.d(),n[20](null),i=!1,Ee(s)}}}function Qw(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,g,_=!1;const k=wt();function S(G=0){o&&(clearTimeout(g),g=setTimeout($,G))}function $(){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?$():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)&&$()}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(),$())}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"))&&$()}un(()=>(L(),()=>I()));function V(G){ne[G?"unshift":"push"](()=>{d=G,t(3,d)})}function Z(G){ne[G?"unshift":"push"](()=>{c=G,t(2,c)})}return n.$$set=G=>{"trigger"in G&&t(8,l=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,s=G.$$scope)},n.$$.update=()=>{var G,de;n.$$.dirty[0]&260&&c&&L(l),n.$$.dirty[0]&65537&&(o?((G=m==null?void 0:m.classList)==null||G.add("active"),m==null||m.setAttribute("aria-expanded",!0),k("show")):((de=m==null?void 0:m.classList)==null||de.remove("active"),m==null||m.setAttribute("aria-expanded",!1),k("hide")))},[o,f,c,d,z,F,B,J,l,r,a,u,S,$,T,O,m,s,i,V,Z]}class Dn extends ve{constructor(e){super(),ye(this,e,Qw,Xw,be,{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 an=zn(""),pr=zn(""),Il=zn(!1),Tn=zn({});function Jt(n){Tn.set(n||{})}function Wn(n){Tn.update(e=>(U.deleteByPath(e,n),e))}const Lr=zn({});function rc(n){Lr.set(n||{})}class jn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,jn.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 jn||(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.":(l=(s=(i=this.originalError)==null?void 0:i.cause)==null?void 0:s.message)!=null&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Eo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function xw(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||e3;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}Dk=typeof atob!="function"||n3?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const uc="pb_auth";class Fu{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!Ar(this.token)}get isSuperuser(){var t,i;let e=es(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"),es(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=uc){const i=xw(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.record||s.model||null)}exportToCookie(e,t=uc){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=es(this.token);i.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const l={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let o=ac(t,JSON.stringify(l),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(l.record&&r>4096){l.record={id:(a=l.record)==null?void 0:a.id,email:(u=l.record)==null?void 0:u.email};const f=["collectionId","collectionName","verified"];for(const c in this.record)f.includes(c)&&(l.record[c]=this.record[c]);o=ac(t,JSON.stringify(l),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 Ik extends Fu{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 zi{constructor(e){this.client=e}}class i3 extends zi{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,s){return s=Object.assign({method:"POST",body:{email:t,template:i,collection:e}},s),this.client.send("/api/settings/test/email",s).then(()=>!0)}async generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}const l3=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function qu(n){if(n){n.query=n.query||{};for(let e in n)l3.includes(e)||(n.query[e]=n[e],delete n[e])}}function Lk(n){const e=[];for(const t in n){const i=encodeURIComponent(t),s=Array.isArray(n[t])?n[t]:[n[t]];for(let l of s)l=s3(l),l!==null&&e.push(i+"="+l)}return e.join("&")}function s3(n){return n==null?null:n instanceof Date?encodeURIComponent(n.toISOString().replace("T"," ")):encodeURIComponent(typeof n=="object"?JSON.stringify(n):n)}class Ak extends zi{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 s=e;if(i){qu(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));s+=(s.includes("?")?"&":"?")+r}const l=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(l),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(s,l):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,l)}async unsubscribe(e){var i;let t=!1;if(e){const s=this.getSubscriptionsByTopic(e);for(let l in s)if(this.hasSubscriptionListeners(l)){for(let o of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,o);delete this.subscriptions[l],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let s in this.subscriptions)if((s+"?").startsWith(e)){t=!0;for(let l of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,l);delete this.subscriptions[s]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var l;let i=!1;const s=this.getSubscriptionsByTopic(e);for(let o in s){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),(l=this.eventSource)==null||l.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 s in this.subscriptions)if((i=this.subscriptions[s])!=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 s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in i)for(let l of i[s])l(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 jn(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 Pk extends zi{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(s=>{var l;return s.items=((l=s.items)==null?void 0:l.map(o=>this.decode(o)))||[],s})}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 s;if(!((s=i==null?void 0:i.items)!=null&&s.length))throw new jn({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 jn({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(s=>this.decode(s))}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=[],s=async l=>this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i});return s(1)}}function Ji(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ra(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class o3 extends Pk{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(s=>{var l,o,r;if(((l=this.client.authStore.record)==null?void 0:l.id)===(s==null?void 0:s.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,s);a&&(u.expand=Object.assign(a,s.expand)),this.client.authStore.save(this.client.authStore.token,u)}return s})}async delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.record)==null?void 0:s.id)!==e||((l=this.client.authStore.record)==null?void 0:l.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 s;i=Object.assign({method:"POST",body:{identity:e,password:t}},i),this.isSuperusers&&(s=i.autoRefreshThreshold,delete i.autoRefreshThreshold,i.autoRefresh||ra(this.client));let l=await this.client.send(this.baseCollectionPath+"/auth-with-password",i);return l=this.authResponse(l),s&&this.isSuperusers&&function(r,a,u,f){ra(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))&&ra(r)});r._resetAutoRefresh=function(){m(),r.beforeSend=c,delete r._resetAutoRefresh},r.beforeSend=async(h,g)=>{var $;const _=r.authStore.token;if(($=g.query)!=null&&$.autoRefresh)return c?c(h,g):{url:h,sendOptions:g};let k=r.authStore.isValid;if(k&&Ar(r.authStore.token,a))try{await u()}catch{k=!1}k||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,s,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},i))),l}async authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectURL:s,createData:l}};return a=Ji("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=fc(void 0));const s=new Ak(this.client);function l(){i==null||i.close(),s.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 jn(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=()=>{l()}),new Promise(async(m,h)=>{var g;try{await s.subscribe("@oauth2",async $=>{var O;const T=s.clientId;try{if(!$.state||T!==$.state)throw new Error("State parameters don't match.");if($.error||!$.code)throw new Error("OAuth2 redirect error or missing code: "+$.error);const E=Object.assign({},t);delete E.provider,delete E.scopes,delete E.createData,delete E.urlCallback,(O=c==null?void 0:c.signal)!=null&&O.onabort&&(c.signal.onabort=null);const L=await this.authWithOAuth2Code(u.name,$.code,u.codeVerifier,f,t.createData,E);m(L)}catch(E){h(new jn(E))}l()});const _={state:s.clientId};(g=t.scopes)!=null&&g.length&&(_.scope=t.scopes.join(" "));const k=this._replaceQueryParams(u.authURL+f,_);await(t.urlCallback||function($){i?i.location.href=$:i=fc($)})(k)}catch(_){l(),h(new jn(_))}})}).catch(a=>{throw l(),a})}async authRefresh(e,t){let i={method:"POST"};return i=Ji("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(s=>this.authResponse(s))}async requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}async confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=Ji("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=Ji("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}async confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=Ji("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>{const l=es(e),o=this.client.authStore.record;return o&&!o.verified&&o.id===l.id&&o.collectionId===l.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=Ji("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}async confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=Ji("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>{const o=es(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 s=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:e,provider:t}));return this.client.collection("_externalAuths").delete(s.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(s=>this.authResponse(s))}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 s=new po(this.client.baseURL,new Fu,this.client.lang),l=await s.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(e),i);return s.authStore.save(l==null?void 0:l.token,this.decode((l==null?void 0:l.record)||{})),s}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function fc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new jn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class r3 extends Pk{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 a3 extends zi{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 jn({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 u3 extends zi{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class f3 extends zi{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 s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildURL(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}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 c3 extends zi{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)}`)}}class d3 extends zi{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/crons",e)}async run(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/crons/${encodeURIComponent(e)}`,t).then(()=>!0)}}function eu(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 tu(n){return n&&(n.constructor.name==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function cc(n){for(const e in n){const t=Array.isArray(n[e])?n[e]:[n[e]];for(const i of t)if(eu(i))return!0}return!1}const p3=/^[\-\.\d]+$/;function dc(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")&&p3.test(n)){let e=+n;if(""+e===n)return e}return n}class m3 extends zi{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(e){return this.subs[e]||(this.subs[e]=new h3(this.requests,e)),this.subs[e]}async send(e){const t=new FormData,i=[];for(let s=0;s{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(dc(r))):o[a]=dc(r)}),o}(i));for(const s in i){const l=i[s];if(eu(l))e.files[s]=e.files[s]||[],e.files[s].push(l);else if(Array.isArray(l)){const o=[],r=[];for(const a of l)eu(a)?o.push(a):r.push(a);if(o.length>0&&o.length==l.length){e.files[s]=e.files[s]||[];for(let a of o)e.files[s].push(a)}else if(e.json[s]=r,o.length>0){let a=s;s.startsWith("+")||s.endsWith("+")||(a+="+"),e.files[a]=e.files[a]||[];for(let u of o)e.files[a].push(u)}}else e.json[s]=l}}}class po{get baseUrl(){return this.baseURL}set baseUrl(e){this.baseURL=e}constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=e,this.lang=i,t?this.authStore=t:typeof window<"u"&&window.Deno?this.authStore=new Fu:this.authStore=new Ik,this.collections=new r3(this),this.files=new f3(this),this.logs=new a3(this),this.settings=new i3(this),this.realtime=new Ak(this),this.health=new u3(this),this.backups=new c3(this),this.crons=new d3(this)}get admins(){return this.collection("_superusers")}createBatch(){return new m3(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new o3(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 s=t[i];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",s)}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 s=Object.assign({},await this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=Lk(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),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 s=>{let l={};try{l=await s.json()}catch{}if(this.afterSend&&(l=await this.afterSend(s,l,t)),s.status>=400)throw new jn({url:s.url,status:s.status,data:l});return l}).catch(s=>{throw new jn(s)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=function(s){if(typeof FormData>"u"||s===void 0||typeof s!="object"||s===null||tu(s)||!cc(s))return s;const l=new FormData;for(const o in s){const r=s[o];if(typeof r!="object"||cc({data:r})){const a=Array.isArray(r)?r:[r];for(let u of a)l.append(o,u)}else{let a={};a[o]=r,l.append("@jsonPayload",JSON.stringify(a))}}return l}(t.body),qu(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||tu(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 s=new AbortController;this.cancelControllers[i]=s,t.signal=s.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 In=zn([]),ii=zn({}),Zs=zn(!1),Nk=zn({}),Pr=zn({});let Ps;typeof BroadcastChannel<"u"&&(Ps=new BroadcastChannel("collections"),Ps.onmessage=()=>{var n;ju((n=c0(ii))==null?void 0:n.id)});function Rk(){Ps==null||Ps.postMessage("reload")}function _3(n){In.update(e=>{const t=e.find(i=>i.id==n||i.name==n);return t?ii.set(t):e.length&&ii.set(e.find(i=>!i.system)||e[0]),e})}function g3(n){ii.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),In.update(e=>(U.pushOrReplaceByKey(e,n,"id"),Hu(),Rk(),U.sortCollections(e)))}function b3(n){In.update(e=>(U.removeByKey(e,"id",n.id),ii.update(t=>t.id===n.id?e.find(i=>!i.system)||e[0]:t),Hu(),Rk(),e))}async function k3(){Pr.set(await he.collections.getScaffolds())}async function ju(n=null){Zs.set(!0);try{const e=[];e.push(he.collections.getScaffolds()),e.push(he.collections.getFullList());let[t,i]=await Promise.all(e);Pr.set(t),i=U.sortCollections(i),In.set(i);const s=n&&i.find(l=>l.id==n||l.name==n);s?ii.set(s):i.length&&ii.set(i.find(l=>!l.system)||i[0]),Hu()}catch(e){he.error(e)}Zs.set(!1)}function Hu(){Nk.update(n=>(In.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.fields)!=null&&t.find(s=>s.type=="file"&&s.protected));return e}),n))}function Fk(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function y3(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[7]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&4?vt(s,[At(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&&y(t),e&&j(e,r)}}}function v3(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),e.$on("routeEvent",r[6]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a&6?vt(s,[a&2&&{params:r[1]},a&4&&At(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&&y(t),e&&j(e,r)}}}function w3(n){let e,t,i,s;const l=[v3,y3],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function pc(){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 Nr=Ck(null,function(e){e(pc());const t=()=>{e(pc())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Ok(Nr,n=>n.location);const zu=Ok(Nr,n=>n.querystring),mc=zn(void 0);async function ls(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await _n();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 Fn(n,e){if(e=_c(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return hc(n,e),{update(t){t=_c(t),hc(n,t)}}}function S3(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function hc(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||T3(i.currentTarget.getAttribute("href"))})}function _c(n){return n&&typeof n=="string"?{href:n}:n||{}}function T3(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function $3(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!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}=Fk(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(s){if(typeof s=="string")if(O.startsWith(s))O=O.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const A=O.match(s);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{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=wt();async function d(T,O){await _n(),c(T,O)}let m=null,h=null;l&&(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),_v(()=>{S3(m)}));let g=null,_=null;const k=Nr.subscribe(async T=>{g=T;let O=0;for(;O{mc.set(u)});return}t(0,a=null),_=null,mc.set(void 0)});ro(()=>{k(),h&&window.removeEventListener("popstate",h)});function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,$]}class C3 extends ve{constructor(e){super(),ye(this,e,$3,w3,be,{routes:3,prefix:4,restoreScrollState:5})}}const aa="pb_superuser_file_token";po.prototype.logout=function(n=!0){this.authStore.clear(),n&&ls("/login")};po.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Mi(l),U.isEmpty(s.data)||Jt(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),ls("/")};po.prototype.getSuperuserFileToken=async function(n=""){let e=!0;if(n){const i=c0(Nk);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(aa)||"";return(!t||Ar(t,10))&&(t&&localStorage.removeItem(aa),this._superuserFileTokenRequest||(this._superuserFileTokenRequest=this.files.getToken()),t=await this._superuserFileTokenRequest,localStorage.setItem(aa,t),this._superuserFileTokenRequest=null),t};class O3 extends Ik{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"&&rc(t)}clear(){super.clear(),rc(null)}}const he=new po("../",new O3);he.authStore.isValid&&he.collection(he.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)&&he.authStore.clear()});const xo=[];let qk;function jk(n){const e=n.pattern.test(qk);gc(n,n.className,e),gc(n,n.inactiveClassName,!e)}function gc(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Nr.subscribe(n=>{qk=n.location+(n.querystring?"?"+n.querystring:""),xo.map(jk)});function Si(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"?Fk(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return xo.push(i),jk(i),{destroy(){xo.splice(xo.indexOf(i),1)}}}const M3="modulepreload",E3=function(n,e){return new URL(n,e).href},bc={},$t=function(e,t,i){let s=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"));s=Promise.allSettled(t.map(u=>{if(u=E3(u,i),u in bc)return;bc[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":M3,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 l(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return s.then(o=>{for(const r of o||[])r.status==="rejected"&&l(r.reason);return e().catch(l)})};function D3(n){e();function e(){he.authStore.isValid?ls("/collections"):he.logout()}return[]}class I3 extends ve{constructor(e){super(),ye(this,e,D3,null,be,{})}}function kc(n,e,t){const i=n.slice();return i[12]=e[t],i}const L3=n=>({}),yc=n=>({uniqueId:n[4]});function A3(n){let e,t,i=ce(n[3]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=qe(t,Ct,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Ct,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&y(e),a&&s&&s.end(),o=!1,r()}}}function vc(n){let e,t,i=mr(n[12])+"",s,l,o,r;return{c(){e=b("div"),t=b("pre"),s=W(i),l=C(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=mr(a[12])+"")&&se(s,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=qe(e,ht,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,ht,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function P3(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Nt(a,n,n[8],yc),f=[A3,L3],c=[];function d(m,_){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),s.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){w(m,e,_),u&&u.m(e,null),v(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Ft(u,a,m,m[8],l?Rt(a,m[8],_,I3):qt(m[8]),yc);let g=i;i=d(m),i===g?c[i].p(m,_):(oe(),D(c[g],1,1,()=>{c[g]=null}),re(),s=c[i],s?s.p(m,_):(s=c[i]=f[i](m),s.c()),M(s,1),s.m(e,null)),(!l||_&2)&&p(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(M(u,m),M(s),l=!0)},o(m){D(u,m),D(s),l=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const wc="Invalid value";function mr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||wc:n||wc}function N3(n,e,t){let i;Ge(n,Tn,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Wn(r)}un(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Le.call(this,n,g)}function _(g){ne[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,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,_]}class fe extends ve{constructor(e){super(),ye(this,e,N3,P3,be,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const R3=n=>({}),Sc=n=>({});function Tc(n){let e,t,i,s,l,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",s=C(),l=b("a"),o=b("span"),o.textContent="PocketBase v0.30.4",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(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(l,"title","Releases")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),w(r,l,a),v(l,o)},d(r){r&&(y(e),y(t),y(i),y(s),y(l))}}}function F3(n){var m;let e,t,i,s,l,o,r;const a=n[4].default,u=Nt(a,n,n[3],null),f=n[4].footer,c=Nt(f,n,n[3],Sc);let d=((m=n[2])==null?void 0:m.id)&&Tc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),s=b("footer"),c&&c.c(),l=C(),d&&d.c(),p(t,"class","page-content"),p(s,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(_,g){w(_,e,g),v(e,t),u&&u.m(t,null),v(e,i),v(e,s),c&&c.m(s,null),v(s,l),d&&d.m(s,null),r=!0},p(_,[g]){var h;u&&u.p&&(!r||g&8)&&Ft(u,a,_,_[3],r?Rt(a,_[3],g,null):qt(_[3]),null),c&&c.p&&(!r||g&8)&&Ft(c,f,_,_[3],r?Rt(f,_[3],g,R3):qt(_[3]),Sc),(h=_[2])!=null&&h.id?d||(d=Tc(),d.c(),d.m(s,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+_[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",_[0])},i(_){r||(M(u,_),M(c,_),r=!0)},o(_){D(u,_),D(c,_),r=!1},d(_){_&&y(e),u&&u.d(_),c&&c.d(_),d&&d.d()}}}function q3(n,e,t){let i;Ge(n,Lr,a=>t(2,i=a));let{$$slots:s={},$$scope:l}=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,l=a.$$scope)},[o,r,i,l,s]}class si extends ve{constructor(e){super(),ye(this,e,q3,F3,be,{center:0,class:1})}}function j3(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),me(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&me(e,l[7])},i:te,o:te,d(l){l&&y(e),n[13](null),i=!1,s()}}}function H3(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),H(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],$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function $c(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function Cc(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function z3(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[H3,j3],m=[];function _(k,S){return k[4]&&!k[5]?0:1}l=_(n),o=m[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&$c(),h=(n[0].length||n[7].length)&&Cc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=C(),o.c(),r=C(),g&&g.c(),a=C(),h&&h.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){w(k,e,S),v(e,t),v(t,i),v(e,s),m[l].m(e,null),v(e,r),g&&g.m(e,null),v(e,a),h&&h.m(e,null),u=!0,f||(c=[Y(e,"click",tn(n[11])),Y(e,"submit",it(n[10]))],f=!0)},p(k,[S]){let $=l;l=_(k),l===$?m[l].p(k,S):(oe(),D(m[$],1,1,()=>{m[$]=null}),re(),o=m[l],o?o.p(k,S):(o=m[l]=d[l](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=$c(),g.c(),M(g,1),g.m(e,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re()),k[0].length||k[7].length?h?(h.p(k,S),S&129&&M(h,1)):(h=Cc(k),h.c(),M(h,1),h.m(e,null)):h&&(oe(),D(h,1,1,()=>{h=null}),re())},i(k){u||(M(o),M(g),M(h),u=!0)},o(k){D(o),D(g),D(h),u=!1},d(k){k&&y(e),m[l].d(),g&&g.d(),h&&h.d(),f=!1,Ee(c)}}}function U3(n,e,t){const i=wt(),s="search_"+U.randomString(7);let{value:l=""}=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 _(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await $t(async()=>{const{default:O}=await import("./FilterAutocompleteInput-OQbEqM-k.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}un(()=>{g()});function h(O){Le.call(this,n,O)}function k(O){d=O,t(7,d),t(0,l)}function S(O){ne[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const T=()=>{m(!1),_()};return n.$$set=O=>{"value"in O&&t(0,l=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 l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,_,h,k,S,$,T]}class Rr extends ve{constructor(e){super(),ye(this,e,U3,z3,be,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function V3(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),v(e,t),l||(o=[Oe(s=Re.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Lt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),l=!1,Ee(o)}}}function B3(n,e,t){const i=wt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return un(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Fr extends ve{constructor(e){super(),ye(this,e,B3,V3,be,{tooltip:0,class:1})}}const W3=n=>({}),Oc=n=>({}),Y3=n=>({}),Mc=n=>({});function K3(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Nt(u,n,n[10],Mc),c=n[11].default,d=Nt(c,n,n[10],null),m=n[11].after,_=Nt(m,n,n[10],Oc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),l=C(),_&&_.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,h){w(g,e,h),f&&f.m(e,null),v(e,t),v(e,i),d&&d.m(i,null),n[12](i),v(e,l),_&&_.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[h]){f&&f.p&&(!o||h&1024)&&Ft(f,u,g,g[10],o?Rt(u,g[10],h,Y3):qt(g[10]),Mc),d&&d.p&&(!o||h&1024)&&Ft(d,c,g,g[10],o?Rt(c,g[10],h,null):qt(g[10]),null),(!o||h&9&&s!==(s="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",s),_&&_.p&&(!o||h&1024)&&Ft(_,m,g,g[10],o?Rt(m,g[10],h,W3):qt(g[10]),Oc)},i(g){o||(M(f,g),M(d,g),M(_,g),o=!0)},o(g){D(f,g),D(d,g),D(_,g),o=!1},d(g){g&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),_&&_.d(g),r=!1,Ee(a)}}}function J3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,_,g,h,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,h=f.clientHeight+2,m=f.scrollWidth-g,_=f.scrollHeight-h,_>0?(t(3,c+=" v-scroll"),r>=h&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=_&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}un(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ne[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,s=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,s,i,E]}class Uu extends ve{constructor(e){super(),ye(this,e,J3,K3,be,{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 Z3(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Ft(r,o,a,a[5],i?Rt(o,a[5],u,null):qt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),s=!1,Ee(l)}}}function G3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class er extends ve{constructor(e){super(),ye(this,e,G3,Z3,be,{class:1,name:2,sort:0,disable:3})}}function X3(n){let e,t=n[0].replace("Z"," UTC")+"",i,s,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),v(e,i),s||(l=Oe(Re.call(null,e,n[1])),s=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:te,o:te,d(o){o&&y(e),s=!1,l()}}}function Q3(n,e,t){let{date:i}=e;const s={get text(){return U.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=l=>{"date"in l&&t(0,i=l.date)},[i,s]}class jk extends ve{constructor(e){super(),ye(this,e,Q3,X3,be,{date:0})}}function x3(n){let e,t,i=(n[1]||"UNKN")+"",s,l,o,r,a;return{c(){e=b("div"),t=b("span"),s=W(i),l=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){w(u,e,f),v(e,t),v(t,s),v(t,l),v(t,o),v(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&se(s,i),f&1&&se(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&&y(e)}}}function eS(n,e,t){let i,{level:s}=e;return n.$$set=l=>{"level"in l&&t(0,s=l.level)},n.$$.update=()=>{var l;n.$$.dirty&1&&t(1,i=(l=wk.find(o=>o.level==s))==null?void 0:l.label)},[s,i]}class Hk extends ve{constructor(e){super(),ye(this,e,eS,x3,be,{level:0})}}function Ec(n,e,t){var o;const i=n.slice();i[32]=e[t];const s=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=s;const l=dS(i[32]);return i[34]=l,i}function Dc(n,e,t){const i=n.slice();return i[37]=e[t],i}function tS(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=C(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),v(e,t),v(e,s),v(e,l),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&&y(e),o=!1,r()}}}function nS(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function iS(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function lS(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function sS(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Ic(n){let e;function t(l,o){return l[7]?rS:oS}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function oS(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Lc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=C(),o&&o.c(),l=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Lc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function rS(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Lc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Ac(n){let e,t=ce(n[34]),i=[];for(let s=0;s',P=C(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[32].id),l.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(h,"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){w(Z,t,G),v(t,i),v(i,s),v(s,l),v(s,a),v(s,u),v(t,c),v(t,d),q(m,d,null),v(t,_),v(t,g),v(g,h),v(h,k),v(k,$),v(g,T),B&&B.m(g,null),v(t,O),v(t,E),q(L,E,null),v(t,I),v(t,A),v(t,P),N=!0,R||(z=[Y(l,"change",F),Y(s,"click",tn(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(l,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(l.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+"")&&se($,S),e[34].length?B?B.p(e,G):(B=Ac(e),B.c(),B.m(g,null)):B&&(B.d(1),B=null);const pe={};G[0]&8&&(pe.date=e[32].created),L.$set(pe)},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&&y(t),j(m),B&&B.d(),j(L),R=!1,Ee(z)}}}function fS(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S=[],$=new Map,T;function O(V,Z){return V[7]?nS:tS}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:[iS]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new er({props:A}),ne.push(()=>ge(o,"sort",I));function P(V){n[21](V)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[lS]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new er({props:N}),ne.push(()=>ge(u,"sort",P));function R(V){n[22](V)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[sS]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new er({props:z}),ne.push(()=>ge(d,"sort",R));let F=ce(n[3]);const B=V=>V[32].id;for(let V=0;Vr=!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],$e(()=>f=!1)),u.$set(de);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:V}),!m&&Z[0]&2&&(m=!0,pe.sort=V[1],$e(()=>m=!1)),d.$set(pe),Z[0]&9369&&(F=ce(V[3]),oe(),S=kt(S,Z,B,1,V,F,$,k,Yt,Nc,null,Ec),re(),!F.length&&J?J.p(V,Z):F.length?J&&(J.d(1),J=null):(J=Ic(V),J.c(),J.m(k,null))),(!T||Z[0]&128)&&x(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;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",n[27]),i=!0)},p(l,o){o[0]&128&&x(t,"btn-loading",l[7]),o[0]&128&&x(t,"btn-disabled",l[7])},d(l){l&&y(e),i=!1,s()}}}function Fc(n){let e,t,i,s,l,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,_,g,h,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),s=b("strong"),l=W(n[5]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),_=b("button"),_.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(_,"type","button"),p(_,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){w($,e,T),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),v(e,_),h=!0,k||(S=[Y(f,"click",n[28]),Y(_,"click",n[14])],k=!0)},p($,T){(!h||T[0]&32)&&se(l,$[5]),(!h||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){h||($&&tt(()=>{h&&(g||(g=qe(e,Hn,{duration:150,y:5},!0)),g.run(1))}),h=!0)},o($){$&&(g||(g=qe(e,Hn,{duration:150,y:5},!1)),g.run(0)),h=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ee(S)}}}function cS(n){let e,t,i,s,l;e=new Uu({props:{class:"table-wrapper",$$slots:{default:[fS]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Rc(n),r=n[5]&&Fc(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),s=ke()},m(a,u){q(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,s,u),l=!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=Rc(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=Fc(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){l||(M(e.$$.fragment,a),M(r),l=!0)},o(a){D(e.$$.fragment,a),D(r),l=!1},d(a){a&&(y(t),y(i),y(s)),j(e,a),o&&o.d(a),r&&r.d(a)}}}const qc=50,ua=/[-:\. ]/gi;function dS(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 pS(n,e,t){let i,s,l;const o=wt();let{filter:r=""}=e,{presets:a=""}=e,{zoom:u={}}=e,{sort:f="-@rowid"}=e,c=[],d=1,m=0,_=!1,g=0,h={};async function k(G=1,de=!0){t(7,_=!0);const pe=[a,U.normalizeLogsFilter(r)];return u.min&&u.max&&pe.push(`created >= "${u.min}" && created <= "${u.max}"`),he.logs.getList(G,qc,{sort:f,skipTotal:1,filter:pe.filter(Boolean).map(ae=>"("+ae+")").join("&&")}).then(async ae=>{var Ye;G<=1&&S();const Ce=U.toArray(ae.items);if(t(7,_=!1),t(6,d=ae.page),t(17,m=((Ye=ae.items)==null?void 0:Ye.length)||0),o("load",c.concat(Ce)),de){const Ke=++g;for(;Ce.length&&g==Ke;){const ct=Ce.splice(0,10);for(let et of ct)U.pushOrReplaceByKey(c,et);t(3,c),await U.yieldToMain()}}else{for(let Ke of Ce)U.pushOrReplaceByKey(c,Ke);t(3,c)}}).catch(ae=>{ae!=null&&ae.isAbort||(t(7,_=!1),console.warn(ae),S(),he.error(ae,!pe||(ae==null?void 0:ae.status)!=400))})}function S(){t(3,c=[]),t(4,h={}),t(6,d=1),t(17,m=0)}function $(){l?T():O()}function T(){t(4,h={})}function O(){for(const G of c)t(4,h[G.id]=G,h);t(4,h)}function E(G){h[G.id]?delete h[G.id]:t(4,h[G.id]=G,h),t(4,h)}function L(){const G=Object.values(h).sort((ae,Ce)=>ae.createdCe.created?-1:0);if(!G.length)return;if(G.length==1)return U.downloadJson(G[0],"log_"+G[0].created.replaceAll(ua,"")+".json");const de=G[0].created.replaceAll(ua,""),pe=G[G.length-1].created.replaceAll(ua,"");return U.downloadJson(G,`${G.length}_logs_${pe}_to_${de}.json`)}function I(G){Le.call(this,n,G)}const A=()=>$();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=()=>k(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(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=qc),n.$$.dirty[0]&16&&t(5,s=Object.keys(h).length),n.$$.dirty[0]&40&&t(8,l=c.length&&s===c.length)},[r,f,k,c,h,s,d,_,l,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,B,J,V,Z]}class mS extends ve{constructor(e){super(),ye(this,e,pS,cS,be,{filter:0,presets:15,zoom:16,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! +`)})},i(a){l||(a&&tt(()=>{l&&(s||(s=qe(t,Ct,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Ct,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&y(e),a&&s&&s.end(),o=!1,r()}}}function vc(n){let e,t,i=mr(n[12])+"",s,l,o,r;return{c(){e=b("div"),t=b("pre"),s=W(i),l=C(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=mr(a[12])+"")&&se(s,i)},i(a){r||(a&&tt(()=>{r&&(o||(o=qe(e,ht,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,ht,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&y(e),a&&o&&o.end()}}}function N3(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Nt(a,n,n[8],yc),f=[P3,A3],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=C(),s.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),u&&u.m(e,null),v(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!l||h&256)&&Ft(u,a,m,m[8],l?Rt(a,m[8],h,L3):qt(m[8]),yc);let g=i;i=d(m),i===g?c[i].p(m,h):(oe(),D(c[g],1,1,()=>{c[g]=null}),re(),s=c[i],s?s.p(m,h):(s=c[i]=f[i](m),s.c()),M(s,1),s.m(e,null)),(!l||h&2)&&p(e,"class",m[1]),(!l||h&10)&&x(e,"error",m[3].length)},i(m){l||(M(u,m),M(s),l=!0)},o(m){D(u,m),D(s),l=!1},d(m){m&&y(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const wc="Invalid value";function mr(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||wc:n||wc}function R3(n,e,t){let i;Ge(n,Tn,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){Wn(r)}un(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(g){Le.call(this,n,g)}function h(g){ne[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,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=U.toArray(U.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,h]}class fe extends ve{constructor(e){super(),ye(this,e,R3,N3,be,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}const F3=n=>({}),Sc=n=>({});function Tc(n){let e,t,i,s,l,o;return{c(){e=b("a"),e.innerHTML=' Docs',t=C(),i=b("span"),i.textContent="|",s=C(),l=b("a"),o=b("span"),o.textContent="PocketBase v0.30.4",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(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(l,"title","Releases")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),w(r,l,a),v(l,o)},d(r){r&&(y(e),y(t),y(i),y(s),y(l))}}}function q3(n){var m;let e,t,i,s,l,o,r;const a=n[4].default,u=Nt(a,n,n[3],null),f=n[4].footer,c=Nt(f,n,n[3],Sc);let d=((m=n[2])==null?void 0:m.id)&&Tc();return{c(){e=b("div"),t=b("main"),u&&u.c(),i=C(),s=b("footer"),c&&c.c(),l=C(),d&&d.c(),p(t,"class","page-content"),p(s,"class","page-footer"),p(e,"class",o="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(h,g){w(h,e,g),v(e,t),u&&u.m(t,null),v(e,i),v(e,s),c&&c.m(s,null),v(s,l),d&&d.m(s,null),r=!0},p(h,[g]){var _;u&&u.p&&(!r||g&8)&&Ft(u,a,h,h[3],r?Rt(a,h[3],g,null):qt(h[3]),null),c&&c.p&&(!r||g&8)&&Ft(c,f,h,h[3],r?Rt(f,h[3],g,F3):qt(h[3]),Sc),(_=h[2])!=null&&_.id?d||(d=Tc(),d.c(),d.m(s,null)):d&&(d.d(1),d=null),(!r||g&2&&o!==(o="page-wrapper "+h[1]))&&p(e,"class",o),(!r||g&3)&&x(e,"center-content",h[0])},i(h){r||(M(u,h),M(c,h),r=!0)},o(h){D(u,h),D(c,h),r=!1},d(h){h&&y(e),u&&u.d(h),c&&c.d(h),d&&d.d()}}}function j3(n,e,t){let i;Ge(n,Lr,a=>t(2,i=a));let{$$slots:s={},$$scope:l}=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,l=a.$$scope)},[o,r,i,l,s]}class si extends ve{constructor(e){super(),ye(this,e,j3,q3,be,{center:0,class:1})}}function H3(n){let e,t,i,s;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),me(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&me(e,l[7])},i:te,o:te,d(l){l&&y(e),n[13](null),i=!1,s()}}}function z3(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),H(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],$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function $c(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function Cc(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function U3(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[z3,H3],m=[];function h(k,S){return k[4]&&!k[5]?0:1}l=h(n),o=m[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&$c(),_=(n[0].length||n[7].length)&&Cc(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=C(),o.c(),r=C(),g&&g.c(),a=C(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){w(k,e,S),v(e,t),v(t,i),v(e,s),m[l].m(e,null),v(e,r),g&&g.m(e,null),v(e,a),_&&_.m(e,null),u=!0,f||(c=[Y(e,"click",tn(n[11])),Y(e,"submit",it(n[10]))],f=!0)},p(k,[S]){let $=l;l=h(k),l===$?m[l].p(k,S):(oe(),D(m[$],1,1,()=>{m[$]=null}),re(),o=m[l],o?o.p(k,S):(o=m[l]=d[l](k),o.c()),M(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?g?S&129&&M(g,1):(g=$c(),g.c(),M(g,1),g.m(e,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&M(_,1)):(_=Cc(k),_.c(),M(_,1),_.m(e,null)):_&&(oe(),D(_,1,1,()=>{_=null}),re())},i(k){u||(M(o),M(g),M(_),u=!0)},o(k){D(o),D(g),D(_),u=!1},d(k){k&&y(e),m[l].d(),g&&g.d(),_&&_.d(),f=!1,Ee(c)}}}function V3(n,e,t){const i=wt(),s="search_"+U.randomString(7);let{value:l=""}=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,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await $t(async()=>{const{default:O}=await import("./FilterAutocompleteInput-D6GbKUeb.js");return{default:O}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}un(()=>{g()});function _(O){Le.call(this,n,O)}function k(O){d=O,t(7,d),t(0,l)}function S(O){ne[O?"unshift":"push"](()=>{c=O,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const T=()=>{m(!1),h()};return n.$$set=O=>{"value"in O&&t(0,l=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 l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,_,k,S,$,T]}class Rr extends ve{constructor(e){super(),ye(this,e,V3,U3,be,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function B3(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),v(e,t),l||(o=[Oe(s=Re.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Lt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&y(e),l=!1,Ee(o)}}}function W3(n,e,t){const i=wt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return un(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Fr extends ve{constructor(e){super(),ye(this,e,W3,B3,be,{tooltip:0,class:1})}}const Y3=n=>({}),Oc=n=>({}),K3=n=>({}),Mc=n=>({});function J3(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Nt(u,n,n[10],Mc),c=n[11].default,d=Nt(c,n,n[10],null),m=n[11].after,h=Nt(m,n,n[10],Oc);return{c(){e=b("div"),f&&f.c(),t=C(),i=b("div"),d&&d.c(),l=C(),h&&h.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){w(g,e,_),f&&f.m(e,null),v(e,t),v(e,i),d&&d.m(i,null),n[12](i),v(e,l),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)&&Ft(f,u,g,g[10],o?Rt(u,g[10],_,K3):qt(g[10]),Mc),d&&d.p&&(!o||_&1024)&&Ft(d,c,g,g[10],o?Rt(c,g[10],_,null):qt(g[10]),null),(!o||_&9&&s!==(s="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",s),h&&h.p&&(!o||_&1024)&&Ft(h,m,g,g[10],o?Rt(m,g[10],_,Y3):qt(g[10]),Oc)},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&&y(e),f&&f.d(g),d&&d.d(g),n[12](null),h&&h.d(g),r=!1,Ee(a)}}}function Z3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,g,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),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"),l("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function O(){d||(d=setTimeout(()=>{T(),d=null},150))}un(()=>(O(),k=new MutationObserver(O),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function E(L){ne[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,s=L.$$scope)},[o,O,f,c,r,a,u,S,$,T,s,i,E]}class Uu extends ve{constructor(e){super(),ye(this,e,Z3,J3,be,{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 G3(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Ft(r,o,a,a[5],i?Rt(o,a[5],u,null):qt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),s=!1,Ee(l)}}}function X3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class er extends ve{constructor(e){super(),ye(this,e,X3,G3,be,{class:1,name:2,sort:0,disable:3})}}function Q3(n){let e,t=n[0].replace("Z"," UTC")+"",i,s,l;return{c(){e=b("span"),i=W(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),v(e,i),s||(l=Oe(Re.call(null,e,n[1])),s=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:te,o:te,d(o){o&&y(e),s=!1,l()}}}function x3(n,e,t){let{date:i}=e;const s={get text(){return U.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=l=>{"date"in l&&t(0,i=l.date)},[i,s]}class Hk extends ve{constructor(e){super(),ye(this,e,x3,Q3,be,{date:0})}}function eS(n){let e,t,i=(n[1]||"UNKN")+"",s,l,o,r,a;return{c(){e=b("div"),t=b("span"),s=W(i),l=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){w(u,e,f),v(e,t),v(t,s),v(t,l),v(t,o),v(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&se(s,i),f&1&&se(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&&y(e)}}}function tS(n,e,t){let i,{level:s}=e;return n.$$set=l=>{"level"in l&&t(0,s=l.level)},n.$$.update=()=>{var l;n.$$.dirty&1&&t(1,i=(l=Sk.find(o=>o.level==s))==null?void 0:l.label)},[s,i]}class zk extends ve{constructor(e){super(),ye(this,e,tS,eS,be,{level:0})}}function Ec(n,e,t){var o;const i=n.slice();i[32]=e[t];const s=((o=i[32].data)==null?void 0:o.type)=="request";i[33]=s;const l=pS(i[32]);return i[34]=l,i}function Dc(n,e,t){const i=n.slice();return i[37]=e[t],i}function nS(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=C(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),v(e,t),v(e,s),v(e,l),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&&y(e),o=!1,r()}}}function iS(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function lS(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function sS(n){let e;return{c(){e=b("div"),e.innerHTML=' message',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function oS(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Ic(n){let e;function t(l,o){return l[7]?aS:rS}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function rS(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Lc(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=C(),o&&o.c(),l=C(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Lc(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&y(e),o&&o.d()}}}function aS(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Lc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Ac(n){let e,t=ce(n[34]),i=[];for(let s=0;s',P=C(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[32].id),l.checked=r=e[4][e[32].id],p(u,"for",f="checkbox_"+e[32].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(k,"class","txt-ellipsis"),p(_,"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){w(Z,t,G),v(t,i),v(i,s),v(s,l),v(s,a),v(s,u),v(t,c),v(t,d),q(m,d,null),v(t,h),v(t,g),v(g,_),v(_,k),v(k,$),v(g,T),B&&B.m(g,null),v(t,O),v(t,E),q(L,E,null),v(t,I),v(t,A),v(t,P),N=!0,R||(z=[Y(l,"change",F),Y(s,"click",tn(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(l,"id",o),(!N||G[0]&24&&r!==(r=e[4][e[32].id]))&&(l.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+"")&&se($,S),e[34].length?B?B.p(e,G):(B=Ac(e),B.c(),B.m(g,null)):B&&(B.d(1),B=null);const pe={};G[0]&8&&(pe.date=e[32].created),L.$set(pe)},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&&y(t),j(m),B&&B.d(),j(L),R=!1,Ee(z)}}}function cS(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S=[],$=new Map,T;function O(V,Z){return V[7]?iS:nS}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:[lS]},$$scope:{ctx:n}};n[1]!==void 0&&(A.sort=n[1]),o=new er({props:A}),ne.push(()=>ge(o,"sort",I));function P(V){n[21](V)}let N={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[sS]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),u=new er({props:N}),ne.push(()=>ge(u,"sort",P));function R(V){n[22](V)}let z={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[oS]},$$scope:{ctx:n}};n[1]!==void 0&&(z.sort=n[1]),d=new er({props:z}),ne.push(()=>ge(d,"sort",R));let F=ce(n[3]);const B=V=>V[32].id;for(let V=0;Vr=!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],$e(()=>f=!1)),u.$set(de);const pe={};Z[1]&512&&(pe.$$scope={dirty:Z,ctx:V}),!m&&Z[0]&2&&(m=!0,pe.sort=V[1],$e(()=>m=!1)),d.$set(pe),Z[0]&9369&&(F=ce(V[3]),oe(),S=kt(S,Z,B,1,V,F,$,k,Yt,Nc,null,Ec),re(),!F.length&&J?J.p(V,Z):F.length?J&&(J.d(1),J=null):(J=Ic(V),J.c(),J.m(k,null))),(!T||Z[0]&128)&&x(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;ZLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",n[27]),i=!0)},p(l,o){o[0]&128&&x(t,"btn-loading",l[7]),o[0]&128&&x(t,"btn-disabled",l[7])},d(l){l&&y(e),i=!1,s()}}}function Fc(n){let e,t,i,s,l,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),s=b("strong"),l=W(n[5]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m($,T){w($,e,T),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),v(e,h),_=!0,k||(S=[Y(f,"click",n[28]),Y(h,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&se(l,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){_||($&&tt(()=>{_&&(g||(g=qe(e,Hn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=qe(e,Hn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ee(S)}}}function dS(n){let e,t,i,s,l;e=new Uu({props:{class:"table-wrapper",$$slots:{default:[cS]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&Rc(n),r=n[5]&&Fc(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=C(),r&&r.c(),s=ke()},m(a,u){q(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,s,u),l=!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=Rc(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=Fc(a),r.c(),M(r,1),r.m(s.parentNode,s)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){l||(M(e.$$.fragment,a),M(r),l=!0)},o(a){D(e.$$.fragment,a),D(r),l=!1},d(a){a&&(y(t),y(i),y(s)),j(e,a),o&&o.d(a),r&&r.d(a)}}}const qc=50,ua=/[-:\. ]/gi;function pS(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 mS(n,e,t){let i,s,l;const o=wt();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 k(G=1,de=!0){t(7,h=!0);const pe=[a,U.normalizeLogsFilter(r)];return u.min&&u.max&&pe.push(`created >= "${u.min}" && created <= "${u.max}"`),he.logs.getList(G,qc,{sort:f,skipTotal:1,filter:pe.filter(Boolean).map(ae=>"("+ae+")").join("&&")}).then(async ae=>{var Ye;G<=1&&S();const Ce=U.toArray(ae.items);if(t(7,h=!1),t(6,d=ae.page),t(17,m=((Ye=ae.items)==null?void 0:Ye.length)||0),o("load",c.concat(Ce)),de){const Ke=++g;for(;Ce.length&&g==Ke;){const ct=Ce.splice(0,10);for(let et of ct)U.pushOrReplaceByKey(c,et);t(3,c),await U.yieldToMain()}}else{for(let Ke of Ce)U.pushOrReplaceByKey(c,Ke);t(3,c)}}).catch(ae=>{ae!=null&&ae.isAbort||(t(7,h=!1),console.warn(ae),S(),he.error(ae,!pe||(ae==null?void 0:ae.status)!=400))})}function S(){t(3,c=[]),t(4,_={}),t(6,d=1),t(17,m=0)}function $(){l?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((ae,Ce)=>ae.createdCe.created?-1:0);if(!G.length)return;if(G.length==1)return U.downloadJson(G[0],"log_"+G[0].created.replaceAll(ua,"")+".json");const de=G[0].created.replaceAll(ua,""),pe=G[G.length-1].created.replaceAll(ua,"");return U.downloadJson(G,`${G.length}_logs_${pe}_to_${de}.json`)}function I(G){Le.call(this,n,G)}const A=()=>$();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=()=>k(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(),k(1)),n.$$.dirty[0]&131072&&t(9,i=m>=qc),n.$$.dirty[0]&16&&t(5,s=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,l=c.length&&s===c.length)},[r,f,k,c,_,s,d,h,l,i,o,$,T,E,L,a,u,m,I,A,P,N,R,z,F,B,J,V,Z]}class hS extends ve{constructor(e){super(),ye(this,e,mS,dS,be,{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 mo(n){return n+.5|0}const Qi=(n,e,t)=>Math.max(Math.min(n,t),e);function Es(n){return Qi(mo(n*2.55),0,255)}function ll(n){return Qi(mo(n*255),0,255)}function qi(n){return Qi(mo(n/2.55)/100,0,1)}function jc(n){return Qi(mo(n*100),0,100)}const Xn={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},nu=[..."0123456789ABCDEF"],hS=n=>nu[n&15],_S=n=>nu[(n&240)>>4]+nu[n&15],Do=n=>(n&240)>>4===(n&15),gS=n=>Do(n.r)&&Do(n.g)&&Do(n.b)&&Do(n.a);function bS(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Xn[n[1]]*17,g:255&Xn[n[2]]*17,b:255&Xn[n[3]]*17,a:e===5?Xn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Xn[n[1]]<<4|Xn[n[2]],g:Xn[n[3]]<<4|Xn[n[4]],b:Xn[n[5]]<<4|Xn[n[6]],a:e===9?Xn[n[7]]<<4|Xn[n[8]]:255})),t}const kS=(n,e)=>n<255?e(n):"";function yS(n){var e=gS(n)?hS:_S;return n?"#"+e(n.r)+e(n.g)+e(n.b)+kS(n.a,e):void 0}const vS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function zk(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function wS(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function SS(n,e,t){const i=zk(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function TS(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=TS(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Bu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(ll)}function Wu(n,e,t){return Bu(zk,n,e,t)}function $S(n,e,t){return Bu(SS,n,e,t)}function CS(n,e,t){return Bu(wS,n,e,t)}function Uk(n){return(n%360+360)%360}function OS(n){const e=vS.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Es(+e[5]):ll(+e[5]));const s=Uk(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=$S(s,l,o):e[1]==="hsv"?i=CS(s,l,o):i=Wu(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function MS(n,e){var t=Vu(n);t[0]=Uk(t[0]+e),t=Wu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function ES(n){if(!n)return;const e=Vu(n),t=e[0],i=jc(e[1]),s=jc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${qi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Hc={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"},zc={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 DS(){const n={},e=Object.keys(zc),t=Object.keys(Hc);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Io;function IS(n){Io||(Io=DS(),Io.transparent=[0,0,0,0]);const e=Io[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const LS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function AS(n){const e=LS.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Es(o):Qi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Es(i):Qi(i,0,255)),s=255&(e[4]?Es(s):Qi(s,0,255)),l=255&(e[6]?Es(l):Qi(l,0,255)),{r:i,g:s,b:l,a:t}}}function PS(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${qi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const fa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Kl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function NS(n,e,t){const i=Kl(qi(n.r)),s=Kl(qi(n.g)),l=Kl(qi(n.b));return{r:ll(fa(i+t*(Kl(qi(e.r))-i))),g:ll(fa(s+t*(Kl(qi(e.g))-s))),b:ll(fa(l+t*(Kl(qi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Lo(n,e,t){if(n){let i=Vu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Wu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Vk(n,e){return n&&Object.assign(e||{},n)}function Uc(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=ll(n[3]))):(e=Vk(n,{r:0,g:0,b:0,a:1}),e.a=ll(e.a)),e}function RS(n){return n.charAt(0)==="r"?AS(n):OS(n)}class Gs{constructor(e){if(e instanceof Gs)return e;const t=typeof e;let i;t==="object"?i=Uc(e):t==="string"&&(i=bS(e)||IS(e)||RS(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Vk(this._rgb);return e&&(e.a=qi(e.a)),e}set rgb(e){this._rgb=Uc(e)}rgbString(){return this._valid?PS(this._rgb):void 0}hexString(){return this._valid?yS(this._rgb):void 0}hslString(){return this._valid?ES(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=NS(this._rgb,e._rgb,t)),this}clone(){return new Gs(this.rgb)}alpha(e){return this._rgb.a=ll(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=mo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Lo(this._rgb,2,e),this}darken(e){return Lo(this._rgb,2,-e),this}saturate(e){return Lo(this._rgb,1,e),this}desaturate(e){return Lo(this._rgb,1,-e),this}rotate(e){return MS(this._rgb,e),this}}/*! + */function mo(n){return n+.5|0}const Qi=(n,e,t)=>Math.max(Math.min(n,t),e);function Es(n){return Qi(mo(n*2.55),0,255)}function ll(n){return Qi(mo(n*255),0,255)}function qi(n){return Qi(mo(n/2.55)/100,0,1)}function jc(n){return Qi(mo(n*100),0,100)}const Xn={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},nu=[..."0123456789ABCDEF"],_S=n=>nu[n&15],gS=n=>nu[(n&240)>>4]+nu[n&15],Do=n=>(n&240)>>4===(n&15),bS=n=>Do(n.r)&&Do(n.g)&&Do(n.b)&&Do(n.a);function kS(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Xn[n[1]]*17,g:255&Xn[n[2]]*17,b:255&Xn[n[3]]*17,a:e===5?Xn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Xn[n[1]]<<4|Xn[n[2]],g:Xn[n[3]]<<4|Xn[n[4]],b:Xn[n[5]]<<4|Xn[n[6]],a:e===9?Xn[n[7]]<<4|Xn[n[8]]:255})),t}const yS=(n,e)=>n<255?e(n):"";function vS(n){var e=bS(n)?_S:gS;return n?"#"+e(n.r)+e(n.g)+e(n.b)+yS(n.a,e):void 0}const wS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Uk(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function SS(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function TS(n,e,t){const i=Uk(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function $S(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=$S(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Bu(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(ll)}function Wu(n,e,t){return Bu(Uk,n,e,t)}function CS(n,e,t){return Bu(TS,n,e,t)}function OS(n,e,t){return Bu(SS,n,e,t)}function Vk(n){return(n%360+360)%360}function MS(n){const e=wS.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Es(+e[5]):ll(+e[5]));const s=Vk(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=CS(s,l,o):e[1]==="hsv"?i=OS(s,l,o):i=Wu(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function ES(n,e){var t=Vu(n);t[0]=Vk(t[0]+e),t=Wu(t),n.r=t[0],n.g=t[1],n.b=t[2]}function DS(n){if(!n)return;const e=Vu(n),t=e[0],i=jc(e[1]),s=jc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${qi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Hc={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"},zc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function IS(){const n={},e=Object.keys(zc),t=Object.keys(Hc);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Io;function LS(n){Io||(Io=IS(),Io.transparent=[0,0,0,0]);const e=Io[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const AS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function PS(n){const e=AS.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Es(o):Qi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Es(i):Qi(i,0,255)),s=255&(e[4]?Es(s):Qi(s,0,255)),l=255&(e[6]?Es(l):Qi(l,0,255)),{r:i,g:s,b:l,a:t}}}function NS(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${qi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const fa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Kl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function RS(n,e,t){const i=Kl(qi(n.r)),s=Kl(qi(n.g)),l=Kl(qi(n.b));return{r:ll(fa(i+t*(Kl(qi(e.r))-i))),g:ll(fa(s+t*(Kl(qi(e.g))-s))),b:ll(fa(l+t*(Kl(qi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Lo(n,e,t){if(n){let i=Vu(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Wu(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Bk(n,e){return n&&Object.assign(e||{},n)}function Uc(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=ll(n[3]))):(e=Bk(n,{r:0,g:0,b:0,a:1}),e.a=ll(e.a)),e}function FS(n){return n.charAt(0)==="r"?PS(n):MS(n)}class Gs{constructor(e){if(e instanceof Gs)return e;const t=typeof e;let i;t==="object"?i=Uc(e):t==="string"&&(i=kS(e)||LS(e)||FS(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Bk(this._rgb);return e&&(e.a=qi(e.a)),e}set rgb(e){this._rgb=Uc(e)}rgbString(){return this._valid?NS(this._rgb):void 0}hexString(){return this._valid?vS(this._rgb):void 0}hslString(){return this._valid?DS(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=RS(this._rgb,e._rgb,t)),this}clone(){return new Gs(this.rgb)}alpha(e){return this._rgb.a=ll(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=mo(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Lo(this._rgb,2,e),this}darken(e){return Lo(this._rgb,2,-e),this}saturate(e){return Lo(this._rgb,1,e),this}desaturate(e){return Lo(this._rgb,1,-e),this}rotate(e){return ES(this._rgb,e),this}}/*! * Chart.js v4.5.1 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License - */function Ni(){}const FS=(()=>{let n=0;return()=>n++})();function Vt(n){return n==null}function dn(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 St(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Sn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gi(n,e){return Sn(n)?n:e}function Et(n,e){return typeof n>"u"?e:n}const qS=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let s,l,o;if(dn(n))for(l=n.length,s=0;sn,x:n=>n.x,y:n=>n.y};function zS(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function US(n){const e=zS(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function gr(n,e){return(Vc[e]||(Vc[e]=US(e)))(n)}function Yu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const br=n=>typeof n<"u",ol=n=>typeof n=="function",Bc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function VS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const vn=Math.PI,Ci=2*vn,BS=Ci+vn,kr=Number.POSITIVE_INFINITY,WS=vn/180,ci=vn/2,kl=vn/4,Wc=vn*2/3,Wk=Math.log10,rl=Math.sign;function Ml(n,e,t){return Math.abs(n-e)s-l).pop(),e}function KS(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Qs(n){return!KS(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function JS(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function ZS(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ku(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Cl=(n,e,t,i)=>Ku(n,t,i?s=>{const l=n[s][e];return ln[s][e]Ku(n,t,i=>n[i][e]>=t);function t4(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Yu(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Jc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Jk.forEach(l=>{delete n[l]}),delete n._chartjs)}function i4(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Zk=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Gk(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,Zk.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 s4=n=>n==="start"?"left":n==="end"?"right":"center",Zc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function o4(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,vScale:r,_parsed:a}=n,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=o.axis,{min:c,max:d,minDefined:m,maxDefined:_}=o.getUserBounds();if(m){if(s=Math.min(Cl(a,f,c).lo,t?i:Cl(e,f,o.getPixelForValue(c)).lo),u){const g=a.slice(0,s+1).reverse().findIndex(h=>!Vt(h[r.axis]));s-=Math.max(0,g)}s=di(s,0,i-1)}if(_){let g=Math.max(Cl(a,o.axis,d,!0).hi+1,t?0:Cl(e,f,o.getPixelForValue(d),!0).hi+1);if(u){const h=a.slice(g-1).findIndex(k=>!Vt(k[r.axis]));g+=Math.max(0,h)}l=di(g,s,i)-s}else l=i-s}return{start:s,count:l}}function r4(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Ao=n=>n===0||n===1,Gc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ci/t)),Xc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ci/t)+1,Rs={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*ci)+1,easeOutSine:n=>Math.sin(n*ci),easeInOutSine:n=>-.5*(Math.cos(vn*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=>Ao(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=>Ao(n)?n:Gc(n,.075,.3),easeOutElastic:n=>Ao(n)?n:Xc(n,.075,.3),easeInOutElastic(n){return Ao(n)?n:n<.5?.5*Gc(n*2,.1125,.45):.5+.5*Xc(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-Rs.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?Rs.easeInBounce(n*2)*.5:Rs.easeOutBounce(n*2-1)*.5+.5};function Ju(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Qc(n){return Ju(n)?n:new Gs(n)}function ca(n){return Ju(n)?n:new Gs(n).saturate(.5).darken(.1).hexString()}const a4=["x","y","borderWidth","radius","tension"],u4=["color","borderColor","backgroundColor"];function f4(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:u4},numbers:{type:"number",properties:a4}}),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 c4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const xc=new Map;function d4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=xc.get(t);return i||(i=new Intl.NumberFormat(n,e),xc.set(t,i)),i}function Xk(n,e,t){return d4(e,t).format(n)}const p4={values(n){return dn(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=m4(n,t)}const o=Wk(Math.abs(l)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Xk(n,i,a)}};function m4(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 Qk={formatters:p4};function h4(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:Qk.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ll=Object.create(null),lu=Object.create(null);function Fs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ca(s.backgroundColor),this.hoverBorderColor=(i,s)=>ca(s.borderColor),this.hoverColor=(i,s)=>ca(s.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 da(this,e,t)}get(e){return Fs(this,e)}describe(e,t){return da(lu,e,t)}override(e,t){return da(Ll,e,t)}route(e,t,i,s){const l=Fs(this,e),o=Fs(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return St(a)?Object.assign({},u,a):Et(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var rn=new _4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[f4,c4,h4]);function g4(n){return!n||Vt(n.size)||Vt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ed(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function yl(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function td(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function su(n,e,t,i){b4(n,e,t,i)}function b4(n,e,t,i,s){let l,o,r,a,u,f,c,d;const m=e.pointStyle,_=e.rotation,g=e.radius;let h=(_||0)*WS;if(m&&typeof m=="object"&&(l=m.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(h),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,Ci),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(h)*f,i-Math.cos(h)*g),h+=Wc,n.lineTo(t+Math.sin(h)*f,i-Math.cos(h)*g),h+=Wc,n.lineTo(t+Math.sin(h)*f,i-Math.cos(h)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(h+kl)*a,c=Math.cos(h+kl)*a,r=Math.sin(h+kl)*a,d=Math.sin(h+kl)*a,n.arc(t-c,i-r,u,h-vn,h-ci),n.arc(t+d,i-o,u,h-ci,h),n.arc(t+c,i+r,u,h,h+ci),n.arc(t-d,i+o,u,h+ci,h+vn),n.closePath();break;case"rect":if(!_){a=Math.SQRT1_2*g,f=a,n.rect(t-f,i-a,2*f,2*a);break}h+=kl;case"rectRot":c=Math.cos(h)*g,o=Math.cos(h)*g,r=Math.sin(h)*g,d=Math.sin(h)*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":h+=kl;case"cross":c=Math.cos(h)*g,o=Math.cos(h)*g,r=Math.sin(h)*g,d=Math.sin(h)*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(h)*g,o=Math.cos(h)*g,r=Math.sin(h)*g,d=Math.sin(h)*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),h+=kl,c=Math.cos(h)*g,o=Math.cos(h)*g,r=Math.sin(h)*g,d=Math.sin(h)*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(h)*g,r=Math.sin(h)*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(h)*g,i+Math.sin(h)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ss(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,v4(n,l),a=0;a+n||0;function xk(n,e){const t={},i=St(e),s=i?Object.keys(e):e,l=St(n)?i?o=>Et(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=O4(l(o));return t}function M4(n){return xk(n,{top:"y",right:"x",bottom:"y",left:"x"})}function tr(n){return xk(n,["topLeft","topRight","bottomLeft","bottomRight"])}function al(n){const e=M4(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $i(n,e){n=n||{},e=e||rn.font;let t=Et(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Et(n.style,e.style);i&&!(""+i).match($4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Et(n.family,e.family),lineHeight:C4(Et(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Et(n.weight,e.weight),string:""};return s.string=g4(s),s}function Po(n,e,t,i){let s,l,o;for(s=0,l=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Nl(n,e){return Object.assign(Object.create(n),e)}function Xu(n,e=[""],t,i,s=()=>n[0]){const l=t||n;typeof i>"u"&&(i=iy("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:l,_fallback:i,_getTarget:s,override:r=>Xu([r,...n],e,l,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return ty(r,a,()=>F4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return sd(r).includes(a)},ownKeys(r){return sd(r)},set(r,a,u){const f=r._storage||(r._storage=s());return r[a]=f[a]=u,delete r._keys,!0}})}function os(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:ey(n,i),setContext:l=>os(n,l,t,i),override:l=>os(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return ty(l,o,()=>I4(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function ey(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:ol(t)?t:()=>t,isIndexable:ol(i)?i:()=>i}}const D4=(n,e)=>n?n+Yu(e):e,Qu=(n,e)=>St(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function ty(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function I4(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ol(r)&&o.isScriptable(e)&&(r=L4(e,r,n,t)),dn(r)&&r.length&&(r=A4(e,r,n,o.isIndexable)),Qu(e,r)&&(r=os(r,s,l&&l[e],o)),r}function L4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(l,o||i);return r.delete(n),Qu(n,a)&&(a=xu(s._scopes,s,n,a)),a}function A4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(typeof l.index<"u"&&i(n))return e[l.index%e.length];if(St(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=xu(u,s,n,f);e.push(os(c,l,o&&o[n],r))}}return e}function ny(n,e,t){return ol(n)?n(e,t):n}const P4=(n,e)=>n===!0?e:typeof n=="string"?gr(e,n):void 0;function N4(n,e,t,i,s){for(const l of e){const o=P4(t,l);if(o){n.add(o);const r=ny(o._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function xu(n,e,t,i){const s=e._rootScopes,l=ny(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=ld(r,o,t,l||t,i);return a===null||typeof l<"u"&&l!==t&&(a=ld(r,o,l,a,i),a===null)?!1:Xu(Array.from(r),[""],s,l,()=>R4(e,t,i))}function ld(n,e,t,i,s){for(;t;)t=N4(n,e,t,i,s);return t}function R4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return dn(s)&&St(t)?t:s||{}}function F4(n,e,t,i){let s;for(const l of e)if(s=iy(D4(l,n),t),typeof s<"u")return Qu(n,s)?xu(t,i,n,s):s}function iy(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function sd(n){let e=n._keys;return e||(e=n._keys=q4(n._scopes)),e}function q4(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}const j4=Number.EPSILON||1e-14,rs=(n,e)=>en==="x"?"y":"x";function H4(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=iu(l,s),a=iu(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function z4(n,e,t){const i=n.length;let s,l,o,r,a,u=rs(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")V4(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;ln.ownerDocument.defaultView.getComputedStyle(n,null);function Y4(n,e){return qr(n).getPropertyValue(e)}const K4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=K4[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const J4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Z4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(J4(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=qr(t),l=s.boxSizing==="border-box",o=El(s,"padding"),r=El(s,"border","width"),{x:a,y:u,box:f}=Z4(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:_}=e;return l&&(m-=o.width+r.width,_-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/_*t.height/i)}}function G4(n,e,t){let i,s;if(e===void 0||t===void 0){const l=n&&tf(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=qr(l),a=El(r,"border","width"),u=El(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=yr(r.maxWidth,l,"clientWidth"),s=yr(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||kr,maxHeight:s||kr}}const xi=n=>Math.round(n*10)/10;function X4(n,e,t,i){const s=qr(n),l=El(s,"margin"),o=yr(s.maxWidth,n,"clientWidth")||kr,r=yr(s.maxHeight,n,"clientHeight")||kr,a=G4(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=El(s,"border","width"),m=El(s,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?u/i:f-l.height),u=xi(Math.min(u,o,a.maxWidth)),f=xi(Math.min(f,r,a.maxHeight)),u&&!f&&(f=xi(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=xi(Math.floor(f*i))),{width:u,height:f}}function od(n,e,t){const i=e||1,s=xi(n.height*i),l=xi(n.width*i);n.height=xi(n.height),n.width=xi(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!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Q4=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};ef()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function rd(n,e){const t=Y4(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function wl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function x4(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 eT(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=wl(n,s,t),r=wl(s,l,t),a=wl(l,e,t),u=wl(o,r,t),f=wl(r,a,t);return wl(u,f,t)}const tT=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}}},nT=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function pa(n,e,t){return n?tT(e,t):nT()}function iT(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 lT(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function sy(n){return n==="angle"?{between:Yk,compare:QS,normalize:yi}:{between:Kk,compare:(e,t)=>e-t,normalize:e=>e}}function ad({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function sT(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=sy(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(s,$,k)&&r(s,$)!==0,O=()=>r(l,k)===0||a(l,$,k),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(g=a(k,s,l),h===null&&E()&&(h=r(k,s)===0?I:A),h!==null&&L()&&(_.push(ad({start:h,end:I,loop:d,count:o,style:m})),h=null),A=I,$=k));return h!==null&&_.push(ad({start:h,end:c,loop:d,count:o,style:m})),_}function ry(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function rT(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function aT(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=oT(t,s,l,i);if(i===!0)return ud(n,[{start:o,end:r,loop:l}],t,e);const a=r{let n=0;return()=>n++})();function Vt(n){return n==null}function dn(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 St(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Sn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function gi(n,e){return Sn(n)?n:e}function Et(n,e){return typeof n>"u"?e:n}const jS=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let s,l,o;if(dn(n))for(l=n.length,s=0;sn,x:n=>n.x,y:n=>n.y};function US(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function VS(n){const e=US(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function gr(n,e){return(Vc[e]||(Vc[e]=VS(e)))(n)}function Yu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const br=n=>typeof n<"u",ol=n=>typeof n=="function",Bc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function BS(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const vn=Math.PI,Ci=2*vn,WS=Ci+vn,kr=Number.POSITIVE_INFINITY,YS=vn/180,ci=vn/2,kl=vn/4,Wc=vn*2/3,Yk=Math.log10,rl=Math.sign;function Ml(n,e,t){return Math.abs(n-e)s-l).pop(),e}function JS(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Qs(n){return!JS(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function ZS(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function GS(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ku(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Cl=(n,e,t,i)=>Ku(n,t,i?s=>{const l=n[s][e];return ln[s][e]Ku(n,t,i=>n[i][e]>=t);function n4(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Yu(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function Jc(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Zk.forEach(l=>{delete n[l]}),delete n._chartjs)}function l4(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Gk=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Xk(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,Gk.call(window,()=>{i=!1,n.apply(e,t)}))}}function s4(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const o4=n=>n==="start"?"left":n==="end"?"right":"center",Zc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function r4(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,vScale:r,_parsed:a}=n,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=o.axis,{min:c,max:d,minDefined:m,maxDefined:h}=o.getUserBounds();if(m){if(s=Math.min(Cl(a,f,c).lo,t?i:Cl(e,f,o.getPixelForValue(c)).lo),u){const g=a.slice(0,s+1).reverse().findIndex(_=>!Vt(_[r.axis]));s-=Math.max(0,g)}s=di(s,0,i-1)}if(h){let g=Math.max(Cl(a,o.axis,d,!0).hi+1,t?0:Cl(e,f,o.getPixelForValue(d),!0).hi+1);if(u){const _=a.slice(g-1).findIndex(k=>!Vt(k[r.axis]));g+=Math.max(0,_)}l=di(g,s,i)-s}else l=i-s}return{start:s,count:l}}function a4(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Ao=n=>n===0||n===1,Gc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ci/t)),Xc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ci/t)+1,Rs={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*ci)+1,easeOutSine:n=>Math.sin(n*ci),easeInOutSine:n=>-.5*(Math.cos(vn*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=>Ao(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=>Ao(n)?n:Gc(n,.075,.3),easeOutElastic:n=>Ao(n)?n:Xc(n,.075,.3),easeInOutElastic(n){return Ao(n)?n:n<.5?.5*Gc(n*2,.1125,.45):.5+.5*Xc(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-Rs.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?Rs.easeInBounce(n*2)*.5:Rs.easeOutBounce(n*2-1)*.5+.5};function Ju(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Qc(n){return Ju(n)?n:new Gs(n)}function ca(n){return Ju(n)?n:new Gs(n).saturate(.5).darken(.1).hexString()}const u4=["x","y","borderWidth","radius","tension"],f4=["color","borderColor","backgroundColor"];function c4(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:u4}}),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 d4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const xc=new Map;function p4(n,e){e=e||{};const t=n+JSON.stringify(e);let i=xc.get(t);return i||(i=new Intl.NumberFormat(n,e),xc.set(t,i)),i}function Qk(n,e,t){return p4(e,t).format(n)}const m4={values(n){return dn(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=h4(n,t)}const o=Yk(Math.abs(l)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Qk(n,i,a)}};function h4(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 xk={formatters:m4};function _4(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:xk.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Ll=Object.create(null),lu=Object.create(null);function Fs(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>ca(s.backgroundColor),this.hoverBorderColor=(i,s)=>ca(s.borderColor),this.hoverColor=(i,s)=>ca(s.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 da(this,e,t)}get(e){return Fs(this,e)}describe(e,t){return da(lu,e,t)}override(e,t){return da(Ll,e,t)}route(e,t,i,s){const l=Fs(this,e),o=Fs(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return St(a)?Object.assign({},u,a):Et(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var rn=new g4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[c4,d4,_4]);function b4(n){return!n||Vt(n.size)||Vt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ed(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function yl(n,e,t){const i=n.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((e-s)*i)/i+s}function td(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function su(n,e,t,i){k4(n,e,t,i)}function k4(n,e,t,i,s){let l,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,g=e.radius;let _=(h||0)*YS;if(m&&typeof m=="object"&&(l=m.toString(),l==="[object HTMLImageElement]"||l==="[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,Ci),n.closePath();break;case"triangle":f=g,n.moveTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Wc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),_+=Wc,n.lineTo(t+Math.sin(_)*f,i-Math.cos(_)*g),n.closePath();break;case"rectRounded":u=g*.516,a=g-u,o=Math.cos(_+kl)*a,c=Math.cos(_+kl)*a,r=Math.sin(_+kl)*a,d=Math.sin(_+kl)*a,n.arc(t-c,i-r,u,_-vn,_-ci),n.arc(t+d,i-o,u,_-ci,_),n.arc(t+c,i+r,u,_,_+ci),n.arc(t-d,i+o,u,_+ci,_+vn),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}_+=kl;case"rectRot":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":_+=kl;case"cross":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),_+=kl,c=Math.cos(_)*g,o=Math.cos(_)*g,r=Math.sin(_)*g,d=Math.sin(_)*g,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(_)*g,r=Math.sin(_)*g,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(_)*g,i+Math.sin(_)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ss(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,w4(n,l),a=0;a+n||0;function ey(n,e){const t={},i=St(e),s=i?Object.keys(e):e,l=St(n)?i?o=>Et(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=M4(l(o));return t}function E4(n){return ey(n,{top:"y",right:"x",bottom:"y",left:"x"})}function tr(n){return ey(n,["topLeft","topRight","bottomLeft","bottomRight"])}function al(n){const e=E4(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $i(n,e){n=n||{},e=e||rn.font;let t=Et(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Et(n.style,e.style);i&&!(""+i).match(C4)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Et(n.family,e.family),lineHeight:O4(Et(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Et(n.weight,e.weight),string:""};return s.string=b4(s),s}function Po(n,e,t,i){let s,l,o;for(s=0,l=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Nl(n,e){return Object.assign(Object.create(n),e)}function Xu(n,e=[""],t,i,s=()=>n[0]){const l=t||n;typeof i>"u"&&(i=ly("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:l,_fallback:i,_getTarget:s,override:r=>Xu([r,...n],e,l,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return ny(r,a,()=>q4(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return sd(r).includes(a)},ownKeys(r){return sd(r)},set(r,a,u){const f=r._storage||(r._storage=s());return r[a]=f[a]=u,delete r._keys,!0}})}function os(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:ty(n,i),setContext:l=>os(n,l,t,i),override:l=>os(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return ny(l,o,()=>L4(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function ty(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:ol(t)?t:()=>t,isIndexable:ol(i)?i:()=>i}}const I4=(n,e)=>n?n+Yu(e):e,Qu=(n,e)=>St(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function ny(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function L4(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ol(r)&&o.isScriptable(e)&&(r=A4(e,r,n,t)),dn(r)&&r.length&&(r=P4(e,r,n,o.isIndexable)),Qu(e,r)&&(r=os(r,s,l&&l[e],o)),r}function A4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(l,o||i);return r.delete(n),Qu(n,a)&&(a=xu(s._scopes,s,n,a)),a}function P4(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(typeof l.index<"u"&&i(n))return e[l.index%e.length];if(St(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=xu(u,s,n,f);e.push(os(c,l,o&&o[n],r))}}return e}function iy(n,e,t){return ol(n)?n(e,t):n}const N4=(n,e)=>n===!0?e:typeof n=="string"?gr(e,n):void 0;function R4(n,e,t,i,s){for(const l of e){const o=N4(t,l);if(o){n.add(o);const r=iy(o._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function xu(n,e,t,i){const s=e._rootScopes,l=iy(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=ld(r,o,t,l||t,i);return a===null||typeof l<"u"&&l!==t&&(a=ld(r,o,l,a,i),a===null)?!1:Xu(Array.from(r),[""],s,l,()=>F4(e,t,i))}function ld(n,e,t,i,s){for(;t;)t=R4(n,e,t,i,s);return t}function F4(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return dn(s)&&St(t)?t:s||{}}function q4(n,e,t,i){let s;for(const l of e)if(s=ly(I4(l,n),t),typeof s<"u")return Qu(n,s)?xu(t,i,n,s):s}function ly(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function sd(n){let e=n._keys;return e||(e=n._keys=j4(n._scopes)),e}function j4(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}const H4=Number.EPSILON||1e-14,rs=(n,e)=>en==="x"?"y":"x";function z4(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=iu(l,s),a=iu(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function U4(n,e,t){const i=n.length;let s,l,o,r,a,u=rs(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")B4(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;ln.ownerDocument.defaultView.getComputedStyle(n,null);function K4(n,e){return qr(n).getPropertyValue(e)}const J4=["top","right","bottom","left"];function El(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=J4[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Z4=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function G4(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Z4(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function vi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=qr(t),l=s.boxSizing==="border-box",o=El(s,"padding"),r=El(s,"border","width"),{x:a,y:u,box:f}=G4(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return l&&(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 X4(n,e,t){let i,s;if(e===void 0||t===void 0){const l=n&&tf(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=qr(l),a=El(r,"border","width"),u=El(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=yr(r.maxWidth,l,"clientWidth"),s=yr(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||kr,maxHeight:s||kr}}const xi=n=>Math.round(n*10)/10;function Q4(n,e,t,i){const s=qr(n),l=El(s,"margin"),o=yr(s.maxWidth,n,"clientWidth")||kr,r=yr(s.maxHeight,n,"clientHeight")||kr,a=X4(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=El(s,"border","width"),m=El(s,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?u/i:f-l.height),u=xi(Math.min(u,o,a.maxWidth)),f=xi(Math.min(f,r,a.maxHeight)),u&&!f&&(f=xi(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=xi(Math.floor(f*i))),{width:u,height:f}}function od(n,e,t){const i=e||1,s=xi(n.height*i),l=xi(n.width*i);n.height=xi(n.height),n.width=xi(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!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const x4=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};ef()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function rd(n,e){const t=K4(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function wl(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function eT(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 tT(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=wl(n,s,t),r=wl(s,l,t),a=wl(l,e,t),u=wl(o,r,t),f=wl(r,a,t);return wl(u,f,t)}const nT=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}}},iT=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function pa(n,e,t){return n?nT(e,t):iT()}function lT(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 sT(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function oy(n){return n==="angle"?{between:Kk,compare:xS,normalize:yi}:{between:Jk,compare:(e,t)=>e-t,normalize:e=>e}}function ad({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function oT(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=oy(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(s,$,k)&&r(s,$)!==0,O=()=>r(l,k)===0||a(l,$,k),E=()=>g||T(),L=()=>!g||O();for(let I=f,A=f;I<=c;++I)S=e[I%o],!S.skip&&(k=u(S[i]),k!==$&&(g=a(k,s,l),_===null&&E()&&(_=r(k,s)===0?I:A),_!==null&&L()&&(h.push(ad({start:_,end:I,loop:d,count:o,style:m})),_=null),A=I,$=k));return _!==null&&h.push(ad({start:_,end:c,loop:d,count:o,style:m})),h}function ay(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function aT(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function uT(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=rT(t,s,l,i);if(i===!0)return ud(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Zk.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ri=new dT;const cd="transparent",pT={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Qc(n||cd),s=i.valid&&Qc(e||cd);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class mT{constructor(e,t,i,s){const l=t[i];s=Po([e.to,s,l,e.from]);const o=Po([e.from,l,s]);this._active=!0,this._fn=e.fn||pT[e.type||typeof o],this._easing=Rs[e.easing]||Rs.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Po([e.to,t,s,e.from]),this._from=Po([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s{const l=e[s];if(!St(l))return;const o={};for(const r of t)o[r]=l[r];(dn(l.properties)&&l.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,s=_T(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&hT(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new mT(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Ri.add(this._chart,i),!0}}function hT(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function hd(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=yT(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function ST(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function TT(n,e,t){return Nl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t],l[i]._visualValues!==void 0&&l[i]._visualValues[t]!==void 0&&delete l[i]._visualValues[t]}}}const _a=n=>n==="reset"||n==="none",_d=(n,e)=>e?n:Object.assign({},n),$T=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:fy(t,!0),values:null};class qs{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=ma(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(),s=(c,d,m,_)=>c==="x"?d:c==="r"?_:m,l=t.xAxisID=Et(i.xAxisID,ha(e,"x")),o=t.yAxisID=Et(i.yAxisID,ha(e,"y")),r=t.rAxisID=Et(i.rAxisID,ha(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Jc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(St(t)){const s=this._cachedMeta;this._data=kT(t,s)}else if(i!==t){if(i){Jc(i,this);const s=this._cachedMeta;vs(s),s._parsed=[]}t&&Object.isExtensible(t)&&n4(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=ma(t.vScale,t),t.stack!==i.stack&&(s=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&(hd(this,t._parsed),t._stacked=ma(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:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{dn(s[e])?d=this.parseArrayData(i,s,e,t):St(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!_()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s,t),g=u.resolveNamedOptions(d,m,_,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(_d(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new uy(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||_a(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){_a(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!_a(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const E=e[O],L=k?E:{};if(O=S){L.skip=!0;continue}const I=this.getParsed(O),A=Vt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=l||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])>h,g&&(L.parsed=I,L.raw=u.data[O]),c&&(L.options=f||this.resolveDataElementOptions(O,E.active?"active":s)),k||this.updateElement(E,O,L,s),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(nr,"id","line"),pt(nr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(nr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function vl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class nf{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(nf.prototype,e)}init(){}formats(){return vl()}parse(){return vl()}format(){return vl()}add(){return vl()}diff(){return vl()}startOf(){return vl()}endOf(){return vl()}}var cy={_date:nf};function CT(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale,a=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const u=r._reversePixels?e4:Cl;if(i){if(s._sharedOptions){const f=l[0],c=typeof f.getRange=="function"&&f.getRange(e);if(c){const d=u(l,e,t-c),m=u(l,e,t+c);return{lo:d.lo,hi:m.hi}}}}else{const f=u(l,e,t);if(a){const{vScale:c}=s._cachedMeta,{_parsed:d}=n,m=d.slice(0,f.lo+1).reverse().findIndex(g=>!Vt(g[c.axis]));f.lo-=Math.max(0,m);const _=d.slice(f.hi).findIndex(g=>!Vt(g[c.axis]));f.hi+=Math.max(0,_)}return f}}return{lo:0,hi:l.length-1}}function jr(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o]&&a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var DT={modes:{index(n,e,t,i){const s=vi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?ga(n,s,l,i,o):ba(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=vi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?ga(n,s,l,i,o):ba(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function bd(n,e){return n.filter(t=>dy.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function IT(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ss(ws(e,"left"),!0),s=Ss(ws(e,"right")),l=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=bd(e,"x"),a=bd(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function kd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function py(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 NT(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!St(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&py(o,l.getPadding());const r=Math.max(0,e.outerWidth-kd(o,n,"left","right")),a=Math.max(0,e.outerHeight-kd(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 RT(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function FT(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Ds(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,h)=>h.box.options&&h.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);py(d,al(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),_=AT(a.concat(u),c);Ds(r.fullSize,m,c,_),Ds(a,m,c,_),Ds(u,m,c,_)&&Ds(a,m,c,_),RT(m),yd(r.leftAndTop,m,c,_),m.x+=m.w,m.y+=m.h,yd(r.rightAndBottom,m,c,_),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,g=>{const h=g.box;Object.assign(h,n.chartArea),h.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class my{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class qT extends my{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ir="$chartjs",jT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vd=n=>n===null||n==="";function HT(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ir]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",vd(s)){const l=rd(n,"width");l!==void 0&&(n.width=l)}if(vd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=rd(n,"height");l!==void 0&&(n.height=l)}return n}const hy=Q4?{passive:!0}:!1;function zT(n,e,t){n&&n.addEventListener(e,t,hy)}function UT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,hy)}function VT(n,e){const t=jT[n.type]||n.type,{x:i,y:s}=vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function BT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||vr(r.addedNodes,i),o=o&&!vr(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function WT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||vr(r.removedNodes,i),o=o&&!vr(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const xs=new Map;let wd=0;function _y(){const n=window.devicePixelRatio;n!==wd&&(wd=n,xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function YT(n,e){xs.size||window.addEventListener("resize",_y),xs.set(n,e)}function KT(n){xs.delete(n),xs.size||window.removeEventListener("resize",_y)}function JT(n,e,t){const i=n.canvas,s=i&&tf(i);if(!s)return;const l=Gk((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),YT(n,l),o}function ka(n,e,t){t&&t.disconnect(),e==="resize"&&KT(n)}function ZT(n,e,t){const i=n.canvas,s=Gk(l=>{n.ctx!==null&&t(VT(l,n))},n);return zT(i,e,s),s}class GT extends my{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(HT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ir])return!1;const i=t[ir].initial;["height","width"].forEach(l=>{const o=i[l];Vt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ir],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:BT,detach:WT,resize:JT}[t]||ZT;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:ka,detach:ka,resize:ka}[t]||UT)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return X4(e,t,i,s)}isAttached(e){const t=e&&tf(e);return!!(t&&t.isConnected)}}function XT(n){return!ef()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?qT:GT}class Al{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 Qs(this.x)&&Qs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}pt(Al,"defaults",{}),pt(Al,"defaultRoutes");function QT(n,e){const t=n.options.ticks,i=xT(n),s=Math.min(t.maxTicksLimit||i,i),l=t.major.enabled?t5(e):[],o=l.length,r=l[0],a=l[o-1],u=[];if(o>s)return n5(e,u,l,o/s),u;const f=e5(l,e,s);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Vt(m)?0:r-m,r),c=0,d=o-1;cs)return a}return Math.max(s,1)}function t5(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Sd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Td=(n,e)=>Math.min(e||n,n);function $d(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function o5(n,e){gt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=E4(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=di(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-Cd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=GS(Math.min(Math.asin(di((f.highest.height+6)/r,-1,1)),Math.asin(di(a/u,-1,1))-Math.asin(di(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Cd(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(l)+a):(e.height=this.maxHeight,e.width=Ts(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,_=$l(this.labelRotation),g=Math.cos(_),h=Math.sin(_);if(r){const k=i.mirror?0:h*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+h*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,h,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,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width: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 xS(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&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o,border:r}=s,a=l.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ts(l),m=[],_=r.setContext(this.getContext()),g=_.display?_.width:0,h=g/2,k=function(J){return yl(i,J,g)};let S,$,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-h,N=k(e.top)+h,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-h,L=S+h,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,I=S-h,P=k(e.left)+h,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-h,E=S+h,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(this.chart.scales[J].getPixelForValue(V))}N=e.top,z=e.bottom,L=S+h,A=L+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(this.chart.scales[J].getPixelForValue(V))}E=S-h,I=E-d,P=e.left,R=e.right}const F=Et(s.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/F));for($=0;$0&&(ct-=Ye/2);break}pe={left:ct,top:Ke,width:Ye+ae.width,height:Ce+ae.height,color:B.backdropColor}}h.push({label:T,font:A,textOffset:R,options:{rotation:g,color:V,strokeColor:Z,strokeWidth:G,textAlign:de,textBaseline:z,translation:[O,E],backdrop:pe}})}return h}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-$l(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,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"?s?(f=this.left+l,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:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(l)}}]:[{z:i,draw:l=>{this.drawBackground(),this.drawGrid(l),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:l=>{this.drawLabels(l)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");rn.route(l,s,a,r)})}function p5(n){return"id"in n&&"defaults"in n}class m5{constructor(){this.controllers=new Ho(qs,"datasets",!0),this.elements=new Ho(Al,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho(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(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):gt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Yu(e);ft(i["before"+s],[],i),t[e](i),ft(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;tl.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function _5(n){const e={},t=[],i=Object.keys(ki.plugins.items);for(let l=0;l1&&Od(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Md(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function S5(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 Md(n,"x",t[0])||Md(n,"y",t[0])}return{}}function T5(n,e){const t=Ll[n.type]||{scales:{}},i=e.scales||{},s=ou(n.type,e),l=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!St(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=ru(o,r,S5(o,n),rn.scales[r.type]),u=v5(a,s),f=t.scales||{};l[o]=Ns(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||ou(r,e),f=(Ll[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=y5(c,a),m=o[d+"AxisID"]||d;l[m]=l[m]||Object.create(null),Ns(l[m],[{axis:d},i[m],f[c]])})}),Object.keys(l).forEach(o=>{const r=l[o];Ns(r,[rn.scales[r.type],rn.scale])}),l}function gy(n){const e=n.options||(n.options={});e.plugins=Et(e.plugins,{}),e.scales=T5(n,e)}function by(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function $5(n){return n=n||{},n.data=by(n.data),gy(n),n}const Ed=new Map,ky=new Set;function zo(n,e){let t=Ed.get(n);return t||(t=e(),Ed.set(n,t),ky.add(t)),t}const $s=(n,e,t)=>{const i=gr(e,t);i!==void 0&&n.add(i)};class C5{constructor(e){this._config=$5(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=by(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(),gy(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return zo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return zo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return zo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return zo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>$s(a,e,c))),f.forEach(c=>$s(a,s,c)),f.forEach(c=>$s(a,Ll[l]||{},c)),f.forEach(c=>$s(a,rn,c)),f.forEach(c=>$s(a,lu,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),ky.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Ll[t]||{},rn.datasets[t]||{},{type:t},rn,lu]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Dd(this._resolverCache,e,s);let a=o;if(M5(o,t)){l.$shared=!1,i=ol(i)?i():i;const u=this.createResolver(e,i,r);a=os(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Dd(this._resolverCache,e,i);return St(t)?os(l,t,void 0,s):l}}function Dd(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Xu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const O5=n=>St(n)&&Object.getOwnPropertyNames(n).some(e=>ol(n[e]));function M5(n,e){const{isScriptable:t,isIndexable:i}=ey(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ol(r)||O5(r))||o&&dn(r))return!0}return!1}var E5="4.5.1";const D5=["top","bottom","left","right","chartArea"];function Id(n,e){return n==="top"||n==="bottom"||D5.indexOf(n)===-1&&e==="x"}function Ld(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Ad(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ft(t&&t.onComplete,[n],e)}function I5(n){const e=n.chart,t=e.options.animation;ft(t&&t.onProgress,[n],e)}function yy(n){return ef()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const lr={},Pd=n=>{const e=yy(n);return Object.values(lr).filter(t=>t.canvas===e).pop()};function L5(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function A5(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class wi{static register(...e){ki.add(...e),Nd()}static unregister(...e){ki.remove(...e),Nd()}constructor(e,t){const i=this.config=new C5(t),s=yy(e),l=Pd(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||XT(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=FS(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new h5,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=[],lr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Ri.listen(this,"complete",Ad),Ri.listen(this,"progress",I5),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Vt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ki}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():od(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return td(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(e,t){Ri.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,od(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ft(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ru(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),gt(l,o=>{const r=o.options,a=r.id,u=ru(a,r),f=Et(r.type,o.dtype);(r.position===void 0||Id(r.position,u)!==Id(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ki.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(s,(o,r)=>{o||delete i[r]}),gt(i,o=>{qo.configure(this,o,o.options),qo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Ld("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{qo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Bc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;L5(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i={meta:e,index:e.index,cancelable:!0},s=ay(this,e);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Zu(t,s),e.controller.draw(),s&&Gu(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return ss(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=DT.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Nl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);br(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Ri.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};gt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!hr(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 s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=VS(e),u=A5(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ft(l.onHover,[e,r,this],this),a&&ft(l.onClick,[e,r,this],this));const f=!hr(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}pt(wi,"defaults",rn),pt(wi,"instances",lr),pt(wi,"overrides",Ll),pt(wi,"registry",ki),pt(wi,"version",E5),pt(wi,"getChart",Pd);function Nd(){return gt(wi.instances,n=>n._plugins.invalidate())}function vy(n,e,t=e){n.lineCap=Et(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Et(t.borderDash,e.borderDash)),n.lineDashOffset=Et(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Et(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Et(t.borderWidth,e.borderWidth),n.strokeStyle=Et(t.borderColor,e.borderColor)}function P5(n,e,t){n.lineTo(t.x,t.y)}function N5(n){return n.stepped?k4:n.tension||n.cubicInterpolationMode==="monotone"?y4:P5}function wy(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,$=()=>{g!==h&&(n.lineTo(f,h),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[S(d)],m.skip)continue;const T=m.x,O=m.y,E=T|0;E===_?(Oh&&(h=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),_=E,c=0,g=h=O),k=O}$()}function au(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?F5:R5}function q5(n){return n.stepped?x4:n.tension||n.cubicInterpolationMode==="monotone"?eT:wl}function j5(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),vy(n,e.options),n.stroke(s)}function H5(n,e,t,i){const{segments:s,options:l}=e,o=au(e);for(const r of s)vy(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const z5=typeof Path2D=="function";function U5(n,e,t,i){z5&&!e.options.segment?j5(n,e,t,i):H5(n,e,t,i)}class el extends Al{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;W4(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=aT(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=ry(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=q5(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Rd(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Hr(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Hr(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Fd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Sy(n,e){let t=[],i=!1;return dn(n)?(i=!0,t=n):t=B5(n,e),t.length?new el({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function qd(n){return n&&n.fill!==!1}function W5(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Sn(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function Y5(n,e,t){const i=G5(n);if(St(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Sn(s)&&Math.floor(s)===s?K5(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function K5(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function J5(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:St(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Z5(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:St(n)?i=n.value:i=e.getBaseValue(),i}function G5(n){const e=n.options,t=e.fill;let i=Et(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function X5(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=Q5(e,t);r.push(Sy({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&ya(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;qd(l)&&ya(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!qd(i)||t.drawTime!=="beforeDatasetDraw"||ya(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Is={average(n){if(!n.length)return!1;let e,t,i=new Set,s=0,l=0;for(e=0,t=n.length;er+a)/i.size,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;lr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gk.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Ri=new pT;const cd="transparent",mT={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Qc(n||cd),s=i.valid&&Qc(e||cd);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class hT{constructor(e,t,i,s){const l=t[i];s=Po([e.to,s,l,e.from]);const o=Po([e.from,l,s]);this._active=!0,this._fn=e.fn||mT[e.type||typeof o],this._easing=Rs[e.easing]||Rs.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Po([e.to,t,s,e.from]),this._from=Po([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s{const l=e[s];if(!St(l))return;const o={};for(const r of t)o[r]=l[r];(dn(l.properties)&&l.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,s=gT(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&_T(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new hT(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return Ri.add(this._chart,i),!0}}function _T(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function hd(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=vT(l,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function TT(n,e){return Nl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function $T(n,e,t){return Nl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function vs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t],l[i]._visualValues!==void 0&&l[i]._visualValues[t]!==void 0&&delete l[i]._visualValues[t]}}}const _a=n=>n==="reset"||n==="none",_d=(n,e)=>e?n:Object.assign({},n),CT=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:cy(t,!0),values:null};class qs{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=ma(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(),s=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,l=t.xAxisID=Et(i.xAxisID,ha(e,"x")),o=t.yAxisID=Et(i.yAxisID,ha(e,"y")),r=t.rAxisID=Et(i.rAxisID,ha(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Jc(this._data,this),e._stacked&&vs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(St(t)){const s=this._cachedMeta;this._data=yT(t,s)}else if(i!==t){if(i){Jc(i,this);const s=this._cachedMeta;vs(s),s._parsed=[]}t&&Object.isExtensible(t)&&i4(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=ma(t.vScale,t),t.stack!==i.stack&&(s=!0,vs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&(hd(this,t._parsed),t._stacked=ma(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:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{dn(s[e])?d=this.parseArrayData(i,s,e,t):St(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s,t),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(_d(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new fy(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||_a(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){_a(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!_a(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r0&&this.getParsed(t-1);for(let O=0;O<$;++O){const E=e[O],L=k?E:{};if(O=S){L.skip=!0;continue}const I=this.getParsed(O),A=Vt(I[m]),P=L[d]=o.getPixelForValue(I[d],O),N=L[m]=l||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":s)),k||this.updateElement(E,O,L,s),T=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}pt(nr,"id","line"),pt(nr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),pt(nr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function vl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class nf{constructor(e){pt(this,"options");this.options=e||{}}static override(e){Object.assign(nf.prototype,e)}init(){}formats(){return vl()}parse(){return vl()}format(){return vl()}add(){return vl()}diff(){return vl()}startOf(){return vl()}endOf(){return vl()}}var dy={_date:nf};function OT(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale,a=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const u=r._reversePixels?t4:Cl;if(i){if(s._sharedOptions){const f=l[0],c=typeof f.getRange=="function"&&f.getRange(e);if(c){const d=u(l,e,t-c),m=u(l,e,t+c);return{lo:d.lo,hi:m.hi}}}}else{const f=u(l,e,t);if(a){const{vScale:c}=s._cachedMeta,{_parsed:d}=n,m=d.slice(0,f.lo+1).reverse().findIndex(g=>!Vt(g[c.axis]));f.lo-=Math.max(0,m);const h=d.slice(f.hi).findIndex(g=>!Vt(g[c.axis]));f.hi+=Math.max(0,h)}return f}}return{lo:0,hi:l.length-1}}function jr(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o]&&a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var IT={modes:{index(n,e,t,i){const s=vi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?ga(n,s,l,i,o):ba(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=vi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?ga(n,s,l,i,o):ba(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function bd(n,e){return n.filter(t=>py.indexOf(t.pos)===-1&&t.box.axis===e)}function Ss(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function LT(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Ss(ws(e,"left"),!0),s=Ss(ws(e,"right")),l=Ss(ws(e,"top"),!0),o=Ss(ws(e,"bottom")),r=bd(e,"x"),a=bd(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function kd(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function my(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function RT(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!St(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&my(o,l.getPadding());const r=Math.max(0,e.outerWidth-kd(o,n,"left","right")),a=Math.max(0,e.outerHeight-kd(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 s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function qT(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function Ds(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{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:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);my(d,al(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=PT(a.concat(u),c);Ds(r.fullSize,m,c,h),Ds(a,m,c,h),Ds(u,m,c,h)&&Ds(a,m,c,h),FT(m),yd(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,yd(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},gt(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class hy{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class jT extends hy{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ir="$chartjs",HT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vd=n=>n===null||n==="";function zT(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ir]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",vd(s)){const l=rd(n,"width");l!==void 0&&(n.width=l)}if(vd(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=rd(n,"height");l!==void 0&&(n.height=l)}return n}const _y=x4?{passive:!0}:!1;function UT(n,e,t){n&&n.addEventListener(e,t,_y)}function VT(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,_y)}function BT(n,e){const t=HT[n.type]||n.type,{x:i,y:s}=vi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vr(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function WT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||vr(r.addedNodes,i),o=o&&!vr(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function YT(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||vr(r.removedNodes,i),o=o&&!vr(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const xs=new Map;let wd=0;function gy(){const n=window.devicePixelRatio;n!==wd&&(wd=n,xs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function KT(n,e){xs.size||window.addEventListener("resize",gy),xs.set(n,e)}function JT(n){xs.delete(n),xs.size||window.removeEventListener("resize",gy)}function ZT(n,e,t){const i=n.canvas,s=i&&tf(i);if(!s)return;const l=Xk((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),KT(n,l),o}function ka(n,e,t){t&&t.disconnect(),e==="resize"&&JT(n)}function GT(n,e,t){const i=n.canvas,s=Xk(l=>{n.ctx!==null&&t(BT(l,n))},n);return UT(i,e,s),s}class XT extends hy{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(zT(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ir])return!1;const i=t[ir].initial;["height","width"].forEach(l=>{const o=i[l];Vt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[ir],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:WT,detach:YT,resize:ZT}[t]||GT;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:ka,detach:ka,resize:ka}[t]||VT)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Q4(e,t,i,s)}isAttached(e){const t=e&&tf(e);return!!(t&&t.isConnected)}}function QT(n){return!ef()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?jT:XT}class Al{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 Qs(this.x)&&Qs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}pt(Al,"defaults",{}),pt(Al,"defaultRoutes");function xT(n,e){const t=n.options.ticks,i=e5(n),s=Math.min(t.maxTicksLimit||i,i),l=t.major.enabled?n5(e):[],o=l.length,r=l[0],a=l[o-1],u=[];if(o>s)return i5(e,u,l,o/s),u;const f=t5(l,e,s);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(jo(e,u,f,Vt(m)?0:r-m,r),c=0,d=o-1;cs)return a}return Math.max(s,1)}function n5(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Sd=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Td=(n,e)=>Math.min(e||n,n);function $d(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function r5(n,e){gt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:gi(t,gi(i,t)),max:gi(i,gi(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=D4(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=di(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-Cd(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=XS(Math.min(Math.asin(di((f.highest.height+6)/r,-1,1)),Math.asin(di(a/u,-1,1))-Math.asin(di(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Cd(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ts(l)+a):(e.height=this.maxHeight,e.width=Ts(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=$l(this.labelRotation),g=Math.cos(h),_=Math.sin(h);if(r){const k=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width: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&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o,border:r}=s,a=l.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Ts(l),m=[],h=r.setContext(this.getContext()),g=h.display?h.width:0,_=g/2,k=function(J){return yl(i,J,g)};let S,$,T,O,E,L,I,A,P,N,R,z;if(o==="top")S=k(this.bottom),L=this.bottom-d,A=S-_,N=k(e.top)+_,z=e.bottom;else if(o==="bottom")S=k(this.top),N=e.top,z=k(e.bottom)-_,L=S+_,A=this.top+d;else if(o==="left")S=k(this.right),E=this.right-d,I=S-_,P=k(e.left)+_,R=e.right;else if(o==="right")S=k(this.left),P=e.left,R=k(e.right)-_,E=S+_,I=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(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=k((e.left+e.right)/2);else if(St(o)){const J=Object.keys(o)[0],V=o[J];S=k(this.chart.scales[J].getPixelForValue(V))}E=S-_,I=E-d,P=e.left,R=e.right}const F=Et(s.ticks.maxTicksLimit,c),B=Math.max(1,Math.ceil(c/F));for($=0;$0&&(ct-=Ye/2);break}pe={left:ct,top:Ke,width:Ye+ae.width,height:Ce+ae.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:pe}})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-$l(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,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"?s?(f=this.left+l,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:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(l)}}]:[{z:i,draw:l=>{this.drawBackground(),this.drawGrid(l),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:t,draw:l=>{this.drawLabels(l)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");rn.route(l,s,a,r)})}function m5(n){return"id"in n&&"defaults"in n}class h5{constructor(){this.controllers=new Ho(qs,"datasets",!0),this.elements=new Ho(Al,"elements"),this.plugins=new Ho(Object,"plugins"),this.scales=new Ho(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(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):gt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Yu(e);ft(i["before"+s],[],i),t[e](i),ft(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;tl.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function g5(n){const e={},t=[],i=Object.keys(ki.plugins.items);for(let l=0;l1&&Od(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Md(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function T5(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 Md(n,"x",t[0])||Md(n,"y",t[0])}return{}}function $5(n,e){const t=Ll[n.type]||{scales:{}},i=e.scales||{},s=ou(n.type,e),l=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!St(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=ru(o,r,T5(o,n),rn.scales[r.type]),u=w5(a,s),f=t.scales||{};l[o]=Ns(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||ou(r,e),f=(Ll[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=v5(c,a),m=o[d+"AxisID"]||d;l[m]=l[m]||Object.create(null),Ns(l[m],[{axis:d},i[m],f[c]])})}),Object.keys(l).forEach(o=>{const r=l[o];Ns(r,[rn.scales[r.type],rn.scale])}),l}function by(n){const e=n.options||(n.options={});e.plugins=Et(e.plugins,{}),e.scales=$5(n,e)}function ky(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function C5(n){return n=n||{},n.data=ky(n.data),by(n),n}const Ed=new Map,yy=new Set;function zo(n,e){let t=Ed.get(n);return t||(t=e(),Ed.set(n,t),yy.add(t)),t}const $s=(n,e,t)=>{const i=gr(e,t);i!==void 0&&n.add(i)};class O5{constructor(e){this._config=C5(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(),by(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return zo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return zo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return zo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return zo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>$s(a,e,c))),f.forEach(c=>$s(a,s,c)),f.forEach(c=>$s(a,Ll[l]||{},c)),f.forEach(c=>$s(a,rn,c)),f.forEach(c=>$s(a,lu,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),yy.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,Ll[t]||{},rn.datasets[t]||{},{type:t},rn,lu]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Dd(this._resolverCache,e,s);let a=o;if(E5(o,t)){l.$shared=!1,i=ol(i)?i():i;const u=this.createResolver(e,i,r);a=os(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Dd(this._resolverCache,e,i);return St(t)?os(l,t,void 0,s):l}}function Dd(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Xu(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const M5=n=>St(n)&&Object.getOwnPropertyNames(n).some(e=>ol(n[e]));function E5(n,e){const{isScriptable:t,isIndexable:i}=ty(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ol(r)||M5(r))||o&&dn(r))return!0}return!1}var D5="4.5.1";const I5=["top","bottom","left","right","chartArea"];function Id(n,e){return n==="top"||n==="bottom"||I5.indexOf(n)===-1&&e==="x"}function Ld(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Ad(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ft(t&&t.onComplete,[n],e)}function L5(n){const e=n.chart,t=e.options.animation;ft(t&&t.onProgress,[n],e)}function vy(n){return ef()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const lr={},Pd=n=>{const e=vy(n);return Object.values(lr).filter(t=>t.canvas===e).pop()};function A5(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function P5(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class wi{static register(...e){ki.add(...e),Nd()}static unregister(...e){ki.remove(...e),Nd()}constructor(e,t){const i=this.config=new O5(t),s=vy(e),l=Pd(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||QT(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=qS(),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 _5,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s4(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],lr[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}Ri.listen(this,"complete",Ad),Ri.listen(this,"progress",L5),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Vt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return ki}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():od(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return td(this.canvas,this.ctx),this}stop(){return Ri.stop(this),this}resize(e,t){Ri.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,od(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),ft(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ru(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),gt(l,o=>{const r=o.options,a=r.id,u=ru(a,r),f=Et(r.type,o.dtype);(r.position===void 0||Id(r.position,u)!==Id(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=ki.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(s,(o,r)=>{o||delete i[r]}),gt(i,o=>{qo.configure(this,o,o.options),qo.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Ld("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{qo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Bc(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;A5(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i={meta:e,index:e.index,cancelable:!0},s=uy(this,e);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Zu(t,s),e.controller.draw(),s&&Gu(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return ss(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=IT.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Nl(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);br(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Ri.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};gt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!hr(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 s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=BS(e),u=P5(e,this._lastEvent,i,a);i&&(this._lastEvent=null,ft(l.onHover,[e,r,this],this),a&&ft(l.onClick,[e,r,this],this));const f=!hr(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}pt(wi,"defaults",rn),pt(wi,"instances",lr),pt(wi,"overrides",Ll),pt(wi,"registry",ki),pt(wi,"version",D5),pt(wi,"getChart",Pd);function Nd(){return gt(wi.instances,n=>n._plugins.invalidate())}function wy(n,e,t=e){n.lineCap=Et(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Et(t.borderDash,e.borderDash)),n.lineDashOffset=Et(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Et(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Et(t.borderWidth,e.borderWidth),n.strokeStyle=Et(t.borderColor,e.borderColor)}function N5(n,e,t){n.lineTo(t.x,t.y)}function R5(n){return n.stepped?y4:n.tension||n.cubicInterpolationMode==="monotone"?v4:N5}function Sy(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,$=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,k))};for(a&&(m=s[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[S(d)],m.skip)continue;const T=m.x,O=m.y,E=T|0;E===h?(O_&&(_=O),f=(c*f+T)/++c):($(),n.lineTo(T,O),h=E,c=0,g=_=O),k=O}$()}function au(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?q5:F5}function j5(n){return n.stepped?eT:n.tension||n.cubicInterpolationMode==="monotone"?tT:wl}function H5(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),wy(n,e.options),n.stroke(s)}function z5(n,e,t,i){const{segments:s,options:l}=e,o=au(e);for(const r of s)wy(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const U5=typeof Path2D=="function";function V5(n,e,t,i){U5&&!e.options.segment?H5(n,e,t,i):z5(n,e,t,i)}class el extends Al{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Y4(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=uT(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=ay(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=j5(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Rd(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=Hr(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function Hr(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Fd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Ty(n,e){let t=[],i=!1;return dn(n)?(i=!0,t=n):t=W5(n,e),t.length?new el({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function qd(n){return n&&n.fill!==!1}function Y5(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Sn(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function K5(n,e,t){const i=X5(n);if(St(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Sn(s)&&Math.floor(s)===s?J5(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function J5(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Z5(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:St(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function G5(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:St(n)?i=n.value:i=e.getBaseValue(),i}function X5(n){const e=n.options,t=e.fill;let i=Et(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Q5(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=x5(e,t);r.push(Ty({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&ya(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;qd(l)&&ya(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!qd(i)||t.drawTime!=="beforeDatasetDraw"||ya(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Is={average(n){if(!n.length)return!1;let e,t,i=new Set,s=0,l=0;for(e=0,t=n.length;er+a)/i.size,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;l-1?n.split(` -`):n}function u6(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Ud(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$i(e.bodyFont),u=$i(e.titleFont),f=$i(e.footerFont),c=l.length,d=s.length,m=i.length,_=al(e.padding);let g=_.height,h=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){h=Math.max(h,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),h+=_.width,{width:h,height:g}}function f6(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function c6(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function d6(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),c6(u,n,e,t)&&(u="center"),u}function Vd(n,e,t){const i=t.yAlign||e.yAlign||f6(n,t);return{xAlign:t.xAlign||e.xAlign||d6(n,e,t,i),yAlign:i}}function p6(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function m6(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Bd(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=tr(o);let _=p6(e,r);const g=m6(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,d)+s:r==="right"&&(_+=Math.max(c,m)+s),{x:di(_,0,i.width-e.width),y:di(g,0,i.height-e.height)}}function Uo(n,e,t){const i=al(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Wd(n){return bi([],Fi(n))}function h6(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Yd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const $y={beforeTitle:Ni,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?$y[e].call(t,i):s}class fu extends Al{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new uy(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=h6(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=An(i,"beforeTitle",this,e),l=An(i,"title",this,e),o=An(i,"afterTitle",this,e);let r=[];return r=bi(r,Fi(s)),r=bi(r,Fi(l)),r=bi(r,Fi(o)),r}getBeforeBody(e,t){return Wd(An(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return gt(e,l=>{const o={before:[],lines:[],after:[]},r=Yd(i,l);bi(o.before,Fi(An(r,"beforeLabel",this,l))),bi(o.lines,An(r,"label",this,l)),bi(o.after,Fi(An(r,"afterLabel",this,l))),s.push(o)}),s}getAfterBody(e,t){return Wd(An(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=An(i,"beforeFooter",this,e),l=An(i,"footer",this,e),o=An(i,"afterFooter",this,e);let r=[];return r=bi(r,Fi(s)),r=bi(r,Fi(l)),r=bi(r,Fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),gt(r,f=>{const c=Yd(e.callbacks,f);s.push(An(c,"labelColor",this,f)),l.push(An(c,"labelPointStyle",this,f)),o.push(An(c,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=Is[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Ud(this,i),u=Object.assign({},r,a),f=Vd(this.chart,i,u),c=Bd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=tr(r),{x:d,y:m}=e,{width:_,height:g}=t;let h,k,S,$,T,O;return l==="center"?(T=m+g/2,s==="left"?(h=d,k=h-o,$=T+o,O=T-o):(h=d+_,k=h+o,$=T-o,O=T+o),S=h):(s==="left"?k=d+Math.max(a,f)+o:s==="right"?k=d+_-Math.max(u,c)-o:k=this.caretX,l==="top"?($=m,T=$-o,h=k-o,S=k+o):($=m+g,T=$+o,h=k+o,S=k-o),O=$),{x1:h,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=pa(i.rtl,this.x,this.width);for(e.x=Uo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=$i(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,id(e,{x:g,y:_,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),id(e,{x:h,y:_+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(g,_,u,a),e.strokeRect(g,_,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:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=$i(i.bodyFont);let d=c.lineHeight,m=0;const _=pa(i.rtl,this.x,this.width),g=function(I){t.fillText(I,_.x(e.x+m),e.y+d/2),e.y+=d+l},h=_.textAlign(o);let k,S,$,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Uo(this,h,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,g),m=r&&h!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=Is[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Ud(this,e),a=Object.assign({},o,this._size),u=Vd(t,e,a),f=Bd(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=al(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),iT(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),lT(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!hr(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!hr(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t.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,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=Is[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}pt(fu,"positioners",Is);var _6={id:"tooltip",_element:fu,positioners:Is,afterInit(n,e,t){t&&(n.tooltip=new fu({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:$y},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 g6(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,_=f-1,{min:g,max:h}=e,k=!Vt(o),S=!Vt(r),$=!Vt(u),T=(h-g)/(c+1);let O=Yc((h-g)/_/m)*m,E,L,I,A;if(O<1e-14&&!k&&!S)return[{value:g},{value:h}];A=Math.ceil(h/O)-Math.floor(g/O),A>_&&(O=Yc(A*O/_/m)*m),Vt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),s==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(h/O)*O):(L=g,I=h),k&&S&&l&&JS((r-o)/l,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ml(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Kc(O),Kc(L));E=Math.pow(10,Vt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ml(t[t.length-1].value,r,Kd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function Kd(n,e,{horizontal:t,minRotation:i}){const s=$l(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class b6 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 Vt(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:s,max:l}=this;const o=a=>s=t?s:a,r=a=>l=i?l:a;if(e){const a=rl(s),u=rl(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=l===0?1:Math.abs(l*.05);r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=g6(s,l);return e.bounds==="ticks"&&ZS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Xk(e,this.chart.options.locale,this.options.ticks.format)}}class cu extends b6{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Sn(e)?e:0,this.max=Sn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=$l(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}pt(cu,"id","linear"),pt(cu,"defaults",{ticks:{callback:Qk.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}},qn=Object.keys(zr);function Jd(n,e){return n-e}function Zd(n,e){if(Vt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Sn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Qs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Gd(n,e,t,i){const s=qn.length;for(let l=qn.indexOf(n);l=qn.indexOf(t);l--){const o=qn[l];if(zr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return qn[t?qn.indexOf(t):0]}function y6(n){for(let e=qn.indexOf(n)+1,t=qn.length;e=e?t[i]:t[s];n[l]=!0}}function v6(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Qd(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=di(t,0,o),i=di(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||Gd(l.minUnit,t,i,this._getLabelCapacity(t)),r=Et(s.ticks.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Qs(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const _=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+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 s=this.options.time.displayFormats,l=this._unit,o=t||s[l];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.ticks.callback;if(o)return ft(o,[e,t,i],this);const r=l.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,s||(m?c:f))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Cl(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Cl(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class xd extends eo{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Vo(t,this.min),this._tableRange=Vo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;os-l)}_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(Vo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Vo(this._table,i*this._tableRange+this._minPos,!0)}}pt(xd,"id","timeseries"),pt(xd,"defaults",eo.defaults);/*! +`):n}function f6(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function Ud(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$i(e.bodyFont),u=$i(e.titleFont),f=$i(e.footerFont),c=l.length,d=s.length,m=i.length,h=al(e.padding);let g=h.height,_=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=h.width,{width:_,height:g}}function c6(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function d6(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function p6(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),d6(u,n,e,t)&&(u="center"),u}function Vd(n,e,t){const i=t.yAlign||e.yAlign||c6(n,t);return{xAlign:t.xAlign||e.xAlign||p6(n,e,t,i),yAlign:i}}function m6(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function h6(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Bd(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=tr(o);let h=m6(e,r);const g=h6(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,m)+s),{x:di(h,0,i.width-e.width),y:di(g,0,i.height-e.height)}}function Uo(n,e,t){const i=al(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Wd(n){return bi([],Fi(n))}function _6(n,e,t){return Nl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Yd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Cy={beforeTitle:Ni,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?Cy[e].call(t,i):s}class fu extends Al{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new fy(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=_6(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=An(i,"beforeTitle",this,e),l=An(i,"title",this,e),o=An(i,"afterTitle",this,e);let r=[];return r=bi(r,Fi(s)),r=bi(r,Fi(l)),r=bi(r,Fi(o)),r}getBeforeBody(e,t){return Wd(An(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return gt(e,l=>{const o={before:[],lines:[],after:[]},r=Yd(i,l);bi(o.before,Fi(An(r,"beforeLabel",this,l))),bi(o.lines,An(r,"label",this,l)),bi(o.after,Fi(An(r,"afterLabel",this,l))),s.push(o)}),s}getAfterBody(e,t){return Wd(An(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,s=An(i,"beforeFooter",this,e),l=An(i,"footer",this,e),o=An(i,"afterFooter",this,e);let r=[];return r=bi(r,Fi(s)),r=bi(r,Fi(l)),r=bi(r,Fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),gt(r,f=>{const c=Yd(e.callbacks,f);s.push(An(c,"labelColor",this,f)),l.push(An(c,"labelPointStyle",this,f)),o.push(An(c,"labelTextColor",this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=Is[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=Ud(this,i),u=Object.assign({},r,a),f=Vd(this.chart,i,u),c=Bd(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=tr(r),{x:d,y:m}=e,{width:h,height:g}=t;let _,k,S,$,T,O;return l==="center"?(T=m+g/2,s==="left"?(_=d,k=_-o,$=T+o,O=T-o):(_=d+h,k=_+o,$=T-o,O=T+o),S=_):(s==="left"?k=d+Math.max(a,f)+o:s==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,l==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+g,T=$+o,_=k+o,S=k-o),O=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:O}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=pa(i.rtl,this.x,this.width);for(e.x=Uo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=$i(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,id(e,{x:g,y:h,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),id(e,{x:_,y:h+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=l.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:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=$i(i.bodyFont);let d=c.lineHeight,m=0;const h=pa(i.rtl,this.x,this.width),g=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+l},_=h.textAlign(o);let k,S,$,T,O,E,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Uo(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,g),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,E=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=Is[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Ud(this,e),a=Object.assign({},o,this._size),u=Vd(t,e,a),f=Bd(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=al(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),lT(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),sT(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!hr(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!hr(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t.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,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=Is[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}pt(fu,"positioners",Is);var g6={id:"tooltip",_element:fu,positioners:Is,afterInit(n,e,t){t&&(n.tooltip=new fu({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:Cy},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 b6(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,h=f-1,{min:g,max:_}=e,k=!Vt(o),S=!Vt(r),$=!Vt(u),T=(_-g)/(c+1);let O=Yc((_-g)/h/m)*m,E,L,I,A;if(O<1e-14&&!k&&!S)return[{value:g},{value:_}];A=Math.ceil(_/O)-Math.floor(g/O),A>h&&(O=Yc(A*O/h/m)*m),Vt(a)||(E=Math.pow(10,a),O=Math.ceil(O*E)/E),s==="ticks"?(L=Math.floor(g/O)*O,I=Math.ceil(_/O)*O):(L=g,I=_),k&&S&&l&&ZS((r-o)/l,O/1e3)?(A=Math.round(Math.min((r-o)/O,f)),O=(r-o)/A,L=o,I=r):$?(L=k?o:L,I=S?r:I,A=u-1,O=(I-L)/A):(A=(I-L)/O,Ml(A,Math.round(A),O/1e3)?A=Math.round(A):A=Math.ceil(A));const P=Math.max(Kc(O),Kc(L));E=Math.pow(10,Vt(a)?P:a),L=Math.round(L*E)/E,I=Math.round(I*E)/E;let N=0;for(k&&(d&&L!==o?(t.push({value:o}),Lr)break;t.push({value:R})}return S&&d&&I!==r?t.length&&Ml(t[t.length-1].value,r,Kd(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function Kd(n,e,{horizontal:t,minRotation:i}){const s=$l(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class k6 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 Vt(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:s,max:l}=this;const o=a=>s=t?s:a,r=a=>l=i?l:a;if(e){const a=rl(s),u=rl(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=l===0?1:Math.abs(l*.05);r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=b6(s,l);return e.bounds==="ticks"&&GS(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Qk(e,this.chart.options.locale,this.options.ticks.format)}}class cu extends k6{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Sn(e)?e:0,this.max=Sn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=$l(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}pt(cu,"id","linear"),pt(cu,"defaults",{ticks:{callback:xk.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}},qn=Object.keys(zr);function Jd(n,e){return n-e}function Zd(n,e){if(Vt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Sn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Qs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Gd(n,e,t,i){const s=qn.length;for(let l=qn.indexOf(n);l=qn.indexOf(t);l--){const o=qn[l];if(zr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return qn[t?qn.indexOf(t):0]}function v6(n){for(let e=qn.indexOf(n)+1,t=qn.length;e=e?t[i]:t[s];n[l]=!0}}function w6(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Qd(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=di(t,0,o),i=di(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||Gd(l.minUnit,t,i,this._getLabelCapacity(t)),r=Et(s.ticks.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Qs(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=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+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 s=this.options.time.displayFormats,l=this._unit,o=t||s[l];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.ticks.callback;if(o)return ft(o,[e,t,i],this);const r=l.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,s||(m?c:f))}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Cl(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=Cl(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class xd extends eo{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Vo(t,this.min),this._tableRange=Vo(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;os-l)}_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(Vo(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Vo(this._table,i*this._tableRange+this._minPos,!0)}}pt(xd,"id","timeseries"),pt(xd,"defaults",eo.defaults);/*! * chartjs-adapter-luxon v1.3.1 * https://www.chartjs.org * (c) 2023 chartjs-adapter-luxon Contributors * Released under the MIT license - */const w6={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"}};cy._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 w6},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()}});var w9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function S6(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cy={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 + */const S6={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"}};dy._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 S6},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()}});var S9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T6(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oy={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,s){var l=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,u=Math.abs,f=Date.now;function c(K,Q,ie){return setTimeout($(K,ie),Q)}function d(K,Q,ie){return Array.isArray(K)?(m(K,ie[Q],ie),!0):!1}function m(K,Q,ie){var _e;if(K)if(K.forEach)K.forEach(Q,ie);else if(K.length!==s)for(_e=0;_e\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",_t=e.console&&(e.console.warn||e.console.log);return _t&&_t.call(e.console,_e,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===s||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ie=Object(Q),_e=1;_e-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ie){if(K.indexOf&&!ie)return K.indexOf(Q);for(var _e=0;_eCn[Q]}),_e}function F(K,Q){for(var ie,_e,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze1&&!ie.firstMultiple?ie.firstMultiple=Gt(Q):Ae===1&&(ie.firstMultiple=!1);var Ze=ie.firstInput,_t=ie.firstMultiple,cn=_t?_t.center:Ze.center,hn=Q.center=en(_e);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=yt(cn,hn),Q.distance=oi(cn,hn),Pe(ie,Q),Q.offsetDirection=Ei(Q.deltaX,Q.deltaY);var Cn=mi(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Cn.x,Q.overallVelocityY=Cn.y,Q.overallVelocity=u(Cn.x)>u(Cn.y)?Cn.x:Cn.y,Q.scale=_t?fn(_t.pointers,_e):1,Q.rotation=_t?Jn(_t.pointers,_e):0,Q.maxPointers=ie.prevInput?Q.pointers.length>ie.prevInput.maxPointers?Q.pointers.length:ie.prevInput.maxPointers:Q.pointers.length,jt(ie,Q);var _i=K.element;I(Q.srcEvent.target,_i)&&(_i=Q.srcEvent.target),Q.target=_i}function Pe(K,Q){var ie=Q.center,_e=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===Be)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},_e=K.offsetDelta={x:ie.x,y:ie.y}),Q.deltaX=Ae.x+(ie.x-_e.x),Q.deltaY=Ae.y+(ie.y-_e.y)}function jt(K,Q){var ie=K.lastInterval||Q,_e=Q.timeStamp-ie.timeStamp,Ae,Ze,_t,cn;if(Q.eventType!=ut&&(_e>ct||ie.velocity===s)){var hn=Q.deltaX-ie.deltaX,Cn=Q.deltaY-ie.deltaY,_i=mi(_e,hn,Cn);Ze=_i.x,_t=_i.y,Ae=u(_i.x)>u(_i.y)?_i.x:_i.y,cn=Ei(hn,Cn),K.lastInterval=Q}else Ae=ie.velocity,Ze=ie.velocityX,_t=ie.velocityY,cn=ie.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=_t,Q.direction=cn}function Gt(K){for(var Q=[],ie=0;ie=u(Q)?K<0?Ue:De:Q<0?ot:Ie}function oi(K,Q,ie){ie||(ie=zt);var _e=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.sqrt(_e*_e+Ae*Ae)}function yt(K,Q,ie){ie||(ie=zt);var _e=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.atan2(Ae,_e)*180/Math.PI}function Jn(K,Q){return yt(Q[1],Q[0],Ne)+yt(K[1],K[0],Ne)}function fn(K,Q){return oi(Q[0],Q[1],Ne)/oi(K[0],K[1],Ne)}var It={mousedown:et,mousemove:xe,mouseup:Be},Di="mousedown",fl="mousemove mouseup";function Vi(){this.evEl=Di,this.evWin=fl,this.pressed=!1,Me.apply(this,arguments)}S(Vi,Me,{handler:function(Q){var ie=It[Q.type];ie&et&&Q.button===0&&(this.pressed=!0),ie&xe&&Q.which!==1&&(ie=Be),this.pressed&&(ie&Be&&(this.pressed=!1),this.callback(this.manager,ie,{pointers:[Q],changedPointers:[Q],pointerType:Ye,srcEvent:Q}))}});var Bi={pointerdown:et,pointermove:xe,pointerup:Be,pointercancel:ut,pointerout:ut},cl={2:ae,3:Ce,4:Ye,5:Ke},Ln="pointerdown",ql="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Ln="MSPointerDown",ql="MSPointerMove MSPointerUp MSPointerCancel");function dl(){this.evEl=Ln,this.evWin=ql,Me.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(dl,Me,{handler:function(Q){var ie=this.store,_e=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Bi[Ae],_t=cl[Q.pointerType]||Q.pointerType,cn=_t==ae,hn=N(ie,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||cn)?hn<0&&(ie.push(Q),hn=ie.length-1):Ze&(Be|ut)&&(_e=!0),!(hn<0)&&(ie[hn]=Q,this.callback(this.manager,Ze,{pointers:ie,changedPointers:[Q],pointerType:_t,srcEvent:Q}),_e&&ie.splice(hn,1))}});var X={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},ee="touchstart",le="touchstart touchmove touchend touchcancel";function Se(){this.evTarget=ee,this.evWin=le,this.started=!1,Me.apply(this,arguments)}S(Se,Me,{handler:function(Q){var ie=X[Q.type];if(ie===et&&(this.started=!0),!!this.started){var _e=Fe.call(this,Q,ie);ie&(Be|ut)&&_e[0].length-_e[1].length===0&&(this.started=!1),this.callback(this.manager,ie,{pointers:_e[0],changedPointers:_e[1],pointerType:ae,srcEvent:Q})}}});function Fe(K,Q){var ie=R(K.touches),_e=R(K.changedTouches);return Q&(Be|ut)&&(ie=z(ie.concat(_e),"identifier")),[ie,_e]}var Ve={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},rt="touchstart touchmove touchend touchcancel";function Je(){this.evTarget=rt,this.targetIds={},Me.apply(this,arguments)}S(Je,Me,{handler:function(Q){var ie=Ve[Q.type],_e=ue.call(this,Q,ie);_e&&this.callback(this.manager,ie,{pointers:_e[0],changedPointers:_e[1],pointerType:ae,srcEvent:Q})}});function ue(K,Q){var ie=R(K.touches),_e=this.targetIds;if(Q&(et|xe)&&ie.length===1)return _e[ie[0].identifier]=!0,[ie,ie];var Ae,Ze,_t=R(K.changedTouches),cn=[],hn=this.target;if(Ze=ie.filter(function(Cn){return I(Cn.target,hn)}),Q===et)for(Ae=0;Ae-1&&_e.splice(Ze,1)};setTimeout(Ae,we)}}function pn(K){for(var Q=K.srcEvent.clientX,ie=K.srcEvent.clientY,_e=0;_e-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,ie=this.state;function _e(Ae){Q.manager.emit(Ae,K)}ie=Wi&&_e(Q.options.event+mf(ie))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=hi},canEmit:function(){for(var K=0;KQ.threshold&&Ae&Q.direction},attrTest:function(K){return ri.prototype.attrTest.call(this,K)&&(this.state&Zn||!(this.state&Zn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=hf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){ri.apply(this,arguments)}S(Br,ri,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Zn)},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(){Ai.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Ai,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ie=K.pointers.length===Q.pointers,_e=K.distanceQ.time;if(this._input=K,!_e||!ie||K.eventType&(Be|ut)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Li,this.tryEmit()},Q.time,this);else if(K.eventType&Be)return Li;return hi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Li&&(K&&K.eventType&Be?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){ri.apply(this,arguments)}S(Yr,ri,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Zn)}});function Kr(){ri.apply(this,arguments)}S(Kr,ri,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:We|Te,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ie;return Q&(We|Te)?ie=K.overallVelocity:Q&We?ie=K.overallVelocityX:Q&Te&&(ie=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ie)>this.options.velocity&&K.eventType&Be},emit:function(K){var Q=hf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Ai.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Ai,{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,ie=K.pointers.length===Q.pointers,_e=K.distance\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",_t=e.console&&(e.console.warn||e.console.log);return _t&&_t.call(e.console,_e,Ze),K.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=function(Q){if(Q===s||Q===null)throw new TypeError("Cannot convert undefined or null to object");for(var ie=Object(Q),_e=1;_e-1}function P(K){return K.trim().split(/\s+/g)}function N(K,Q,ie){if(K.indexOf&&!ie)return K.indexOf(Q);for(var _e=0;_eCn[Q]}),_e}function F(K,Q){for(var ie,_e,Ae=Q[0].toUpperCase()+Q.slice(1),Ze=0;Ze1&&!ie.firstMultiple?ie.firstMultiple=Gt(Q):Ae===1&&(ie.firstMultiple=!1);var Ze=ie.firstInput,_t=ie.firstMultiple,cn=_t?_t.center:Ze.center,hn=Q.center=en(_e);Q.timeStamp=f(),Q.deltaTime=Q.timeStamp-Ze.timeStamp,Q.angle=yt(cn,hn),Q.distance=oi(cn,hn),Pe(ie,Q),Q.offsetDirection=Ei(Q.deltaX,Q.deltaY);var Cn=mi(Q.deltaTime,Q.deltaX,Q.deltaY);Q.overallVelocityX=Cn.x,Q.overallVelocityY=Cn.y,Q.overallVelocity=u(Cn.x)>u(Cn.y)?Cn.x:Cn.y,Q.scale=_t?fn(_t.pointers,_e):1,Q.rotation=_t?Jn(_t.pointers,_e):0,Q.maxPointers=ie.prevInput?Q.pointers.length>ie.prevInput.maxPointers?Q.pointers.length:ie.prevInput.maxPointers:Q.pointers.length,jt(ie,Q);var _i=K.element;I(Q.srcEvent.target,_i)&&(_i=Q.srcEvent.target),Q.target=_i}function Pe(K,Q){var ie=Q.center,_e=K.offsetDelta||{},Ae=K.prevDelta||{},Ze=K.prevInput||{};(Q.eventType===et||Ze.eventType===Be)&&(Ae=K.prevDelta={x:Ze.deltaX||0,y:Ze.deltaY||0},_e=K.offsetDelta={x:ie.x,y:ie.y}),Q.deltaX=Ae.x+(ie.x-_e.x),Q.deltaY=Ae.y+(ie.y-_e.y)}function jt(K,Q){var ie=K.lastInterval||Q,_e=Q.timeStamp-ie.timeStamp,Ae,Ze,_t,cn;if(Q.eventType!=ut&&(_e>ct||ie.velocity===s)){var hn=Q.deltaX-ie.deltaX,Cn=Q.deltaY-ie.deltaY,_i=mi(_e,hn,Cn);Ze=_i.x,_t=_i.y,Ae=u(_i.x)>u(_i.y)?_i.x:_i.y,cn=Ei(hn,Cn),K.lastInterval=Q}else Ae=ie.velocity,Ze=ie.velocityX,_t=ie.velocityY,cn=ie.direction;Q.velocity=Ae,Q.velocityX=Ze,Q.velocityY=_t,Q.direction=cn}function Gt(K){for(var Q=[],ie=0;ie=u(Q)?K<0?Ue:De:Q<0?ot:Ie}function oi(K,Q,ie){ie||(ie=zt);var _e=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.sqrt(_e*_e+Ae*Ae)}function yt(K,Q,ie){ie||(ie=zt);var _e=Q[ie[0]]-K[ie[0]],Ae=Q[ie[1]]-K[ie[1]];return Math.atan2(Ae,_e)*180/Math.PI}function Jn(K,Q){return yt(Q[1],Q[0],Ne)+yt(K[1],K[0],Ne)}function fn(K,Q){return oi(Q[0],Q[1],Ne)/oi(K[0],K[1],Ne)}var It={mousedown:et,mousemove:xe,mouseup:Be},Di="mousedown",fl="mousemove mouseup";function Vi(){this.evEl=Di,this.evWin=fl,this.pressed=!1,Me.apply(this,arguments)}S(Vi,Me,{handler:function(Q){var ie=It[Q.type];ie&et&&Q.button===0&&(this.pressed=!0),ie&xe&&Q.which!==1&&(ie=Be),this.pressed&&(ie&Be&&(this.pressed=!1),this.callback(this.manager,ie,{pointers:[Q],changedPointers:[Q],pointerType:Ye,srcEvent:Q}))}});var Bi={pointerdown:et,pointermove:xe,pointerup:Be,pointercancel:ut,pointerout:ut},cl={2:ae,3:Ce,4:Ye,5:Ke},Ln="pointerdown",ql="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(Ln="MSPointerDown",ql="MSPointerMove MSPointerUp MSPointerCancel");function dl(){this.evEl=Ln,this.evWin=ql,Me.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}S(dl,Me,{handler:function(Q){var ie=this.store,_e=!1,Ae=Q.type.toLowerCase().replace("ms",""),Ze=Bi[Ae],_t=cl[Q.pointerType]||Q.pointerType,cn=_t==ae,hn=N(ie,Q.pointerId,"pointerId");Ze&et&&(Q.button===0||cn)?hn<0&&(ie.push(Q),hn=ie.length-1):Ze&(Be|ut)&&(_e=!0),!(hn<0)&&(ie[hn]=Q,this.callback(this.manager,Ze,{pointers:ie,changedPointers:[Q],pointerType:_t,srcEvent:Q}),_e&&ie.splice(hn,1))}});var X={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},ee="touchstart",le="touchstart touchmove touchend touchcancel";function Se(){this.evTarget=ee,this.evWin=le,this.started=!1,Me.apply(this,arguments)}S(Se,Me,{handler:function(Q){var ie=X[Q.type];if(ie===et&&(this.started=!0),!!this.started){var _e=Fe.call(this,Q,ie);ie&(Be|ut)&&_e[0].length-_e[1].length===0&&(this.started=!1),this.callback(this.manager,ie,{pointers:_e[0],changedPointers:_e[1],pointerType:ae,srcEvent:Q})}}});function Fe(K,Q){var ie=R(K.touches),_e=R(K.changedTouches);return Q&(Be|ut)&&(ie=z(ie.concat(_e),"identifier")),[ie,_e]}var Ve={touchstart:et,touchmove:xe,touchend:Be,touchcancel:ut},rt="touchstart touchmove touchend touchcancel";function Je(){this.evTarget=rt,this.targetIds={},Me.apply(this,arguments)}S(Je,Me,{handler:function(Q){var ie=Ve[Q.type],_e=ue.call(this,Q,ie);_e&&this.callback(this.manager,ie,{pointers:_e[0],changedPointers:_e[1],pointerType:ae,srcEvent:Q})}});function ue(K,Q){var ie=R(K.touches),_e=this.targetIds;if(Q&(et|xe)&&ie.length===1)return _e[ie[0].identifier]=!0,[ie,ie];var Ae,Ze,_t=R(K.changedTouches),cn=[],hn=this.target;if(Ze=ie.filter(function(Cn){return I(Cn.target,hn)}),Q===et)for(Ae=0;Ae-1&&_e.splice(Ze,1)};setTimeout(Ae,we)}}function pn(K){for(var Q=K.srcEvent.clientX,ie=K.srcEvent.clientY,_e=0;_e-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,ie=this.state;function _e(Ae){Q.manager.emit(Ae,K)}ie=Wi&&_e(Q.options.event+mf(ie))},tryEmit:function(K){if(this.canEmit())return this.emit(K);this.state=hi},canEmit:function(){for(var K=0;KQ.threshold&&Ae&Q.direction},attrTest:function(K){return ri.prototype.attrTest.call(this,K)&&(this.state&Zn||!(this.state&Zn)&&this.directionTest(K))},emit:function(K){this.pX=K.deltaX,this.pY=K.deltaY;var Q=hf(K.direction);Q&&(K.additionalEvent=this.options.event+Q),this._super.emit.call(this,K)}});function Br(){ri.apply(this,arguments)}S(Br,ri,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.scale-1)>this.options.threshold||this.state&Zn)},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(){Ai.apply(this,arguments),this._timer=null,this._input=null}S(Wr,Ai,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[bo]},process:function(K){var Q=this.options,ie=K.pointers.length===Q.pointers,_e=K.distanceQ.time;if(this._input=K,!_e||!ie||K.eventType&(Be|ut)&&!Ae)this.reset();else if(K.eventType&et)this.reset(),this._timer=c(function(){this.state=Li,this.tryEmit()},Q.time,this);else if(K.eventType&Be)return Li;return hi},reset:function(){clearTimeout(this._timer)},emit:function(K){this.state===Li&&(K&&K.eventType&Be?this.manager.emit(this.options.event+"up",K):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Yr(){ri.apply(this,arguments)}S(Yr,ri,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ii]},attrTest:function(K){return this._super.attrTest.call(this,K)&&(Math.abs(K.rotation)>this.options.threshold||this.state&Zn)}});function Kr(){ri.apply(this,arguments)}S(Kr,ri,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:We|Te,pointers:1},getTouchAction:function(){return vo.prototype.getTouchAction.call(this)},attrTest:function(K){var Q=this.options.direction,ie;return Q&(We|Te)?ie=K.overallVelocity:Q&We?ie=K.overallVelocityX:Q&Te&&(ie=K.overallVelocityY),this._super.attrTest.call(this,K)&&Q&K.offsetDirection&&K.distance>this.options.threshold&&K.maxPointers==this.options.pointers&&u(ie)>this.options.velocity&&K.eventType&Be},emit:function(K){var Q=hf(K.offsetDirection);Q&&this.manager.emit(this.options.event+Q,K),this.manager.emit(this.options.event,K)}});function wo(){Ai.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}S(wo,Ai,{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,ie=K.pointers.length===Q.pointers,_e=K.distancen&&n.enabled&&n.modifierKey,Oy=(n,e)=>n&&e[n+"Key"],lf=(n,e)=>n&&!e[n+"Key"];function ul(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 wa(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 $6(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function C6({x:n,y:e},t){const i=t.scales,s=Object.keys(i);for(let l=0;l=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function My(n,e,t){const{mode:i="xy",scaleMode:s,overScaleMode:l}=n||{},o=C6(e,t),r=wa(i,t),a=wa(s,t);if(l){const f=wa(l,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 gt(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const du=new WeakMap;function Zt(n){let e=du.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},du.set(n,e)),e}function O6(n){du.delete(n)}function Ey(n,e,t,i){const s=Math.max(0,Math.min(1,(n-e)/t||0)),l=1-s;return{min:i*s,max:i*l}}function Dy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function Iy(n,e,t){const i=n.max-n.min,s=i*(e-1),l=Dy(n,t);return Ey(l,n.min,i,s)}function M6(n,e,t){const i=Dy(n,t);if(i===void 0)return{min:n.min,max:n.max};const s=Math.log10(n.min),l=Math.log10(n.max),o=Math.log10(i),r=l-s,a=r*(e-1),u=Ey(o,s,r,a);return{min:Math.pow(10,s+u.min),max:Math.pow(10,l-u.max)}}function E6(n,e){return e&&(e[n.id]||e[n.axis])||{}}function ep(n,e,t,i,s){let l=t[i];if(l==="original"){const o=n.originalScaleLimits[e.id][i];l=Et(o.options,o.scale)}return Et(l,s)}function D6(n,e,t){const i=n.getValueForPixel(e),s=n.getValueForPixel(t);return{min:Math.min(i,s),max:Math.max(i,s)}}function I6(n,{min:e,max:t,minLimit:i,maxLimit:s},l){const o=(n-t+e)/2;e-=o,t+=o;const r=l.min.options??l.min.scale,a=l.max.options??l.max.scale,u=n/1e6;return Ml(e,r,u)&&(e=r),Ml(t,a,u)&&(t=a),es&&(t=s,e=Math.max(s-n,i)),{min:e,max:t}}function Rl(n,{min:e,max:t},i,s=!1){const l=Zt(n.chart),{options:o}=n,r=E6(n,i),{minRange:a=0}=r,u=ep(l,n,r,"min",-1/0),f=ep(l,n,r,"max",1/0);if(s==="pan"&&(ef))return!0;const c=n.max-n.min,d=s?Math.max(t-e,a):c;if(s&&d===a&&c<=a)return!0;const m=I6(d,{min:e,max:t,minLimit:u,maxLimit:f},l.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,l.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function L6(n,e,t,i){const s=Iy(n,e,t),l={min:n.min+s.min,max:n.max-s.max};return Rl(n,l,i,!0)}function A6(n,e,t,i){const s=M6(n,e,t);return Rl(n,s,i,!0)}function P6(n,e,t,i){Rl(n,D6(n,e,t),i,!0)}const tp=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function N6(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(l=Math.max(0,l-u),o=r===1?l:l+r,f=l===0),Rl(n,{min:l,max:o},t)||f}const j6={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 Ly(n,e,t,i=!1){const{min:s,max:l,options:o}=n,r=o.time&&o.time.round,a=j6[r]||0,u=n.getValueForPixel(n.getPixelForValue(s+a)-e),f=n.getValueForPixel(n.getPixelForValue(l+a)-e);return isNaN(u)||isNaN(f)?!0:Rl(n,{min:u,max:f},t,i?"pan":!1)}function np(n,e,t){return Ly(n,e,t,!0)}const pu={category:R6,default:L6,logarithmic:A6},mu={default:P6},hu={category:q6,default:Ly,logarithmic:np,timeseries:np};function H6(n,e,t){const{id:i,options:{min:s,max:l}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==s||o.max!==l}function ip(n,e){gt(n,(t,i)=>{e[i]||delete n[i]})}function ps(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:s}=e;return gt(t,function(l){H6(l,i,s)&&(i[l.id]={min:{scale:l.min,options:l.options.min},max:{scale:l.max,options:l.options.max}})}),ip(i,t),ip(s,t),i}function lp(n,e,t,i){const s=pu[n.type]||pu.default;ft(s,[n,e,t,i])}function sp(n,e,t,i){const s=mu[n.type]||mu.default;ft(s,[n,e,t,i])}function z6(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function sf(n,e,t="none",i="api"){const{x:s=1,y:l=1,focalPoint:o=z6(n)}=typeof e=="number"?{x:e,y:e}:e,r=Zt(n),{options:{limits:a,zoom:u}}=r;ps(n,r);const f=s!==1,c=l!==1,d=My(u,o,n);gt(d||n.scales,function(m){m.isHorizontal()&&f?lp(m,s,o,a):!m.isHorizontal()&&c&&lp(m,l,o,a)}),n.update(t),ft(u.onZoom,[{chart:n,trigger:i}])}function Ay(n,e,t,i="none",s="api"){const l=Zt(n),{options:{limits:o,zoom:r}}=l,{mode:a="xy"}=r;ps(n,l);const u=ul(a,"x",n),f=ul(a,"y",n);gt(n.scales,function(c){c.isHorizontal()&&u?sp(c,e.x,t.x,o):!c.isHorizontal()&&f&&sp(c,e.y,t.y,o)}),n.update(i),ft(r.onZoom,[{chart:n,trigger:s}])}function U6(n,e,t,i="none",s="api"){var r;const l=Zt(n);ps(n,l);const o=n.scales[e];Rl(o,t,void 0,!0),n.update(i),ft((r=l.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:s}])}function V6(n,e="default"){const t=Zt(n),i=ps(n,t);gt(n.scales,function(s){const l=s.options;i[s.id]?(l.min=i[s.id].min.options,l.max=i[s.id].max.options):(delete l.min,delete l.max),delete t.updatedScaleLimits[s.id]}),n.update(e),ft(t.options.zoom.onZoomComplete,[{chart:n}])}function B6(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:s}=t;return Et(s.options,s.scale)-Et(i.options,i.scale)}function W6(n){const e=Zt(n);let t=1,i=1;return gt(n.scales,function(s){const l=B6(e,s.id);if(l){const o=Math.round(l/(s.max-s.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function op(n,e,t,i){const{panDelta:s}=i,l=s[n.id]||0;rl(l)===rl(e)&&(e+=l);const o=hu[n.type]||hu.default;ft(o,[n,e,t])?s[n.id]=0:s[n.id]=e}function Py(n,e,t,i="none"){const{x:s=0,y:l=0}=typeof e=="number"?{x:e,y:e}:e,o=Zt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ps(n,o);const f=s!==0,c=l!==0;gt(t||n.scales,function(d){d.isHorizontal()&&f?op(d,s,a,o):!d.isHorizontal()&&c&&op(d,l,a,o)}),n.update(i),ft(u,[{chart:n}])}function Ny(n){const e=Zt(n);ps(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:s,max:l}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:s.scale,max:l.scale}}return t}function Y6(n){const e=Zt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function K6(n){const e=Ny(n);for(const t of Object.keys(n.scales)){const{min:i,max:s}=e[t];if(i!==void 0&&n.scales[t].min!==i||s!==void 0&&n.scales[t].max!==s)return!0}return!1}function rp(n){const e=Zt(n);return e.panning||e.dragging}const ap=(n,e,t)=>Math.min(t,Math.max(e,n));function Nn(n,e){const{handlers:t}=Zt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:s,options:l}=Zt(n),o=s[t];if(o&&o.target===e)return;Nn(n,t),s[t]=a=>i(n,a,l),s[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,s[t],{passive:r})}function J6(n,e){const t=Zt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function Z6(n,e){const t=Zt(n);!t.dragStart||e.key!=="Escape"||(Nn(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function _u(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return vi(n,e)}function Ry(n,e,t){const{onZoomStart:i,onZoomRejected:s}=t;if(i){const l=_u(e,n);if(ft(i,[{chart:n,event:e,point:l}])===!1)return ft(s,[{chart:n,event:e}]),!1}}function G6(n,e){if(n.legend){const l=vi(e,n);if(ss(l,n.legend))return}const t=Zt(n),{pan:i,zoom:s={}}=t.options;if(e.button!==0||Oy(to(i),e)||lf(to(s.drag),e))return ft(s.onZoomRejected,[{chart:n,event:e}]);Ry(n,e,s)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",J6),Hs(n,window.document,"keydown",Z6))}function X6({begin:n,end:e},t){let i=e.x-n.x,s=e.y-n.y;const l=Math.abs(i/s);l>t?i=Math.sign(i)*Math.abs(s*t):l=0?2-1/(1-l):1+l,r={x:o,y:o,focalPoint:{x:e.clientX-s.left,y:e.clientY-s.top}};sf(n,r,"zoom","wheel"),ft(t,[{chart:n}])}function n$(n,e,t,i){t&&(Zt(n).handlers[e]=$6(()=>ft(t,[{chart:n}]),i))}function i$(n,e){const t=n.canvas,{wheel:i,drag:s,onZoomComplete:l}=e.zoom;i.enabled?(Hs(n,t,"wheel",t$),n$(n,"onZoomComplete",l,250)):Nn(n,"wheel"),s.enabled?(Hs(n,t,"mousedown",G6),Hs(n,t.ownerDocument,"mouseup",x6)):(Nn(n,"mousedown"),Nn(n,"mousemove"),Nn(n,"mouseup"),Nn(n,"keydown"))}function l$(n){Nn(n,"mousedown"),Nn(n,"mousemove"),Nn(n,"mouseup"),Nn(n,"wheel"),Nn(n,"click"),Nn(n,"keydown")}function s$(n,e){return function(t,i){const{pan:s,zoom:l={}}=e.options;if(!s||!s.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(lf(to(s),o)||Oy(to(l.drag),o))?(ft(s.onPanRejected,[{chart:n,event:i}]),!1):!0}}function o$(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),s=t/i;let l,o;return s>.3&&s<1.7?l=o=!0:t>i?l=!0:o=!0,{x:l,y:o}}function qy(n,e,t){if(e.scale){const{center:i,pointers:s}=t,l=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=o$(s[0],s[1]),a=e.options.zoom.mode,u={x:r.x&&ul(a,"x",n)?l:1,y:r.y&&ul(a,"y",n)?l:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};sf(n,u,"zoom","pinch"),e.scale=t.scale}}function r$(n,e,t){if(e.options.zoom.pinch.enabled){const i=vi(t,n);ft(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ft(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function a$(n,e,t){e.scale&&(qy(n,e,t),e.scale=null,ft(e.options.zoom.onZoomComplete,[{chart:n}]))}function jy(n,e,t){const i=e.delta;i&&(e.panning=!0,Py(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function u$(n,e,t){const{enabled:i,onPanStart:s,onPanRejected:l}=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(ft(s,[{chart:n,event:t,point:r}])===!1)return ft(l,[{chart:n,event:t}]);e.panScales=My(e.options.pan,r,n),e.delta={x:0,y:0},jy(n,e,t)}function f$(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ft(e.options.pan.onPanComplete,[{chart:n}]))}const gu=new WeakMap;function fp(n,e){const t=Zt(n),i=n.canvas,{pan:s,zoom:l}=e,o=new js.Manager(i);l&&l.pinch.enabled&&(o.add(new js.Pinch),o.on("pinchstart",r=>r$(n,t,r)),o.on("pinch",r=>qy(n,t,r)),o.on("pinchend",r=>a$(n,t,r))),s&&s.enabled&&(o.add(new js.Pan({threshold:s.threshold,enable:s$(n,t)})),o.on("panstart",r=>u$(n,t,r)),o.on("panmove",r=>jy(n,t,r)),o.on("panend",()=>f$(n,t))),gu.set(n,o)}function cp(n){const e=gu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),gu.delete(n))}function c$(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:s,zoom:l}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=l==null?void 0:l.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(s==null?void 0:s.enabled)||(t==null?void 0:t.threshold)!==(s==null?void 0:s.threshold)}var d$="2.2.0";function Bo(n,e,t){const i=t.zoom.drag,{dragStart:s,dragEnd:l}=Zt(n);if(i.drawTime!==e||!l)return;const{left:o,top:r,width:a,height:u}=Fy(n,t.zoom.mode,{dragStart:s,dragEnd:l},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 p$={id:"zoom",version:d$,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=Zt(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)."),js&&fp(n,t),n.pan=(s,l,o)=>Py(n,s,l,o),n.zoom=(s,l)=>sf(n,s,l),n.zoomRect=(s,l,o)=>Ay(n,s,l,o),n.zoomScale=(s,l,o)=>U6(n,s,l,o),n.resetZoom=s=>V6(n,s),n.getZoomLevel=()=>W6(n),n.getInitialScaleBounds=()=>Ny(n),n.getZoomedScaleBounds=()=>Y6(n),n.isZoomedOrPanned=()=>K6(n),n.isZoomingOrPanning=()=>rp(n)},beforeEvent(n,{event:e}){if(rp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Zt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Zt(n),s=i.options;i.options=t,c$(s,t)&&(cp(n),fp(n,t)),i$(n,t)},beforeDatasetsDraw(n,e,t){Bo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Bo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Bo(n,"beforeDraw",t)},afterDraw(n,e,t){Bo(n,"afterDraw",t)},stop:function(n){l$(n),js&&cp(n),O6(n)},panFunctions:hu,zoomFunctions:pu,zoomRectFunctions:mu};function dp(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Ct,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function pp(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(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function m$(n){let e,t,i,s,l,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,_=n[2]&&dp(),g=n[3]&&pp(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),s=W(n[1]),l=C(),r=W(o),a=C(),_&&_.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),x(e,"loading",n[2])},m(h,k){w(h,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(t,r),v(e,a),_&&_.m(e,null),v(e,u),v(e,f),n[11](f),v(e,c),g&&g.m(e,null),d||(m=Y(f,"dblclick",n[4]),d=!0)},p(h,[k]){k&2&&se(s,h[1]),k&2&&o!==(o=h[1]==1?"log":"logs")&&se(r,o),k&4&&x(t,"hidden",h[2]),h[2]?_?k&4&&M(_,1):(_=dp(),_.c(),M(_,1),_.m(e,u)):_&&(oe(),D(_,1,1,()=>{_=null}),re()),h[3]?g?g.p(h,k):(g=pp(h),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&x(e,"loading",h[2])},i(h){M(_)},o(h){D(_)},d(h){h&&y(e),_&&_.d(),n[11](null),g&&g.d(),d=!1,m()}}}function h$(n,e,t){let{filter:i=""}=e,{zoom:s={}}=e,{presets:l=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const h=[l,U.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return he.logs.getStats({filter:h}).then(k=>{m(),k=U.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),he.error(k,!h||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function _(){r==null||r.resetZoom()}un(()=>(wi.register(el,sr,nr,cu,eo,a6,_6),wi.register(p$),t(9,r=new wi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:h=>{var k;return(k=h.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>{var k;return(k=h.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:h})=>{t(3,c=h.isZoomedOrPanned()),c?(t(5,s.min=U.formatToUTCDate(h.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",s),t(5,s.max=U.formatToUTCDate(h.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",s)):(s.min||s.max)&&t(5,s={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(h){ne[h?"unshift":"push"](()=>{o=h,t(0,o)})}return n.$$set=h=>{"filter"in h&&t(6,i=h.filter),"zoom"in h&&t(5,s=h.zoom),"presets"in h&&t(7,l=h.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof l<"u")&&d(),n.$$.dirty&1536&&typeof a<"u"&&r&&(t(9,r.data.datasets[0].data=a,r),r.update())},[o,u,f,c,_,s,i,l,d,r,a,g]}class _$ extends ve{constructor(e){super(),ye(this,e,h$,m$,be,{filter:6,zoom:5,presets:7,load:8})}get load(){return this.$$.ctx[8]}}function g$(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(s,l){w(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(s){s&&y(e)}}}function b$(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,{class:l=""}=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[s]||Prism.languages.javascript,s)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,s=a.language),"class"in a&&t(0,l=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[l,o,i,s]}class of extends ve{constructor(e){super(),ye(this,e,b$,g$,be,{content:2,language:3,class:0})}}function k$(n){let e,t,i,s,l;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){w(o,e,r),s||(l=[Oe(i=Re.call(null,e,n[3]?void 0:n[0])),Y(e,"click",tn(n[4]))],s=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Lt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&y(e),s=!1,Ee(l)}}}function y$(n,e,t){let{value:i=""}=e,{tooltip:s="Copy"}=e,{idleClasses:l="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 un(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,s=f.tooltip),"idleClasses"in f&&t(1,l=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[s,l,o,a,u,i,r]}class Oi extends ve{constructor(e){super(),ye(this,e,y$,k$,be,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function mp(n,e,t){const i=n.slice();i[16]=e[t];const s=i[1].data[i[16]];i[17]=s;const l=U.isEmpty(i[17]);i[18]=l;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function v$(n){let e,t,i,s,l,o,r,a=n[1].id+"",u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V;d=new Oi({props:{value:n[1].id}}),S=new Hk({props:{level:n[1].level}}),O=new Oi({props:{value:n[1].level}}),N=new jk({props:{date:n[1].created}}),F=new Oi({props:{value:n[1].created}});let Z=!n[4]&&hp(n),G=ce(n[5](n[1].data)),de=[];for(let ae=0;aeD(de[ae],1,1,()=>{de[ae]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=C(),o=b("td"),r=b("span"),u=W(a),f=C(),c=b("div"),H(d.$$.fragment),m=C(),_=b("tr"),g=b("td"),g.textContent="level",h=C(),k=b("td"),H(S.$$.fragment),$=C(),T=b("div"),H(O.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),H(N.$$.fragment),R=C(),z=b("div"),H(F.$$.fragment),B=C(),Z&&Z.c(),J=C();for(let ae=0;ae{Z=null}),re()):Z?(Z.p(ae,Ce),Ce&16&&M(Z,1)):(Z=hp(ae),Z.c(),M(Z,1),Z.m(t,J)),Ce&50){G=ce(ae[5](ae[1].data));let Be;for(Be=0;Be',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function hp(n){let e,t,i,s,l,o,r;const a=[T$,S$],u=[];function f(c,d){return c[1].message?0:1}return l=f(n),o=u[l]=a[l](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),s=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(s,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),u[l].m(s,null),r=!0},p(c,d){let m=l;l=f(c),l===m?u[l].p(c,d):(oe(),D(u[m],1,1,()=>{u[m]=null}),re(),o=u[l],o?o.p(c,d):(o=u[l]=a[l](c),o.c()),M(o,1),o.m(s,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&y(e),u[l].d()}}}function S$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function T$(n){let e,t=n[1].message+"",i,s,l,o,r;return o=new Oi({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),s=C(),l=b("div"),H(o.$$.fragment),p(e,"class","txt"),p(l,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),w(a,l,u),q(o,l,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&se(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&&(y(e),y(s),y(l)),j(o)}}}function $$(n){let e,t=n[17]+"",i,s=n[4]&&n[16]=="execTime"?"ms":"",l;return{c(){e=b("span"),i=W(t),l=W(s),p(e,"class","txt")},m(o,r){w(o,e,r),v(e,i),v(e,l)},p(o,r){r&2&&t!==(t=o[17]+"")&&se(i,t),r&18&&s!==(s=o[4]&&o[16]=="execTime"?"ms":"")&&se(l,s)},i:te,o:te,d(o){o&&y(e)}}}function C$(n){let e,t;return e=new of({props:{content:n[17],language:"html"}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=i[17]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function O$(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(s,l){w(s,e,l),v(e,i)},p(s,l){l&2&&t!==(t=s[17]+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function M$(n){let e,t;return e=new of({props:{content:JSON.stringify(n[17],null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=JSON.stringify(i[17],null,2)),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function E$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function _p(n){let e,t,i;return t=new Oi({props:{value:n[17]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.value=s[17]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function gp(n){let e,t,i,s=n[16]+"",l,o,r,a,u,f,c,d;const m=[E$,M$,O$,C$,$$],_=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=_[a]=m[a](n);let h=!n[18]&&_p(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),l=W(s),o=C(),r=b("td"),u.c(),f=C(),h&&h.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),x(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){w(k,e,S),v(e,t),v(t,i),v(t,l),v(e,o),v(e,r),_[a].m(r,null),v(r,f),h&&h.m(r,null),v(e,c),d=!0},p(k,S){(!d||S&2)&&s!==(s=k[16]+"")&&se(l,s),(!d||S&34)&&x(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?_[a].p(k,S):(oe(),D(_[$],1,1,()=>{_[$]=null}),re(),u=_[a],u?u.p(k,S):(u=_[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?h&&(oe(),D(h,1,1,()=>{h=null}),re()):h?(h.p(k,S),S&2&&M(h,1)):(h=_p(k),h.c(),M(h,1),h.m(r,null))},i(k){d||(M(u),M(h),d=!0)},o(k){D(u),D(h),d=!1},d(k){k&&y(e),_[a].d(),h&&h.d()}}}function D$(n){let e,t,i,s;const l=[w$,v$],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]=l[e](n)),{c(){t&&t.c(),i=ke()},m(a,u){~e&&o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(oe(),D(o[f],1,1,()=>{o[f]=null}),re()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),~e&&o[e].d(a)}}}function I$(n){let e;return{c(){e=b("h4"),e.textContent="Log details"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function L$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),s=b("i"),l=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(s,"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){w(u,e,f),w(u,t,f),w(u,i,f),v(i,s),v(i,l),v(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&&(y(e),y(t),y(i)),r=!1,Ee(a)}}}function A$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[L$],header:[I$],default:[D$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194330&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}const bp="log_view";function P$(n,e,t){let i;const s=wt();let l,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),_()}),l==null?void 0:l.show()}function u(){return he.cancelRequest(bp),l==null?void 0:l.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await he.logs.getOne($,{requestKey:bp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Mi(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){U.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function _(){s("show",o)}function g(){s("hide",o),t(1,o={})}const h=()=>u(),k=()=>m();function S($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,l,r,i,d,m,g,a,h,k,S]}class N$ extends ve{constructor(e){super(),ye(this,e,P$,A$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function R$(n,e,t){const i=n.slice();return i[1]=e[t],i}function F$(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function q$(n){let e,t,i,s=ce(wk),l=[];for(let o=0;o{"class"in s&&t(0,i=s.class)},[i]}class Hy extends ve{constructor(e){super(),ye(this,e,j$,q$,be,{class:0})}}function H$(n){let e,t,i,s,l,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[U$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[V$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[B$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[W$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){w(d,e,m),q(t,e,null),v(e,i),q(s,e,null),v(e,l),q(o,e,null),v(e,r),q(a,e,null),u=!0,f||(c=Y(e,"submit",it(n[7])),f=!0)},p(d,m){const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),t.$set(_);const g={};m&25165826&&(g.$$scope={dirty:m,ctx:d}),s.$set(g);const h={};m&25165826&&(h.$$scope={dirty:m,ctx:d}),o.$set(h);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(s.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(s.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),j(t),j(s),j(o),j(a),f=!1,c()}}}function z$(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function U$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),s=C(),l=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&2&&mt(l.value)!==c[1].logs.maxDays&&me(l,c[1].logs.maxDays)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function V$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return f=new Hy({}),{c(){e=b("label"),t=W("Min log level"),s=C(),l=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),H(f.$$.fragment),p(e,"for",i=n[23]),p(l,"type","number"),l.required=!0,p(l,"min","-100"),p(l,"max","100"),p(r,"class","help-block")},m(_,g){w(_,e,g),v(e,t),w(_,s,g),w(_,l,g),me(l,n[1].logs.minLevel),w(_,o,g),w(_,r,g),v(r,a),v(r,u),q(f,r,null),c=!0,d||(m=Y(l,"input",n[12]),d=!0)},p(_,g){(!c||g&8388608&&i!==(i=_[23]))&&p(e,"for",i),g&2&&mt(l.value)!==_[1].logs.minLevel&&me(l,_[1].logs.minLevel)},i(_){c||(M(f.$$.fragment,_),c=!0)},o(_){D(f.$$.fragment,_),c=!1},d(_){_&&(y(e),y(s),y(l),y(o),y(r)),j(f),d=!1,m()}}}function B$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function W$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Y$(n){let e,t,i,s;const l=[z$,H$],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function K$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function J$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),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])&&(s.disabled=o),f&8&&x(s,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Z$(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[J$],header:[K$],default:[Y$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeHide=s[15]),l&16777274&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function G$(n,e,t){let i,s;const l=wt(),o="logs_settings_"+U.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return _(),g(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function _(){Jt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await he.settings.getAll()||{};k(P)}catch(P){he.error(P)}t(4,u=!1)}async function h(){if(s){t(3,a=!0);try{const P=await he.settings.update(U.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),l("save",P)}catch(P){t(3,a=!1),he.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=mt(this.value),t(1,c)}function $(){c.logs.minLevel=mt(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){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,s=i!=JSON.stringify(c))},[m,c,r,a,u,s,o,h,d,f,i,S,$,T,O,E,L,I,A]}class X$ extends ve{constructor(e){super(),ye(this,e,G$,Z$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Q$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function kp(n){let e,t,i;function s(o){n[14](o)}let l={filter:n[1],presets:n[6]};return n[5]!==void 0&&(l.zoom=n[5]),e=new _$({props:l}),ne.push(()=>ge(e,"zoom",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yp(n){let e,t,i,s;function l(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 mS({props:r}),ne.push(()=>ge(e,"filter",l)),ne.push(()=>ge(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){s||(M(e.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function x$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Fr({}),u.$on("refresh",n[11]),_=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[Q$,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),h=new Rr({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),h.$on("submit",n[13]),S=new Hy({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=kp(n),R=yp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(_.$$.fragment),g=C(),H(h.$$.fragment),k=C(),H(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),p(s,"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){w(z,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),v(t,r),v(t,a),q(u,t,null),v(t,f),v(t,c),v(t,d),v(t,m),q(_,m,null),v(e,g),q(h,e,null),v(e,k),q(S,e,null),v(e,$),N.m(e,null),w(z,O,F),R.m(z,F),w(z,L,F),I=!0,A||(P=[Oe(Re.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&se(l,z[7]);const B={};F&100663300&&(B.$$scope={dirty:F,ctx:z}),_.$set(B);const J={};F&2&&(J.value=z[1]),h.$set(J),F&16&&be(T,T=z[4])?(oe(),D(N,1,1,te),re(),N=kp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&be(E,E=z[4])?(oe(),D(R,1,1,te),re(),R=yp(z),R.c(),M(R,1),R.m(L.parentNode,L)):R.p(z,F)},i(z){I||(M(u.$$.fragment,z),M(_.$$.fragment,z),M(h.$$.fragment,z),M(S.$$.fragment,z),M(N),M(R),I=!0)},o(z){D(u.$$.fragment,z),D(_.$$.fragment,z),D(h.$$.fragment,z),D(S.$$.fragment,z),D(N),D(R),I=!1},d(z){z&&(y(e),y(O),y(L)),j(u),j(_),j(h),j(S),N.d(z),R.d(z),A=!1,Ee(P)}}}function eC(n){let e,t,i,s,l,o;e=new si({props:{$$slots:{default:[x$]},$$scope:{ctx:n}}});let r={};i=new N$({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return l=new X$({props:a}),n[21](l),l.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(u,f){q(e,u,f),w(u,t,f),q(i,u,f),w(u,s,f),q(l,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={};l.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(l.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(l.$$.fragment,u),o=!1},d(u){u&&(y(t),y(s)),j(e,u),n[18](null),j(i,u),n[21](null),j(l,u)}}}const Wo="logId",vp="superuserRequests",wp="superuserLogRequests";function tC(n,e,t){var R;let i,s,l;Ge(n,zu,z=>t(22,s=z)),Ge(n,an,z=>t(7,l=z)),En(an,l="Logs",l);const o=new URLSearchParams(s);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(vp)||((R=window.localStorage)==null?void 0:R.getItem(wp)))<<0,m=d;function _(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[vp]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const h=()=>a==null?void 0:a.show(),k=()=>_();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ne[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Wo]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Wo]=null,U.replaceHashQueryParams(z)};function N(z){ne[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Wo)&&r&&r.show(o.get(Wo)),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(wp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,l,_,m,h,k,S,$,T,O,E,L,I,A,P,N]}class nC extends ve{constructor(e){super(),ye(this,e,tC,eC,be,{})}}function Sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Tp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Cp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function iC(n){let e,t=n[15].label+"",i,s,l,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),s=C(),p(e,"type","button"),p(e,"class","sidebar-item"),x(e,"active",n[5]===n[14])},m(a,u){w(a,e,u),v(e,i),v(e,s),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&se(i,t),u&40&&x(e,"active",n[5]===n[14])},d(a){a&&y(e),l=!1,o()}}}function lC(n){let e,t=n[15].label+"",i,s,l,o;return{c(){e=b("div"),i=W(t),s=C(),p(e,"class","sidebar-item disabled")},m(r,a){w(r,e,a),v(e,i),v(e,s),l||(o=Oe(Re.call(null,e,{position:"left",text:"Not enabled for the collection"})),l=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&se(i,t)},d(r){r&&y(e),l=!1,o()}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=i&&Cp();function r(f,c){return f[15].disabled?lC:iC}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),s=C(),u.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),o&&o.m(f,c),w(f,s,c),u.m(f,c),w(f,l,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=Cp(),o.c(),o.m(s.parentNode,s)):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(l.parentNode,l)))},d(f){f&&(y(t),y(s),y(l)),o&&o.d(f),u.d(f)}}}function Mp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:rC,then:oC,catch:sC,value:19,blocks:[,,,]};return yf(t=n[15].component,s),{c(){e=ke(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&yf(t,s)||bv(s,n,o)},i(l){i||(M(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];D(r)}i=!1},d(l){l&&y(e),s.block.d(l),s.token=null,s=null}}}function sC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function oC(n){Tp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(s,l){q(e,s,l),w(s,t,l),i=!0},p(s,l){Tp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(M(e.$$.fragment,s),i=!0)},o(s){D(e.$$.fragment,s),i=!1},d(s){s&&y(t),j(e,s)}}}function rC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Ep(n,e){let t,i,s,l=e[5]===e[14]&&Mp(e);return{key:n,first:null,c(){t=ke(),l&&l.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&M(l,1)):(l=Mp(e),l.c(),M(l,1),l.m(i.parentNode,i)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){s||(M(l),s=!0)},o(o){D(l),s=!1},d(o){o&&(y(t),y(i)),l&&l.d(o)}}}function aC(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ce(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function fC(n){let e,t,i={class:"docs-panel",$$slots:{footer:[uC],default:[aC]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function cC(n,e,t){const i={list:{label:"List/Search",component:$t(()=>import("./ListApiDocs-CcCzYz3p.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:$t(()=>import("./ViewApiDocs-B2y8Uo6-.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:$t(()=>import("./CreateApiDocs-lXFE62xH.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:$t(()=>import("./UpdateApiDocs-DkcacVoU.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:$t(()=>import("./DeleteApiDocs-CtgDyQsc.js"),[],import.meta.url)},realtime:{label:"Realtime",component:$t(()=>import("./RealtimeApiDocs-BHDoW4tn.js"),[],import.meta.url)},batch:{label:"Batch",component:$t(()=>import("./BatchApiDocs-DIiO-qIL.js"),[],import.meta.url)}},s={"list-auth-methods":{label:"List auth methods",component:$t(()=>import("./AuthMethodsDocs-Ded_AT2F.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:$t(()=>import("./AuthWithPasswordDocs-DhLB4CTX.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:$t(()=>import("./AuthWithOAuth2Docs-D0NUW2n8.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:$t(()=>import("./AuthWithOtpDocs-8gtiEr6v.js"),__vite__mapDeps([11,3]),import.meta.url)},refresh:{label:"Auth refresh",component:$t(()=>import("./AuthRefreshDocs-B7jzqxzk.js"),__vite__mapDeps([12,3]),import.meta.url)},verification:{label:"Verification",component:$t(()=>import("./VerificationDocs-BKpmlyO1.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:$t(()=>import("./PasswordResetDocs-BKbijaSo.js"),[],import.meta.url)},"email-change":{label:"Email change",component:$t(()=>import("./EmailChangeDocs-BH4CkQJs.js"),[],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function _(k){ne[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){Le.call(this,n,k)}function h(k){Le.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),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,l,r,i,u,d,m,_,g,h]}class dC extends ve{constructor(e){super(),ye(this,e,cC,fC,be,{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 pC=n=>({active:n&1}),Dp=n=>({active:n[0]});function Ip(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=b("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ft(l,s,o,o[14],i?Rt(s,o[14],r,null):qt(o[14]),null)},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,ht,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,ht,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),l&&l.d(o),o&&t&&t.end()}}}function mC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Dp);let f=n[0]&&Ip(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",it(n[17])),Y(t,"drop",it(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",it(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ft(u,a,c,c[14],l?Rt(a,c[14],d,pC):qt(c[14]),Dp),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&1)&&p(t,"aria-expanded",c[0]),(!l||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=Ip(c),f.c(),M(f,1),f.m(e,null)):f&&(oe(),D(f,1,1,()=>{f=null}),re()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&x(e,"active",c[0])},i(c){l||(M(u,c),M(f),l=!0)},o(c){D(u,c),D(f),l=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ee(r)}}}function hC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function _(){return!!f}function g(){S(),t(0,f=!0),l("expand")}function h(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?h():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()}}un(()=>()=>clearTimeout(r));function $(P){Le.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),l("drop",P))},E=P=>u&&l("dragstart",P),L=P=>{u&&(t(7,m=!0),l("dragenter",P))},I=P=>{u&&(t(7,m=!1),l("dragleave",P))};function A(P){ne[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,l,d,_,g,h,r,s,i,$,T,O,E,L,I,A]}class Ui extends ve{constructor(e){super(),ye(this,e,hC,mC,be,{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 Lp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Ap(n,e,t){const i=n.slice();return i[25]=e[t],i}function Pp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Pp(n);return{c(){e=b("label"),t=W("Subject"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[24]),p(l,"type","text"),p(l,"id",o=n[24]),p(l,"spellcheck","false"),l.required=!0},m(m,_){w(m,e,_),v(e,t),w(m,s,_),w(m,l,_),me(l,n[0].subject),w(m,r,_),c&&c.m(m,_),w(m,a,_),u||(f=Y(l,"input",n[14]),u=!0)},p(m,_){var g;_&16777216&&i!==(i=m[24])&&p(e,"for",i),_&16777216&&o!==(o=m[24])&&p(l,"id",o),_&1&&l.value!==m[0].subject&&me(l,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,_):(c=Pp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function gC(n){let e,t,i,s;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(l,o){w(l,e,o),me(e,n[0].body),i||(s=Y(e,"input",n[17]),i=!0)},p(l,o){o&16777216&&t!==(t=l[24])&&p(e,"id",t),o&1&&me(e,l[0].body)},i:te,o:te,d(l){l&&y(e),i=!1,s()}}}function bC(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(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,$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function Rp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Rp(n);return{c(){e=b("label"),t=W("Body (HTML)"),s=C(),o.c(),r=C(),m&&m.c(),a=ke(),p(e,"for",i=n[24])},m(g,h){w(g,e,h),v(e,t),w(g,s,h),c[l].m(g,h),w(g,r,h),m&&m.m(g,h),w(g,a,h),u=!0},p(g,h){var S;(!u||h&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=l;l=d(g),l===k?c[l].p(g,h):(oe(),D(c[k],1,1,()=>{c[k]=null}),re(),o=c[l],o?o.p(g,h):(o=c[l]=f[l](g),o.c()),M(o,1),o.m(r.parentNode,r)),((S=g[3])==null?void 0:S.length)>0?m?m.p(g,h):(m=Rp(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&&(y(e),y(s),y(r),y(a)),c[l].d(g),m&&m.d(g)}}}function yC(n){let e,t,i,s;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[_C,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[kC,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name=l[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function qp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function vC(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&qp();return{c(){e=b("div"),t=b("i"),i=C(),s=b("span"),l=W(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),v(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d&4&&se(l,c[2]),c[7]?f?d&128&&M(f,1):(f=qp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function wC(n){let e,t;const i=[n[9]];let s={$$slots:{header:[vC],default:[yC]},$$scope:{ctx:n}};for(let l=0;lt(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=jp,m=!1;function _(){c==null||c.expand()}function g(){c==null||c.collapse()}function h(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await $t(async()=>{const{default:R}=await import("./CodeEditor-oVf9mPjW.js");return{default:R}},__vite__mapDeps([13,1]),import.meta.url)).default),jp=d,t(6,m=!1))}function S(R){R=R.replace("*",""),U.copyToClipboard(R),Js(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ne[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Le.call(this,n,R)}function P(R){Le.call(this,n,R)}function N(R){Le.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Kt(R)),t(9,l=lt(e,s)),"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||Wn(r))},[u,r,a,f,c,d,m,i,S,l,_,g,h,o,$,T,O,E,L,I,A,P,N]}class TC extends ve{constructor(e){super(),ye(this,e,SC,wC,be,{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 $C(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),l=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,_){w(m,e,_),v(e,t),v(e,i),w(m,l,_),w(m,o,_),me(o,n[0]),w(m,a,_),w(m,u,_),v(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,_){_&8&&se(t,m[3]),_&64&&s!==(s=m[6])&&p(e,"for",s),_&64&&r!==(r=m[6])&&p(o,"id",r),_&1&&mt(o.value)!==m[0]&&me(o,m[0]),_&2&&x(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(l),y(o),y(a),y(u)),c=!1,Ee(d)}}}function CC(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[$C,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function OC(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=mt(this.value),t(0,l)}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,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class MC extends ve{constructor(e){super(),ye(this,e,OC,CC,be,{key:2,label:3,duration:0,secret:1})}}function Hp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function zp(n,e){let t,i,s,l,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 MC({props:f}),ne.push(()=>ge(i,"duration",a)),ne.push(()=>ge(i,"secret",u)),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){w(c,t,d),q(i,t,null),v(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),!s&&d&3&&(s=!0,m.duration=e[0][e[8].key].duration,$e(()=>s=!1)),!l&&d&3&&(l=!0,m.secret=e[0][e[8].key].secret,$e(()=>l=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),j(i)}}}function EC(n){let e,t=[],i=new Map,s,l=ce(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function DC(n){let e,t,i,s,l,o=n[2]&&Up();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),s=C(),o&&o.c(),l=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),o&&o.m(r,a),w(r,l,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Up(),o.c(),M(o,1),o.m(l.parentNode,l)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},d(r){r&&(y(e),y(t),y(i),y(s),y(l)),o&&o.d(r)}}}function IC(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[DC],default:[EC]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2055&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function LC(n,e,t){let i,s,l;Ge(n,Tn,c=>t(4,l=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,s=a(l))},[o,r,s,i,l,u,f]}class AC extends ve{constructor(e){super(),ye(this,e,LC,IC,be,{collection:0})}}const PC=n=>({isSuperuserOnly:n&2048}),Vp=n=>({isSuperuserOnly:n[11]}),NC=n=>({isSuperuserOnly:n&2048}),Bp=n=>({isSuperuserOnly:n[11]}),RC=n=>({isSuperuserOnly:n&2048}),Wp=n=>({isSuperuserOnly:n[11]});function FC(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[jC,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2064&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),s&8&&(l.name=i[3]),s&2362855&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Yp(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(s,"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){w(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=Y(e,"click",n[13]),l=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),l=!1,o()}}}function Kp(n){let e,t,i,s,l,o,r,a=!n[10]&&Jp();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){w(u,e,f),a&&a.m(e,null),v(e,t),v(e,i),l=!0,o||(r=Y(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Jp(),a.c(),a.m(e,t)),(!l||f&1024)&&(e.disabled=u[10]),(!l||f&1024)&&p(e,"aria-hidden",u[10])},i(u){l||(u&&tt(()=>{l&&(s||(s=qe(e,Ct,{duration:150,start:.98},!0)),s.run(1))}),l=!0)},o(u){u&&(s||(s=qe(e,Ct,{duration:150,start:.98},!1)),s.run(0)),l=!1},d(u){u&&y(e),a&&a.d(),u&&s&&s.end(),o=!1,r()}}}function Jp(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function jC(n){let e,t,i,s,l,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,_,g,h,k,S,$,T,O;const E=n[15].beforeLabel,L=Nt(E,n,n[18],Wp),I=n[15].afterLabel,A=Nt(I,n,n[18],Bp);let P=n[5]&&!n[11]&&Yp(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=Ht(R,z(n)),n[16](m),ne.push(()=>ge(m,"value",N)));let F=n[5]&&n[11]&&Kp(n);const B=n[15].default,J=Nt(B,n,n[18],Vp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),s=b("span"),l=W(n[2]),o=C(),a=W(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&H(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(s,"class","txt"),x(s,"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){w(V,e,Z),v(e,t),L&&L.m(t,null),v(t,i),v(t,s),v(s,l),v(s,o),v(s,a),v(t,u),A&&A.m(t,null),v(t,f),P&&P.m(t,null),v(e,d),m&&q(m,e,null),v(e,g),F&&F.m(e,null),w(V,k,Z),w(V,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(h=Re.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&&(!$||Z&264192)&&Ft(L,E,V,V[18],$?Rt(E,V[18],Z,RC):qt(V[18]),Wp),(!$||Z&4)&&se(l,V[2]),(!$||Z&2048)&&r!==(r=V[11]?"- Superusers only":"")&&se(a,r),(!$||Z&2048)&&x(s,"txt-hint",V[11]),A&&A.p&&(!$||Z&264192)&&Ft(A,I,V,V[18],$?Rt(I,V[18],Z,NC):qt(V[18]),Bp),V[5]&&!V[11]?P?P.p(V,Z):(P=Yp(V),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=V[21]))&&p(t,"for",c),Z&256&&R!==(R=V[8])){if(m){oe();const G=m;D(G.$$.fragment,1,0,()=>{j(G,1)}),re()}R?(m=Ht(R,z(V)),V[16](m),ne.push(()=>ge(m,"value",N)),H(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]),!_&&Z&1&&(_=!0,G.value=V[0],$e(()=>_=!1)),m.$set(G)}V[5]&&V[11]?F?(F.p(V,Z),Z&2080&&M(F,1)):(F=Kp(V),F.c(),M(F,1),F.m(e,null)):F&&(oe(),D(F,1,1,()=>{F=null}),re()),h&&Lt(h.update)&&Z&2&&h.update.call(null,V[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Ft(J,B,V,V[18],$?Rt(B,V[18],Z,PC):qt(V[18]),Vp)},i(V){$||(M(L,V),M(A,V),m&&M(m.$$.fragment,V),M(F),M(J,V),$=!0)},o(V){D(L,V),D(A,V),m&&D(m.$$.fragment,V),D(F),D(J,V),$=!1},d(V){V&&(y(e),y(k),y(S)),L&&L.d(V),A&&A.d(V),P&&P.d(),n[16](null),m&&j(m),F&&F.d(),J&&J.d(V),T=!1,O()}}}function HC(n){let e,t,i,s;const l=[qC,FC],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}let Zp;function zC(n,e,t){let i,s,{$$slots:l={},$$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:_="Leave empty to grant everyone access..."}=e,g=null,h=null,k=Zp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await $t(async()=>{const{default:I}=await import("./FilterAutocompleteInput-OQbEqM-k.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Zp=k,t(9,S=!1))}async function T(){t(0,a=h||""),await _n(),g==null||g.focus()}function O(){h=a,t(0,a=null)}function E(I){ne[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,_=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,s=d||r.system)},[a,r,u,f,c,m,_,g,k,S,s,i,T,O,d,l,E,L,o]}class sl extends ve{constructor(e){super(),ye(this,e,zC,HC,be,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function UC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(l,"class","txt"),p(s,"for",o=n[5])},m(u,f){w(u,e,f),e.checked=n[0].mfa.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function VC(n){let e,t,i,s,l;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to - email != ''.`,s=C(),l=b("p"),l.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(s),y(l))}}}function BC(n){let e,t,i,s,l,o,r,a,u;s=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[UC,({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:[VC]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new sl({props:c}),ne.push(()=>ge(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

Multi-factor authentication (MFA) requires the user to authenticate with any 2 different auth + */const to=n=>n&&n.enabled&&n.modifierKey,My=(n,e)=>n&&e[n+"Key"],lf=(n,e)=>n&&!e[n+"Key"];function ul(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 wa(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 C6(n,e){let t;return function(){return clearTimeout(t),t=setTimeout(n,e),e}}function O6({x:n,y:e},t){const i=t.scales,s=Object.keys(i);for(let l=0;l=o.top&&e<=o.bottom&&n>=o.left&&n<=o.right)return o}return null}function Ey(n,e,t){const{mode:i="xy",scaleMode:s,overScaleMode:l}=n||{},o=O6(e,t),r=wa(i,t),a=wa(s,t);if(l){const f=wa(l,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 gt(t.scales,function(f){r[f.axis]&&u.push(f)}),u}const du=new WeakMap;function Zt(n){let e=du.get(n);return e||(e={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},du.set(n,e)),e}function M6(n){du.delete(n)}function Dy(n,e,t,i){const s=Math.max(0,Math.min(1,(n-e)/t||0)),l=1-s;return{min:i*s,max:i*l}}function Iy(n,e){const t=n.isHorizontal()?e.x:e.y;return n.getValueForPixel(t)}function Ly(n,e,t){const i=n.max-n.min,s=i*(e-1),l=Iy(n,t);return Dy(l,n.min,i,s)}function E6(n,e,t){const i=Iy(n,t);if(i===void 0)return{min:n.min,max:n.max};const s=Math.log10(n.min),l=Math.log10(n.max),o=Math.log10(i),r=l-s,a=r*(e-1),u=Dy(o,s,r,a);return{min:Math.pow(10,s+u.min),max:Math.pow(10,l-u.max)}}function D6(n,e){return e&&(e[n.id]||e[n.axis])||{}}function ep(n,e,t,i,s){let l=t[i];if(l==="original"){const o=n.originalScaleLimits[e.id][i];l=Et(o.options,o.scale)}return Et(l,s)}function I6(n,e,t){const i=n.getValueForPixel(e),s=n.getValueForPixel(t);return{min:Math.min(i,s),max:Math.max(i,s)}}function L6(n,{min:e,max:t,minLimit:i,maxLimit:s},l){const o=(n-t+e)/2;e-=o,t+=o;const r=l.min.options??l.min.scale,a=l.max.options??l.max.scale,u=n/1e6;return Ml(e,r,u)&&(e=r),Ml(t,a,u)&&(t=a),es&&(t=s,e=Math.max(s-n,i)),{min:e,max:t}}function Rl(n,{min:e,max:t},i,s=!1){const l=Zt(n.chart),{options:o}=n,r=D6(n,i),{minRange:a=0}=r,u=ep(l,n,r,"min",-1/0),f=ep(l,n,r,"max",1/0);if(s==="pan"&&(ef))return!0;const c=n.max-n.min,d=s?Math.max(t-e,a):c;if(s&&d===a&&c<=a)return!0;const m=L6(d,{min:e,max:t,minLimit:u,maxLimit:f},l.originalScaleLimits[n.id]);return o.min=m.min,o.max=m.max,l.updatedScaleLimits[n.id]=m,n.parse(m.min)!==n.min||n.parse(m.max)!==n.max}function A6(n,e,t,i){const s=Ly(n,e,t),l={min:n.min+s.min,max:n.max-s.max};return Rl(n,l,i,!0)}function P6(n,e,t,i){const s=E6(n,e,t);return Rl(n,s,i,!0)}function N6(n,e,t,i){Rl(n,I6(n,e,t),i,!0)}const tp=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function R6(n){const t=n.getLabels().length-1;n.min>0&&(n.min-=1),n.maxa&&(l=Math.max(0,l-u),o=r===1?l:l+r,f=l===0),Rl(n,{min:l,max:o},t)||f}const H6={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 Ay(n,e,t,i=!1){const{min:s,max:l,options:o}=n,r=o.time&&o.time.round,a=H6[r]||0,u=n.getValueForPixel(n.getPixelForValue(s+a)-e),f=n.getValueForPixel(n.getPixelForValue(l+a)-e);return isNaN(u)||isNaN(f)?!0:Rl(n,{min:u,max:f},t,i?"pan":!1)}function np(n,e,t){return Ay(n,e,t,!0)}const pu={category:F6,default:A6,logarithmic:P6},mu={default:N6},hu={category:j6,default:Ay,logarithmic:np,timeseries:np};function z6(n,e,t){const{id:i,options:{min:s,max:l}}=n;if(!e[i]||!t[i])return!0;const o=t[i];return o.min!==s||o.max!==l}function ip(n,e){gt(n,(t,i)=>{e[i]||delete n[i]})}function ps(n,e){const{scales:t}=n,{originalScaleLimits:i,updatedScaleLimits:s}=e;return gt(t,function(l){z6(l,i,s)&&(i[l.id]={min:{scale:l.min,options:l.options.min},max:{scale:l.max,options:l.options.max}})}),ip(i,t),ip(s,t),i}function lp(n,e,t,i){const s=pu[n.type]||pu.default;ft(s,[n,e,t,i])}function sp(n,e,t,i){const s=mu[n.type]||mu.default;ft(s,[n,e,t,i])}function U6(n){const e=n.chartArea;return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function sf(n,e,t="none",i="api"){const{x:s=1,y:l=1,focalPoint:o=U6(n)}=typeof e=="number"?{x:e,y:e}:e,r=Zt(n),{options:{limits:a,zoom:u}}=r;ps(n,r);const f=s!==1,c=l!==1,d=Ey(u,o,n);gt(d||n.scales,function(m){m.isHorizontal()&&f?lp(m,s,o,a):!m.isHorizontal()&&c&&lp(m,l,o,a)}),n.update(t),ft(u.onZoom,[{chart:n,trigger:i}])}function Py(n,e,t,i="none",s="api"){const l=Zt(n),{options:{limits:o,zoom:r}}=l,{mode:a="xy"}=r;ps(n,l);const u=ul(a,"x",n),f=ul(a,"y",n);gt(n.scales,function(c){c.isHorizontal()&&u?sp(c,e.x,t.x,o):!c.isHorizontal()&&f&&sp(c,e.y,t.y,o)}),n.update(i),ft(r.onZoom,[{chart:n,trigger:s}])}function V6(n,e,t,i="none",s="api"){var r;const l=Zt(n);ps(n,l);const o=n.scales[e];Rl(o,t,void 0,!0),n.update(i),ft((r=l.options.zoom)==null?void 0:r.onZoom,[{chart:n,trigger:s}])}function B6(n,e="default"){const t=Zt(n),i=ps(n,t);gt(n.scales,function(s){const l=s.options;i[s.id]?(l.min=i[s.id].min.options,l.max=i[s.id].max.options):(delete l.min,delete l.max),delete t.updatedScaleLimits[s.id]}),n.update(e),ft(t.options.zoom.onZoomComplete,[{chart:n}])}function W6(n,e){const t=n.originalScaleLimits[e];if(!t)return;const{min:i,max:s}=t;return Et(s.options,s.scale)-Et(i.options,i.scale)}function Y6(n){const e=Zt(n);let t=1,i=1;return gt(n.scales,function(s){const l=W6(e,s.id);if(l){const o=Math.round(l/(s.max-s.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function op(n,e,t,i){const{panDelta:s}=i,l=s[n.id]||0;rl(l)===rl(e)&&(e+=l);const o=hu[n.type]||hu.default;ft(o,[n,e,t])?s[n.id]=0:s[n.id]=e}function Ny(n,e,t,i="none"){const{x:s=0,y:l=0}=typeof e=="number"?{x:e,y:e}:e,o=Zt(n),{options:{pan:r,limits:a}}=o,{onPan:u}=r||{};ps(n,o);const f=s!==0,c=l!==0;gt(t||n.scales,function(d){d.isHorizontal()&&f?op(d,s,a,o):!d.isHorizontal()&&c&&op(d,l,a,o)}),n.update(i),ft(u,[{chart:n}])}function Ry(n){const e=Zt(n);ps(n,e);const t={};for(const i of Object.keys(n.scales)){const{min:s,max:l}=e.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:s.scale,max:l.scale}}return t}function K6(n){const e=Zt(n),t={};for(const i of Object.keys(n.scales))t[i]=e.updatedScaleLimits[i];return t}function J6(n){const e=Ry(n);for(const t of Object.keys(n.scales)){const{min:i,max:s}=e[t];if(i!==void 0&&n.scales[t].min!==i||s!==void 0&&n.scales[t].max!==s)return!0}return!1}function rp(n){const e=Zt(n);return e.panning||e.dragging}const ap=(n,e,t)=>Math.min(t,Math.max(e,n));function Nn(n,e){const{handlers:t}=Zt(n),i=t[e];i&&i.target&&(i.target.removeEventListener(e,i),delete t[e])}function Hs(n,e,t,i){const{handlers:s,options:l}=Zt(n),o=s[t];if(o&&o.target===e)return;Nn(n,t),s[t]=a=>i(n,a,l),s[t].target=e;const r=t==="wheel"?!1:void 0;e.addEventListener(t,s[t],{passive:r})}function Z6(n,e){const t=Zt(n);t.dragStart&&(t.dragging=!0,t.dragEnd=e,n.update("none"))}function G6(n,e){const t=Zt(n);!t.dragStart||e.key!=="Escape"||(Nn(n,"keydown"),t.dragging=!1,t.dragStart=t.dragEnd=null,n.update("none"))}function _u(n,e){if(n.target!==e.canvas){const t=e.canvas.getBoundingClientRect();return{x:n.clientX-t.left,y:n.clientY-t.top}}return vi(n,e)}function Fy(n,e,t){const{onZoomStart:i,onZoomRejected:s}=t;if(i){const l=_u(e,n);if(ft(i,[{chart:n,event:e,point:l}])===!1)return ft(s,[{chart:n,event:e}]),!1}}function X6(n,e){if(n.legend){const l=vi(e,n);if(ss(l,n.legend))return}const t=Zt(n),{pan:i,zoom:s={}}=t.options;if(e.button!==0||My(to(i),e)||lf(to(s.drag),e))return ft(s.onZoomRejected,[{chart:n,event:e}]);Fy(n,e,s)!==!1&&(t.dragStart=e,Hs(n,n.canvas.ownerDocument,"mousemove",Z6),Hs(n,window.document,"keydown",G6))}function Q6({begin:n,end:e},t){let i=e.x-n.x,s=e.y-n.y;const l=Math.abs(i/s);l>t?i=Math.sign(i)*Math.abs(s*t):l=0?2-1/(1-l):1+l,r={x:o,y:o,focalPoint:{x:e.clientX-s.left,y:e.clientY-s.top}};sf(n,r,"zoom","wheel"),ft(t,[{chart:n}])}function i$(n,e,t,i){t&&(Zt(n).handlers[e]=C6(()=>ft(t,[{chart:n}]),i))}function l$(n,e){const t=n.canvas,{wheel:i,drag:s,onZoomComplete:l}=e.zoom;i.enabled?(Hs(n,t,"wheel",n$),i$(n,"onZoomComplete",l,250)):Nn(n,"wheel"),s.enabled?(Hs(n,t,"mousedown",X6),Hs(n,t.ownerDocument,"mouseup",e$)):(Nn(n,"mousedown"),Nn(n,"mousemove"),Nn(n,"mouseup"),Nn(n,"keydown"))}function s$(n){Nn(n,"mousedown"),Nn(n,"mousemove"),Nn(n,"mouseup"),Nn(n,"wheel"),Nn(n,"click"),Nn(n,"keydown")}function o$(n,e){return function(t,i){const{pan:s,zoom:l={}}=e.options;if(!s||!s.enabled)return!1;const o=i&&i.srcEvent;return o&&!e.panning&&i.pointerType==="mouse"&&(lf(to(s),o)||My(to(l.drag),o))?(ft(s.onPanRejected,[{chart:n,event:i}]),!1):!0}}function r$(n,e){const t=Math.abs(n.clientX-e.clientX),i=Math.abs(n.clientY-e.clientY),s=t/i;let l,o;return s>.3&&s<1.7?l=o=!0:t>i?l=!0:o=!0,{x:l,y:o}}function jy(n,e,t){if(e.scale){const{center:i,pointers:s}=t,l=1/e.scale*t.scale,o=t.target.getBoundingClientRect(),r=r$(s[0],s[1]),a=e.options.zoom.mode,u={x:r.x&&ul(a,"x",n)?l:1,y:r.y&&ul(a,"y",n)?l:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}};sf(n,u,"zoom","pinch"),e.scale=t.scale}}function a$(n,e,t){if(e.options.zoom.pinch.enabled){const i=vi(t,n);ft(e.options.zoom.onZoomStart,[{chart:n,event:t,point:i}])===!1?(e.scale=null,ft(e.options.zoom.onZoomRejected,[{chart:n,event:t}])):e.scale=1}}function u$(n,e,t){e.scale&&(jy(n,e,t),e.scale=null,ft(e.options.zoom.onZoomComplete,[{chart:n}]))}function Hy(n,e,t){const i=e.delta;i&&(e.panning=!0,Ny(n,{x:t.deltaX-i.x,y:t.deltaY-i.y},e.panScales),e.delta={x:t.deltaX,y:t.deltaY})}function f$(n,e,t){const{enabled:i,onPanStart:s,onPanRejected:l}=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(ft(s,[{chart:n,event:t,point:r}])===!1)return ft(l,[{chart:n,event:t}]);e.panScales=Ey(e.options.pan,r,n),e.delta={x:0,y:0},Hy(n,e,t)}function c$(n,e){e.delta=null,e.panning&&(e.panning=!1,e.filterNextClick=!0,ft(e.options.pan.onPanComplete,[{chart:n}]))}const gu=new WeakMap;function fp(n,e){const t=Zt(n),i=n.canvas,{pan:s,zoom:l}=e,o=new js.Manager(i);l&&l.pinch.enabled&&(o.add(new js.Pinch),o.on("pinchstart",r=>a$(n,t,r)),o.on("pinch",r=>jy(n,t,r)),o.on("pinchend",r=>u$(n,t,r))),s&&s.enabled&&(o.add(new js.Pan({threshold:s.threshold,enable:o$(n,t)})),o.on("panstart",r=>f$(n,t,r)),o.on("panmove",r=>Hy(n,t,r)),o.on("panend",()=>c$(n,t))),gu.set(n,o)}function cp(n){const e=gu.get(n);e&&(e.remove("pinchstart"),e.remove("pinch"),e.remove("pinchend"),e.remove("panstart"),e.remove("pan"),e.remove("panend"),e.destroy(),gu.delete(n))}function d$(n,e){var o,r,a,u;const{pan:t,zoom:i}=n,{pan:s,zoom:l}=e;return((r=(o=i==null?void 0:i.zoom)==null?void 0:o.pinch)==null?void 0:r.enabled)!==((u=(a=l==null?void 0:l.zoom)==null?void 0:a.pinch)==null?void 0:u.enabled)||(t==null?void 0:t.enabled)!==(s==null?void 0:s.enabled)||(t==null?void 0:t.threshold)!==(s==null?void 0:s.threshold)}var p$="2.2.0";function Bo(n,e,t){const i=t.zoom.drag,{dragStart:s,dragEnd:l}=Zt(n);if(i.drawTime!==e||!l)return;const{left:o,top:r,width:a,height:u}=qy(n,t.zoom.mode,{dragStart:s,dragEnd:l},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 m$={id:"zoom",version:p$,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=Zt(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)."),js&&fp(n,t),n.pan=(s,l,o)=>Ny(n,s,l,o),n.zoom=(s,l)=>sf(n,s,l),n.zoomRect=(s,l,o)=>Py(n,s,l,o),n.zoomScale=(s,l,o)=>V6(n,s,l,o),n.resetZoom=s=>B6(n,s),n.getZoomLevel=()=>Y6(n),n.getInitialScaleBounds=()=>Ry(n),n.getZoomedScaleBounds=()=>K6(n),n.isZoomedOrPanned=()=>J6(n),n.isZoomingOrPanning=()=>rp(n)},beforeEvent(n,{event:e}){if(rp(n))return!1;if(e.type==="click"||e.type==="mouseup"){const t=Zt(n);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(n,e,t){const i=Zt(n),s=i.options;i.options=t,d$(s,t)&&(cp(n),fp(n,t)),l$(n,t)},beforeDatasetsDraw(n,e,t){Bo(n,"beforeDatasetsDraw",t)},afterDatasetsDraw(n,e,t){Bo(n,"afterDatasetsDraw",t)},beforeDraw(n,e,t){Bo(n,"beforeDraw",t)},afterDraw(n,e,t){Bo(n,"afterDraw",t)},stop:function(n){s$(n),js&&cp(n),M6(n)},panFunctions:hu,zoomFunctions:pu,zoomRectFunctions:mu};function dp(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-kfnurg")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Ct,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&y(e),s&&t&&t.end()}}}function pp(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(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function h$(n){let e,t,i,s,l,o=n[1]==1?"log":"logs",r,a,u,f,c,d,m,h=n[2]&&dp(),g=n[3]&&pp(n);return{c(){e=b("div"),t=b("div"),i=W("Found "),s=W(n[1]),l=C(),r=W(o),a=C(),h&&h.c(),u=C(),f=b("canvas"),c=C(),g&&g.c(),p(t,"class","total-logs entrance-right svelte-kfnurg"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-kfnurg"),p(e,"class","chart-wrapper svelte-kfnurg"),x(e,"loading",n[2])},m(_,k){w(_,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(t,r),v(e,a),h&&h.m(e,null),v(e,u),v(e,f),n[11](f),v(e,c),g&&g.m(e,null),d||(m=Y(f,"dblclick",n[4]),d=!0)},p(_,[k]){k&2&&se(s,_[1]),k&2&&o!==(o=_[1]==1?"log":"logs")&&se(r,o),k&4&&x(t,"hidden",_[2]),_[2]?h?k&4&&M(h,1):(h=dp(),h.c(),M(h,1),h.m(e,u)):h&&(oe(),D(h,1,1,()=>{h=null}),re()),_[3]?g?g.p(_,k):(g=pp(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k&4&&x(e,"loading",_[2])},i(_){M(h)},o(_){D(h)},d(_){_&&y(e),h&&h.d(),n[11](null),g&&g.d(),d=!1,m()}}}function _$(n,e,t){let{filter:i=""}=e,{zoom:s={}}=e,{presets:l=""}=e,o,r,a=[],u=0,f=!1,c=!1;async function d(){t(2,f=!0);const _=[l,U.normalizeLogsFilter(i)].filter(Boolean).map(k=>"("+k+")").join("&&");return he.logs.getStats({filter:_}).then(k=>{m(),k=U.toArray(k);for(let S of k)a.push({x:new Date(S.date),y:S.total}),t(1,u+=S.total)}).catch(k=>{k!=null&&k.isAbort||(m(),console.warn(k),he.error(k,!_||(k==null?void 0:k.status)!=400))}).finally(()=>{t(2,f=!1)})}function m(){t(10,a=[]),t(1,u=0)}function h(){r==null||r.resetZoom()}un(()=>(wi.register(el,sr,nr,cu,eo,u6,g6),wi.register(m$),t(9,r=new wi(o,{type:"line",data:{datasets:[{label:"Total requests",data:a,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:_=>{var k;return(k=_.tick)!=null&&k.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:_=>{var k;return(k=_.tick)!=null&&k.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1},zoom:{enabled:!0,zoom:{mode:"x",pinch:{enabled:!0},drag:{enabled:!0,backgroundColor:"rgba(255, 99, 132, 0.2)",borderWidth:0,threshold:10},limits:{x:{minRange:1e8},y:{minRange:1e8}},onZoomComplete:({chart:_})=>{t(3,c=_.isZoomedOrPanned()),c?(t(5,s.min=U.formatToUTCDate(_.scales.x.min,"yyyy-MM-dd HH")+":00:00.000Z",s),t(5,s.max=U.formatToUTCDate(_.scales.x.max,"yyyy-MM-dd HH")+":59:59.999Z",s)):(s.min||s.max)&&t(5,s={})}}}}}})),()=>r==null?void 0:r.destroy()));function g(_){ne[_?"unshift":"push"](()=>{o=_,t(0,o)})}return n.$$set=_=>{"filter"in _&&t(6,i=_.filter),"zoom"in _&&t(5,s=_.zoom),"presets"in _&&t(7,l=_.presets)},n.$$.update=()=>{n.$$.dirty&192&&(typeof i<"u"||typeof l<"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,s,i,l,d,r,a,g]}class g$ extends ve{constructor(e){super(),ye(this,e,_$,h$,be,{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(s,l){w(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:te,o:te,d(s){s&&y(e)}}}function k$(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,{class:l=""}=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[s]||Prism.languages.javascript,s)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,s=a.language),"class"in a&&t(0,l=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[l,o,i,s]}class of extends ve{constructor(e){super(),ye(this,e,k$,b$,be,{content:2,language:3,class:0})}}function y$(n){let e,t,i,s,l;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){w(o,e,r),s||(l=[Oe(i=Re.call(null,e,n[3]?void 0:n[0])),Y(e,"click",tn(n[4]))],s=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Lt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:te,o:te,d(o){o&&y(e),s=!1,Ee(l)}}}function v$(n,e,t){let{value:i=""}=e,{tooltip:s="Copy"}=e,{idleClasses:l="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 un(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,s=f.tooltip),"idleClasses"in f&&t(1,l=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[s,l,o,a,u,i,r]}class Oi extends ve{constructor(e){super(),ye(this,e,v$,y$,be,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function mp(n,e,t){const i=n.slice();i[16]=e[t];const s=i[1].data[i[16]];i[17]=s;const l=U.isEmpty(i[17]);i[18]=l;const o=!i[18]&&i[17]!==null&&typeof i[17]=="object";return i[19]=o,i}function w$(n){let e,t,i,s,l,o,r,a=n[1].id+"",u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V;d=new Oi({props:{value:n[1].id}}),S=new zk({props:{level:n[1].level}}),O=new Oi({props:{value:n[1].level}}),N=new Hk({props:{date:n[1].created}}),F=new Oi({props:{value:n[1].created}});let Z=!n[4]&&hp(n),G=ce(n[5](n[1].data)),de=[];for(let ae=0;aeD(de[ae],1,1,()=>{de[ae]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=C(),o=b("td"),r=b("span"),u=W(a),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("tr"),g=b("td"),g.textContent="level",_=C(),k=b("td"),H(S.$$.fragment),$=C(),T=b("div"),H(O.$$.fragment),E=C(),L=b("tr"),I=b("td"),I.textContent="created",A=C(),P=b("td"),H(N.$$.fragment),R=C(),z=b("div"),H(F.$$.fragment),B=C(),Z&&Z.c(),J=C();for(let ae=0;ae{Z=null}),re()):Z?(Z.p(ae,Ce),Ce&16&&M(Z,1)):(Z=hp(ae),Z.c(),M(Z,1),Z.m(t,J)),Ce&50){G=ce(ae[5](ae[1].data));let Be;for(Be=0;Be',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function hp(n){let e,t,i,s,l,o,r;const a=[$$,T$],u=[];function f(c,d){return c[1].message?0:1}return l=f(n),o=u[l]=a[l](n),{c(){e=b("tr"),t=b("td"),t.textContent="message",i=C(),s=b("td"),o.c(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),p(s,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),u[l].m(s,null),r=!0},p(c,d){let m=l;l=f(c),l===m?u[l].p(c,d):(oe(),D(u[m],1,1,()=>{u[m]=null}),re(),o=u[l],o?o.p(c,d):(o=u[l]=a[l](c),o.c()),M(o,1),o.m(s,null))},i(c){r||(M(o),r=!0)},o(c){D(o),r=!1},d(c){c&&y(e),u[l].d()}}}function T$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function $$(n){let e,t=n[1].message+"",i,s,l,o,r;return o=new Oi({props:{value:n[1].message}}),{c(){e=b("span"),i=W(t),s=C(),l=b("div"),H(o.$$.fragment),p(e,"class","txt"),p(l,"class","copy-icon-wrapper svelte-1c23bpt")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),w(a,l,u),q(o,l,null),r=!0},p(a,u){(!r||u&2)&&t!==(t=a[1].message+"")&&se(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&&(y(e),y(s),y(l)),j(o)}}}function C$(n){let e,t=n[17]+"",i,s=n[4]&&n[16]=="execTime"?"ms":"",l;return{c(){e=b("span"),i=W(t),l=W(s),p(e,"class","txt")},m(o,r){w(o,e,r),v(e,i),v(e,l)},p(o,r){r&2&&t!==(t=o[17]+"")&&se(i,t),r&18&&s!==(s=o[4]&&o[16]=="execTime"?"ms":"")&&se(l,s)},i:te,o:te,d(o){o&&y(e)}}}function O$(n){let e,t;return e=new of({props:{content:n[17],language:"html"}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=i[17]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function M$(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(s,l){w(s,e,l),v(e,i)},p(s,l){l&2&&t!==(t=s[17]+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function E$(n){let e,t;return e=new of({props:{content:JSON.stringify(n[17],null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.content=JSON.stringify(i[17],null,2)),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function D$(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function _p(n){let e,t,i;return t=new Oi({props:{value:n[17]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","copy-icon-wrapper svelte-1c23bpt")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.value=s[17]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function gp(n){let e,t,i,s=n[16]+"",l,o,r,a,u,f,c,d;const m=[D$,E$,M$,O$,C$],h=[];function g(k,S){return k[18]?0:k[19]?1:k[16]=="error"?2:k[16]=="details"?3:4}a=g(n),u=h[a]=m[a](n);let _=!n[18]&&_p(n);return{c(){e=b("tr"),t=b("td"),i=W("data."),l=W(s),o=C(),r=b("td"),u.c(),f=C(),_&&_.c(),c=C(),p(t,"class","min-width txt-hint txt-bold svelte-1c23bpt"),x(t,"v-align-top",n[19]),p(r,"class","svelte-1c23bpt"),p(e,"class","svelte-1c23bpt")},m(k,S){w(k,e,S),v(e,t),v(t,i),v(t,l),v(e,o),v(e,r),h[a].m(r,null),v(r,f),_&&_.m(r,null),v(e,c),d=!0},p(k,S){(!d||S&2)&&s!==(s=k[16]+"")&&se(l,s),(!d||S&34)&&x(t,"v-align-top",k[19]);let $=a;a=g(k),a===$?h[a].p(k,S):(oe(),D(h[$],1,1,()=>{h[$]=null}),re(),u=h[a],u?u.p(k,S):(u=h[a]=m[a](k),u.c()),M(u,1),u.m(r,f)),k[18]?_&&(oe(),D(_,1,1,()=>{_=null}),re()):_?(_.p(k,S),S&2&&M(_,1)):(_=_p(k),_.c(),M(_,1),_.m(r,null))},i(k){d||(M(u),M(_),d=!0)},o(k){D(u),D(_),d=!1},d(k){k&&y(e),h[a].d(),_&&_.d()}}}function I$(n){let e,t,i,s;const l=[S$,w$],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]=l[e](n)),{c(){t&&t.c(),i=ke()},m(a,u){~e&&o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(oe(),D(o[f],1,1,()=>{o[f]=null}),re()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),~e&&o[e].d(a)}}}function L$(n){let e;return{c(){e=b("h4"),e.textContent="Log details"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function A$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),e.innerHTML='Close',t=C(),i=b("button"),s=b("i"),l=C(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(s,"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){w(u,e,f),w(u,t,f),w(u,i,f),v(i,s),v(i,l),v(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&&(y(e),y(t),y(i)),r=!1,Ee(a)}}}function P$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[A$],header:[L$],default:[I$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("hide",n[7]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194330&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}const bp="log_view";function N$(n,e,t){let i;const s=wt();let l,o={},r=!1;function a($){return f($).then(T=>{t(1,o=T),h()}),l==null?void 0:l.show()}function u(){return he.cancelRequest(bp),l==null?void 0:l.hide()}async function f($){if($&&typeof $!="string")return t(3,r=!1),$;t(3,r=!0);let T={};try{T=await he.logs.getOne($,{requestKey:bp})}catch(O){O.isAbort||(u(),console.warn("resolveModel:",O),Mi(`Unable to load log with id "${$}"`))}return t(3,r=!1),T}const c=["execTime","type","auth","authId","status","method","url","referer","remoteIP","userIP","userAgent","error","details"];function d($){if(!$)return[];let T=[];for(let E of c)typeof $[E]<"u"&&T.push(E);const O=Object.keys($);for(let E of O)T.includes(E)||T.push(E);return T}function m(){U.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){s("show",o)}function g(){s("hide",o),t(1,o={})}const _=()=>u(),k=()=>m();function S($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}return n.$$.update=()=>{var $;n.$$.dirty&2&&t(4,i=(($=o.data)==null?void 0:$.type)=="request")},[u,o,l,r,i,d,m,g,a,_,k,S]}class R$ extends ve{constructor(e){super(),ye(this,e,N$,P$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function F$(n,e,t){const i=n.slice();return i[1]=e[t],i}function q$(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function j$(n){let e,t,i,s=ce(Sk),l=[];for(let o=0;o{"class"in s&&t(0,i=s.class)},[i]}class zy extends ve{constructor(e){super(),ye(this,e,H$,j$,be,{class:0})}}function z$(n){let e,t,i,s,l,o,r,a,u,f,c;return t=new fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[V$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[B$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field form-field-toggle",name:"logs.logIP",$$slots:{default:[W$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle",name:"logs.logAuthId",$$slots:{default:[Y$,({uniqueId:d})=>({23:d}),({uniqueId:d})=>d?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(d,m){w(d,e,m),q(t,e,null),v(e,i),q(s,e,null),v(e,l),q(o,e,null),v(e,r),q(a,e,null),u=!0,f||(c=Y(e,"submit",it(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}),s.$set(g);const _={};m&25165826&&(_.$$scope={dirty:m,ctx:d}),o.$set(_);const k={};m&25165826&&(k.$$scope={dirty:m,ctx:d}),a.$set(k)},i(d){u||(M(t.$$.fragment,d),M(s.$$.fragment,d),M(o.$$.fragment,d),M(a.$$.fragment,d),u=!0)},o(d){D(t.$$.fragment,d),D(s.$$.fragment,d),D(o.$$.fragment,d),D(a.$$.fragment,d),u=!1},d(d){d&&y(e),j(t),j(s),j(o),j(a),f=!1,c()}}}function U$(n){let e;return{c(){e=b("div"),e.innerHTML='

',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function V$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max days retention"),s=C(),l=b("input"),r=C(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&2&&mt(l.value)!==c[1].logs.maxDays&&me(l,c[1].logs.maxDays)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function B$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return f=new zy({}),{c(){e=b("label"),t=W("Min log level"),s=C(),l=b("input"),o=C(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=C(),H(f.$$.fragment),p(e,"for",i=n[23]),p(l,"type","number"),l.required=!0,p(l,"min","-100"),p(l,"max","100"),p(r,"class","help-block")},m(h,g){w(h,e,g),v(e,t),w(h,s,g),w(h,l,g),me(l,n[1].logs.minLevel),w(h,o,g),w(h,r,g),v(r,a),v(r,u),q(f,r,null),c=!0,d||(m=Y(l,"input",n[12]),d=!0)},p(h,g){(!c||g&8388608&&i!==(i=h[23]))&&p(e,"for",i),g&2&&mt(l.value)!==h[1].logs.minLevel&&me(l,h[1].logs.minLevel)},i(h){c||(M(f.$$.fragment,h),c=!0)},o(h){D(f.$$.fragment,h),c=!1},d(h){h&&(y(e),y(s),y(l),y(o),y(r)),j(f),d=!1,m()}}}function W$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIP,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Y$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable Auth Id logging"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[1].logs.logAuthId,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function K$(n){let e,t,i,s;const l=[U$,z$],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function J$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Z$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),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])&&(s.disabled=o),f&8&&x(s,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function G$(n){let e,t,i={popup:!0,class:"superuser-panel",beforeHide:n[15],$$slots:{footer:[Z$],header:[J$],default:[K$]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("hide",n[17]),e.$on("show",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeHide=s[15]),l&16777274&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function X$(n,e,t){let i,s;const l=wt(),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(){Jt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function g(){t(4,u=!0);try{const P=await he.settings.getAll()||{};k(P)}catch(P){he.error(P)}t(4,u=!1)}async function _(){if(s){t(3,a=!0);try{const P=await he.settings.update(U.filterRedactedProps(c));k(P),t(3,a=!1),m(),nn("Successfully saved logs settings."),l("save",P)}catch(P){t(3,a=!1),he.error(P)}}}function k(P={}){t(1,c={logs:(P==null?void 0:P.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=mt(this.value),t(1,c)}function $(){c.logs.minLevel=mt(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){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,s=i!=JSON.stringify(c))},[m,c,r,a,u,s,o,_,d,f,i,S,$,T,O,E,L,I,A]}class Q$ extends ve{constructor(e){super(),ye(this,e,X$,G$,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function x$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Include requests by superusers"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"for",o=n[25])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function kp(n){let e,t,i;function s(o){n[14](o)}let l={filter:n[1],presets:n[6]};return n[5]!==void 0&&(l.zoom=n[5]),e=new g$({props:l}),ne.push(()=>ge(e,"zoom",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yp(n){let e,t,i,s;function l(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 hS({props:r}),ne.push(()=>ge(e,"filter",l)),ne.push(()=>ge(e,"zoom",o)),e.$on("select",n[17]),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,u){const f={};u&64&&(f.presets=a[6]),!t&&u&2&&(t=!0,f.filter=a[1],$e(()=>t=!1)),!i&&u&32&&(i=!0,f.zoom=a[5],$e(()=>i=!1)),e.$set(f)},i(a){s||(M(e.$$.fragment,a),s=!0)},o(a){D(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function eC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T=n[4],O,E=n[4],L,I,A,P;u=new Fr({}),u.$on("refresh",n[11]),h=new fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[x$,({uniqueId:z})=>({25:z}),({uniqueId:z})=>z?33554432:0]},$$scope:{ctx:n}}}),_=new Rr({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 zy({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let N=kp(n),R=yp(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=W(n[7]),o=C(),r=b("button"),r.innerHTML='',a=C(),H(u.$$.fragment),f=C(),c=b("div"),d=C(),m=b("div"),H(h.$$.fragment),g=C(),H(_.$$.fragment),k=C(),H(S.$$.fragment),$=C(),N.c(),O=C(),R.c(),L=ke(),p(s,"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){w(z,e,F),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),v(t,r),v(t,a),q(u,t,null),v(t,f),v(t,c),v(t,d),v(t,m),q(h,m,null),v(e,g),q(_,e,null),v(e,k),q(S,e,null),v(e,$),N.m(e,null),w(z,O,F),R.m(z,F),w(z,L,F),I=!0,A||(P=[Oe(Re.call(null,r,{text:"Logs settings",position:"right"})),Y(r,"click",n[10])],A=!0)},p(z,F){(!I||F&128)&&se(l,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&&be(T,T=z[4])?(oe(),D(N,1,1,te),re(),N=kp(z),N.c(),M(N,1),N.m(e,null)):N.p(z,F),F&16&&be(E,E=z[4])?(oe(),D(R,1,1,te),re(),R=yp(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&&(y(e),y(O),y(L)),j(u),j(h),j(_),j(S),N.d(z),R.d(z),A=!1,Ee(P)}}}function tC(n){let e,t,i,s,l,o;e=new si({props:{$$slots:{default:[eC]},$$scope:{ctx:n}}});let r={};i=new R$({props:r}),n[18](i),i.$on("show",n[19]),i.$on("hide",n[20]);let a={};return l=new Q$({props:a}),n[21](l),l.$on("save",n[8]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(u,f){q(e,u,f),w(u,t,f),q(i,u,f),w(u,s,f),q(l,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={};l.$set(m)},i(u){o||(M(e.$$.fragment,u),M(i.$$.fragment,u),M(l.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),D(i.$$.fragment,u),D(l.$$.fragment,u),o=!1},d(u){u&&(y(t),y(s)),j(e,u),n[18](null),j(i,u),n[21](null),j(l,u)}}}const Wo="logId",vp="superuserRequests",wp="superuserLogRequests";function nC(n,e,t){var R;let i,s,l;Ge(n,zu,z=>t(22,s=z)),Ge(n,an,z=>t(7,l=z)),En(an,l="Logs",l);const o=new URLSearchParams(s);let r,a,u=1,f=o.get("filter")||"",c={},d=(o.get(vp)||((R=window.localStorage)==null?void 0:R.getItem(wp)))<<0,m=d;function h(){t(4,u++,u)}function g(z={}){let F={};F.filter=f||null,F[vp]=d<<0||null,U.replaceHashQueryParams(Object.assign(F,z))}const _=()=>a==null?void 0:a.show(),k=()=>h();function S(){d=this.checked,t(2,d)}const $=z=>t(1,f=z.detail);function T(z){c=z,t(5,c)}function O(z){f=z,t(1,f)}function E(z){c=z,t(5,c)}const L=z=>r==null?void 0:r.show(z==null?void 0:z.detail);function I(z){ne[z?"unshift":"push"](()=>{r=z,t(0,r)})}const A=z=>{var B;let F={};F[Wo]=((B=z.detail)==null?void 0:B.id)||null,U.replaceHashQueryParams(F)},P=()=>{let z={};z[Wo]=null,U.replaceHashQueryParams(z)};function N(z){ne[z?"unshift":"push"](()=>{a=z,t(3,a)})}return n.$$.update=()=>{var z;n.$$.dirty&1&&o.get(Wo)&&r&&r.show(o.get(Wo)),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(wp,d<<0),g()),n.$$.dirty&2&&typeof f<"u"&&g()},[r,f,d,a,u,c,i,l,h,m,_,k,S,$,T,O,E,L,I,A,P,N]}class iC extends ve{constructor(e){super(),ye(this,e,nC,tC,be,{})}}function Sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Tp(n){n[18]=n[19].default}function $p(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Cp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function lC(n){let e,t=n[15].label+"",i,s,l,o;function r(){return n[9](n[14])}return{c(){e=b("button"),i=W(t),s=C(),p(e,"type","button"),p(e,"class","sidebar-item"),x(e,"active",n[5]===n[14])},m(a,u){w(a,e,u),v(e,i),v(e,s),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&8&&t!==(t=n[15].label+"")&&se(i,t),u&40&&x(e,"active",n[5]===n[14])},d(a){a&&y(e),l=!1,o()}}}function sC(n){let e,t=n[15].label+"",i,s,l,o;return{c(){e=b("div"),i=W(t),s=C(),p(e,"class","sidebar-item disabled")},m(r,a){w(r,e,a),v(e,i),v(e,s),l||(o=Oe(Re.call(null,e,{position:"left",text:"Not enabled for the collection"})),l=!0)},p(r,a){a&8&&t!==(t=r[15].label+"")&&se(i,t)},d(r){r&&y(e),l=!1,o()}}}function Op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=i&&Cp();function r(f,c){return f[15].disabled?sC:lC}let a=r(e),u=a(e);return{key:n,first:null,c(){t=ke(),o&&o.c(),s=C(),u.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),o&&o.m(f,c),w(f,s,c),u.m(f,c),w(f,l,c)},p(f,c){e=f,c&8&&(i=e[21]===Object.keys(e[6]).length),i?o||(o=Cp(),o.c(),o.m(s.parentNode,s)):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(l.parentNode,l)))},d(f){f&&(y(t),y(s),y(l)),o&&o.d(f),u.d(f)}}}function Mp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:aC,then:rC,catch:oC,value:19,blocks:[,,,]};return yf(t=n[15].component,s),{c(){e=ke(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&yf(t,s)||kv(s,n,o)},i(l){i||(M(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];D(r)}i=!1},d(l){l&&y(e),s.block.d(l),s.token=null,s=null}}}function oC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function rC(n){Tp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=C()},m(s,l){q(e,s,l),w(s,t,l),i=!0},p(s,l){Tp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(M(e.$$.fragment,s),i=!0)},o(s){D(e.$$.fragment,s),i=!1},d(s){s&&y(t),j(e,s)}}}function aC(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Ep(n,e){let t,i,s,l=e[5]===e[14]&&Mp(e);return{key:n,first:null,c(){t=ke(),l&&l.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&M(l,1)):(l=Mp(e),l.c(),M(l,1),l.m(i.parentNode,i)):l&&(oe(),D(l,1,1,()=>{l=null}),re())},i(o){s||(M(l),s=!0)},o(o){D(l),s=!1},d(o){o&&(y(t),y(i)),l&&l.d(o)}}}function uC(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=ce(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function cC(n){let e,t,i={class:"docs-panel",$$slots:{footer:[fC],default:[uC]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function dC(n,e,t){const i={list:{label:"List/Search",component:$t(()=>import("./ListApiDocs-DcR09AiE.js"),__vite__mapDeps([2,3,4]),import.meta.url)},view:{label:"View",component:$t(()=>import("./ViewApiDocs-jOgeApYb.js"),__vite__mapDeps([5,3]),import.meta.url)},create:{label:"Create",component:$t(()=>import("./CreateApiDocs-ChXbrqJd.js"),__vite__mapDeps([6,3]),import.meta.url)},update:{label:"Update",component:$t(()=>import("./UpdateApiDocs-D66gcPkv.js"),__vite__mapDeps([7,3]),import.meta.url)},delete:{label:"Delete",component:$t(()=>import("./DeleteApiDocs-Lgq-jakm.js"),[],import.meta.url)},realtime:{label:"Realtime",component:$t(()=>import("./RealtimeApiDocs-Ccu7wZvj.js"),[],import.meta.url)},batch:{label:"Batch",component:$t(()=>import("./BatchApiDocs-C0h3bP_1.js"),[],import.meta.url)}},s={"list-auth-methods":{label:"List auth methods",component:$t(()=>import("./AuthMethodsDocs-emhroE88.js"),__vite__mapDeps([8,3]),import.meta.url)},"auth-with-password":{label:"Auth with password",component:$t(()=>import("./AuthWithPasswordDocs-CJv5XhID.js"),__vite__mapDeps([9,3]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:$t(()=>import("./AuthWithOAuth2Docs-DqJ60m_y.js"),__vite__mapDeps([10,3]),import.meta.url)},"auth-with-otp":{label:"Auth with OTP",component:$t(()=>import("./AuthWithOtpDocs-CDQM7KGQ.js"),__vite__mapDeps([11,3]),import.meta.url)},refresh:{label:"Auth refresh",component:$t(()=>import("./AuthRefreshDocs-C8u7IdT_.js"),__vite__mapDeps([12,3]),import.meta.url)},verification:{label:"Verification",component:$t(()=>import("./VerificationDocs-DGrZV9bE.js"),[],import.meta.url)},"password-reset":{label:"Password reset",component:$t(()=>import("./PasswordResetDocs-CHzwnxhE.js"),[],import.meta.url)},"email-change":{label:"Email change",component:$t(()=>import("./EmailChangeDocs-DckvBZz5.js"),[],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function h(k){ne[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){Le.call(this,n,k)}function _(k){Le.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),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,l,r,i,u,d,m,h,g,_]}class pC extends ve{constructor(e){super(),ye(this,e,dC,cC,be,{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 mC=n=>({active:n&1}),Dp=n=>({active:n[0]});function Ip(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=b("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ft(l,s,o,o[14],i?Rt(s,o[14],r,null):qt(o[14]),null)},i(o){i||(M(l,o),o&&tt(()=>{i&&(t||(t=qe(e,ht,{delay:10,duration:150},!0)),t.run(1))}),i=!0)},o(o){D(l,o),o&&(t||(t=qe(e,ht,{delay:10,duration:150},!1)),t.run(0)),i=!1},d(o){o&&y(e),l&&l.d(o),o&&t&&t.end()}}}function hC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Dp);let f=n[0]&&Ip(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=C(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",it(n[17])),Y(t,"drop",it(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",it(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ft(u,a,c,c[14],l?Rt(a,c[14],d,mC):qt(c[14]),Dp),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&1)&&p(t,"aria-expanded",c[0]),(!l||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&M(f,1)):(f=Ip(c),f.c(),M(f,1),f.m(e,null)):f&&(oe(),D(f,1,1,()=>{f=null}),re()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&x(e,"active",c[0])},i(c){l||(M(u,c),M(f),l=!0)},o(c){D(u,c),D(f),l=!1},d(c){c&&y(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ee(r)}}}function _C(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();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),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("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()}}un(()=>()=>clearTimeout(r));function $(P){Le.call(this,n,P)}const T=()=>c&&k(),O=P=>{u&&(t(7,m=!1),S(),l("drop",P))},E=P=>u&&l("dragstart",P),L=P=>{u&&(t(7,m=!0),l("dragenter",P))},I=P=>{u&&(t(7,m=!1),l("dragleave",P))};function A(P){ne[P?"unshift":"push"](()=>{o=P,t(6,o)})}return n.$$set=P=>{"class"in P&&t(1,a=P.class),"draggable"in P&&t(2,u=P.draggable),"active"in P&&t(0,f=P.active),"interactive"in P&&t(3,c=P.interactive),"single"in P&&t(9,d=P.single),"$$scope"in P&&t(14,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,l,d,h,g,_,r,s,i,$,T,O,E,L,I,A]}class Ui extends ve{constructor(e){super(),ye(this,e,_C,hC,be,{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 Lp(n,e,t){const i=n.slice();return i[25]=e[t],i}function Ap(n,e,t){const i=n.slice();return i[25]=e[t],i}function Pp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Pp(n);return{c(){e=b("label"),t=W("Subject"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[24]),p(l,"type","text"),p(l,"id",o=n[24]),p(l,"spellcheck","false"),l.required=!0},m(m,h){w(m,e,h),v(e,t),w(m,s,h),w(m,l,h),me(l,n[0].subject),w(m,r,h),c&&c.m(m,h),w(m,a,h),u||(f=Y(l,"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(l,"id",o),h&1&&l.value!==m[0].subject&&me(l,m[0].subject),((g=m[3])==null?void 0:g.length)>0?c?c.p(m,h):(c=Pp(m),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(m){m&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(m),u=!1,f()}}}function bC(n){let e,t,i,s;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(l,o){w(l,e,o),me(e,n[0].body),i||(s=Y(e,"input",n[17]),i=!0)},p(l,o){o&16777216&&t!==(t=l[24])&&p(e,"id",t),o&1&&me(e,l[0].body)},i:te,o:te,d(l){l&&y(e),i=!1,s()}}}function kC(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&32&&o!==(o=a[5])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(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,$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function Rp(n){let e,t,i=ce(n[3]),s=[];for(let l=0;l0&&Rp(n);return{c(){e=b("label"),t=W("Body (HTML)"),s=C(),o.c(),r=C(),m&&m.c(),a=ke(),p(e,"for",i=n[24])},m(g,_){w(g,e,_),v(e,t),w(g,s,_),c[l].m(g,_),w(g,r,_),m&&m.m(g,_),w(g,a,_),u=!0},p(g,_){var S;(!u||_&16777216&&i!==(i=g[24]))&&p(e,"for",i);let k=l;l=d(g),l===k?c[l].p(g,_):(oe(),D(c[k],1,1,()=>{c[k]=null}),re(),o=c[l],o?o.p(g,_):(o=c[l]=f[l](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=Rp(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&&(y(e),y(s),y(r),y(a)),c[l].d(g),m&&m.d(g)}}}function vC(n){let e,t,i,s;return e=new fe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[gC,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[yC,({uniqueId:l})=>({24:l}),({uniqueId:l})=>l?16777216:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".subject"),o&1090519049&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name=l[1]+".body"),o&1090519145&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function qp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function wC(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&qp();return{c(){e=b("div"),t=b("i"),i=C(),s=b("span"),l=W(n[2]),o=C(),r=b("div"),a=C(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),v(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d&4&&se(l,c[2]),c[7]?f?d&128&&M(f,1):(f=qp(),f.c(),M(f,1),f.m(u.parentNode,u)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(o),y(r),y(a),y(u)),f&&f.d(c)}}}function SC(n){let e,t;const i=[n[9]];let s={$$slots:{header:[wC],default:[vC]},$$scope:{ctx:n}};for(let l=0;lt(13,o=R));let{key:r}=e,{title:a}=e,{config:u={}}=e,{placeholders:f=[]}=e,c,d=jp,m=!1;function h(){c==null||c.expand()}function g(){c==null||c.collapse()}function _(){c==null||c.collapseSiblings()}async function k(){d||m||(t(6,m=!0),t(5,d=(await $t(async()=>{const{default:R}=await import("./CodeEditor-CTDCRa84.js");return{default:R}},__vite__mapDeps([13,1]),import.meta.url)).default),jp=d,t(6,m=!1))}function S(R){R=R.replace("*",""),U.copyToClipboard(R),Js(`Copied ${R} to clipboard`,2e3)}k();function $(){u.subject=this.value,t(0,u)}const T=R=>S("{"+R+"}");function O(R){n.$$.not_equal(u.body,R)&&(u.body=R,t(0,u))}function E(){u.body=this.value,t(0,u)}const L=R=>S("{"+R+"}");function I(R){ne[R?"unshift":"push"](()=>{c=R,t(4,c)})}function A(R){Le.call(this,n,R)}function P(R){Le.call(this,n,R)}function N(R){Le.call(this,n,R)}return n.$$set=R=>{e=je(je({},e),Kt(R)),t(9,l=lt(e,s)),"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||Wn(r))},[u,r,a,f,c,d,m,i,S,l,h,g,_,o,$,T,O,E,L,I,A,P,N]}class $C extends ve{constructor(e){super(),ye(this,e,TC,SC,be,{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 CC(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=W(n[3]),i=W(" duration (in seconds)"),l=C(),o=b("input"),a=C(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(o,"placeholder","No change"),p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){w(m,e,h),v(e,t),v(e,i),w(m,l,h),w(m,o,h),me(o,n[0]),w(m,a,h),w(m,u,h),v(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(m,h){h&8&&se(t,m[3]),h&64&&s!==(s=m[6])&&p(e,"for",s),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&mt(o.value)!==m[0]&&me(o,m[0]),h&2&&x(f,"txt-success",!!m[1])},d(m){m&&(y(e),y(l),y(o),y(a),y(u)),c=!1,Ee(d)}}}function OC(n){let e,t;return e=new fe({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[CC,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MC(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=mt(this.value),t(0,l)}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,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class EC extends ve{constructor(e){super(),ye(this,e,MC,OC,be,{key:2,label:3,duration:0,secret:1})}}function Hp(n,e,t){const i=n.slice();return i[8]=e[t],i[9]=e,i[10]=t,i}function zp(n,e){let t,i,s,l,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 EC({props:f}),ne.push(()=>ge(i,"duration",a)),ne.push(()=>ge(i,"secret",u)),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),o=C(),p(t,"class","col-sm-6"),this.first=t},m(c,d){w(c,t,d),q(i,t,null),v(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),!s&&d&3&&(s=!0,m.duration=e[0][e[8].key].duration,$e(()=>s=!1)),!l&&d&3&&(l=!0,m.secret=e[0][e[8].key].secret,$e(()=>l=!1)),i.$set(m)},i(c){r||(M(i.$$.fragment,c),r=!0)},o(c){D(i.$$.fragment,c),r=!1},d(c){c&&y(t),j(i)}}}function DC(n){let e,t=[],i=new Map,s,l=ce(n[1]);const o=r=>r[8].key;for(let r=0;r{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function IC(n){let e,t,i,s,l,o=n[2]&&Up();return{c(){e=b("div"),e.innerHTML=' Tokens options (invalidate, duration)',t=C(),i=b("div"),s=C(),o&&o.c(),l=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),w(r,s,a),o&&o.m(r,a),w(r,l,a)},p(r,a){r[2]?o?a&4&&M(o,1):(o=Up(),o.c(),M(o,1),o.m(l.parentNode,l)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},d(r){r&&(y(e),y(t),y(i),y(s),y(l)),o&&o.d(r)}}}function LC(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[IC],default:[DC]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2055&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function AC(n,e,t){let i,s,l;Ge(n,Tn,c=>t(4,l=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,s=a(l))},[o,r,s,i,l,u,f]}class PC extends ve{constructor(e){super(),ye(this,e,AC,LC,be,{collection:0})}}const NC=n=>({isSuperuserOnly:n&2048}),Vp=n=>({isSuperuserOnly:n[11]}),RC=n=>({isSuperuserOnly:n&2048}),Bp=n=>({isSuperuserOnly:n[11]}),FC=n=>({isSuperuserOnly:n&2048}),Wp=n=>({isSuperuserOnly:n[11]});function qC(n){let e,t;return e=new fe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[11]?"disabled":""),name:n[3],$$slots:{default:[HC,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2064&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[11]?"disabled":"")),s&8&&(l.name=i[3]),s&2362855&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jC(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Yp(n){let e,t,i,s,l,o;return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Set Superusers only",p(t,"class","ri-lock-line"),p(t,"aria-hidden","true"),p(s,"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){w(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=Y(e,"click",n[13]),l=!0)},p(r,a){a&1024&&p(e,"aria-hidden",r[10]),a&1024&&(e.disabled=r[10])},d(r){r&&y(e),l=!1,o()}}}function Kp(n){let e,t,i,s,l,o,r,a=!n[10]&&Jp();return{c(){e=b("button"),a&&a.c(),t=C(),i=b("div"),i.innerHTML='',p(i,"class","icon svelte-dnx4io"),p(i,"aria-hidden","true"),p(e,"type","button"),p(e,"class","unlock-overlay svelte-dnx4io"),e.disabled=n[10],p(e,"aria-hidden",n[10])},m(u,f){w(u,e,f),a&&a.m(e,null),v(e,t),v(e,i),l=!0,o||(r=Y(e,"click",n[12]),o=!0)},p(u,f){u[10]?a&&(a.d(1),a=null):a||(a=Jp(),a.c(),a.m(e,t)),(!l||f&1024)&&(e.disabled=u[10]),(!l||f&1024)&&p(e,"aria-hidden",u[10])},i(u){l||(u&&tt(()=>{l&&(s||(s=qe(e,Ct,{duration:150,start:.98},!0)),s.run(1))}),l=!0)},o(u){u&&(s||(s=qe(e,Ct,{duration:150,start:.98},!1)),s.run(0)),l=!1},d(u){u&&y(e),a&&a.d(),u&&s&&s.end(),o=!1,r()}}}function Jp(n){let e;return{c(){e=b("small"),e.textContent="Unlock and set custom rule",p(e,"class","txt svelte-dnx4io")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function HC(n){let e,t,i,s,l,o,r=n[11]?"- Superusers only":"",a,u,f,c,d,m,h,g,_,k,S,$,T,O;const E=n[15].beforeLabel,L=Nt(E,n,n[18],Wp),I=n[15].afterLabel,A=Nt(I,n,n[18],Bp);let P=n[5]&&!n[11]&&Yp(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=Ht(R,z(n)),n[16](m),ne.push(()=>ge(m,"value",N)));let F=n[5]&&n[11]&&Kp(n);const B=n[15].default,J=Nt(B,n,n[18],Vp);return{c(){e=b("div"),t=b("label"),L&&L.c(),i=C(),s=b("span"),l=W(n[2]),o=C(),a=W(r),u=C(),A&&A.c(),f=C(),P&&P.c(),d=C(),m&&H(m.$$.fragment),g=C(),F&&F.c(),k=C(),S=b("div"),J&&J.c(),p(s,"class","txt"),x(s,"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){w(V,e,Z),v(e,t),L&&L.m(t,null),v(t,i),v(t,s),v(s,l),v(s,o),v(s,a),v(t,u),A&&A.m(t,null),v(t,f),P&&P.m(t,null),v(e,d),m&&q(m,e,null),v(e,g),F&&F.m(e,null),w(V,k,Z),w(V,S,Z),J&&J.m(S,null),$=!0,T||(O=Oe(_=Re.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&&(!$||Z&264192)&&Ft(L,E,V,V[18],$?Rt(E,V[18],Z,FC):qt(V[18]),Wp),(!$||Z&4)&&se(l,V[2]),(!$||Z&2048)&&r!==(r=V[11]?"- Superusers only":"")&&se(a,r),(!$||Z&2048)&&x(s,"txt-hint",V[11]),A&&A.p&&(!$||Z&264192)&&Ft(A,I,V,V[18],$?Rt(I,V[18],Z,RC):qt(V[18]),Bp),V[5]&&!V[11]?P?P.p(V,Z):(P=Yp(V),P.c(),P.m(t,null)):P&&(P.d(1),P=null),(!$||Z&2097152&&c!==(c=V[21]))&&p(t,"for",c),Z&256&&R!==(R=V[8])){if(m){oe();const G=m;D(G.$$.fragment,1,0,()=>{j(G,1)}),re()}R?(m=Ht(R,z(V)),V[16](m),ne.push(()=>ge(m,"value",N)),H(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],$e(()=>h=!1)),m.$set(G)}V[5]&&V[11]?F?(F.p(V,Z),Z&2080&&M(F,1)):(F=Kp(V),F.c(),M(F,1),F.m(e,null)):F&&(oe(),D(F,1,1,()=>{F=null}),re()),_&&Lt(_.update)&&Z&2&&_.update.call(null,V[1].system?{text:"System collection rule cannot be changed.",position:"top"}:void 0),J&&J.p&&(!$||Z&264192)&&Ft(J,B,V,V[18],$?Rt(B,V[18],Z,NC):qt(V[18]),Vp)},i(V){$||(M(L,V),M(A,V),m&&M(m.$$.fragment,V),M(F),M(J,V),$=!0)},o(V){D(L,V),D(A,V),m&&D(m.$$.fragment,V),D(F),D(J,V),$=!1},d(V){V&&(y(e),y(k),y(S)),L&&L.d(V),A&&A.d(V),P&&P.d(),n[16](null),m&&j(m),F&&F.d(),J&&J.d(V),T=!1,O()}}}function zC(n){let e,t,i,s;const l=[jC,qC],o=[];function r(a,u){return a[9]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}let Zp;function UC(n,e,t){let i,s,{$$slots:l={},$$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,k=Zp,S=!1;$();async function $(){k||S||(t(9,S=!0),t(8,k=(await $t(async()=>{const{default:I}=await import("./FilterAutocompleteInput-D6GbKUeb.js");return{default:I}},__vite__mapDeps([0,1]),import.meta.url)).default),Zp=k,t(9,S=!1))}async function T(){t(0,a=_||""),await _n(),g==null||g.focus()}function O(){_=a,t(0,a=null)}function E(I){ne[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,s=d||r.system)},[a,r,u,f,c,m,h,g,k,S,s,i,T,O,d,l,E,L,o]}class sl extends ve{constructor(e){super(),ye(this,e,UC,zC,be,{collection:1,rule:0,label:2,formKey:3,required:4,disabled:14,superuserToggle:5,placeholder:6})}}function VC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Enable",p(e,"type","checkbox"),p(e,"id",t=n[5]),p(l,"class","txt"),p(s,"for",o=n[5])},m(u,f){w(u,e,f),e.checked=n[0].mfa.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function BC(n){let e,t,i,s,l;return{c(){e=b("p"),e.textContent="This optional rule could be used to enable/disable MFA per account basis.",t=C(),i=b("p"),i.innerHTML=`For example, to require MFA only for accounts with non-empty email you can set it to + email != ''.`,s=C(),l=b("p"),l.textContent="Leave the rule empty to require MFA for everyone."},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:te,d(o){o&&(y(e),y(t),y(i),y(s),y(l))}}}function WC(n){let e,t,i,s,l,o,r,a,u;s=new fe({props:{class:"form-field form-field-toggle",name:"mfa.enabled",$$slots:{default:[VC,({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:[BC]},$$scope:{ctx:n}};return n[0].mfa.rule!==void 0&&(c.rule=n[0].mfa.rule),r=new sl({props:c}),ne.push(()=>ge(r,"rule",f)),{c(){e=b("div"),e.innerHTML=`

This feature is experimental and may change in the future.

`,t=C(),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),q(s,i,null),v(i,l),v(i,o),q(r,o,null),u=!0},p(d,m){const _={};m&97&&(_.$$scope={dirty:m,ctx:d}),s.$set(_);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(s.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(s.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),j(s),j(r)}}}function WC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function YC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Gp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function KC(n){let e,t,i,s,l,o;function r(c,d){return c[0].mfa.enabled?YC:WC}let a=r(n),u=a(n),f=n[1]&&Gp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=Gp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function JC(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[KC],default:[BC]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&67&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ZC(n,e,t){let i,s;Ge(n,Tn,a=>t(2,s=a));let{collection:l}=e;function o(){l.mfa.enabled=this.checked,t(0,l)}function r(a){n.$$.not_equal(l.mfa.rule,a)&&(l.mfa.rule=a,t(0,l))}return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!U.isEmpty(s==null?void 0:s.mfa))},[l,i,s,o,r]}class GC extends ve{constructor(e){super(),ye(this,e,ZC,JC,be,{collection:0})}}const XC=n=>({}),Xp=n=>({});function Qp(n,e,t){const i=n.slice();return i[50]=e[t],i}const QC=n=>({}),xp=n=>({});function em(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function tm(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&x(e,"link-hint",!s[5]&&!s[6])},d(s){s&&y(e)}}}function xC(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[50]+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function e8(n){let e,t,i;const s=[{item:n[50]},n[11]];var l=n[10];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?vt(s,[a[0]&1&&{item:r[50]},a[0]&2048&&At(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&&y(t),e&&j(e,r)}}}function nm(n){let e,t,i;function s(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,"Clear")),Y(e,"click",tn(it(s)))],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function im(n){let e,t,i,s,l,o;const r=[e8,xC],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])&&nm(n);return{c(){e=b("div"),i.c(),s=C(),f&&f.c(),l=C(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=nm(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function lm(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[i8]},$$scope:{ctx:n}};return e=new Dn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&16384&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[42](null),j(e,s)}}}function sm(n){let e,t,i,s,l,o,r,a,u=n[17].length&&om(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',s=C(),l=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),v(e,t),v(t,i),v(t,s),v(t,l),me(l,n[17]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&me(l,f[17]),f[17].length?u?u.p(f,c):(u=om(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function om(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",tn(it(n[23]))),i=!0)},p:te,d(l){l&&y(e),i=!1,s()}}}function rm(n){let e,t=n[1]&&am(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=am(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function am(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&y(e)}}}function t8(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[50]+"")&&se(t,e)},i:te,o:te,d(i){i&&y(t)}}}function n8(n){let e,t,i;const s=[{item:n[50]},n[13]];var l=n[12];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?vt(s,[a[0]&4194304&&{item:r[50]},a[0]&8192&&At(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&&y(t),e&&j(e,r)}}}function um(n){let e,t,i,s,l,o,r;const a=[n8,t8],u=[];function f(m,_){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(),s=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[50]))},m(m,_){w(m,e,_),u[t].m(e,null),v(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,_){n=m;let g=t;t=f(n),t===g?u[t].p(n,_):(oe(),D(u[g],1,1,()=>{u[g]=null}),re(),i=u[t],i?i.p(n,_):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,s)),(!l||_[0]&512)&&x(e,"closable",n[9]),(!l||_[0]&6291456)&&x(e,"selected",n[21](n[50]))},i(m){l||(M(i),l=!0)},o(m){D(i),l=!1},d(m){m&&y(e),u[t].d(),o=!1,Ee(r)}}}function i8(n){let e,t,i,s,l,o=n[14]&&sm(n);const r=n[36].beforeOptions,a=Nt(r,n,n[45],xp);let u=ce(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=rm(n));const m=n[36].afterOptions,_=Nt(m,n,n[45],Xp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=tm(n));let c=!n[5]&&!n[6]&&lm(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),re()),(!o||m[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=h()}=e,{toggle:S=d}=e,{closable:$=!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=wt();let{class:N=""}=e,R,z="",F,B;function J(Te){if(U.isEmpty(k))return;let nt=U.toArray(k);U.inArray(nt,Te)&&(U.removeByValue(nt,Te),t(0,k=d?nt:(nt==null?void 0:nt[0])||h())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function V(Te){if(d){let nt=U.toArray(k);U.inArray(nt,Te)||t(0,k=[...nt,Te])}else t(0,k=Te);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(Te){return s(Te)?J(Te):V(Te)}function G(){t(0,k=h()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function de(){R!=null&&R.show&&(R==null||R.show())}function pe(){R!=null&&R.hide&&(R==null||R.hide())}function ae(){if(U.isEmpty(k)||U.isEmpty(c))return;let Te=U.toArray(k),nt=[];for(const zt of Te)U.inArray(c,zt)||nt.push(zt);if(nt.length){for(const zt of nt)U.removeByValue(Te,zt);t(0,k=d?Te:Te[0])}}function Ce(){t(17,z="")}function Ye(Te,nt){Te=Te||[];const zt=A||s8;return Te.filter(Ne=>zt(Ne,nt))||[]}function Ke(Te,nt){Te.preventDefault(),S&&d?Z(nt):V(nt)}function ct(Te,nt){(Te.code==="Enter"||Te.code==="Space")&&(Ke(Te,nt),$&&pe())}function et(){Ce(),setTimeout(()=>{const Te=F==null?void 0:F.querySelector(".dropdown-item.option.selected");Te&&(Te.focus(),Te.scrollIntoView({block:"nearest"}))},0)}function xe(Te){Te.stopPropagation(),!_&&!m&&(R==null||R.toggle())}un(()=>{const Te=document.querySelectorAll(`label[for="${r}"]`);for(const nt of Te)nt.addEventListener("click",xe);return()=>{for(const nt of Te)nt.removeEventListener("click",xe)}});const Be=Te=>J(Te);function ut(Te){ne[Te?"unshift":"push"](()=>{B=Te,t(20,B)})}function Bt(){z=this.value,t(17,z)}const Ue=(Te,nt)=>Ke(nt,Te),De=(Te,nt)=>ct(nt,Te);function ot(Te){ne[Te?"unshift":"push"](()=>{R=Te,t(18,R)})}function Ie(Te){Le.call(this,n,Te)}function We(Te){ne[Te?"unshift":"push"](()=>{F=Te,t(19,F)})}return n.$$set=Te=>{"id"in Te&&t(27,r=Te.id),"noOptionsText"in Te&&t(1,a=Te.noOptionsText),"selectPlaceholder"in Te&&t(2,u=Te.selectPlaceholder),"searchPlaceholder"in Te&&t(3,f=Te.searchPlaceholder),"items"in Te&&t(28,c=Te.items),"multiple"in Te&&t(4,d=Te.multiple),"disabled"in Te&&t(5,m=Te.disabled),"readonly"in Te&&t(6,_=Te.readonly),"upside"in Te&&t(7,g=Te.upside),"zeroFunc"in Te&&t(29,h=Te.zeroFunc),"selected"in Te&&t(0,k=Te.selected),"toggle"in Te&&t(8,S=Te.toggle),"closable"in Te&&t(9,$=Te.closable),"labelComponent"in Te&&t(10,T=Te.labelComponent),"labelComponentProps"in Te&&t(11,O=Te.labelComponentProps),"optionComponent"in Te&&t(12,E=Te.optionComponent),"optionComponentProps"in Te&&t(13,L=Te.optionComponentProps),"searchable"in Te&&t(14,I=Te.searchable),"searchFunc"in Te&&t(30,A=Te.searchFunc),"class"in Te&&t(15,N=Te.class),"$$scope"in Te&&t(45,o=Te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ae(),Ce()),n.$$.dirty[0]&268566528&&t(22,i=Ye(c,z)),n.$$.dirty[0]&1&&t(21,s=function(Te){const nt=U.toArray(k);return U.inArray(nt,Te)})},[k,a,u,f,d,m,_,g,S,$,T,O,E,L,I,N,J,z,R,F,B,s,i,Ce,Ke,ct,et,r,c,h,A,V,Z,G,de,pe,l,Be,ut,Bt,Ue,De,ot,Ie,We,o]}class ms extends ve{constructor(e){super(),ye(this,e,o8,l8,be,{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,s=[{type:"password"},{autocomplete:"new-password"},n[4]],l={};for(let o=0;o',i=C(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(s,a)},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Oe(Re.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",it(n[3]))],l=!0)},p(u,f){ni(s,a=vt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(s)),l=!1,Ee(o)}}}function u8(n){let e;function t(l,o){return l[1]?a8:r8}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function f8(n,e,t){const i=["value","mask"];let s=lt(e,i),{value:l=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,l=""),t(1,o=!1),await _n(),r==null||r.focus()}function u(c){ne[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){l=this.value,t(0,l)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(4,s=lt(e,i)),"value"in c&&t(0,l=c.value),"mask"in c&&t(1,o=c.mask)},[l,o,r,a,s,u,f]}class rf extends ve{constructor(e){super(),ye(this,e,f8,u8,be,{value:0,mask:1})}}function c8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[1].clientId),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&2&&l.value!==u[1].clientId&&me(l,u[1].clientId)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function d8(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Client secret"),s=C(),H(l.$$.fragment),p(e,"for",i=n[23])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const _={};m&8388608&&(_.id=d[23]),!o&&m&32&&(o=!0,_.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,_.value=d[1].clientSecret,$e(()=>r=!1)),l.$set(_)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function fm(n){let e,t,i,s;const l=[{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;dge(t,"config",o))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&q(t,e,null),s=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){oe();const c=t;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}r?(t=Ht(r,a(u,f)),ne.push(()=>ge(t,"config",o)),H(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?vt(l,[f&64&&{key:u[6]},f&8&&At(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){s||(t&&M(t.$$.fragment,u),s=!0)},o(u){t&&D(t.$$.fragment,u),s=!1},d(u){u&&y(e),t&&j(t)}}}function p8(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[c8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[d8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&fm(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),q(s,e,null),v(e,l),u&&u.m(e,null),o=!0,r||(a=Y(e,"submit",it(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}),s.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=fm(f),u.c(),M(u,1),u.m(e,null)):u&&(oe(),D(u,1,1,()=>{u=null}),re())},i(f){o||(M(t.$$.fragment,f),M(s.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(s.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),j(t),j(s),u&&u.d(),r=!1,a()}}}function m8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function h8(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!wn(e.src,t="./images/oauth2/"+s[3].logo)&&p(e,"src",t),l&8&&i!==(i=s[3].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function _8(n){let e,t,i,s=n[3].title+"",l,o,r,a,u=n[3].key+"",f,c;function d(g,h){return g[3].logo?h8:m8}let m=d(n),_=m(n);return{c(){e=b("figure"),_.c(),t=C(),i=b("h4"),l=W(s),o=C(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,h){w(g,e,h),_.m(e,null),w(g,t,h),w(g,i,h),v(i,l),v(i,o),v(i,r),v(r,a),v(r,f),v(r,c)},p(g,h){m===(m=d(g))&&_?_.p(g,h):(_.d(1),_=m(g),_&&(_.c(),_.m(e,null))),h&8&&s!==(s=g[3].title+"")&&se(l,s),h&8&&u!==(u=g[3].key+"")&&se(f,u)},d(g){g&&(y(e),y(t),y(i)),_.d()}}}function cm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Oe(Re.call(null,e,{text:"Remove provider",position:"right"})),Y(e,"click",n[10])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function g8(n){let e,t,i,s,l,o,r,a,u=!n[4]&&cm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[8]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),v(s,l),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=cm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(s.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(s)),u&&u.d(f),r=!1,a()}}}function b8(n){let e,t,i={btnClose:!1,$$slots:{footer:[g8],header:[_8],default:[p8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777466&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}function k8(n,e,t){let i,s;const l=wt(),o="provider_popup_"+U.randomString(5);let r,a={},u={},f=!1,c="",d=!1,m=0;function _(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(){Wn(s),r==null||r.hide()}async function h(){l("submit",{uiOptions:a,config:u}),g()}async function k(){yn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{l("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>h();function L(P){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,s="oauth2.providers."+m)},[g,u,r,a,f,d,s,i,o,h,k,_,c,m,S,$,T,O,E,L,I,A]}class y8 extends ve{constructor(e){super(),ye(this,e,k8,b8,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function v8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function w8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Team ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&me(l,u[3])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function S8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Key ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&me(l,u[4])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function T8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",or),r.required=!0},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[6]),u||(f=[Oe(Re.call(null,s,{text:`Max ${or} seconds (~${or/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&mt(r.value)!==c[6]&&me(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function $8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),s=C(),l=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- + (Learn more) .

`,t=C(),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(e,"class","content m-b-sm"),p(o,"class","content"),x(o,"fade",!n[0].mfa.enabled),p(i,"class","grid")},m(d,m){w(d,e,m),w(d,t,m),w(d,i,m),q(s,i,null),v(i,l),v(i,o),q(r,o,null),u=!0},p(d,m){const h={};m&97&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const g={};m&1&&(g.disabled=!d[0].mfa.enabled),m&1&&(g.collection=d[0]),m&64&&(g.$$scope={dirty:m,ctx:d}),!a&&m&1&&(a=!0,g.rule=d[0].mfa.rule,$e(()=>a=!1)),r.$set(g),(!u||m&1)&&x(o,"fade",!d[0].mfa.enabled)},i(d){u||(M(s.$$.fragment,d),M(r.$$.fragment,d),u=!0)},o(d){D(s.$$.fragment,d),D(r.$$.fragment,d),u=!1},d(d){d&&(y(e),y(t),y(i)),j(s),j(r)}}}function YC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function KC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Gp(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function JC(n){let e,t,i,s,l,o;function r(c,d){return c[0].mfa.enabled?KC:YC}let a=r(n),u=a(n),f=n[1]&&Gp();return{c(){e=b("div"),e.innerHTML=' Multi-factor authentication (MFA)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=Gp(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function ZC(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[JC],default:[WC]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&67&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GC(n,e,t){let i,s;Ge(n,Tn,a=>t(2,s=a));let{collection:l}=e;function o(){l.mfa.enabled=this.checked,t(0,l)}function r(a){n.$$.not_equal(l.mfa.rule,a)&&(l.mfa.rule=a,t(0,l))}return n.$$set=a=>{"collection"in a&&t(0,l=a.collection)},n.$$.update=()=>{n.$$.dirty&4&&t(1,i=!U.isEmpty(s==null?void 0:s.mfa))},[l,i,s,o,r]}class XC extends ve{constructor(e){super(),ye(this,e,GC,ZC,be,{collection:0})}}const QC=n=>({}),Xp=n=>({});function Qp(n,e,t){const i=n.slice();return i[50]=e[t],i}const xC=n=>({}),xp=n=>({});function em(n,e,t){const i=n.slice();return i[50]=e[t],i[54]=t,i}function tm(n){let e,t,i;return{c(){e=b("div"),t=W(n[2]),i=C(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&se(t,s[2]),l[0]&96&&x(e,"link-hint",!s[5]&&!s[6])},d(s){s&&y(e)}}}function e8(n){let e,t=n[50]+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[50]+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function t8(n){let e,t,i;const s=[{item:n[50]},n[11]];var l=n[10];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?vt(s,[a[0]&1&&{item:r[50]},a[0]&2048&&At(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&&y(t),e&&j(e,r)}}}function nm(n){let e,t,i;function s(){return n[37](n[50])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,"Clear")),Y(e,"click",tn(it(s)))],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function im(n){let e,t,i,s,l,o;const r=[t8,e8],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])&&nm(n);return{c(){e=b("div"),i.c(),s=C(),f&&f.c(),l=C(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),M(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=nm(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(M(i),o=!0)},o(c){D(i),o=!1},d(c){c&&y(e),a[t].d(),f&&f.d()}}}function lm(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 Dn({props:i}),n[42](e),e.$on("show",n[26]),e.$on("hide",n[43]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&16384&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[42](null),j(e,s)}}}function sm(n){let e,t,i,s,l,o,r,a,u=n[17].length&&om(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',s=C(),l=b("input"),o=C(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),v(e,t),v(t,i),v(t,s),v(t,l),me(l,n[17]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[39]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&me(l,f[17]),f[17].length?u?u.p(f,c):(u=om(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&y(e),u&&u.d(),r=!1,a()}}}function om(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",tn(it(n[23]))),i=!0)},p:te,d(l){l&&y(e),i=!1,s()}}}function rm(n){let e,t=n[1]&&am(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=am(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function am(n){let e,t;return{c(){e=b("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&2&&se(t,i[1])},d(i){i&&y(e)}}}function n8(n){let e=n[50]+"",t;return{c(){t=W(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[50]+"")&&se(t,e)},i:te,o:te,d(i){i&&y(t)}}}function i8(n){let e,t,i;const s=[{item:n[50]},n[13]];var l=n[12];function o(r,a){let u={};for(let f=0;f{j(u,1)}),re()}l?(e=Ht(l,o(r,a)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?vt(s,[a[0]&4194304&&{item:r[50]},a[0]&8192&&At(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&&y(t),e&&j(e,r)}}}function um(n){let e,t,i,s,l,o,r;const a=[i8,n8],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(),s=C(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[50]))},m(m,h){w(m,e,h),u[t].m(e,null),v(e,s),l=!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):(oe(),D(u[g],1,1,()=>{u[g]=null}),re(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),M(i,1),i.m(e,s)),(!l||h[0]&512)&&x(e,"closable",n[9]),(!l||h[0]&6291456)&&x(e,"selected",n[21](n[50]))},i(m){l||(M(i),l=!0)},o(m){D(i),l=!1},d(m){m&&y(e),u[t].d(),o=!1,Ee(r)}}}function l8(n){let e,t,i,s,l,o=n[14]&&sm(n);const r=n[36].beforeOptions,a=Nt(r,n,n[45],xp);let u=ce(n[22]),f=[];for(let g=0;gD(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=rm(n));const m=n[36].afterOptions,h=Nt(m,n,n[45],Xp);return{c(){o&&o.c(),e=C(),a&&a.c(),t=C(),i=b("div");for(let g=0;gD(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=tm(n));let c=!n[5]&&!n[6]&&lm(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),re()),(!o||m[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;md?[]:void 0}=e,{selected:k=_()}=e,{toggle:S=d}=e,{closable:$=!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=wt();let{class:N=""}=e,R,z="",F,B;function J(Te){if(U.isEmpty(k))return;let nt=U.toArray(k);U.inArray(nt,Te)&&(U.removeByValue(nt,Te),t(0,k=d?nt:(nt==null?void 0:nt[0])||_())),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function V(Te){if(d){let nt=U.toArray(k);U.inArray(nt,Te)||t(0,k=[...nt,Te])}else t(0,k=Te);P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function Z(Te){return s(Te)?J(Te):V(Te)}function G(){t(0,k=_()),P("change",{selected:k}),F==null||F.dispatchEvent(new CustomEvent("change",{detail:k,bubbles:!0}))}function de(){R!=null&&R.show&&(R==null||R.show())}function pe(){R!=null&&R.hide&&(R==null||R.hide())}function ae(){if(U.isEmpty(k)||U.isEmpty(c))return;let Te=U.toArray(k),nt=[];for(const zt of Te)U.inArray(c,zt)||nt.push(zt);if(nt.length){for(const zt of nt)U.removeByValue(Te,zt);t(0,k=d?Te:Te[0])}}function Ce(){t(17,z="")}function Ye(Te,nt){Te=Te||[];const zt=A||o8;return Te.filter(Ne=>zt(Ne,nt))||[]}function Ke(Te,nt){Te.preventDefault(),S&&d?Z(nt):V(nt)}function ct(Te,nt){(Te.code==="Enter"||Te.code==="Space")&&(Ke(Te,nt),$&&pe())}function et(){Ce(),setTimeout(()=>{const Te=F==null?void 0:F.querySelector(".dropdown-item.option.selected");Te&&(Te.focus(),Te.scrollIntoView({block:"nearest"}))},0)}function xe(Te){Te.stopPropagation(),!h&&!m&&(R==null||R.toggle())}un(()=>{const Te=document.querySelectorAll(`label[for="${r}"]`);for(const nt of Te)nt.addEventListener("click",xe);return()=>{for(const nt of Te)nt.removeEventListener("click",xe)}});const Be=Te=>J(Te);function ut(Te){ne[Te?"unshift":"push"](()=>{B=Te,t(20,B)})}function Bt(){z=this.value,t(17,z)}const Ue=(Te,nt)=>Ke(nt,Te),De=(Te,nt)=>ct(nt,Te);function ot(Te){ne[Te?"unshift":"push"](()=>{R=Te,t(18,R)})}function Ie(Te){Le.call(this,n,Te)}function We(Te){ne[Te?"unshift":"push"](()=>{F=Te,t(19,F)})}return n.$$set=Te=>{"id"in Te&&t(27,r=Te.id),"noOptionsText"in Te&&t(1,a=Te.noOptionsText),"selectPlaceholder"in Te&&t(2,u=Te.selectPlaceholder),"searchPlaceholder"in Te&&t(3,f=Te.searchPlaceholder),"items"in Te&&t(28,c=Te.items),"multiple"in Te&&t(4,d=Te.multiple),"disabled"in Te&&t(5,m=Te.disabled),"readonly"in Te&&t(6,h=Te.readonly),"upside"in Te&&t(7,g=Te.upside),"zeroFunc"in Te&&t(29,_=Te.zeroFunc),"selected"in Te&&t(0,k=Te.selected),"toggle"in Te&&t(8,S=Te.toggle),"closable"in Te&&t(9,$=Te.closable),"labelComponent"in Te&&t(10,T=Te.labelComponent),"labelComponentProps"in Te&&t(11,O=Te.labelComponentProps),"optionComponent"in Te&&t(12,E=Te.optionComponent),"optionComponentProps"in Te&&t(13,L=Te.optionComponentProps),"searchable"in Te&&t(14,I=Te.searchable),"searchFunc"in Te&&t(30,A=Te.searchFunc),"class"in Te&&t(15,N=Te.class),"$$scope"in Te&&t(45,o=Te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(ae(),Ce()),n.$$.dirty[0]&268566528&&t(22,i=Ye(c,z)),n.$$.dirty[0]&1&&t(21,s=function(Te){const nt=U.toArray(k);return U.inArray(nt,Te)})},[k,a,u,f,d,m,h,g,S,$,T,O,E,L,I,N,J,z,R,F,B,s,i,Ce,Ke,ct,et,r,c,_,A,V,Z,G,de,pe,l,Be,ut,Bt,Ue,De,ot,Ie,We,o]}class ms extends ve{constructor(e){super(),ye(this,e,r8,s8,be,{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 a8(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[4]],l={};for(let o=0;o',i=C(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(s,a)},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Oe(Re.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",it(n[3]))],l=!0)},p(u,f){ni(s,a=vt(r,[{disabled:!0},{type:"text"},{placeholder:"******"},f&16&&u[4]]))},d(u){u&&(y(e),y(i),y(s)),l=!1,Ee(o)}}}function f8(n){let e;function t(l,o){return l[1]?u8:a8}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function c8(n,e,t){const i=["value","mask"];let s=lt(e,i),{value:l=void 0}=e,{mask:o=!1}=e,r;async function a(){t(0,l=""),t(1,o=!1),await _n(),r==null||r.focus()}function u(c){ne[c?"unshift":"push"](()=>{r=c,t(2,r)})}function f(){l=this.value,t(0,l)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(4,s=lt(e,i)),"value"in c&&t(0,l=c.value),"mask"in c&&t(1,o=c.mask)},[l,o,r,a,s,u,f]}class rf extends ve{constructor(e){super(),ye(this,e,c8,f8,be,{value:0,mask:1})}}function d8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[1].clientId),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&2&&l.value!==u[1].clientId&&me(l,u[1].clientId)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function p8(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Client secret"),s=C(),H(l.$$.fragment),p(e,"for",i=n[23])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&2&&(r=!0,h.value=d[1].clientSecret,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function fm(n){let e,t,i,s;const l=[{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;dge(t,"config",o))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&q(t,e,null),s=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){oe();const c=t;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}r?(t=Ht(r,a(u,f)),ne.push(()=>ge(t,"config",o)),H(t.$$.fragment),M(t.$$.fragment,1),q(t,e,null)):t=null}else if(r){const c=f&72?vt(l,[f&64&&{key:u[6]},f&8&&At(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],$e(()=>i=!1)),t.$set(c)}},i(u){s||(t&&M(t.$$.fragment,u),s=!0)},o(u){t&&D(t.$$.fragment,u),s=!1},d(u){u&&y(e),t&&j(t)}}}function m8(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:n[6]+".clientId",$$slots:{default:[d8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:n[6]+".clientSecret",$$slots:{default:[p8,({uniqueId:f})=>({23:f}),({uniqueId:f})=>f?8388608:0]},$$scope:{ctx:n}}});let u=n[3].optionsComponent&&fm(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),u&&u.c(),p(e,"id",n[8]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),q(s,e,null),v(e,l),u&&u.m(e,null),o=!0,r||(a=Y(e,"submit",it(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}),s.$set(m),f[3].optionsComponent?u?(u.p(f,c),c&8&&M(u,1)):(u=fm(f),u.c(),M(u,1),u.m(e,null)):u&&(oe(),D(u,1,1,()=>{u=null}),re())},i(f){o||(M(t.$$.fragment,f),M(s.$$.fragment,f),M(u),o=!0)},o(f){D(t.$$.fragment,f),D(s.$$.fragment,f),D(u),o=!1},d(f){f&&y(e),j(t),j(s),u&&u.d(),r=!1,a()}}}function h8(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function _8(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[3].logo)||p(e,"src",t),p(e,"alt",i=n[3].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!wn(e.src,t="./images/oauth2/"+s[3].logo)&&p(e,"src",t),l&8&&i!==(i=s[3].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function g8(n){let e,t,i,s=n[3].title+"",l,o,r,a,u=n[3].key+"",f,c;function d(g,_){return g[3].logo?_8:h8}let m=d(n),h=m(n);return{c(){e=b("figure"),h.c(),t=C(),i=b("h4"),l=W(s),o=C(),r=b("small"),a=W("("),f=W(u),c=W(")"),p(e,"class","provider-logo"),p(r,"class","txt-hint"),p(i,"class","center txt-break")},m(g,_){w(g,e,_),h.m(e,null),w(g,t,_),w(g,i,_),v(i,l),v(i,o),v(i,r),v(r,a),v(r,f),v(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&&s!==(s=g[3].title+"")&&se(l,s),_&8&&u!==(u=g[3].key+"")&&se(f,u)},d(g){g&&(y(e),y(t),y(i)),h.d()}}}function cm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='',t=C(),i=b("div"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-circle btn-hint btn-sm"),p(e,"aria-label","Remove provider"),p(i,"class","flex-fill")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Oe(Re.call(null,e,{text:"Remove provider",position:"right"})),Y(e,"click",n[10])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function b8(n){let e,t,i,s,l,o,r,a,u=!n[4]&&cm(n);return{c(){u&&u.c(),e=C(),t=b("button"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Set provider config",p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[8]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[7]},m(f,c){u&&u.m(f,c),w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),v(s,l),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=cm(f),u.c(),u.m(e.parentNode,e)),c&128&&o!==(o=!f[7])&&(s.disabled=o)},d(f){f&&(y(e),y(t),y(i),y(s)),u&&u.d(f),r=!1,a()}}}function k8(n){let e,t,i={btnClose:!1,$$slots:{footer:[b8],header:[g8],default:[m8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777466&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}function y8(n,e,t){let i,s;const l=wt(),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(){Wn(s),r==null||r.hide()}async function _(){l("submit",{uiOptions:a,config:u}),g()}async function k(){yn(`Do you really want to remove the "${a.title}" OAuth2 provider from the collection?`,()=>{l("remove",{uiOptions:a}),g()})}function S(){u.clientId=this.value,t(1,u)}function $(P){d=P,t(5,d)}function T(P){n.$$.not_equal(u.clientSecret,P)&&(u.clientSecret=P,t(1,u))}function O(P){u=P,t(1,u)}const E=()=>_();function L(P){ne[P?"unshift":"push"](()=>{r=P,t(2,r)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return n.$$.update=()=>{n.$$.dirty&4098&&t(7,i=JSON.stringify(u)!=c),n.$$.dirty&8192&&t(6,s="oauth2.providers."+m)},[g,u,r,a,f,d,s,i,o,_,k,h,c,m,S,$,T,O,E,L,I,A]}class v8 extends ve{constructor(e){super(),ye(this,e,y8,k8,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function w8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Client ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function S8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Team ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&me(l,u[3])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function T8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Key ID"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&me(l,u[4])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function $8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","number"),p(r,"id",a=n[23]),p(r,"max",or),r.required=!0},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[6]),u||(f=[Oe(Re.call(null,s,{text:`Max ${or} seconds (~${or/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&mt(r.value)!==c[6]&&me(r,c[6])},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function C8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Private key"),s=C(),l=b("textarea"),r=C(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- ... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&me(l,c[5])},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function C8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S;return s=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[v8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[w8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[S8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[T8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[$8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),_=C(),H(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){w($,e,T),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),v(t,_),q(g,t,null),h=!0,k||(S=Y(e,"submit",it(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),s.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){h||(M(s.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),h=!0)},o($){D(s.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),h=!1},d($){$&&y(e),j(s),j(r),j(f),j(m),j(g),k=!1,S()}}}function O8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function M8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(c,d){w(c,e,d),v(e,t),w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&x(s,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(s)),u=!1,f()}}}function E8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[M8],header:[O8],default:[C8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const or=15777e3;function D8(n,e,t){let i;const s=wt(),l="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||or),Jt({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){he.error(P)}t(7,d=!1)}function h(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=mt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ne[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return t(8,i=!0),[_,o,r,a,u,f,c,d,i,l,g,m,h,k,S,$,T,O,E,L,I,A]}class I8 extends ve{constructor(e){super(),ye(this,e,D8,E8,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function L8(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new I8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Generate secret",o=C(),H(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),v(e,t),v(e,i),v(e,s),w(d,o,m),q(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const _={};r.$set(_)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),j(r,d),u=!1,f()}}}function A8(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){ne[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class P8 extends ve{constructor(e){super(),ye(this,e,A8,L8,be,{key:1,config:0})}}function dm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function N8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&dm(n);return{c(){l&&l.c(),e=C(),t=b("span"),s=W(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=dm(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:te,o:te,d(o){o&&(y(e),y(t)),l&&l.d(o)}}}function R8(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class pm extends ve{constructor(e){super(),ye(this,e,R8,N8,be,{item:0})}}const F8=n=>({}),mm=n=>({});function q8(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[13],mm);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&8192)&&Ft(i,t,s,s[13],e?Rt(t,s[13],l,F8):qt(s[13]),mm)},i(s){e||(M(i,s),e=!0)},o(s){D(i,s),e=!1},d(s){i&&i.d(s)}}}function j8(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[q8]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?vt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&At(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function H8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=pm}=e,{optionComponent:c=pm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e,_=JSON.stringify(m);function g(O){O=U.toArray(O,!0);let E=[];for(let L of O){const I=U.findByKey(r,d,L);I&&E.push(I)}O.length&&!E.length||t(0,u=a?E:E[0])}async function h(O){if(!r.length)return;let E=U.toArray(O,!0).map(I=>I[d]),L=a?E:E[0];JSON.stringify(L)!=_&&(t(6,m=L),_=JSON.stringify(m))}function k(O){u=O,t(0,u)}function S(O){Le.call(this,n,O)}function $(O){Le.call(this,n,O)}function T(O){Le.call(this,n,O)}return n.$$set=O=>{e=je(je({},e),Kt(O)),t(5,s=lt(e,i)),"items"in O&&t(1,r=O.items),"multiple"in O&&t(2,a=O.multiple),"selected"in O&&t(0,u=O.selected),"labelComponent"in O&&t(3,f=O.labelComponent),"optionComponent"in O&&t(4,c=O.optionComponent),"selectionKey"in O&&t(7,d=O.selectionKey),"keyOfSelected"in O&&t(6,m=O.keyOfSelected),"$$scope"in O&&t(13,o=O.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&h(u)},[u,r,a,f,c,s,m,d,l,k,S,$,T,o]}class $n extends ve{constructor(e){super(),ye(this,e,H8,j8,be,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function z8(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],items:n[1]};return n[0]!==void 0&&(u.keyOfSelected=n[0]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Site"),s=C(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function U8(n){let e,t,i,s;return e=new fe({props:{class:"form-field",$$slots:{default:[z8,({uniqueId:l})=>({4:l}),({uniqueId:l})=>l?16:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.innerHTML=`

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

Note that the Lark user's Union ID will be used for the association with the +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&me(l,c[5])},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function O8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S;return s=new fe({props:{class:"form-field required",name:"clientId",$$slots:{default:[w8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"teamId",$$slots:{default:[S8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field required",name:"keyId",$$slots:{default:[T8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field required",name:"duration",$$slots:{default:[$8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[C8,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),H(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){w($,e,T),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),v(t,h),q(g,t,null),_=!0,k||(S=Y(e,"submit",it(n[17])),k=!0)},p($,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:$}),s.$set(O);const E={};T&25165832&&(E.$$scope={dirty:T,ctx:$}),r.$set(E);const L={};T&25165840&&(L.$$scope={dirty:T,ctx:$}),f.$set(L);const I={};T&25165888&&(I.$$scope={dirty:T,ctx:$}),m.$set(I);const A={};T&25165856&&(A.$$scope={dirty:T,ctx:$}),g.$set(A)},i($){_||(M(s.$$.fragment,$),M(r.$$.fragment,$),M(f.$$.fragment,$),M(m.$$.fragment,$),M(g.$$.fragment,$),_=!0)},o($){D(s.$$.fragment,$),D(r.$$.fragment,$),D(f.$$.fragment,$),D(m.$$.fragment,$),D(g.$$.fragment,$),_=!1},d($){$&&y(e),j(s),j(r),j(f),j(m),j(g),k=!1,S()}}}function M8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function E8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(c,d){w(c,e,d),v(e,t),w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&x(s,"btn-loading",c[7])},d(c){c&&(y(e),y(i),y(s)),u=!1,f()}}}function D8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[E8],header:[M8],default:[O8]},$$scope:{ctx:n}};return e=new ln({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const or=15777e3;function I8(n,e,t){let i;const s=wt(),l="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||or),Jt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const P=await he.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),nn("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){he.error(P)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=mt(this.value),t(6,c)}function T(){f=this.value,t(5,f)}const O=()=>g(),E=()=>!d;function L(P){ne[P?"unshift":"push"](()=>{o=P,t(1,o)})}function I(P){Le.call(this,n,P)}function A(P){Le.call(this,n,P)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,g,m,_,k,S,$,T,O,E,L,I,A]}class L8 extends ve{constructor(e){super(),ye(this,e,I8,D8,be,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function A8(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new L8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent="Generate secret",o=C(),H(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),v(e,t),v(e,i),v(e,s),w(d,o,m),q(r,d,m),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const h={};r.$set(h)},i(d){a||(M(r.$$.fragment,d),a=!0)},o(d){D(r.$$.fragment,d),a=!1},d(d){d&&(y(e),y(o)),n[4](null),j(r,d),u=!1,f()}}}function P8(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){ne[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class N8 extends ve{constructor(e){super(),ye(this,e,P8,A8,be,{key:1,config:0})}}function dm(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&y(e)}}}function R8(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&dm(n);return{c(){l&&l.c(),e=C(),t=b("span"),s=W(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=dm(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(s,i)},i:te,o:te,d(o){o&&(y(e),y(t)),l&&l.d(o)}}}function F8(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class pm extends ve{constructor(e){super(),ye(this,e,F8,R8,be,{item:0})}}const q8=n=>({}),mm=n=>({});function j8(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[13],mm);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&8192)&&Ft(i,t,s,s[13],e?Rt(t,s[13],l,q8):qt(s[13]),mm)},i(s){e||(M(i,s),e=!0)},o(s){D(i,s),e=!1},d(s){i&&i.d(s)}}}function H8(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[j8]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),e.$on("change",n[12]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?vt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&At(r[5])]):{};a&8192&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function z8(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=pm}=e,{optionComponent:c=pm}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e,h=JSON.stringify(m);function g(O){O=U.toArray(O,!0);let E=[];for(let L of O){const I=U.findByKey(r,d,L);I&&E.push(I)}O.length&&!E.length||t(0,u=a?E:E[0])}async function _(O){if(!r.length)return;let E=U.toArray(O,!0).map(I=>I[d]),L=a?E:E[0];JSON.stringify(L)!=h&&(t(6,m=L),h=JSON.stringify(m))}function k(O){u=O,t(0,u)}function S(O){Le.call(this,n,O)}function $(O){Le.call(this,n,O)}function T(O){Le.call(this,n,O)}return n.$$set=O=>{e=je(je({},e),Kt(O)),t(5,s=lt(e,i)),"items"in O&&t(1,r=O.items),"multiple"in O&&t(2,a=O.multiple),"selected"in O&&t(0,u=O.selected),"labelComponent"in O&&t(3,f=O.labelComponent),"optionComponent"in O&&t(4,c=O.optionComponent),"selectionKey"in O&&t(7,d=O.selectionKey),"keyOfSelected"in O&&t(6,m=O.keyOfSelected),"$$scope"in O&&t(13,o=O.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,s,m,d,l,k,S,$,T,o]}class $n extends ve{constructor(e){super(),ye(this,e,z8,H8,be,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function U8(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],items:n[1]};return n[0]!==void 0&&(u.keyOfSelected=n[0]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Site"),s=C(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function V8(n){let e,t,i,s;return e=new fe({props:{class:"form-field",$$slots:{default:[U8,({uniqueId:l})=>({4:l}),({uniqueId:l})=>l?16:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.innerHTML=`
Note that the Lark user's Union ID will be used for the association with the PocketBase user (see Different Types of Lark IDs - ).
`,p(i,"class","alert alert-info")},m(l,o){q(e,l,o),w(l,t,o),w(l,i,o),s=!0},p(l,[o]){const r={};o&49&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){s||(M(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&(y(t),y(i)),j(e,l)}}}const hm="feishu.cn",Sa="larksuite.com";function V8(n,e,t){var r;let{config:i={}}=e;const s=[{label:"Feishu (China)",value:hm},{label:"Lark (International)",value:Sa}];let l=hm;(r=i.authURL)!=null&&r.includes(Sa)&&(l=Sa);function o(a){l=a,t(0,l)}return n.$$set=a=>{"config"in a&&t(2,i=a.config)},n.$$.update=()=>{n.$$.dirty&1&&(t(2,i.authURL=`https://accounts.${l}/open-apis/authen/v1/authorize`,i),t(2,i.tokenURL=`https://open.${l}/open-apis/authen/v2/oauth/token`,i),t(2,i.userInfoURL=`https://open.${l}/open-apis/authen/v1/user_info`,i))},[l,s,i,o]}class B8 extends ve{constructor(e){super(),ye(this,e,V8,U8,be,{config:2})}}function W8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[0].authURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&1&&l.value!==c[0].authURL&&me(l,c[0].authURL)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function Y8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[0].tokenURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&1&&l.value!==c[0].tokenURL&&me(l,c[0].tokenURL)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function K8(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[W8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[Y8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),q(l,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}),l.$set(f)},i(r){o||(M(i.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(s)),j(i,r),j(l,r)}}}function J8(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authURL=this.value,t(0,s)}function o(){s.tokenURL=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class Z8 extends ve{constructor(e){super(),ye(this,e,J8,K8,be,{key:1,config:0})}}function G8(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=U.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Kt(c)),t(5,l=lt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=U.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class _o extends ve{constructor(e){super(),ye(this,e,X8,G8,be,{value:0,separator:1,readonly:2,disabled:3})}}function Q8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Display name"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","text"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].displayName),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].displayName&&me(l,u[0].displayName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function x8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function tO(n){let e,t,i,s,l,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]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),s=C(),H(l.$$.fragment),p(e,"for",i=n[13])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,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],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function nO(n){let e,t,i,s,l,o,r,a;return s=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[lO,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[sO,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token - is a direct result of the trusted server code->token exchange response.`,i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),v(e,t),v(e,i),q(s,e,null),v(e,l),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}),s.$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(s.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=qe(e,ht,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(s.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=qe(e,ht,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),j(s),j(o),u&&r&&r.end()}}}function iO(n){let e,t,i,s;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[oO,({uniqueId:l})=>({13:l}),({uniqueId:l})=>l?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","content")},m(l,o){w(l,e,o),q(t,e,null),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:l}),t.$set(r)},i(l){s||(M(t.$$.fragment,l),l&&tt(()=>{s&&(i||(i=qe(e,ht,{delay:10,duration:150},!0)),i.run(1))}),s=!0)},o(l){D(t.$$.fragment,l),l&&(i||(i=qe(e,ht,{delay:10,duration:150},!1)),i.run(0)),s=!1},d(l){l&&y(e),j(t),l&&i&&i.end()}}}function lO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].extra.jwksURL),u||(f=[Oe(Re.call(null,s,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&me(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function sO(n){let e,t,i,s,l,o,r,a,u,f,c;function d(_){n[10](_)}let m={id:n[13]};return n[0].extra.issuers!==void 0&&(m.value=n[0].extra.issuers),r=new _o({props:m}),ne.push(()=>ge(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13])},m(_,g){w(_,e,g),v(e,t),v(e,i),v(e,s),w(_,o,g),q(r,_,g),u=!0,f||(c=Oe(Re.call(null,s,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(_,g){(!u||g&8192&&l!==(l=_[13]))&&p(e,"for",l);const h={};g&8192&&(h.id=_[13]),!a&&g&1&&(a=!0,h.value=_[0].extra.issuers,$e(()=>a=!1)),r.$set(h)},i(_){u||(M(r.$$.fragment,_),u=!0)},o(_){D(r.$$.fragment,_),u=!1},d(_){_&&(y(e),y(o)),j(r,_),f=!1,c()}}}function oO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[11]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function aO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[Q8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[x8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[eO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[tO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[iO,nO],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[rO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",s=C(),H(l.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),c=b("div"),m.c(),_=C(),H(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),w(T,t,O),w(T,i,O),w(T,s,O),q(l,T,O),w(T,o,O),q(r,T,O),w(T,a,O),q(u,T,O),w(T,f,O),w(T,c,O),S[d].m(c,null),w(T,_,O),q(g,T,O),h=!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}),l.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(oe(),D(S[P],1,1,()=>{S[P]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){h||(M(e.$$.fragment,T),M(l.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),h=!0)},o(T){D(e.$$.fragment,T),D(l.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),h=!1},d(T){T&&(y(t),y(i),y(s),y(o),y(a),y(f),y(c),y(_)),j(e,T),j(l,T),j(r,T),j(u,T),S[d].d(),j(g,T)}}}function uO(n,e,t){let{key:i=""}=e,{config:s={}}=e;const l=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!s.userInfoURL;U.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC"),s.extra||(s.extra={},o=!0);function r(){o?t(0,s.extra={},s):(t(0,s.userInfoURL="",s),t(0,s.extra=s.extra||{},s))}function a(){s.displayName=this.value,t(0,s)}function u(){s.authURL=this.value,t(0,s)}function f(){s.tokenURL=this.value,t(0,s)}function c(h){o=h,t(2,o)}function d(){s.userInfoURL=this.value,t(0,s)}function m(){s.extra.jwksURL=this.value,t(0,s)}function _(h){n.$$.not_equal(s.extra.issuers,h)&&(s.extra.issuers=h,t(0,s))}function g(){s.pkce=this.checked,t(0,s)}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"config"in h&&t(0,s=h.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[s,i,o,l,a,u,f,c,d,m,_,g]}class Ta extends ve{constructor(e){super(),ye(this,e,uO,aO,be,{key:1,config:0})}}function fO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function cO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function dO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function pO(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[fO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),v(e,t),w(f,i,c),q(s,f,c),w(f,l,c),q(o,f,c),w(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(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}),s.$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 _={};c&8&&(_.class="form-field "+(f[3]?"required":"")),c&2&&(_.name=f[1]+".userInfoURL"),c&777&&(_.$$scope={dirty:c,ctx:f}),a.$set(_)},i(f){u||(M(s.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(s.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(l),y(r)),j(s,f),j(o,f),j(a,f)}}}function mO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authURL=this.value,t(0,l)}function u(){l.tokenURL=this.value,t(0,l)}function f(){l.userInfoURL=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=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&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class $a extends ve{constructor(e){super(),ye(this,e,mO,pO,be,{key:1,config:0,required:4,title:2})}}const af=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:P8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:Z8},{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:$a,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:$a,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"X/Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"lark",title:"Lark",logo:"lark.svg",optionsComponent:B8},{key:"box",title:"Box",logo:"box.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"trakt",title:"Trakt",logo:"trakt.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:$a,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta}];function _m(n,e,t){const i=n.slice();return i[16]=e[t],i}function gm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function hO(n){let e,t,i,s,l,o,r,a,u,f,c=n[1]!=""&&gm(n);return{c(){e=b("label"),t=b("i"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(l,"id",o=n[19]),p(l,"type","text"),p(l,"placeholder","Search provider")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[1]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"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(l,"id",o),m&2&&l.value!==d[1]&&me(l,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=gm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(oe(),D(c,1,1,()=>{c=null}),re())},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function bm(n){let e,t,i,s,l=n[1]!=""&&km(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),l&&l.c(),s=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){w(o,e,r),v(e,t),v(e,i),l&&l.m(e,null),v(e,s)},p(o,r){o[1]!=""?l?l.p(o,r):(l=km(o),l.c(),l.m(e,s)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function km(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(s,l){w(s,e,l),t||(i=Y(e,"click",n[5]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function ym(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!wn(e.src,t="./images/oauth2/"+s[16].logo)&&p(e,"src",t),l&8&&i!==(i=s[16].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function vm(n,e){let t,i,s,l,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,_,g,h,k=e[16].logo&&ym(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),s=b("figure"),k&&k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),_=C(),p(s,"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($,T){w($,t,T),v(t,i),v(i,s),k&&k.m(s,null),v(i,l),v(i,o),v(o,r),v(r,u),v(o,f),v(o,c),v(c,m),v(t,_),g||(h=Y(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=ym(e),k.c(),k.m(s,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&se(u,a),T&8&&d!==(d=e[16].key+"")&&se(m,d)},d($){$&&y(t),k&&k.d(),g=!1,h()}}}function _O(n){let e,t,i,s=[],l=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[hO,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=ce(n[3]);const a=f=>f[16].key;for(let f=0;f!s.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const _=()=>t(1,o=""),g=$=>f($);function h($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}function k($){Le.call(this,n,$)}function S($){Le.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,s=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||s!==-1)&&t(3,r=c())},[u,o,l,r,f,d,s,a,m,_,g,h,k,S]}class vO extends ve{constructor(e){super(),ye(this,e,yO,kO,be,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function wm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const s=i[9](i[28].name);return i[29]=s,i}function wO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(s,"for",o=n[27])},m(u,f){w(u,e,f),e.checked=n[0].oauth2.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function SO(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function TO(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l[0]&1&&!wn(e.src,t="./images/oauth2/"+s[29].logo)&&p(e,"src",t),l[0]&1&&i!==(i=s[29].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function Sm(n){let e,t,i;function s(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,{text:"Edit config",position:"left"})),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function Tm(n,e){var $;let t,i,s,l,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,_;function g(T,O){var E;return(E=T[29])!=null&&E.logo?TO:SO}let h=g(e),k=h(e),S=e[29]&&Sm(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),s=b("figure"),k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),_=C(),S&&S.c(),p(s,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),x(i,"error",!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){w(T,t,O),v(t,i),v(i,s),k.m(s,null),v(i,l),v(i,o),v(o,r),v(r,u),v(o,f),v(o,c),v(c,m),v(i,_),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,h===(h=g(e))&&k?k.p(e,O):(k.d(1),k=h(e),k&&(k.c(),k.m(s,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&se(u,a),O[0]&1&&d!==(d=e[28].name+"")&&se(m,d),e[29]?S?S.p(e,O):(S=Sm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&x(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&&y(t),k.d(),S&&S.d()}}}function $O(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function CO(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function $m(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g;return s=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[OO,({uniqueId:h})=>({27:h}),({uniqueId:h})=>[h?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[MO,({uniqueId:h})=>({27:h}),({uniqueId:h})=>[h?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[EO,({uniqueId:h})=>({27:h}),({uniqueId:h})=>[h?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[DO,({uniqueId:h})=>({27:h}),({uniqueId:h})=>[h?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(h,k){w(h,e,k),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),g=!0},p(h,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:h}),s.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:h}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:h}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:h}),m.$set(O)},i(h){g||(M(s.$$.fragment,h),M(r.$$.fragment,h),M(f.$$.fragment,h),M(m.$$.fragment,h),h&&tt(()=>{g&&(_||(_=qe(e,ht,{duration:150},!0)),_.run(1))}),g=!0)},o(h){D(s.$$.fragment,h),D(r.$$.fragment,h),D(f.$$.fragment,h),D(m.$$.fragment,h),h&&(_||(_=qe(e,ht,{duration:150},!1)),_.run(0)),g=!1},d(h){h&&y(e),j(s),j(r),j(f),j(m),h&&_&&_.end()}}}function OO(n){let e,t,i,s,l,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),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function MO(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:FO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function EO(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:qO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function DO(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:jO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function IO(n){let e,t,i,s=[],l=new Map,o,r,a,u,f,c,d,m=n[0].name+"",_,g,h,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[wO,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=ce(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=W("Optional "),_=W(m),g=W(" create fields map"),h=C(),N.c(),S=C(),R&&R.c(),$=ke(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),w(z,t,F),w(z,i,F);for(let B=0;B{R=null}),re())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),j(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,l),w(a,o,u),w(a,r,u)},p(a,u){u[0]&128&&se(t,a[7]),u[0]&128&&s!==(s=a[7]==1?"provider":"providers")&&se(l,s),u[0]&128&&x(e,"label-warning",!a[7]),u[0]&128&&x(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function Cm(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function PO(n){let e,t,i,s,l,o;function r(c,d){return c[0].oauth2.enabled?AO:LO}let a=r(n),u=a(n),f=n[8]&&Cm();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[8]?f?d[0]&256&&M(f,1):(f=Cm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function NO(n){var u,f;let e,t,i,s,l,o;e=new Ui({props:{single:!0,$$slots:{header:[PO],default:[IO]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(Om))||[]};i=new vO({props:r}),n[18](i),i.$on("select",n[19]);let a={};return l=new y8({props:a}),n[20](l),l.$on("remove",n[21]),l.$on("submit",n[22]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(c,d){q(e,c,d),w(c,t,d),q(i,c,d),w(c,s,d),q(l,c,d),o=!0},p(c,d){var h,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const _={};d[0]&1&&(_.disabled=((k=(h=c[0].oauth2)==null?void 0:h.providers)==null?void 0:k.map(Om))||[]),i.$set(_);const g={};l.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(l.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(l.$$.fragment,c),o=!1},d(c){c&&(y(t),y(s)),j(e,c),n[18](null),j(i,c),n[20](null),j(l,c)}}}const RO=()=>"",FO=()=>"",qO=()=>"",jO=()=>"",Om=n=>n.name;function HO(n,e,t){let i,s,l;Ge(n,Tn,F=>t(1,l=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=[],_=[];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,_=((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 h(F){for(let B of af)if(B.key==F)return B;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,B,J)=>{c==null||c.show(F,B,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function 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){ne[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){ne[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(l==null?void 0:l.oauth2)),n.$$.dirty[0]&1&&t(7,s=((B=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:B.length)||0)},[o,l,f,c,d,m,_,s,i,h,k,S,$,T,O,E,L,I,A,P,N,R,z]}class zO extends ve{constructor(e){super(),ye(this,e,HO,NO,be,{collection:0},null,[-1,-1])}}function Mm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function UO(n){let e,t,i,s,l,o,r,a,u,f,c=n[2]&&Mm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"for",o=n[8])},m(d,m){w(d,e,m),e.checked=n[0].otp.enabled,w(d,i,m),w(d,s,m),v(s,l),w(d,r,m),c&&c.m(d,m),w(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(s,"for",o),d[2]?c||(c=Mm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(s),y(r),y(a)),c&&c.d(d),u=!1,Ee(f)}}}function VO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.duration),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].otp.duration&&me(l,u[0].otp.duration)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function BO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.length),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].otp.length&&me(l,u[0].otp.length)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function WO(n){let e,t,i,s,l,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[UO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[VO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[BO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),p(s,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),w(f,t,c),w(f,i,c),v(i,s),q(l,s,null),v(i,o),v(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}),l.$set(m);const _={};c&769&&(_.$$scope={dirty:c,ctx:f}),a.$set(_)},i(f){u||(M(e.$$.fragment,f),M(l.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),j(e,f),j(l),j(a)}}}function YO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function KO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Em(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function JO(n){let e,t,i,s,l,o;function r(c,d){return c[0].otp.enabled?KO:YO}let a=r(n),u=a(n),f=n[1]&&Em();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=Em(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function ZO(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[JO],default:[WO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GO(n,e,t){let i,s,l;Ge(n,Tn,c=>t(3,l=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=mt(this.value),t(0,o)}function f(){o.otp.length=mt(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,s=!U.isEmpty(l==null?void 0:l.otp))},[o,s,i,l,r,a,u,f]}class XO extends ve{constructor(e){super(),ye(this,e,GO,ZO,be,{collection:0})}}function Dm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function QO(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&Dm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(s,"for",o=n[9])},m(d,m){w(d,e,m),e.checked=n[0].passwordAuth.enabled,w(d,i,m),w(d,s,m),v(s,l),w(d,r,m),c&&c.m(d,m),w(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(s,"for",o),d[3]?c||(c=Dm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function xO(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",s=C(),H(l.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,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,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function eM(n){let e,t,i,s;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[QO,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[xO,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function tM(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function nM(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Im(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function iM(n){let e,t,i,s,l,o;function r(c,d){return c[0].passwordAuth.enabled?nM:tM}let a=r(n),u=a(n),f=n[2]&&Im();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&M(f,1):(f=Im(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function lM(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[iM],default:[eM]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&1039&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function sM(n,e,t){let i,s,l;Ge(n,Tn,d=>t(5,l=d));let{collection:o}=e,r=[],a="";function u(){t(1,r=[{value:"email"}]);const d=(o==null?void 0:o.fields)||[],m=(o==null?void 0:o.indexes)||[];t(4,a=m.join(""));for(let _ of m){const g=U.parseIndex(_);if(!g.unique||g.columns.length!=1||g.columns[0].name=="email")continue;const h=d.find(k=>!k.hidden&&k.name.toLowerCase()==g.columns[0].name.toLowerCase());h&&r.push({value:h.name})}}function f(){o.passwordAuth.enabled=this.checked,t(0,o)}function c(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,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,s=!U.isEmpty(l==null?void 0:l.passwordAuth)),n.$$.dirty&17&&o&&a!=o.indexes.join("")&&u()},[o,r,s,i,a,l,f,c]}class oM extends ve{constructor(e){super(),ye(this,e,sM,lM,be,{collection:0})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function Am(n,e){let t,i,s,l,o,r=e[27].label+"",a,u,f,c,d,m;return c=av(e[15][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),l=C(),o=b("label"),a=W(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[26]+e[27].value),i.__value=e[27].value,me(i,i.__value),p(o,"for",u=e[26]+e[27].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(_,g){w(_,t,g),v(t,i),i.checked=i.__value===e[3],v(t,l),v(t,o),v(o,a),v(t,f),d||(m=Y(i,"change",e[14]),d=!0)},p(_,g){e=_,g&67108864&&s!==(s=e[26]+e[27].value)&&p(i,"id",s),g&8&&(i.checked=i.__value===e[3]),g&67108864&&u!==(u=e[26]+e[27].value)&&p(o,"for",u)},d(_){_&&y(t),c.r(),d=!1,m()}}}function rM(n){let e=[],t=new Map,i,s=ce(n[11]);const l=o=>o[27].value;for(let o=0;o({26:i}),({uniqueId:i})=>i?67108864:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1140850882&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function aM(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[26],selectPlaceholder:n[7]?"Loading auth collections...":"Select auth collection",noOptionsText:"No auth collections found",selectionKey:"id",items:n[6]};return n[1]!==void 0&&(u.keyOfSelected=n[1]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Auth collection"),s=C(),H(l.$$.fragment),p(e,"for",i=n[26])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&67108864&&i!==(i=f[26]))&&p(e,"for",i);const d={};c&67108864&&(d.id=f[26]),c&128&&(d.selectPlaceholder=f[7]?"Loading auth collections...":"Select auth collection"),c&64&&(d.items=f[6]),!o&&c&2&&(o=!0,d.keyOfSelected=f[1],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function uM(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("To email address"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.autofocus=!0,l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),l.focus(),r||(a=Y(l,"input",n[17]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function fM(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:"template",$$slots:{default:[rM,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}});let u=n[8]&&Pm(n);return l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[uM,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),u&&u.c(),s=C(),H(l.$$.fragment),p(e,"id",n[10]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),u&&u.m(e,null),v(e,s),q(l,e,null),o=!0,r||(a=Y(e,"submit",it(n[18])),r=!0)},p(f,c){const d={};c&1140850696&&(d.$$scope={dirty:c,ctx:f}),t.$set(d),f[8]?u?(u.p(f,c),c&256&&M(u,1)):(u=Pm(f),u.c(),M(u,1),u.m(e,s)):u&&(oe(),D(u,1,1,()=>{u=null}),re());const m={};c&1140850692&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(M(t.$$.fragment,f),M(u),M(l.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),D(u),D(l.$$.fragment,f),o=!1},d(f){f&&y(e),j(t),u&&u.d(),j(l),r=!1,a()}}}function cM(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function dM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[5],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[10]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[5],x(s,"btn-loading",n[5])},m(c,d){w(c,e,d),v(e,t),w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&32&&(e.disabled=c[5]),d&544&&a!==(a=!c[9]||c[5])&&(s.disabled=a),d&32&&x(s,"btn-loading",c[5])},d(c){c&&(y(e),y(i),y(s)),u=!1,f()}}}function pM(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[5],escClose:!n[5],beforeHide:n[19],popup:!0,$$slots:{footer:[dM],header:[cM],default:[fM]},$$scope:{ctx:n}};return e=new ln({props:i}),n[20](e),e.$on("show",n[21]),e.$on("hide",n[22]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.overlayClose=!s[5]),l&32&&(o.escClose=!s[5]),l&32&&(o.beforeHide=s[19]),l&1073742830&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[20](null),j(e,s)}}}const Ca="last_email_test",Nm="email_test_request";function mM(n,e,t){let i;const s=wt(),l="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(Ca),f=o[0].value,c=!1,d=null,m=[],_=!1,g=!1;function h(z="",F="",B=""){Jt({}),t(8,g=!1),t(1,a=z||""),a||$(),t(2,u=F||localStorage.getItem(Ca)),t(3,f=B||o[0].value),r==null||r.show()}function k(){return clearTimeout(d),r==null?void 0:r.hide()}async function S(){if(!(!i||c||!a)){t(5,c=!0),localStorage==null||localStorage.setItem(Ca,u),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(Nm),Mi("Test email send timeout.")},3e4);try{await he.settings.testEmail(a,u,f,{$cancelKey:Nm}),nn("Successfully sent test email."),s("submit"),t(5,c=!1),await _n(),k()}catch(z){t(5,c=!1),he.error(z)}clearTimeout(d)}}async function $(){var z;t(8,g=!0),t(7,_=!0);try{t(6,m=await he.collections.getFullList({filter:"type='auth'",sort:"+name",requestKey:l+"_collections_loading"})),t(1,a=((z=m[0])==null?void 0:z.id)||""),t(7,_=!1)}catch(F){F.isAbort||(t(7,_=!1),he.error(F))}}const T=[[]];function O(){f=this.__value,t(3,f)}function E(z){a=z,t(1,a)}function L(){u=this.value,t(2,u)}const I=()=>S(),A=()=>!c;function P(z){ne[z?"unshift":"push"](()=>{r=z,t(4,r)})}function N(z){Le.call(this,n,z)}function R(z){Le.call(this,n,z)}return n.$$.update=()=>{n.$$.dirty&14&&t(9,i=!!u&&!!f&&!!a)},[k,a,u,f,r,c,m,_,g,i,l,o,S,h,O,T,E,L,I,A,P,N,R]}class zy extends ve{constructor(e){super(),ye(this,e,mM,pM,be,{show:13,hide:0})}get show(){return this.$$.ctx[13]}get hide(){return this.$$.ctx[0]}}function Rm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function hM(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){w(u,e,f),e.checked=n[0].authAlert.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Fm(n){let e,t,i;function s(o){n[11](o)}let l={};return n[0]!==void 0&&(l.collection=n[0]),e=new zO({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qm(n,e){var a;let t,i,s,l;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 TC({props:r}),ne.push(()=>ge(i,"config",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),q(i,u,f),l=!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),!s&&f&4&&(s=!0,c.config=e[18].config,$e(()=>s=!1)),i.$set(c)},i(u){l||(M(i.$$.fragment,u),l=!0)},o(u){D(i.$$.fragment,u),l=!1},d(u){u&&y(t),j(i,u)}}}function _M(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,B,J,V,Z,G,de,pe,ae;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[hM,({uniqueId:Ie})=>({21:Ie}),({uniqueId:Ie})=>Ie?2097152:0]},$$scope:{ctx:n}}});function Ce(Ie){n[10](Ie)}let Ye={};n[0]!==void 0&&(Ye.collection=n[0]),u=new oM({props:Ye}),ne.push(()=>ge(u,"collection",Ce));let Ke=!n[1]&&Fm(n);function ct(Ie){n[12](Ie)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new XO({props:et}),ne.push(()=>ge(m,"collection",ct));function xe(Ie){n[13](Ie)}let Be={};n[0]!==void 0&&(Be.collection=n[0]),h=new GC({props:Be}),ne.push(()=>ge(h,"collection",xe));let ut=ce(n[2]);const Bt=Ie=>Ie[18].key;for(let Ie=0;Iege(J,"collection",Ue));let ot={};return G=new zy({props:ot}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),c=C(),Ke&&Ke.c(),d=C(),H(m.$$.fragment),g=C(),H(h.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let Ie=0;Ief=!1)),u.$set(nt),Ie[1]?Ke&&(oe(),D(Ke,1,1,()=>{Ke=null}),re()):Ke?(Ke.p(Ie,We),We&2&&M(Ke,1)):(Ke=Fm(Ie),Ke.c(),M(Ke,1),Ke.m(a,d));const zt={};!_&&We&1&&(_=!0,zt.collection=Ie[0],$e(()=>_=!1)),m.$set(zt);const Ne={};!k&&We&1&&(k=!0,Ne.collection=Ie[0],$e(()=>k=!1)),h.$set(Ne),We&4&&(ut=ce(Ie[2]),oe(),P=kt(P,We,Bt,1,Ie,ut,N,A,Yt,qm,null,Rm),re());const Me={};!V&&We&1&&(V=!0,Me.collection=Ie[0],$e(()=>V=!1)),J.$set(Me);const bt={};G.$set(bt)},i(Ie){if(!de){M(o.$$.fragment,Ie),M(u.$$.fragment,Ie),M(Ke),M(m.$$.fragment,Ie),M(h.$$.fragment,Ie);for(let We=0;Wec==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,s),t(5,r),t(4,a),t(8,l),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ne[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,s={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,l={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?[s,r,a]:[l,s,o,r,a])},[u,i,f,c,a,r,o,s,l,d,m,_,g,h,k,S,$,T]}class bM extends ve{constructor(e){super(),ye(this,e,gM,_M,be,{collection:0})}}const kM=n=>({dragging:n&4,dragover:n&8}),jm=n=>({dragging:n[2],dragover:n[3]});function yM(n){let e,t,i,s,l;const o=n[10].default,r=Nt(o,n,n[9],jm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",it(n[11])),Y(e,"dragleave",it(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Ft(r,o,a,a[9],i?Rt(o,a[9],u,kM):qt(a[9]),jm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),s=!1,Ee(l)}}}function vM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();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})),l("drag",T)}}function _(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{t(3,d=!0)},h=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>_(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,s=T.$$scope)},[o,u,c,d,m,_,r,a,f,s,i,g,h,k,S,$]}class hs extends ve{constructor(e){super(),ye(this,e,vM,yM,be,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Hm(n,e,t){const i=n.slice();return i[27]=e[t],i}function wM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),s=C(),l=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),v(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function SM(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){oe();const c=e;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(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],$e(()=>t=!1)),e.$set(c)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function TM(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function $M(n){let e,t,i,s;const l=[TM,SM],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function zm(n){let e,t,i,s=ce(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[$M,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&zm(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),r&&r.c(),l=ke()},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=zm(a),r.c(),r.m(l.parentNode,l)):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&&(y(t),y(s),y(l)),j(e,a),j(i,a),r&&r.d(a)}}}function OM(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=b("h4"),i=W(t),s=W(" index")},m(l,o){w(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&y(e)}}}function Vm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function MM(n){let e,t,i,s,l,o,r=n[5]!=""&&Vm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),s=b("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Vm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(s)),r&&r.d(a),l=!1,Ee(o)}}}function EM(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[MM],header:[OM],default:[CM]},$$scope:{ctx:n}};for(let l=0;lG.name.toLowerCase()==V);Z>=0?J.columns.splice(Z,1):U.pushUnique(J.columns,{name:B}),t(2,d=U.buildIndex(J))}un(async()=>{t(8,g=!0);try{t(7,_=(await $t(async()=>{const{default:B}=await import("./CodeEditor-oVf9mPjW.js");return{default:B}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=U.buildIndex(s))};function P(B){d=B,t(2,d)}const N=B=>O(B);function R(B){ne[B?"unshift":"push"](()=>{f=B,t(4,f)})}function z(B){Le.call(this,n,B)}function F(B){Le.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),Kt(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,s=U.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((V=s.columns)==null?void 0:V.map(Z=>Z.name.toLowerCase()))||[])},[u,k,d,s,f,c,m,_,g,l,i,$,T,O,r,h,E,L,I,A,P,N,R,z,F]}class IM extends ve{constructor(e){super(),ye(this,e,DM,EM,be,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=U.parseIndex(i[10]);return i[11]=s,i}function Wm(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;w(r,e,a),s=!0,l||(o=Oe(t=Re.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),l=!0)},p(r,a){var u;t&&Lt(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){s||(r&&tt(()=>{s&&(i||(i=qe(e,Ct,{duration:150},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Ct,{duration:150},!1)),i.run(0)),s=!1},d(r){r&&y(e),r&&i&&i.end(),l=!1,o()}}}function Ym(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Km(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Jm).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Ym();function c(){return n[4](n[10],n[13])}return{c(){var m,_;e=b("button"),f&&f.c(),t=C(),i=b("span"),l=W(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((_=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&_.message?"label-danger":"")+" svelte-167lbwu")},m(m,_){var g,h;w(m,e,_),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[Oe(r=Re.call(null,e,((h=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:h.message)||"")),Y(e,"click",c)],a=!0)},p(m,_){var g,h,k,S,$;n=m,n[11].unique?f||(f=Ym(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),_&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(Jm).join(", "))+"")&&se(l,s),_&4&&o!==(o="label link-primary "+((k=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Lt(r.update)&&_&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ee(u)}}}function LM(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)+"",s,l,o,r,a,u,f,c,d,m,_,g,h=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Wm(n),k=ce(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pge(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),s=W(i),l=W(`) - `),h&&h.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),H(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){w(P,e,N),v(e,t),v(e,s),v(e,l),h&&h.m(e,null),w(P,o,N),w(P,r,N);for(let R=0;R{h=null}),re()),N&7){k=ce(((V=P[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Zd=!1)),c.$set(R)},i(P){m||(M(h),M(c.$$.fragment,P),m=!0)},o(P){D(h),D(c.$$.fragment,P),m=!1},d(P){P&&(y(e),y(o),y(r),y(f)),h&&h.d(),dt(S,P),n[6](null),j(c,P),_=!1,g()}}}const Jm=n=>n.name;function AM(n,e,t){let i;Ge(n,Tn,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let g=0;gl==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){ne[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let _=0;_{var _;(_=i.indexes)!=null&&_.message&&Wn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class PM extends ve{constructor(e){super(),ye(this,e,AM,LM,be,{collection:0})}}function Zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gm(n){let e,t,i,s,l,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent=`${n[5].label}`,l=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){w(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function NM(n){let e,t=ce(n[1]),i=[];for(let s=0;so(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,l,o,r]}class qM extends ve{constructor(e){super(),ye(this,e,FM,RM,be,{class:0})}}const jM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Xm=n=>({interactive:n[7],hasErrors:n[6]}),HM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Qm=n=>({interactive:n[7],hasErrors:n[6]}),zM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),xm=n=>({interactive:n[7],hasErrors:n[6]});function eh(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function th(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&32&&se(t,i[5])},d(i){i&&y(e)}}}function nh(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function UM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_=n[0].required&&th(n),g=n[0].hidden&&nh();return{c(){e=b("div"),_&&_.c(),t=C(),g&&g.c(),i=C(),s=b("div"),l=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(l,"class",o=U.getFieldTypeIcon(n[0].type)),p(s,"class","form-field-addon prefix field-type-icon"),x(s,"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(h,k){w(h,e,k),_&&_.m(e,null),v(e,t),g&&g.m(e,null),w(h,i,k),w(h,s,k),v(s,l),w(h,a,k),w(h,u,k),n[22](u),d||(m=[Oe(r=Re.call(null,s,n[0].type+(n[0].system?" (system)":""))),Y(s,"click",n[21]),Y(u,"input",n[23])],d=!0)},p(h,k){h[0].required?_?_.p(h,k):(_=th(h),_.c(),_.m(e,t)):_&&(_.d(1),_=null),h[0].hidden?g||(g=nh(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=U.getFieldTypeIcon(h[0].type))&&p(l,"class",o),r&&Lt(r.update)&&k[0]&1&&r.update.call(null,h[0].type+(h[0].system?" (system)":"")),k[0]&129&&x(s,"txt-disabled",!h[7]||h[0].system),k[0]&129&&f!==(f=!h[7]||h[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=h[0].name)&&u.value!==c&&(u.value=c)},d(h){h&&(y(e),y(i),y(s),y(a),y(u)),_&&_.d(),g&&g.d(),n[22](null),d=!1,Ee(m)}}}function VM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function BM(n){let e,t,i,s,l,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",s="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(r,a){w(r,e,a),v(e,t),l||(o=Y(e,"click",n[17]),l=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&s!==(s="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",s),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&x(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&x(e,"btn-danger",r[6])},d(r){r&&y(e),l=!1,o()}}}function WM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,"Restore")),Y(e,"click",n[14])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function ih(n){let e,t,i,s,l=!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 _=n[20].options,g=Nt(_,n,n[28],Qm);let h=l&&lh(n),k=r&&sh(n),S=u&&oh(n);const $=n[20].optionsFooter,T=Nt($,n,n[28],Xm);let O=!n[0]._toDelete&&!n[0].primaryKey&&rh(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),s=b("div"),h&&h.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){w(E,e,L),v(e,t),g&&g.m(t,null),v(e,i),v(e,s),h&&h.m(s,null),v(s,o),k&&k.m(s,null),v(s,a),S&&S.m(s,null),v(s,f),T&&T.m(s,null),v(s,c),O&&O.m(s,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Ft(g,_,E,E[28],m?Rt(_,E[28],L,HM):qt(E[28]),Qm),L[0]&257&&(l=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),l?h?(h.p(E,L),L[0]&257&&M(h,1)):(h=lh(E),h.c(),M(h,1),h.m(s,o)):h&&(oe(),D(h,1,1,()=>{h=null}),re()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&M(k,1)):(k=sh(E),k.c(),M(k,1),k.m(s,a)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),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=oh(E),S.c(),M(S,1),S.m(s,f)):S&&(oe(),D(S,1,1,()=>{S=null}),re()),T&&T.p&&(!m||L[0]&268435648)&&Ft(T,$,E,E[28],m?Rt($,E[28],L,jM):qt(E[28]),Xm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=rh(E),O.c(),M(O,1),O.m(s,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re())},i(E){m||(M(g,E),M(h),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=qe(e,ht,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(h),D(k),D(S),D(T,E),D(O),E&&(d||(d=qe(e,ht,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&y(e),g&&g.d(E),h&&h.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function lh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[YM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435489|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),o=W(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[34])},m(m,_){w(m,e,_),e.checked=n[0].required,w(m,i,_),w(m,s,_),v(s,l),v(l,o),v(s,r),v(s,a),c||(d=[Y(e,"change",n[24]),Oe(u=Re.call(null,a,{text:`Requires the field value NOT to be ${U.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,_){_[1]&8&&t!==(t=m[34])&&p(e,"id",t),_[0]&1&&(e.checked=m[0].required),_[0]&32&&se(o,m[5]),u&&Lt(u.update)&&_[0]&1&&u.update.call(null,{text:`Requires the field value NOT to be ${U.zeroDefaultStr(m[0])}.`}),_[1]&8&&f!==(f=m[34])&&p(s,"for",f)},d(m){m&&(y(e),y(i),y(s)),c=!1,Ee(d)}}}function sh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[KM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].hidden,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[25]),Y(e,"change",n[26]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[JM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),s=C(),l=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(l,"for",f=n[34])},m(m,_){w(m,e,_),e.checked=n[0].presentable,w(m,s,_),w(m,l,_),v(l,o),v(l,r),v(l,a),c||(d=[Y(e,"change",n[27]),Oe(Re.call(null,a,{text:"Whether the field should be preferred in the Superuser UI relation listings (default to auto)."}))],c=!0)},p(m,_){_[1]&8&&t!==(t=m[34])&&p(e,"id",t),_[0]&1&&i!==(i=m[0].hidden)&&(e.disabled=i),_[0]&1&&(e.checked=m[0].presentable),_[0]&1&&u!==(u="ri-information-line "+(m[0].hidden?"txt-disabled":"link-hint"))&&p(a,"class",u),_[1]&8&&f!==(f=m[34])&&p(l,"for",f)},d(m){m&&(y(e),y(s),y(l)),c=!1,Ee(d)}}}function rh(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[ZM]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),v(e,t),v(t,i),v(i,s),v(i,l),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&&y(e),j(o)}}}function ah(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[13])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function ZM(n){let e,t,i,s,l,o=!n[0].system&&ah(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ke(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){w(r,e,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s||(l=Y(e,"click",it(n[15])),s=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=ah(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),o&&o.d(r),s=!1,l()}}}function GM(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&n[2]&&eh();s=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[UM]},$$scope:{ctx:n}}});const c=n[20].default,d=Nt(c,n,n[28],xm),m=d||VM();function _(S,$){if(S[0]._toDelete)return WM;if(S[7])return BM}let g=_(n),h=g&&g(n),k=n[7]&&n[4]&&ih(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),H(s.$$.fragment),l=C(),m&&m.c(),o=C(),h&&h.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0]._toDelete)},m(S,$){w(S,e,$),v(e,t),f&&f.m(t,null),v(t,i),q(s,t,null),v(t,l),m&&m.m(t,null),v(t,o),h&&h.m(t,null),v(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=eh(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),s.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Ft(d,c,S,S[28],u?Rt(c,S[28],$,zM):qt(S[28]),xm),g===(g=_(S))&&h?h.p(S,$):(h&&h.d(1),h=g&&g(S),h&&(h.c(),h.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=ih(S),k.c(),M(k,1),k.m(e,null)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),(!u||$[0]&1)&&x(e,"required",S[0].required),(!u||$[0]&144)&&x(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&x(e,"deleted",S[0]._toDelete)},i(S){u||(M(s.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(s.$$.fragment,S),D(m,S),D(k),S&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&y(e),f&&f.d(),j(s),m&&m.d(S),h&&h.d(),k&&k.d(),S&&a&&a.end()}}}let Oa=[];function XM(n,e,t){let i,s,l,o,r;Ge(n,Tn,pe=>t(19,r=pe));let{$$slots:a={},$$scope:u}=e;const f="f_"+U.randomString(8),c=wt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],_=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:h=""}=e,{field:k=U.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Jt({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(pe){return U.slugify(pe)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let pe of Oa)pe.id!=f&&pe.collapse()}un(()=>(Oa.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{U.removeByKey(Oa,"id",f)}));const F=()=>T==null?void 0:T.focus();function B(pe){ne[pe?"unshift":"push"](()=>{T=pe,t(3,T)})}const J=pe=>{const ae=k.name;t(0,k.name=A(pe.target.value),k),pe.target.value=k.name,c("rename",{oldName:ae,newName:k.name})};function V(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=pe=>{pe.target.checked&&t(0,k.presentable=!1,k)};function de(){k.presentable=this.checked,t(0,k)}return n.$$set=pe=>{"key"in pe&&t(1,h=pe.key),"field"in pe&&t(0,k=pe.field),"draggable"in pe&&t(2,S=pe.draggable),"collection"in pe&&t(18,$=pe.collection),"$$scope"in pe&&t(28,u=pe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,s=!k._toDelete),n.$$.dirty[0]&524290&&t(6,l=!U.isEmpty(U.getNestedVal(r,`fields.${h}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,h,S,T,O,o,l,s,i,c,m,_,g,E,L,I,A,R,$,r,a,F,B,J,V,Z,G,de,u]}class Yn extends ve{constructor(e){super(),ye(this,e,XM,GM,be,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function QM(n){let e,t,i,s,l,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 $n({props:a}),ne.push(()=>ge(t,"keyOfSelected",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){w(u,e,f),q(t,e,null),s=!0,l||(o=Oe(Re.call(null,e,{text:"Auto set on:",position:"top"})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){s||(M(t.$$.fragment,u),s=!0)},o(u){D(t.$$.fragment,u),s=!1},d(u){u&&y(e),j(t),l=!1,o()}}}function xM(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[QM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,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&&(y(e),y(t),y(s),y(l)),j(i,r)}}}function eE(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[6](r)}let o={$$slots:{default:[xM,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(s,[a&2&&{key:r[1]},a&16&&At(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}const Ma=1,Ea=2,Da=3;function tE(n,e,t){const i=["field","key"];let s=lt(e,i);const l=[{label:"Create",value:Ma},{label:"Update",value:Ea},{label:"Create/Update",value:Da}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Da:o.onUpdate?Ea:Ma}function f(h){switch(h){case Ma:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Ea:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Da:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!0,o);break}}function c(h){a=h,t(2,a)}function d(h){o=h,t(0,o)}function m(h){Le.call(this,n,h)}function _(h){Le.call(this,n,h)}function g(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(4,s=lt(e,i)),"field"in h&&t(0,o=h.field),"key"in h&&t(1,r=h.key)},n.$$.update=()=>{n.$$.dirty&4&&f(a)},[o,r,a,l,s,c,d,m,_,g]}class nE extends ve{constructor(e){super(),ye(this,e,tE,eE,be,{field:0,key:1})}}function iE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function lE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(c){l=c,t(0,l)}function a(c){Le.call(this,n,c)}function u(c){Le.call(this,n,c)}function f(c){Le.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(2,s=lt(e,i)),"field"in c&&t(0,l=c.field),"key"in c&&t(1,o=c.key)},[l,o,s,r,a,u,f]}class sE extends ve{constructor(e){super(),ye(this,e,lE,iE,be,{field:0,key:1})}}var Ia=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ts={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},no={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Qn=function(n){return n===!0?1:0};function uh(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var La=function(n){return n instanceof Array?n:[n]};function On(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Mt(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 Yo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Uy(n,e){if(e(n))return n;if(n.parentNode)return Uy(n.parentNode,e)}function Ko(n,e){var t=Mt("div","numInputWrapper"),i=Mt("input","numInput "+n),s=Mt("span","arrowUp"),l=Mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Aa=function(){},wr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},oE={D:Aa,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Qn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Aa,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:Aa,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Sl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},zs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[zs.w(n,e,t)]},F:function(n,e,t){return wr(zs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Pn(zs.h(n,e,t))},H:function(n){return Pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Qn(n.getHours()>11)]},M:function(n,e){return wr(n.getMonth(),!0,e)},S:function(n){return Pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Pn(n.getFullYear(),4)},d:function(n){return Pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Pn(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)}},Vy=function(n){var e=n.config,t=e===void 0?ts:e,i=n.l10n,s=i===void 0?no:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return zs[c]&&m[d-1]!=="\\"?zs[c](r,f,t):c!=="\\"?c:""}).join("")}},bu=function(n){var e=n.config,t=e===void 0?ts:e,i=n.l10n,s=i===void 0?no:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ts).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var _=void 0,g=[],h=0,k=0,S="";hMath.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=Na(t.config);ee.setHours(le.hours,le.minutes,le.seconds,ee.getMilliseconds()),t.selectedDates=[ee],t.latestSelectedDateObj=ee}X!==void 0&&X.type!=="blur"&&dl(X);var Se=t._input.value;c(),Ln(),t._input.value!==Se&&t._debouncedChange()}function u(X,ee){return X%12+12*Qn(ee===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,ee=(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 Se=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 Ve=Pa(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Pa(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Je=Pa(X,ee,le);if(Je>rt&&Je=12)]),t.secondElement!==void 0&&(t.secondElement.value=Pn(le)))}function _(X){var ee=Un(X),le=parseInt(ee.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,ee,le,Se){if(ee instanceof Array)return ee.forEach(function(Fe){return g(X,Fe,le,Se)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,ee,le,Se)});X.addEventListener(ee,le,Se),t._handlers.push({remove:function(){return X.removeEventListener(ee,le,Se)}})}function h(){It("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(Se){return g(Se,"click",t[le])})}),t.isMobile){Jn();return}var X=uh(De,50);if(t._debouncedChange=uh(h,fE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ue(Un(le))}),g(t._input,"keydown",Bt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Bt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ct):g(window.document,"mousedown",ct),g(window.document,"focus",ct,{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",ql),g(t.monthNav,["keyup","increment"],_),g(t.daysContainer,"click",Pt)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var ee=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],ee),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",ut)}function S(X,ee){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.maxDate1),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 Ve=Mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ve,t.element),Ve.appendChild(t.element),t.altInput&&Ve.appendChild(t.altInput),Ve.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,ee,le,Se){var Fe=xe(ee,!0),Ve=Mt("span",X,ee.getDate().toString());return Ve.dateObj=ee,Ve.$i=Se,Ve.setAttribute("aria-label",t.formatDate(ee,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(ee,t.now)===0&&(t.todayDateElem=Ve,Ve.classList.add("today"),Ve.setAttribute("aria-current","date")),Fe?(Ve.tabIndex=-1,fl(ee)&&(Ve.classList.add("selected"),t.selectedDateElem=Ve,t.config.mode==="range"&&(On(Ve,"startRange",t.selectedDates[0]&&Vn(ee,t.selectedDates[0],!0)===0),On(Ve,"endRange",t.selectedDates[1]&&Vn(ee,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Ve.classList.add("inRange")))):Ve.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Vi(ee)&&!fl(ee)&&Ve.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&Se%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(ee)+""),It("onDayCreate",Ve),Ve}function L(X){X.focus(),t.config.mode==="range"&&Ue(X)}function I(X){for(var ee=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,Se=ee;Se!=le;Se+=X)for(var Fe=t.daysContainer.children[Se],Ve=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,Je=Ve;Je!=rt;Je+=X){var ue=Fe.children[Je];if(ue.className.indexOf("hidden")===-1&&xe(ue.dateObj))return ue}}function A(X,ee){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,Se=ee>0?t.config.showMonths:-1,Fe=ee>0?1:-1,Ve=le-t.currentMonth;Ve!=Se;Ve+=Fe)for(var rt=t.daysContainer.children[Ve],Je=le-t.currentMonth===Ve?X.$i+ee:ee<0?rt.children.length-1:0,ue=rt.children.length,we=Je;we>=0&&we0?ue:-1);we+=Fe){var He=rt.children[we];if(He.className.indexOf("hidden")===-1&&xe(He.dateObj)&&Math.abs(X.$i-we)>=Math.abs(ee))return L(He)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,ee){var le=l(),Se=Be(le||document.body),Fe=X!==void 0?X:Se?le:t.selectedDateElem!==void 0&&Be(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Be(t.todayDateElem)?t.todayDateElem:I(ee>0?1:-1);Fe===void 0?t._input.focus():Se?A(Fe,ee):L(Fe)}function N(X,ee){for(var le=(new Date(X,ee,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Se=t.utils.getDaysInMonth((ee-1+12)%12,X),Fe=t.utils.getDaysInMonth(ee,X),Ve=window.document.createDocumentFragment(),rt=t.config.showMonths>1,Je=rt?"prevMonthDay hidden":"prevMonthDay",ue=rt?"nextMonthDay hidden":"nextMonthDay",we=Se+1-le,He=0;we<=Se;we++,He++)Ve.appendChild(E("flatpickr-day "+Je,new Date(X,ee-1,we),we,He));for(we=1;we<=Fe;we++,He++)Ve.appendChild(E("flatpickr-day",new Date(X,ee,we),we,He));for(var Qe=Fe+1;Qe<=42-le&&(t.config.showMonths===1||He%7!==0);Qe++,He++)Ve.appendChild(E("flatpickr-day "+ue,new Date(X,ee+1,Qe%Fe),Qe,He));var at=Mt("div","dayContainer");return at.appendChild(Ve),at}function R(){if(t.daysContainer!==void 0){Yo(t.daysContainer),t.weekNumbers&&Yo(t.weekNumbers);for(var X=document.createDocumentFragment(),ee=0;ee1||t.config.monthSelectorType!=="dropdown")){var X=function(Se){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&Set.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var ee=0;ee<12;ee++)if(X(ee)){var le=Mt("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,ee).getMonth().toString(),le.textContent=wr(ee,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===ee&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Mt("div","flatpickr-month"),ee=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Mt("span","cur-month"):(t.monthsDropdownContainer=Mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var Je=Un(rt),ue=parseInt(Je.value,10);t.changeMonth(ue-t.currentMonth),It("onMonthChange")}),z(),le=t.monthsDropdownContainer);var Se=Ko("cur-year",{tabindex:"-1"}),Fe=Se.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 Ve=Mt("div","flatpickr-current-month");return Ve.appendChild(le),Ve.appendChild(Se),ee.appendChild(Ve),X.appendChild(ee),{container:X,yearElement:Fe,monthElement:le}}function B(){Yo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var ee=F();t.yearElements.push(ee.yearElement),t.monthElements.push(ee.monthElement),t.monthNav.appendChild(ee.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Mt("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&&(On(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&(On(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Bi(),t.monthNav}function V(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=Na(t.config);t.timeContainer=Mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var ee=Mt("span","flatpickr-time-separator",":"),le=Ko("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var Se=Ko("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Se.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Pn(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(ee),t.timeContainer.appendChild(Se),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Ko("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Pn(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(Mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Mt("span","flatpickr-am-pm",t.l10n.amPM[Qn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Yo(t.weekdayContainer):t.weekdayContainer=Mt("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var ee=Mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(ee)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,ee=fh(t.l10n.weekdays.shorthand);X>0&&X`,p(i,"class","alert alert-info")},m(l,o){q(e,l,o),w(l,t,o),w(l,i,o),s=!0},p(l,[o]){const r={};o&49&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){s||(M(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&(y(t),y(i)),j(e,l)}}}const hm="feishu.cn",Sa="larksuite.com";function B8(n,e,t){var r;let{config:i={}}=e;const s=[{label:"Feishu (China)",value:hm},{label:"Lark (International)",value:Sa}];let l=hm;(r=i.authURL)!=null&&r.includes(Sa)&&(l=Sa);function o(a){l=a,t(0,l)}return n.$$set=a=>{"config"in a&&t(2,i=a.config)},n.$$.update=()=>{n.$$.dirty&1&&(t(2,i.authURL=`https://accounts.${l}/open-apis/authen/v1/authorize`,i),t(2,i.tokenURL=`https://open.${l}/open-apis/authen/v2/oauth/token`,i),t(2,i.userInfoURL=`https://open.${l}/open-apis/authen/v1/user_info`,i))},[l,s,i,o]}class W8 extends ve{constructor(e){super(),ye(this,e,B8,V8,be,{config:2})}}function Y8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[0].authURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&1&&l.value!==c[0].authURL&&me(l,c[0].authURL)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function K8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),r=C(),a=b("div"),a.textContent="Ex. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[0].tokenURL),w(c,r,d),w(c,a,d),u||(f=Y(l,"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(l,"id",o),d&1&&l.value!==c[0].tokenURL&&me(l,c[0].tokenURL)},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function J8(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[Y8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[K8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),q(l,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}),l.$set(f)},i(r){o||(M(i.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(i.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(y(e),y(t),y(s)),j(i,r),j(l,r)}}}function Z8(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authURL=this.value,t(0,s)}function o(){s.tokenURL=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class G8 extends ve{constructor(e){super(),ye(this,e,Z8,J8,be,{key:1,config:0})}}function X8(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=U.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),Kt(c)),t(5,l=lt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=U.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class _o extends ve{constructor(e){super(),ye(this,e,Q8,X8,be,{value:0,separator:1,readonly:2,disabled:3})}}function x8(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Display name"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","text"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].displayName),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].displayName&&me(l,u[0].displayName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function tO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function nO(n){let e,t,i,s,l,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]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Fetch user info from"),s=C(),H(l.$$.fragment),p(e,"for",i=n[13])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,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],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function iO(n){let e,t,i,s,l,o,r,a;return s=new fe({props:{class:"form-field m-b-xs",name:n[1]+".extra.jwksURL",$$slots:{default:[sO,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:n[1]+".extra.issuers",$$slots:{default:[oO,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("p"),t.innerHTML=`Both fields are considered optional because the parsed id_token + is a direct result of the trusted server code->token exchange response.`,i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),p(t,"class","txt-hint txt-sm m-b-xs"),p(e,"class","content")},m(u,f){w(u,e,f),v(e,t),v(e,i),q(s,e,null),v(e,l),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}),s.$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(s.$$.fragment,u),M(o.$$.fragment,u),u&&tt(()=>{a&&(r||(r=qe(e,ht,{delay:10,duration:150},!0)),r.run(1))}),a=!0)},o(u){D(s.$$.fragment,u),D(o.$$.fragment,u),u&&(r||(r=qe(e,ht,{delay:10,duration:150},!1)),r.run(0)),a=!1},d(u){u&&y(e),j(s),j(o),u&&r&&r.end()}}}function lO(n){let e,t,i,s;return t=new fe({props:{class:"form-field required",name:n[1]+".userInfoURL",$$slots:{default:[rO,({uniqueId:l})=>({13:l}),({uniqueId:l})=>l?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","content")},m(l,o){w(l,e,o),q(t,e,null),s=!0},p(l,o){const r={};o&2&&(r.name=l[1]+".userInfoURL"),o&24577&&(r.$$scope={dirty:o,ctx:l}),t.$set(r)},i(l){s||(M(t.$$.fragment,l),l&&tt(()=>{s&&(i||(i=qe(e,ht,{delay:10,duration:150},!0)),i.run(1))}),s=!0)},o(l){D(t.$$.fragment,l),l&&(i||(i=qe(e,ht,{delay:10,duration:150},!1)),i.run(0)),s=!1},d(l){l&&y(e),j(t),l&&i&&i.end()}}}function sO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="JWKS verification URL",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13]),p(r,"type","url"),p(r,"id",a=n[13])},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].extra.jwksURL),u||(f=[Oe(Re.call(null,s,{text:"URL to the public token verification keys.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].extra.jwksURL&&me(r,c[0].extra.jwksURL)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function oO(n){let e,t,i,s,l,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 _o({props:m}),ne.push(()=>ge(r,"value",d)),{c(){e=b("label"),t=b("span"),t.textContent="Issuers",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[13])},m(h,g){w(h,e,g),v(e,t),v(e,i),v(e,s),w(h,o,g),q(r,h,g),u=!0,f||(c=Oe(Re.call(null,s,{text:"Comma separated list of accepted values for the iss token claim validation.",position:"top"})),f=!0)},p(h,g){(!u||g&8192&&l!==(l=h[13]))&&p(e,"for",l);const _={};g&8192&&(_.id=h[13]),!a&&g&1&&(a=!0,_.value=h[0].extra.issuers,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),j(r,h),f=!1,c()}}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[13]),p(l,"type","url"),p(l,"id",o=n[13]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function aO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Support PKCE",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[11]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function uO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;e=new fe({props:{class:"form-field required",name:n[1]+".displayName",$$slots:{default:[x8,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:n[1]+".authURL",$$slots:{default:[eO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:n[1]+".tokenURL",$$slots:{default:[tO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field m-b-xs",$$slots:{default:[nO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}});const k=[lO,iO],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),g=new fe({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[aO,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),i.textContent="Endpoints",s=C(),H(l.$$.fragment),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),c=b("div"),m.c(),h=C(),H(g.$$.fragment),p(i,"class","section-title"),p(c,"class","sub-panel m-b-base")},m(T,O){q(e,T,O),w(T,t,O),w(T,i,O),w(T,s,O),q(l,T,O),w(T,o,O),q(r,T,O),w(T,a,O),q(u,T,O),w(T,f,O),w(T,c,O),S[d].m(c,null),w(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}),l.$set(L);const I={};O&2&&(I.name=T[1]+".tokenURL"),O&24577&&(I.$$scope={dirty:O,ctx:T}),r.$set(I);const A={};O&24580&&(A.$$scope={dirty:O,ctx:T}),u.$set(A);let P=d;d=$(T),d===P?S[d].p(T,O):(oe(),D(S[P],1,1,()=>{S[P]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(c,null));const N={};O&2&&(N.name=T[1]+".pkce"),O&24577&&(N.$$scope={dirty:O,ctx:T}),g.$set(N)},i(T){_||(M(e.$$.fragment,T),M(l.$$.fragment,T),M(r.$$.fragment,T),M(u.$$.fragment,T),M(m),M(g.$$.fragment,T),_=!0)},o(T){D(e.$$.fragment,T),D(l.$$.fragment,T),D(r.$$.fragment,T),D(u.$$.fragment,T),D(m),D(g.$$.fragment,T),_=!1},d(T){T&&(y(t),y(i),y(s),y(o),y(a),y(f),y(c),y(h)),j(e,T),j(l,T),j(r,T),j(u,T),S[d].d(),j(g,T)}}}function fO(n,e,t){let{key:i=""}=e,{config:s={}}=e;const l=[{label:"User info URL",value:!0},{label:"ID Token",value:!1}];let o=!!s.userInfoURL;U.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC"),s.extra||(s.extra={},o=!0);function r(){o?t(0,s.extra={},s):(t(0,s.userInfoURL="",s),t(0,s.extra=s.extra||{},s))}function a(){s.displayName=this.value,t(0,s)}function u(){s.authURL=this.value,t(0,s)}function f(){s.tokenURL=this.value,t(0,s)}function c(_){o=_,t(2,o)}function d(){s.userInfoURL=this.value,t(0,s)}function m(){s.extra.jwksURL=this.value,t(0,s)}function h(_){n.$$.not_equal(s.extra.issuers,_)&&(s.extra.issuers=_,t(0,s))}function g(){s.pkce=this.checked,t(0,s)}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"config"in _&&t(0,s=_.config)},n.$$.update=()=>{n.$$.dirty&4&&typeof o!==void 0&&r()},[s,i,o,l,a,u,f,c,d,m,h,g]}class Ta extends ve{constructor(e){super(),ye(this,e,fO,uO,be,{key:1,config:0})}}function cO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Auth URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].authURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authURL&&me(l,u[0].authURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function dO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Token URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].tokenURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenURL&&me(l,u[0].tokenURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function pO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("User info URL"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].userInfoURL),r||(a=Y(l,"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(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userInfoURL&&me(l,u[0].userInfoURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function mO(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authURL",$$slots:{default:[cO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenURL",$$slots:{default:[dO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userInfoURL",$$slots:{default:[pO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=W(n[2]),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),v(e,t),w(f,i,c),q(s,f,c),w(f,l,c),q(o,f,c),w(f,r,c),q(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(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}),s.$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(s.$$.fragment,f),M(o.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(s.$$.fragment,f),D(o.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(e),y(i),y(l),y(r)),j(s,f),j(o,f),j(a,f)}}}function hO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authURL=this.value,t(0,l)}function u(){l.tokenURL=this.value,t(0,l)}function f(){l.userInfoURL=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=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&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class $a extends ve{constructor(e){super(),ye(this,e,hO,mO,be,{key:1,config:0,required:4,title:2})}}const af=[{key:"apple",title:"Apple",logo:"apple.svg",optionsComponent:N8},{key:"google",title:"Google",logo:"google.svg"},{key:"microsoft",title:"Microsoft",logo:"microsoft.svg",optionsComponent:G8},{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:$a,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:$a,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discord",title:"Discord",logo:"discord.svg"},{key:"twitter",title:"X/Twitter",logo:"twitter.svg"},{key:"kakao",title:"Kakao",logo:"kakao.svg"},{key:"vk",title:"VK",logo:"vk.svg"},{key:"linear",title:"Linear",logo:"linear.svg"},{key:"notion",title:"Notion",logo:"notion.svg"},{key:"monday",title:"monday.com",logo:"monday.svg"},{key:"lark",title:"Lark",logo:"lark.svg",optionsComponent:W8},{key:"box",title:"Box",logo:"box.svg"},{key:"spotify",title:"Spotify",logo:"spotify.svg"},{key:"trakt",title:"Trakt",logo:"trakt.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:$a,optionsComponentProps:{required:!0}},{key:"planningcenter",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidc",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc2",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta},{key:"oidc3",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Ta}];function _m(n,e,t){const i=n.slice();return i[16]=e[t],i}function gm(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p:te,i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Hn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Hn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c=n[1]!=""&&gm(n);return{c(){e=b("label"),t=b("i"),s=C(),l=b("input"),r=C(),c&&c.c(),a=ke(),p(t,"class","ri-search-line"),p(e,"for",i=n[19]),p(e,"class","m-l-10 txt-xl"),p(l,"id",o=n[19]),p(l,"type","text"),p(l,"placeholder","Search provider")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[1]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"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(l,"id",o),m&2&&l.value!==d[1]&&me(l,d[1]),d[1]!=""?c?(c.p(d,m),m&2&&M(c,1)):(c=gm(d),c.c(),M(c,1),c.m(a.parentNode,a)):c&&(oe(),D(c,1,1,()=>{c=null}),re())},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function bm(n){let e,t,i,s,l=n[1]!=""&&km(n);return{c(){e=b("div"),t=b("span"),t.textContent="No providers to select.",i=C(),l&&l.c(),s=C(),p(t,"class","txt-hint"),p(e,"class","flex inline-flex")},m(o,r){w(o,e,r),v(e,t),v(e,i),l&&l.m(e,null),v(e,s)},p(o,r){o[1]!=""?l?l.p(o,r):(l=km(o),l.c(),l.m(e,s)):l&&(l.d(1),l=null)},d(o){o&&y(e),l&&l.d()}}}function km(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(s,l){w(s,e,l),t||(i=Y(e,"click",n[5]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function ym(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[16].logo)||p(e,"src",t),p(e,"alt",i=n[16].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&8&&!wn(e.src,t="./images/oauth2/"+s[16].logo)&&p(e,"src",t),l&8&&i!==(i=s[16].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function vm(n,e){let t,i,s,l,o,r,a=e[16].title+"",u,f,c,d=e[16].key+"",m,h,g,_,k=e[16].logo&&ym(e);function S(){return e[10](e[16])}return{key:n,first:null,c(){t=b("div"),i=b("button"),s=b("figure"),k&&k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),p(s,"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($,T){w($,t,T),v(t,i),v(i,s),k&&k.m(s,null),v(i,l),v(i,o),v(o,r),v(r,u),v(o,f),v(o,c),v(c,m),v(t,h),g||(_=Y(i,"click",S),g=!0)},p($,T){e=$,e[16].logo?k?k.p(e,T):(k=ym(e),k.c(),k.m(s,null)):k&&(k.d(1),k=null),T&8&&a!==(a=e[16].title+"")&&se(u,a),T&8&&d!==(d=e[16].key+"")&&se(m,d)},d($){$&&y(t),k&&k.d(),g=!1,_()}}}function gO(n){let e,t,i,s=[],l=new Map,o;e=new fe({props:{class:"searchbar m-b-sm",$$slots:{default:[_O,({uniqueId:f})=>({19:f}),({uniqueId:f})=>f?524288:0]},$$scope:{ctx:n}}});let r=ce(n[3]);const a=f=>f[16].key;for(let f=0;f!s.includes(T.key)&&($==""||T.key.toLowerCase().includes($)||T.title.toLowerCase().includes($)))}function d(){t(1,o="")}function m(){o=this.value,t(1,o)}const h=()=>t(1,o=""),g=$=>f($);function _($){ne[$?"unshift":"push"](()=>{l=$,t(2,l)})}function k($){Le.call(this,n,$)}function S($){Le.call(this,n,$)}return n.$$set=$=>{"disabled"in $&&t(6,s=$.disabled)},n.$$.update=()=>{n.$$.dirty&66&&(o!==-1||s!==-1)&&t(3,r=c())},[u,o,l,r,f,d,s,a,m,h,g,_,k,S]}class wO extends ve{constructor(e){super(),ye(this,e,vO,yO,be,{disabled:6,show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function wm(n,e,t){const i=n.slice();i[28]=e[t],i[31]=t;const s=i[9](i[28].name);return i[29]=s,i}function SO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[27]),p(s,"for",o=n[27])},m(u,f){w(u,e,f),e.checked=n[0].oauth2.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function TO(n){let e;return{c(){e=b("i"),p(e,"class","ri-puzzle-line txt-sm txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function $O(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t="./images/oauth2/"+n[29].logo)||p(e,"src",t),p(e,"alt",i=n[29].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l[0]&1&&!wn(e.src,t="./images/oauth2/"+s[29].logo)&&p(e,"src",t),l[0]&1&&i!==(i=s[29].title+" logo")&&p(e,"alt",i)},d(s){s&&y(e)}}}function Sm(n){let e,t,i;function s(){return n[11](n[29],n[28],n[31])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-circle btn-hint btn-transparent"),p(e,"aria-label","Provider settings")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,{text:"Edit config",position:"left"})),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function Tm(n,e){var $;let t,i,s,l,o,r,a=(e[28].displayName||(($=e[29])==null?void 0:$.title)||"Custom")+"",u,f,c,d=e[28].name+"",m,h;function g(T,O){var E;return(E=T[29])!=null&&E.logo?$O:TO}let _=g(e),k=_(e),S=e[29]&&Sm(e);return{key:n,first:null,c(){var T,O,E;t=b("div"),i=b("div"),s=b("figure"),k.c(),l=C(),o=b("div"),r=b("div"),u=W(a),f=C(),c=b("em"),m=W(d),h=C(),S&&S.c(),p(s,"class","provider-logo"),p(r,"class","title"),p(c,"class","txt-hint txt-sm m-r-auto"),p(o,"class","content"),p(i,"class","provider-card"),x(i,"error",!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){w(T,t,O),v(t,i),v(i,s),k.m(s,null),v(i,l),v(i,o),v(o,r),v(r,u),v(o,f),v(o,c),v(c,m),v(i,h),S&&S.m(i,null)},p(T,O){var E,L,I,A;e=T,_===(_=g(e))&&k?k.p(e,O):(k.d(1),k=_(e),k&&(k.c(),k.m(s,null))),O[0]&1&&a!==(a=(e[28].displayName||((E=e[29])==null?void 0:E.title)||"Custom")+"")&&se(u,a),O[0]&1&&d!==(d=e[28].name+"")&&se(m,d),e[29]?S?S.p(e,O):(S=Sm(e),S.c(),S.m(i,null)):S&&(S.d(1),S=null),O[0]&3&&x(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&&y(t),k.d(),S&&S.d()}}}function CO(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function OO(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function $m(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return s=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.name",$$slots:{default:[MO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.avatarURL",$$slots:{default:[EO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.id",$$slots:{default:[DO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.mappedFields.username",$$slots:{default:[IO,({uniqueId:_})=>({27:_}),({uniqueId:_})=>[_?134217728:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(t,"class","grid grid-sm p-t-xs"),p(e,"class","block")},m(_,k){w(_,e,k),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),g=!0},p(_,k){const S={};k[0]&134217761|k[1]&2&&(S.$$scope={dirty:k,ctx:_}),s.$set(S);const $={};k[0]&134217793|k[1]&2&&($.$$scope={dirty:k,ctx:_}),r.$set($);const T={};k[0]&134217761|k[1]&2&&(T.$$scope={dirty:k,ctx:_}),f.$set(T);const O={};k[0]&134217761|k[1]&2&&(O.$$scope={dirty:k,ctx:_}),m.$set(O)},i(_){g||(M(s.$$.fragment,_),M(r.$$.fragment,_),M(f.$$.fragment,_),M(m.$$.fragment,_),_&&tt(()=>{g&&(h||(h=qe(e,ht,{duration:150},!0)),h.run(1))}),g=!0)},o(_){D(s.$$.fragment,_),D(r.$$.fragment,_),D(f.$$.fragment,_),D(m.$$.fragment,_),_&&(h||(h=qe(e,ht,{duration:150},!1)),h.run(0)),g=!1},d(_){_&&y(e),j(s),j(r),j(f),j(m),_&&h&&h.end()}}}function MO(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:FO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.name!==void 0&&(u.selected=n[0].oauth2.mappedFields.name),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 full name"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.name,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function EO(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[27],items:n[6],toggle:!0,zeroFunc:qO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.avatarURL!==void 0&&(u.selected=n[0].oauth2.mappedFields.avatarURL),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 avatar"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&64&&(d.items=f[6]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.avatarURL,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function DO(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:jO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.id!==void 0&&(u.selected=n[0].oauth2.mappedFields.id),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 id"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.id,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function IO(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[27],items:n[5],toggle:!0,zeroFunc:HO,selectPlaceholder:"Select field"};return n[0].oauth2.mappedFields.username!==void 0&&(u.selected=n[0].oauth2.mappedFields.username),l=new ms({props:u}),ne.push(()=>ge(l,"selected",a)),{c(){e=b("label"),t=W("OAuth2 username"),s=C(),H(l.$$.fragment),p(e,"for",i=n[27])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[0]&134217728&&i!==(i=f[27]))&&p(e,"for",i);const d={};c[0]&134217728&&(d.id=f[27]),c[0]&32&&(d.items=f[5]),!o&&c[0]&1&&(o=!0,d.selected=f[0].oauth2.mappedFields.username,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function LO(n){let e,t,i,s=[],l=new Map,o,r,a,u,f,c,d,m=n[0].name+"",h,g,_,k,S,$,T,O,E;e=new fe({props:{class:"form-field form-field-toggle",name:"oauth2.enabled",$$slots:{default:[SO,({uniqueId:z})=>({27:z}),({uniqueId:z})=>[z?134217728:0]]},$$scope:{ctx:n}}});let L=ce(n[0].oauth2.providers);const I=z=>z[28].name;for(let z=0;z Add provider',u=C(),f=b("button"),c=b("strong"),d=W("Optional "),h=W(m),g=W(" create fields map"),_=C(),N.c(),S=C(),R&&R.c(),$=ke(),p(a,"class","btn btn-block btn-lg btn-secondary txt-base"),p(r,"class","col-lg-6"),p(i,"class","grid grid-sm"),p(c,"class","txt"),p(f,"type","button"),p(f,"class",k="m-t-25 btn btn-sm "+(n[4]?"btn-secondary":"btn-hint btn-transparent"))},m(z,F){q(e,z,F),w(z,t,F),w(z,i,F);for(let B=0;B{R=null}),re())},i(z){T||(M(e.$$.fragment,z),M(R),T=!0)},o(z){D(e.$$.fragment,z),D(R),T=!1},d(z){z&&(y(t),y(i),y(u),y(f),y(S),y($)),j(e,z);for(let F=0;F0),p(r,"class","label label-success")},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,l),w(a,o,u),w(a,r,u)},p(a,u){u[0]&128&&se(t,a[7]),u[0]&128&&s!==(s=a[7]==1?"provider":"providers")&&se(l,s),u[0]&128&&x(e,"label-warning",!a[7]),u[0]&128&&x(e,"label-info",a[7]>0)},d(a){a&&(y(e),y(o),y(r))}}}function Cm(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function NO(n){let e,t,i,s,l,o;function r(c,d){return c[0].oauth2.enabled?PO:AO}let a=r(n),u=a(n),f=n[8]&&Cm();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a===(a=r(c))&&u?u.p(c,d):(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[8]?f?d[0]&256&&M(f,1):(f=Cm(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function RO(n){var u,f;let e,t,i,s,l,o;e=new Ui({props:{single:!0,$$slots:{header:[NO],default:[LO]},$$scope:{ctx:n}}});let r={disabled:((f=(u=n[0].oauth2)==null?void 0:u.providers)==null?void 0:f.map(Om))||[]};i=new wO({props:r}),n[18](i),i.$on("select",n[19]);let a={};return l=new v8({props:a}),n[20](l),l.$on("remove",n[21]),l.$on("submit",n[22]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(c,d){q(e,c,d),w(c,t,d),q(i,c,d),w(c,s,d),q(l,c,d),o=!0},p(c,d){var _,k;const m={};d[0]&511|d[1]&2&&(m.$$scope={dirty:d,ctx:c}),e.$set(m);const h={};d[0]&1&&(h.disabled=((k=(_=c[0].oauth2)==null?void 0:_.providers)==null?void 0:k.map(Om))||[]),i.$set(h);const g={};l.$set(g)},i(c){o||(M(e.$$.fragment,c),M(i.$$.fragment,c),M(l.$$.fragment,c),o=!0)},o(c){D(e.$$.fragment,c),D(i.$$.fragment,c),D(l.$$.fragment,c),o=!1},d(c){c&&(y(t),y(s)),j(e,c),n[18](null),j(i,c),n[20](null),j(l,c)}}}const FO=()=>"",qO=()=>"",jO=()=>"",HO=()=>"",Om=n=>n.name;function zO(n,e,t){let i,s,l;Ge(n,Tn,F=>t(1,l=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 af)if(B.key==F)return B;return null}function k(){o.oauth2.enabled=this.checked,t(0,o)}const S=(F,B,J)=>{c==null||c.show(F,B,J)},$=()=>f==null?void 0:f.show(),T=()=>t(4,d=!d);function O(F){n.$$.not_equal(o.oauth2.mappedFields.name,F)&&(o.oauth2.mappedFields.name=F,t(0,o))}function E(F){n.$$.not_equal(o.oauth2.mappedFields.avatarURL,F)&&(o.oauth2.mappedFields.avatarURL=F,t(0,o))}function 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){ne[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){ne[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(l==null?void 0:l.oauth2)),n.$$.dirty[0]&1&&t(7,s=((B=(F=o.oauth2)==null?void 0:F.providers)==null?void 0:B.length)||0)},[o,l,f,c,d,m,h,s,i,_,k,S,$,T,O,E,L,I,A,P,N,R,z]}class UO extends ve{constructor(e){super(),ye(this,e,zO,RO,be,{collection:0},null,[-1,-1])}}function Mm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers can have OTP only as part of Two-factor authentication.",position:"right"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c=n[2]&&Mm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"for",o=n[8])},m(d,m){w(d,e,m),e.checked=n[0].otp.enabled,w(d,i,m),w(d,s,m),v(s,l),w(d,r,m),c&&c.m(d,m),w(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(s,"for",o),d[2]?c||(c=Mm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(s),y(r),y(a)),c&&c.d(d),u=!1,Ee(f)}}}function BO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Duration (in seconds)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.duration),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].otp.duration&&me(l,u[0].otp.duration)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function WO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Generated password length"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"min","0"),p(l,"step","1"),p(l,"id",o=n[8]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].otp.length),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].otp.length&&me(l,u[0].otp.length)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function YO(n){let e,t,i,s,l,o,r,a,u;return e=new fe({props:{class:"form-field form-field-toggle",name:"otp.enabled",$$slots:{default:[VO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field form-field-toggle required",name:"otp.duration",$$slots:{default:[BO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle required",name:"otp.length",$$slots:{default:[WO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),p(s,"class","col-sm-6"),p(r,"class","col-sm-6"),p(i,"class","grid grid-sm")},m(f,c){q(e,f,c),w(f,t,c),w(f,i,c),v(i,s),q(l,s,null),v(i,o),v(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}),l.$set(m);const h={};c&769&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(M(e.$$.fragment,f),M(l.$$.fragment,f),M(a.$$.fragment,f),u=!0)},o(f){D(e.$$.fragment,f),D(l.$$.fragment,f),D(a.$$.fragment,f),u=!1},d(f){f&&(y(t),y(i)),j(e,f),j(l),j(a)}}}function KO(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function JO(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Em(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function ZO(n){let e,t,i,s,l,o;function r(c,d){return c[0].otp.enabled?JO:KO}let a=r(n),u=a(n),f=n[1]&&Em();return{c(){e=b("div"),e.innerHTML=' One-time password (OTP)',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&M(f,1):(f=Em(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function GO(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[ZO],default:[YO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XO(n,e,t){let i,s,l;Ge(n,Tn,c=>t(3,l=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=mt(this.value),t(0,o)}function f(){o.otp.length=mt(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,s=!U.isEmpty(l==null?void 0:l.otp))},[o,s,i,l,r,a,u,f]}class QO extends ve{constructor(e){super(),ye(this,e,XO,GO,be,{collection:0})}}function Dm(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"Superusers are required to have password auth enabled.",position:"right"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function xO(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&Dm();return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable"),r=C(),c&&c.c(),a=ke(),p(e,"type","checkbox"),p(e,"id",t=n[9]),e.disabled=n[3],p(s,"for",o=n[9])},m(d,m){w(d,e,m),e.checked=n[0].passwordAuth.enabled,w(d,i,m),w(d,s,m),v(s,l),w(d,r,m),c&&c.m(d,m),w(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(s,"for",o),d[3]?c||(c=Dm(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(i),y(s),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function eM(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=b("span"),t.textContent="Unique identity fields",s=C(),H(l.$$.fragment),p(t,"class","txt"),p(e,"for",i=n[9])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,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,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function tM(n){let e,t,i,s;return e=new fe({props:{class:"form-field form-field-toggle",name:"passwordAuth.enabled",$$slots:{default:[xO,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-0",name:"passwordAuth.identityFields",$$slots:{default:[eM,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&1545&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&1539&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function nM(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function iM(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Im(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function lM(n){let e,t,i,s,l,o;function r(c,d){return c[0].passwordAuth.enabled?iM:nM}let a=r(n),u=a(n),f=n[2]&&Im();return{c(){e=b("div"),e.innerHTML=' Identity/Password',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&M(f,1):(f=Im(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function sM(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[lM],default:[tM]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&1039&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function oM(n,e,t){let i,s,l;Ge(n,Tn,d=>t(5,l=d));let{collection:o}=e,r=[],a="";function u(){t(1,r=[{value:"email"}]);const d=(o==null?void 0:o.fields)||[],m=(o==null?void 0:o.indexes)||[];t(4,a=m.join(""));for(let h of m){const g=U.parseIndex(h);if(!g.unique||g.columns.length!=1||g.columns[0].name=="email")continue;const _=d.find(k=>!k.hidden&&k.name.toLowerCase()==g.columns[0].name.toLowerCase());_&&r.push({value:_.name})}}function f(){o.passwordAuth.enabled=this.checked,t(0,o)}function c(d){n.$$.not_equal(o.passwordAuth.identityFields,d)&&(o.passwordAuth.identityFields=d,t(0,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,s=!U.isEmpty(l==null?void 0:l.passwordAuth)),n.$$.dirty&17&&o&&a!=o.indexes.join("")&&u()},[o,r,s,i,a,l,f,c]}class rM extends ve{constructor(e){super(),ye(this,e,oM,sM,be,{collection:0})}}function Lm(n,e,t){const i=n.slice();return i[27]=e[t],i}function Am(n,e){let t,i,s,l,o,r=e[27].label+"",a,u,f,c,d,m;return c=uv(e[15][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),l=C(),o=b("label"),a=W(r),f=C(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[26]+e[27].value),i.__value=e[27].value,me(i,i.__value),p(o,"for",u=e[26]+e[27].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,g){w(h,t,g),v(t,i),i.checked=i.__value===e[3],v(t,l),v(t,o),v(o,a),v(t,f),d||(m=Y(i,"change",e[14]),d=!0)},p(h,g){e=h,g&67108864&&s!==(s=e[26]+e[27].value)&&p(i,"id",s),g&8&&(i.checked=i.__value===e[3]),g&67108864&&u!==(u=e[26]+e[27].value)&&p(o,"for",u)},d(h){h&&y(t),c.r(),d=!1,m()}}}function aM(n){let e=[],t=new Map,i,s=ce(n[11]);const l=o=>o[27].value;for(let o=0;o({26:i}),({uniqueId:i})=>i?67108864:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1140850882&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function uM(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[26],selectPlaceholder:n[7]?"Loading auth collections...":"Select auth collection",noOptionsText:"No auth collections found",selectionKey:"id",items:n[6]};return n[1]!==void 0&&(u.keyOfSelected=n[1]),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("Auth collection"),s=C(),H(l.$$.fragment),p(e,"for",i=n[26])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&67108864&&i!==(i=f[26]))&&p(e,"for",i);const d={};c&67108864&&(d.id=f[26]),c&128&&(d.selectPlaceholder=f[7]?"Loading auth collections...":"Select auth collection"),c&64&&(d.items=f[6]),!o&&c&2&&(o=!0,d.keyOfSelected=f[1],$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function fM(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("To email address"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.autofocus=!0,l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),l.focus(),r||(a=Y(l,"input",n[17]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function cM(n){let e,t,i,s,l,o,r,a;t=new fe({props:{class:"form-field required",name:"template",$$slots:{default:[aM,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}});let u=n[8]&&Pm(n);return l=new fe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[fM,({uniqueId:f})=>({26:f}),({uniqueId:f})=>f?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),u&&u.c(),s=C(),H(l.$$.fragment),p(e,"id",n[10]),p(e,"autocomplete","off")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),u&&u.m(e,null),v(e,s),q(l,e,null),o=!0,r||(a=Y(e,"submit",it(n[18])),r=!0)},p(f,c){const d={};c&1140850696&&(d.$$scope={dirty:c,ctx:f}),t.$set(d),f[8]?u?(u.p(f,c),c&256&&M(u,1)):(u=Pm(f),u.c(),M(u,1),u.m(e,s)):u&&(oe(),D(u,1,1,()=>{u=null}),re());const m={};c&1140850692&&(m.$$scope={dirty:c,ctx:f}),l.$set(m)},i(f){o||(M(t.$$.fragment,f),M(u),M(l.$$.fragment,f),o=!0)},o(f){D(t.$$.fragment,f),D(u),D(l.$$.fragment,f),o=!1},d(f){f&&y(e),j(t),u&&u.d(),j(l),r=!1,a()}}}function dM(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function pM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W("Close"),i=C(),s=b("button"),l=b("i"),o=C(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[5],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[10]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[5],x(s,"btn-loading",n[5])},m(c,d){w(c,e,d),v(e,t),w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&32&&(e.disabled=c[5]),d&544&&a!==(a=!c[9]||c[5])&&(s.disabled=a),d&32&&x(s,"btn-loading",c[5])},d(c){c&&(y(e),y(i),y(s)),u=!1,f()}}}function mM(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[5],escClose:!n[5],beforeHide:n[19],popup:!0,$$slots:{footer:[pM],header:[dM],default:[cM]},$$scope:{ctx:n}};return e=new ln({props:i}),n[20](e),e.$on("show",n[21]),e.$on("hide",n[22]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.overlayClose=!s[5]),l&32&&(o.escClose=!s[5]),l&32&&(o.beforeHide=s[19]),l&1073742830&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[20](null),j(e,s)}}}const Ca="last_email_test",Nm="email_test_request";function hM(n,e,t){let i;const s=wt(),l="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(Ca),f=o[0].value,c=!1,d=null,m=[],h=!1,g=!1;function _(z="",F="",B=""){Jt({}),t(8,g=!1),t(1,a=z||""),a||$(),t(2,u=F||localStorage.getItem(Ca)),t(3,f=B||o[0].value),r==null||r.show()}function k(){return clearTimeout(d),r==null?void 0:r.hide()}async function S(){if(!(!i||c||!a)){t(5,c=!0),localStorage==null||localStorage.setItem(Ca,u),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(Nm),Mi("Test email send timeout.")},3e4);try{await he.settings.testEmail(a,u,f,{$cancelKey:Nm}),nn("Successfully sent test email."),s("submit"),t(5,c=!1),await _n(),k()}catch(z){t(5,c=!1),he.error(z)}clearTimeout(d)}}async function $(){var z;t(8,g=!0),t(7,h=!0);try{t(6,m=await he.collections.getFullList({filter:"type='auth'",sort:"+name",requestKey:l+"_collections_loading"})),t(1,a=((z=m[0])==null?void 0:z.id)||""),t(7,h=!1)}catch(F){F.isAbort||(t(7,h=!1),he.error(F))}}const T=[[]];function O(){f=this.__value,t(3,f)}function E(z){a=z,t(1,a)}function L(){u=this.value,t(2,u)}const I=()=>S(),A=()=>!c;function P(z){ne[z?"unshift":"push"](()=>{r=z,t(4,r)})}function N(z){Le.call(this,n,z)}function R(z){Le.call(this,n,z)}return n.$$.update=()=>{n.$$.dirty&14&&t(9,i=!!u&&!!f&&!!a)},[k,a,u,f,r,c,m,h,g,i,l,o,S,_,O,T,E,L,I,A,P,N,R]}class Uy extends ve{constructor(e){super(),ye(this,e,hM,mM,be,{show:13,hide:0})}get show(){return this.$$.ctx[13]}get hide(){return this.$$.ctx[0]}}function Rm(n,e,t){const i=n.slice();return i[18]=e[t],i[19]=e,i[20]=t,i}function _M(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Send email alert for new logins"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){w(u,e,f),e.checked=n[0].authAlert.enabled,w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function Fm(n){let e,t,i;function s(o){n[11](o)}let l={};return n[0]!==void 0&&(l.collection=n[0]),e=new UO({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qm(n,e){var a;let t,i,s,l;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 $C({props:r}),ne.push(()=>ge(i,"config",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),q(i,u,f),l=!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),!s&&f&4&&(s=!0,c.config=e[18].config,$e(()=>s=!1)),i.$set(c)},i(u){l||(M(i.$$.fragment,u),l=!0)},o(u){D(i.$$.fragment,u),l=!1},d(u){u&&y(t),j(i,u)}}}function gM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P=[],N=new Map,R,z,F,B,J,V,Z,G,de,pe,ae;o=new fe({props:{class:"form-field form-field-sm form-field-toggle m-0",name:"authAlert.enabled",inlineError:!0,$$slots:{default:[_M,({uniqueId:Ie})=>({21:Ie}),({uniqueId:Ie})=>Ie?2097152:0]},$$scope:{ctx:n}}});function Ce(Ie){n[10](Ie)}let Ye={};n[0]!==void 0&&(Ye.collection=n[0]),u=new rM({props:Ye}),ne.push(()=>ge(u,"collection",Ce));let Ke=!n[1]&&Fm(n);function ct(Ie){n[12](Ie)}let et={};n[0]!==void 0&&(et.collection=n[0]),m=new QO({props:et}),ne.push(()=>ge(m,"collection",ct));function xe(Ie){n[13](Ie)}let Be={};n[0]!==void 0&&(Be.collection=n[0]),_=new XC({props:Be}),ne.push(()=>ge(_,"collection",xe));let ut=ce(n[2]);const Bt=Ie=>Ie[18].key;for(let Ie=0;Iege(J,"collection",Ue));let ot={};return G=new Uy({props:ot}),n[17](G),{c(){e=b("h4"),t=b("div"),i=b("span"),i.textContent="Auth methods",s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),c=C(),Ke&&Ke.c(),d=C(),H(m.$$.fragment),g=C(),H(_.$$.fragment),S=C(),$=b("h4"),T=b("span"),T.textContent="Mail templates",O=C(),E=b("button"),E.textContent="Send test email",L=C(),I=b("div"),A=b("div");for(let Ie=0;Ief=!1)),u.$set(nt),Ie[1]?Ke&&(oe(),D(Ke,1,1,()=>{Ke=null}),re()):Ke?(Ke.p(Ie,We),We&2&&M(Ke,1)):(Ke=Fm(Ie),Ke.c(),M(Ke,1),Ke.m(a,d));const zt={};!h&&We&1&&(h=!0,zt.collection=Ie[0],$e(()=>h=!1)),m.$set(zt);const Ne={};!k&&We&1&&(k=!0,Ne.collection=Ie[0],$e(()=>k=!1)),_.$set(Ne),We&4&&(ut=ce(Ie[2]),oe(),P=kt(P,We,Bt,1,Ie,ut,N,A,Yt,qm,null,Rm),re());const Me={};!V&&We&1&&(V=!0,Me.collection=Ie[0],$e(()=>V=!1)),J.$set(Me);const bt={};G.$set(bt)},i(Ie){if(!de){M(o.$$.fragment,Ie),M(u.$$.fragment,Ie),M(Ke),M(m.$$.fragment,Ie),M(_.$$.fragment,Ie);for(let We=0;Wec==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,s),t(5,r),t(4,a),t(8,l),t(6,o),t(0,u))}function $(O){u=O,t(0,u)}function T(O){ne[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,s={key:"resetPasswordTemplate",label:"Default Password reset email template",placeholders:["APP_NAME","APP_URL","RECORD:*","TOKEN"],config:u.resetPasswordTemplate}),n.$$.dirty&1&&t(8,l={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?[s,r,a]:[l,s,o,r,a])},[u,i,f,c,a,r,o,s,l,d,m,h,g,_,k,S,$,T]}class kM extends ve{constructor(e){super(),ye(this,e,bM,gM,be,{collection:0})}}const yM=n=>({dragging:n&4,dragover:n&8}),jm=n=>({dragging:n[2],dragover:n[3]});function vM(n){let e,t,i,s,l;const o=n[10].default,r=Nt(o,n,n[9],jm);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-19c69j7"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",it(n[11])),Y(e,"dragleave",it(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Ft(r,o,a,a[9],i?Rt(o,a[9],u,yM):qt(a[9]),jm),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(M(r,a),i=!0)},o(a){D(r,a),i=!1},d(a){a&&y(e),r&&r.d(a),s=!1,Ee(l)}}}function wM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=wt();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})),l("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{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>h(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,m,h,r,a,f,s,i,g,_,k,S,$]}class hs extends ve{constructor(e){super(),ye(this,e,wM,vM,be,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Hm(n,e,t){const i=n.slice();return i[27]=e[t],i}function SM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),s=C(),l=b("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),v(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function TM(n){let e,t,i,s;function l(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=Ht(o,r(n)),ne.push(()=>ge(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){oe();const c=e;D(c.$$.fragment,1,0,()=>{j(c,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"value",l)),H(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],$e(()=>t=!1)),e.$set(c)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function $M(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function CM(n){let e,t,i,s;const l=[$M,TM],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function zm(n){let e,t,i,s=ce(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[CM,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&zm(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),r&&r.c(),l=ke()},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=zm(a),r.c(),r.m(l.parentNode,l)):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&&(y(t),y(s),y(l)),j(e,a),j(i,a),r&&r.d(a)}}}function MM(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=b("h4"),i=W(t),s=W(" index")},m(l,o){w(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&se(i,t)},d(l){l&&y(e)}}}function Vm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function EM(n){let e,t,i,s,l,o,r=n[5]!=""&&Vm(n);return{c(){r&&r.c(),e=C(),t=b("button"),t.innerHTML='Cancel',i=C(),s=b("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Vm(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){a&&(y(e),y(t),y(i),y(s)),r&&r.d(a),l=!1,Ee(o)}}}function DM(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[EM],header:[MM],default:[OM]},$$scope:{ctx:n}};for(let l=0;lG.name.toLowerCase()==V);Z>=0?J.columns.splice(Z,1):U.pushUnique(J.columns,{name:B}),t(2,d=U.buildIndex(J))}un(async()=>{t(8,g=!0);try{t(7,h=(await $t(async()=>{const{default:B}=await import("./CodeEditor-CTDCRa84.js");return{default:B}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const E=()=>$(),L=()=>k(),I=()=>T(),A=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=U.buildIndex(s))};function P(B){d=B,t(2,d)}const N=B=>O(B);function R(B){ne[B?"unshift":"push"](()=>{f=B,t(4,f)})}function z(B){Le.call(this,n,B)}function F(B){Le.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),Kt(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,s=U.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((V=s.columns)==null?void 0:V.map(Z=>Z.name.toLowerCase()))||[])},[u,k,d,s,f,c,m,h,g,l,i,$,T,O,r,_,E,L,I,A,P,N,R,z,F]}class LM extends ve{constructor(e){super(),ye(this,e,IM,DM,be,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bm(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=U.parseIndex(i[10]);return i[11]=s,i}function Wm(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){var u;w(r,e,a),s=!0,l||(o=Oe(t=Re.call(null,e,(u=n[2])==null?void 0:u.indexes.message)),l=!0)},p(r,a){var u;t&&Lt(t.update)&&a&4&&t.update.call(null,(u=r[2])==null?void 0:u.indexes.message)},i(r){s||(r&&tt(()=>{s&&(i||(i=qe(e,Ct,{duration:150},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Ct,{duration:150},!1)),i.run(0)),s=!1},d(r){r&&y(e),r&&i&&i.end(),l=!1,o()}}}function Ym(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Km(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Jm).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Ym();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=C(),i=b("span"),l=W(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var g,_;w(m,e,h),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[Oe(r=Re.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,_,k,S,$;n=m,n[11].unique?f||(f=Ym(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(Jm).join(", "))+"")&&se(l,s),h&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Lt(r.update)&&h&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&y(e),f&&f.d(),a=!1,Ee(u)}}}function AM(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)+"",s,l,o,r,a,u,f,c,d,m,h,g,_=((I=(L=n[2])==null?void 0:L.indexes)==null?void 0:I.message)&&Wm(n),k=ce(((A=n[0])==null?void 0:A.indexes)||[]),S=[];for(let P=0;Pge(c,"collection",$)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=W("Unique constraints and indexes ("),s=W(i),l=W(`) + `),_&&_.c(),o=C(),r=b("div");for(let P=0;P+ New index',f=C(),H(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(P,N){w(P,e,N),v(e,t),v(e,s),v(e,l),_&&_.m(e,null),w(P,o,N),w(P,r,N);for(let R=0;R{_=null}),re()),N&7){k=ce(((V=P[0])==null?void 0:V.indexes)||[]);let Z;for(Z=0;Zd=!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&&(y(e),y(o),y(r),y(f)),_&&_.d(),dt(S,P),n[6](null),j(c,P),h=!1,g()}}}const Jm=n=>n.name;function PM(n,e,t){let i;Ge(n,Tn,m=>t(2,i=m));let{collection:s}=e,l;function o(m,h){for(let g=0;gl==null?void 0:l.show(m,h),a=()=>l==null?void 0:l.show();function u(m){ne[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let h=0;h{var h;(h=i.indexes)!=null&&h.message&&Wn("indexes"),o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class NM extends ve{constructor(e){super(),ye(this,e,PM,AM,be,{collection:0})}}function Zm(n,e,t){const i=n.slice();return i[5]=e[t],i}function Gm(n){let e,t,i,s,l,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=C(),s=b("span"),s.textContent=`${n[5].label}`,l=C(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){w(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&y(e),o=!1,r()}}}function RM(n){let e,t=ce(n[1]),i=[];for(let s=0;so(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,l,o,r]}class jM extends ve{constructor(e){super(),ye(this,e,qM,FM,be,{class:0})}}const HM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Xm=n=>({interactive:n[7],hasErrors:n[6]}),zM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),Qm=n=>({interactive:n[7],hasErrors:n[6]}),UM=n=>({interactive:n[0]&128,hasErrors:n[0]&64}),xm=n=>({interactive:n[7],hasErrors:n[6]});function eh(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function th(n){let e,t;return{c(){e=b("span"),t=W(n[5]),p(e,"class","label label-success")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&32&&se(t,i[5])},d(i){i&&y(e)}}}function nh(n){let e;return{c(){e=b("span"),e.textContent="Hidden",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function VM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=n[0].required&&th(n),g=n[0].hidden&&nh();return{c(){e=b("div"),h&&h.c(),t=C(),g&&g.c(),i=C(),s=b("div"),l=b("i"),a=C(),u=b("input"),p(e,"class","field-labels"),p(l,"class",o=U.getFieldTypeIcon(n[0].type)),p(s,"class","form-field-addon prefix field-type-icon"),x(s,"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(_,k){w(_,e,k),h&&h.m(e,null),v(e,t),g&&g.m(e,null),w(_,i,k),w(_,s,k),v(s,l),w(_,a,k),w(_,u,k),n[22](u),d||(m=[Oe(r=Re.call(null,s,n[0].type+(n[0].system?" (system)":""))),Y(s,"click",n[21]),Y(u,"input",n[23])],d=!0)},p(_,k){_[0].required?h?h.p(_,k):(h=th(_),h.c(),h.m(e,t)):h&&(h.d(1),h=null),_[0].hidden?g||(g=nh(),g.c(),g.m(e,null)):g&&(g.d(1),g=null),k[0]&1&&o!==(o=U.getFieldTypeIcon(_[0].type))&&p(l,"class",o),r&&Lt(r.update)&&k[0]&1&&r.update.call(null,_[0].type+(_[0].system?" (system)":"")),k[0]&129&&x(s,"txt-disabled",!_[7]||_[0].system),k[0]&129&&f!==(f=!_[7]||_[0].system)&&(u.disabled=f),k[0]&1&&c!==(c=_[0].name)&&u.value!==c&&(u.value=c)},d(_){_&&(y(e),y(i),y(s),y(a),y(u)),h&&h.d(),g&&g.d(),n[22](null),d=!1,Ee(m)}}}function BM(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function WM(n){let e,t,i,s,l,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",s="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[4]),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(r,a){w(r,e,a),v(e,t),l||(o=Y(e,"click",n[17]),l=!0)},p(r,a){a[0]&1&&i!==(i="Toggle "+r[0].name+" field options")&&p(e,"aria-label",i),a[0]&16&&s!==(s="btn btn-sm btn-circle options-trigger "+(r[4]?"btn-secondary":"btn-transparent"))&&p(e,"class",s),a[0]&16&&p(e,"aria-expanded",r[4]),a[0]&80&&x(e,"btn-hint",!r[4]&&!r[6]),a[0]&80&&x(e,"btn-danger",r[6])},d(r){r&&y(e),l=!1,o()}}}function YM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-success btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,"Restore")),Y(e,"click",n[14])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function ih(n){let e,t,i,s,l=!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=Nt(h,n,n[28],Qm);let _=l&&lh(n),k=r&&sh(n),S=u&&oh(n);const $=n[20].optionsFooter,T=Nt($,n,n[28],Xm);let O=!n[0]._toDelete&&!n[0].primaryKey&&rh(n);return{c(){e=b("div"),t=b("div"),g&&g.c(),i=C(),s=b("div"),_&&_.c(),o=C(),k&&k.c(),a=C(),S&&S.c(),f=C(),T&&T.c(),c=C(),O&&O.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(E,L){w(E,e,L),v(e,t),g&&g.m(t,null),v(e,i),v(e,s),_&&_.m(s,null),v(s,o),k&&k.m(s,null),v(s,a),S&&S.m(s,null),v(s,f),T&&T.m(s,null),v(s,c),O&&O.m(s,null),m=!0},p(E,L){g&&g.p&&(!m||L[0]&268435648)&&Ft(g,h,E,E[28],m?Rt(h,E[28],L,zM):qt(E[28]),Qm),L[0]&257&&(l=!E[0].primaryKey&&E[0].type!="autodate"&&(!E[8]||!E[10].includes(E[0].name))),l?_?(_.p(E,L),L[0]&257&&M(_,1)):(_=lh(E),_.c(),M(_,1),_.m(s,o)):_&&(oe(),D(_,1,1,()=>{_=null}),re()),L[0]&257&&(r=!E[0].primaryKey&&(!E[8]||!E[11].includes(E[0].name))),r?k?(k.p(E,L),L[0]&257&&M(k,1)):(k=sh(E),k.c(),M(k,1),k.m(s,a)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),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=oh(E),S.c(),M(S,1),S.m(s,f)):S&&(oe(),D(S,1,1,()=>{S=null}),re()),T&&T.p&&(!m||L[0]&268435648)&&Ft(T,$,E,E[28],m?Rt($,E[28],L,HM):qt(E[28]),Xm),!E[0]._toDelete&&!E[0].primaryKey?O?(O.p(E,L),L[0]&1&&M(O,1)):(O=rh(E),O.c(),M(O,1),O.m(s,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re())},i(E){m||(M(g,E),M(_),M(k),M(S),M(T,E),M(O),E&&tt(()=>{m&&(d||(d=qe(e,ht,{delay:10,duration:150},!0)),d.run(1))}),m=!0)},o(E){D(g,E),D(_),D(k),D(S),D(T,E),D(O),E&&(d||(d=qe(e,ht,{delay:10,duration:150},!1)),d.run(0)),m=!1},d(E){E&&y(e),g&&g.d(E),_&&_.d(),k&&k.d(),S&&S.d(),T&&T.d(E),O&&O.d(),E&&d&&d.end()}}}function lh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[KM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435489|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),o=W(n[5]),r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[34])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,s,h),v(s,l),v(l,o),v(s,r),v(s,a),c||(d=[Y(e,"change",n[24]),Oe(u=Re.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&&se(o,m[5]),u&&Lt(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(s,"for",f)},d(m){m&&(y(e),y(i),y(s)),c=!1,Ee(d)}}}function sh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"hidden",$$slots:{default:[JM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Hidden",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].hidden,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[25]),Y(e,"change",n[26]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function oh(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle m-0",name:"presentable",$$slots:{default:[ZM,({uniqueId:i})=>({34:i}),({uniqueId:i})=>[0,i?8:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&268435457|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ZM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("input"),s=C(),l=b("label"),o=b("span"),o.textContent="Presentable",r=C(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.disabled=i=n[0].hidden,p(o,"class","txt"),p(a,"class",u="ri-information-line "+(n[0].hidden?"txt-disabled":"link-hint")),p(l,"for",f=n[34])},m(m,h){w(m,e,h),e.checked=n[0].presentable,w(m,s,h),w(m,l,h),v(l,o),v(l,r),v(l,a),c||(d=[Y(e,"change",n[27]),Oe(Re.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(l,"for",f)},d(m){m&&(y(e),y(s),y(l)),c=!1,Ee(d)}}}function rh(n){let e,t,i,s,l,o,r;return o=new Dn({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"),s=b("i"),l=C(),H(o.$$.fragment),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),v(e,t),v(t,i),v(i,s),v(i,l),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&&y(e),j(o)}}}function ah(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[13])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function GM(n){let e,t,i,s,l,o=!n[0].system&&ah(n);return{c(){e=b("button"),e.innerHTML='Duplicate',t=C(),o&&o.c(),i=ke(),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(r,a){w(r,e,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s||(l=Y(e,"click",it(n[15])),s=!0)},p(r,a){r[0].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=ah(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),o&&o.d(r),s=!1,l()}}}function XM(n){let e,t,i,s,l,o,r,a,u,f=n[7]&&n[2]&&eh();s=new fe({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"fields."+n[1]+".name",inlineError:!0,$$slots:{default:[VM]},$$scope:{ctx:n}}});const c=n[20].default,d=Nt(c,n,n[28],xm),m=d||BM();function h(S,$){if(S[0]._toDelete)return YM;if(S[7])return WM}let g=h(n),_=g&&g(n),k=n[7]&&n[4]&&ih(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=C(),H(s.$$.fragment),l=C(),m&&m.c(),o=C(),_&&_.c(),r=C(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0]._toDelete)},m(S,$){w(S,e,$),v(e,t),f&&f.m(t,null),v(t,i),q(s,t,null),v(t,l),m&&m.m(t,null),v(t,o),_&&_.m(t,null),v(e,r),k&&k.m(e,null),u=!0},p(S,$){S[7]&&S[2]?f||(f=eh(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$[0]&128&&(T.class="form-field required m-0 "+(S[7]?"":"disabled")),$[0]&2&&(T.name="fields."+S[1]+".name"),$[0]&268435625&&(T.$$scope={dirty:$,ctx:S}),s.$set(T),d&&d.p&&(!u||$[0]&268435648)&&Ft(d,c,S,S[28],u?Rt(c,S[28],$,UM):qt(S[28]),xm),g===(g=h(S))&&_?_.p(S,$):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[7]&&S[4]?k?(k.p(S,$),$[0]&144&&M(k,1)):(k=ih(S),k.c(),M(k,1),k.m(e,null)):k&&(oe(),D(k,1,1,()=>{k=null}),re()),(!u||$[0]&1)&&x(e,"required",S[0].required),(!u||$[0]&144)&&x(e,"expanded",S[7]&&S[4]),(!u||$[0]&1)&&x(e,"deleted",S[0]._toDelete)},i(S){u||(M(s.$$.fragment,S),M(m,S),M(k),S&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(S){D(s.$$.fragment,S),D(m,S),D(k),S&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&y(e),f&&f.d(),j(s),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Oa=[];function QM(n,e,t){let i,s,l,o,r;Ge(n,Tn,pe=>t(19,r=pe));let{$$slots:a={},$$scope:u}=e;const f="f_"+U.randomString(8),c=wt(),d={bool:"Nonfalsey",number:"Nonzero"},m=["password","tokenKey","id","autodate"],h=["password","tokenKey","id","email"],g=["password","tokenKey"];let{key:_=""}=e,{field:k=U.initSchemaField()}=e,{draggable:S=!0}=e,{collection:$={}}=e,T,O=!1;function E(){k.id?t(0,k._toDelete=!0,k):(N(),c("remove"))}function L(){t(0,k._toDelete=!1,k),Jt({})}function I(){k._toDelete||(N(),c("duplicate"))}function A(pe){return U.slugify(pe)}function P(){t(4,O=!0),z()}function N(){t(4,O=!1)}function R(){O?N():P()}function z(){for(let pe of Oa)pe.id!=f&&pe.collapse()}un(()=>(Oa.push({id:f,collapse:N}),k.onMountSelect&&(t(0,k.onMountSelect=!1,k),T==null||T.select()),()=>{U.removeByKey(Oa,"id",f)}));const F=()=>T==null?void 0:T.focus();function B(pe){ne[pe?"unshift":"push"](()=>{T=pe,t(3,T)})}const J=pe=>{const ae=k.name;t(0,k.name=A(pe.target.value),k),pe.target.value=k.name,c("rename",{oldName:ae,newName:k.name})};function V(){k.required=this.checked,t(0,k)}function Z(){k.hidden=this.checked,t(0,k)}const G=pe=>{pe.target.checked&&t(0,k.presentable=!1,k)};function de(){k.presentable=this.checked,t(0,k)}return n.$$set=pe=>{"key"in pe&&t(1,_=pe.key),"field"in pe&&t(0,k=pe.field),"draggable"in pe&&t(2,S=pe.draggable),"collection"in pe&&t(18,$=pe.collection),"$$scope"in pe&&t(28,u=pe.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&262144&&t(8,i=($==null?void 0:$.type)=="auth"),n.$$.dirty[0]&1&&k._toDelete&&k._originalName&&k.name!==k._originalName&&t(0,k.name=k._originalName,k),n.$$.dirty[0]&1&&!k._originalName&&k.name&&t(0,k._originalName=k.name,k),n.$$.dirty[0]&1&&typeof k._toDelete>"u"&&t(0,k._toDelete=!1,k),n.$$.dirty[0]&1&&k.required&&t(0,k.nullable=!1,k),n.$$.dirty[0]&1&&t(7,s=!k._toDelete),n.$$.dirty[0]&524290&&t(6,l=!U.isEmpty(U.getNestedVal(r,`fields.${_}`))),n.$$.dirty[0]&1&&t(5,o=d[k==null?void 0:k.type]||"Nonempty")},[k,_,S,T,O,o,l,s,i,c,m,h,g,E,L,I,A,R,$,r,a,F,B,J,V,Z,G,de,u]}class Yn extends ve{constructor(e){super(),ye(this,e,QM,XM,be,{key:1,field:0,draggable:2,collection:18},null,[-1,-1])}}function xM(n){let e,t,i,s,l,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 $n({props:a}),ne.push(()=>ge(t,"keyOfSelected",r)),{c(){e=b("div"),H(t.$$.fragment)},m(u,f){w(u,e,f),q(t,e,null),s=!0,l||(o=Oe(Re.call(null,e,{text:"Auto set on:",position:"top"})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&1&&(c.disabled=u[0].system),f&4096&&(c.readonly=!u[12]),!i&&f&4&&(i=!0,c.keyOfSelected=u[2],$e(()=>i=!1)),t.$set(c)},i(u){s||(M(t.$$.fragment,u),s=!0)},o(u){D(t.$$.fragment,u),s=!1},d(u){u&&y(e),j(t),l=!1,o()}}}function eE(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select form-field-autodate-select "+(n[12]?"":"readonly"),inlineError:!0,$$slots:{default:[xM,({uniqueId:r})=>({13:r}),({uniqueId:r})=>r?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,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&&(y(e),y(t),y(s),y(l)),j(i,r)}}}function tE(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[6](r)}let o={$$slots:{default:[eE,({interactive:r})=>({12:r}),({interactive:r})=>r?4096:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?vt(s,[a&2&&{key:r[1]},a&16&&At(r[4])]):{};a&20485&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}const Ma=1,Ea=2,Da=3;function nE(n,e,t){const i=["field","key"];let s=lt(e,i);const l=[{label:"Create",value:Ma},{label:"Update",value:Ea},{label:"Create/Update",value:Da}];let{field:o}=e,{key:r=""}=e,a=u();function u(){return o.onCreate&&o.onUpdate?Da:o.onUpdate?Ea:Ma}function f(_){switch(_){case Ma:t(0,o.onCreate=!0,o),t(0,o.onUpdate=!1,o);break;case Ea:t(0,o.onCreate=!1,o),t(0,o.onUpdate=!0,o);break;case Da: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(_){Le.call(this,n,_)}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(4,s=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,l,s,c,d,m,h,g]}class iE extends ve{constructor(e){super(),ye(this,e,nE,tE,be,{field:0,key:1})}}function lE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function sE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(c){l=c,t(0,l)}function a(c){Le.call(this,n,c)}function u(c){Le.call(this,n,c)}function f(c){Le.call(this,n,c)}return n.$$set=c=>{e=je(je({},e),Kt(c)),t(2,s=lt(e,i)),"field"in c&&t(0,l=c.field),"key"in c&&t(1,o=c.key)},[l,o,s,r,a,u,f]}class oE extends ve{constructor(e){super(),ye(this,e,sE,lE,be,{field:0,key:1})}}var Ia=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ts={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},no={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Qn=function(n){return n===!0?1:0};function uh(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var La=function(n){return n instanceof Array?n:[n]};function On(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function Mt(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 Yo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Vy(n,e){if(e(n))return n;if(n.parentNode)return Vy(n.parentNode,e)}function Ko(n,e){var t=Mt("div","numInputWrapper"),i=Mt("input","numInput "+n),s=Mt("span","arrowUp"),l=Mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Un(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Aa=function(){},wr=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},rE={D:Aa,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Qn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Aa,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:Aa,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Sl={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},zs={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[zs.w(n,e,t)]},F:function(n,e,t){return wr(zs.n(n,e,t)-1,!1,e)},G:function(n,e,t){return Pn(zs.h(n,e,t))},H:function(n){return Pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Qn(n.getHours()>11)]},M:function(n,e){return wr(n.getMonth(),!0,e)},S:function(n){return Pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return Pn(n.getFullYear(),4)},d:function(n){return Pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return Pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return Pn(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)}},By=function(n){var e=n.config,t=e===void 0?ts:e,i=n.l10n,s=i===void 0?no:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return zs[c]&&m[d-1]!=="\\"?zs[c](r,f,t):c!=="\\"?c:""}).join("")}},bu=function(n){var e=n.config,t=e===void 0?ts:e,i=n.l10n,s=i===void 0?no:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ts).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var h=void 0,g=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),le=Na(t.config);ee.setHours(le.hours,le.minutes,le.seconds,ee.getMilliseconds()),t.selectedDates=[ee],t.latestSelectedDateObj=ee}X!==void 0&&X.type!=="blur"&&dl(X);var Se=t._input.value;c(),Ln(),t._input.value!==Se&&t._debouncedChange()}function u(X,ee){return X%12+12*Qn(ee===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,ee=(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 Se=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 Ve=Pa(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),rt=Pa(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Je=Pa(X,ee,le);if(Je>rt&&Je=12)]),t.secondElement!==void 0&&(t.secondElement.value=Pn(le)))}function h(X){var ee=Un(X),le=parseInt(ee.value)+(X.delta||0);(le/1e3>1||X.key==="Enter"&&!/[^\d]/.test(le.toString()))&&et(le)}function g(X,ee,le,Se){if(ee instanceof Array)return ee.forEach(function(Fe){return g(X,Fe,le,Se)});if(X instanceof Array)return X.forEach(function(Fe){return g(Fe,ee,le,Se)});X.addEventListener(ee,le,Se),t._handlers.push({remove:function(){return X.removeEventListener(ee,le,Se)}})}function _(){It("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(le){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+le+"]"),function(Se){return g(Se,"click",t[le])})}),t.isMobile){Jn();return}var X=uh(De,50);if(t._debouncedChange=uh(_,cE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(le){t.config.mode==="range"&&Ue(Un(le))}),g(t._input,"keydown",Bt),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Bt),!t.config.inline&&!t.config.static&&g(window,"resize",X),window.ontouchstart!==void 0?g(window.document,"touchstart",ct):g(window.document,"mousedown",ct),g(window.document,"focus",ct,{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",ql),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",Pt)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var ee=function(le){return Un(le).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",$),g([t.hourElement,t.minuteElement],["focus","click"],ee),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",ut)}function S(X,ee){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.maxDate1),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 Ve=Mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ve,t.element),Ve.appendChild(t.element),t.altInput&&Ve.appendChild(t.altInput),Ve.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,ee,le,Se){var Fe=xe(ee,!0),Ve=Mt("span",X,ee.getDate().toString());return Ve.dateObj=ee,Ve.$i=Se,Ve.setAttribute("aria-label",t.formatDate(ee,t.config.ariaDateFormat)),X.indexOf("hidden")===-1&&Vn(ee,t.now)===0&&(t.todayDateElem=Ve,Ve.classList.add("today"),Ve.setAttribute("aria-current","date")),Fe?(Ve.tabIndex=-1,fl(ee)&&(Ve.classList.add("selected"),t.selectedDateElem=Ve,t.config.mode==="range"&&(On(Ve,"startRange",t.selectedDates[0]&&Vn(ee,t.selectedDates[0],!0)===0),On(Ve,"endRange",t.selectedDates[1]&&Vn(ee,t.selectedDates[1],!0)===0),X==="nextMonthDay"&&Ve.classList.add("inRange")))):Ve.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Vi(ee)&&!fl(ee)&&Ve.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&X!=="prevMonthDay"&&Se%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(ee)+""),It("onDayCreate",Ve),Ve}function L(X){X.focus(),t.config.mode==="range"&&Ue(X)}function I(X){for(var ee=X>0?0:t.config.showMonths-1,le=X>0?t.config.showMonths:-1,Se=ee;Se!=le;Se+=X)for(var Fe=t.daysContainer.children[Se],Ve=X>0?0:Fe.children.length-1,rt=X>0?Fe.children.length:-1,Je=Ve;Je!=rt;Je+=X){var ue=Fe.children[Je];if(ue.className.indexOf("hidden")===-1&&xe(ue.dateObj))return ue}}function A(X,ee){for(var le=X.className.indexOf("Month")===-1?X.dateObj.getMonth():t.currentMonth,Se=ee>0?t.config.showMonths:-1,Fe=ee>0?1:-1,Ve=le-t.currentMonth;Ve!=Se;Ve+=Fe)for(var rt=t.daysContainer.children[Ve],Je=le-t.currentMonth===Ve?X.$i+ee:ee<0?rt.children.length-1:0,ue=rt.children.length,we=Je;we>=0&&we0?ue:-1);we+=Fe){var He=rt.children[we];if(He.className.indexOf("hidden")===-1&&xe(He.dateObj)&&Math.abs(X.$i-we)>=Math.abs(ee))return L(He)}t.changeMonth(Fe),P(I(Fe),0)}function P(X,ee){var le=l(),Se=Be(le||document.body),Fe=X!==void 0?X:Se?le:t.selectedDateElem!==void 0&&Be(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Be(t.todayDateElem)?t.todayDateElem:I(ee>0?1:-1);Fe===void 0?t._input.focus():Se?A(Fe,ee):L(Fe)}function N(X,ee){for(var le=(new Date(X,ee,1).getDay()-t.l10n.firstDayOfWeek+7)%7,Se=t.utils.getDaysInMonth((ee-1+12)%12,X),Fe=t.utils.getDaysInMonth(ee,X),Ve=window.document.createDocumentFragment(),rt=t.config.showMonths>1,Je=rt?"prevMonthDay hidden":"prevMonthDay",ue=rt?"nextMonthDay hidden":"nextMonthDay",we=Se+1-le,He=0;we<=Se;we++,He++)Ve.appendChild(E("flatpickr-day "+Je,new Date(X,ee-1,we),we,He));for(we=1;we<=Fe;we++,He++)Ve.appendChild(E("flatpickr-day",new Date(X,ee,we),we,He));for(var Qe=Fe+1;Qe<=42-le&&(t.config.showMonths===1||He%7!==0);Qe++,He++)Ve.appendChild(E("flatpickr-day "+ue,new Date(X,ee+1,Qe%Fe),Qe,He));var at=Mt("div","dayContainer");return at.appendChild(Ve),at}function R(){if(t.daysContainer!==void 0){Yo(t.daysContainer),t.weekNumbers&&Yo(t.weekNumbers);for(var X=document.createDocumentFragment(),ee=0;ee1||t.config.monthSelectorType!=="dropdown")){var X=function(Se){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&Set.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var ee=0;ee<12;ee++)if(X(ee)){var le=Mt("option","flatpickr-monthDropdown-month");le.value=new Date(t.currentYear,ee).getMonth().toString(),le.textContent=wr(ee,t.config.shorthandCurrentMonth,t.l10n),le.tabIndex=-1,t.currentMonth===ee&&(le.selected=!0),t.monthsDropdownContainer.appendChild(le)}}}function F(){var X=Mt("div","flatpickr-month"),ee=window.document.createDocumentFragment(),le;t.config.showMonths>1||t.config.monthSelectorType==="static"?le=Mt("span","cur-month"):(t.monthsDropdownContainer=Mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(rt){var Je=Un(rt),ue=parseInt(Je.value,10);t.changeMonth(ue-t.currentMonth),It("onMonthChange")}),z(),le=t.monthsDropdownContainer);var Se=Ko("cur-year",{tabindex:"-1"}),Fe=Se.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 Ve=Mt("div","flatpickr-current-month");return Ve.appendChild(le),Ve.appendChild(Se),ee.appendChild(Ve),X.appendChild(ee),{container:X,yearElement:Fe,monthElement:le}}function B(){Yo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var X=t.config.showMonths;X--;){var ee=F();t.yearElements.push(ee.yearElement),t.monthElements.push(ee.monthElement),t.monthNav.appendChild(ee.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=Mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=Mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=Mt("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&&(On(t.prevMonthNav,"flatpickr-disabled",X),t.__hidePrevMonthArrow=X)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(X){t.__hideNextMonthArrow!==X&&(On(t.nextMonthNav,"flatpickr-disabled",X),t.__hideNextMonthArrow=X)}}),t.currentYearElement=t.yearElements[0],Bi(),t.monthNav}function V(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var X=Na(t.config);t.timeContainer=Mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var ee=Mt("span","flatpickr-time-separator",":"),le=Ko("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=le.getElementsByTagName("input")[0];var Se=Ko("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=Se.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?X.hours:f(X.hours)),t.minuteElement.value=Pn(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(ee),t.timeContainer.appendChild(Se),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Fe=Ko("flatpickr-second");t.secondElement=Fe.getElementsByTagName("input")[0],t.secondElement.value=Pn(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(Mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Fe)}return t.config.time_24hr||(t.amPM=Mt("span","flatpickr-am-pm",t.l10n.amPM[Qn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Yo(t.weekdayContainer):t.weekdayContainer=Mt("div","flatpickr-weekdays");for(var X=t.config.showMonths;X--;){var ee=Mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(ee)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var X=t.l10n.firstDayOfWeek,ee=fh(t.l10n.weekdays.shorthand);X>0&&X `+ee.join("")+` - `}}function de(){t.calendarContainer.classList.add("hasWeeks");var X=Mt("div","flatpickr-weekwrapper");X.appendChild(Mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=Mt("div","flatpickr-weeks");return X.appendChild(ee),{weekWrapper:X,weekNumbers:ee}}function pe(X,ee){ee===void 0&&(ee=!0);var le=ee?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,It("onYearChange"),z()),R(),It("onMonthChange"),Bi())}function ae(X,ee){if(X===void 0&&(X=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=Na(t.config),Se=le.hours,Fe=le.minutes,Ve=le.seconds;m(Se,Fe,Ve)}t.redraw(),X&&It("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),It("onClose")}function Ye(){t.config!==void 0&&It("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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Ke(X){return t.calendarContainer.contains(X)}function ct(X){if(t.isOpen&&!t.config.inline){var ee=Un(X),le=Ke(ee),Se=ee===t.input||ee===t.altInput||t.element.contains(ee)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!Se&&!le&&!Ke(X.relatedTarget),Ve=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(ee)});Fe&&Ve&&(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&&Xt.config.maxDate.getFullYear())){var ee=X,le=t.currentYear!==ee;t.currentYear=ee||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),It("onYearChange"),z())}}function xe(X,ee){var le;ee===void 0&&(ee=!0);var Se=t.parseDate(X,void 0,ee);if(t.config.minDate&&Se&&Vn(Se,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&Se&&Vn(Se,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Se===void 0)return!1;for(var Fe=!!t.config.enable,Ve=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,Je=void 0;rt=Je.from.getTime()&&Se.getTime()<=Je.to.getTime())return Fe}return!Fe}function Be(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function ut(X){var ee=X.target===t._input,le=t._input.value.trimEnd()!==cl();ee&&le&&!(X.relatedTarget&&Ke(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Bt(X){var ee=Un(X),le=t.config.wrap?n.contains(ee):ee===t._input,Se=t.config.allowInput,Fe=t.isOpen&&(!Se||!le),Ve=t.config.inline&&le&&!Se;if(X.keyCode===13&&le){if(Se)return t.setDate(t._input.value,!0,ee===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ee.blur();t.open()}else if(Ke(ee)||Fe||Ve){var rt=!!t.timeContainer&&t.timeContainer.contains(ee);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),Ut()):Pt(X);break;case 27:X.preventDefault(),Ut();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var Je=l();if(t.daysContainer!==void 0&&(Se===!1||Je&&Be(Je))){var ue=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),pe(ue),P(I(1),0)):P(void 0,ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var we=X.keyCode===40?1:-1;t.daysContainer&&ee.$i!==void 0||ee===t.input||ee===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-we),P(I(1),0)):rt||P(void 0,we*7):ee===t.currentYearElement?et(t.currentYear-we):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var He=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Wt){return Wt}),Qe=He.indexOf(ee);if(Qe!==-1){var at=He[Qe+(X.shiftKey?-1:1)];X.preventDefault(),(at||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ee)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&ee===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(),Ln();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ln();break}(le||Ke(ee))&&It("onKeyDown",X)}function Ue(X,ee){if(ee===void 0&&(ee="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(ee)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Se=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Ve=Math.max(le,t.selectedDates[0].getTime()),rt=!1,Je=0,ue=0,we=Fe;weFe&&weJe)?Je=we:we>Se&&(!ue||we ."+ee));He.forEach(function(Qe){var at=Qe.dateObj,Wt=at.getTime(),pn=Je>0&&Wt0&&Wt>ue;if(pn){Qe.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(mn){Qe.classList.remove(mn)});return}else if(rt&&!pn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(mn){Qe.classList.remove(mn)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),Sele&&Wt===Se&&Qe.classList.add("endRange"),Wt>=Je&&(ue===0||Wt<=ue)&&rE(Wt,Se,le)&&Qe.classList.add("inRange"))})}}function De(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function ot(X,ee){if(ee===void 0&&(ee=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()),It("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Se=t.isOpen;t.isOpen=!0,Se||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),It("onOpen"),zt(ee)),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 Ie(X){return function(ee){var le=t.config["_"+X+"Date"]=t.parseDate(ee,t.config.dateFormat),Se=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),Ln()),t.daysContainer&&(bt(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!Se&&le!==void 0&&Se.getFullYear()===le.getFullYear())}}function We(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ee=bn(bn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=ee.parseDate,t.config.formatDate=ee.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(He){t.config._enable=mi(He)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(He){t.config._disable=mi(He)}});var Se=ee.mode==="time";if(!ee.dateFormat&&(ee.enableTime||Se)){var Fe=on.defaultConfig.dateFormat||ts.dateFormat;le.dateFormat=ee.noCalendar||Se?"H:i"+(ee.enableSeconds?":S":""):Fe+" H:i"+(ee.enableSeconds?":S":"")}if(ee.altInput&&(ee.enableTime||Se)&&!ee.altFormat){var Ve=on.defaultConfig.altFormat||ts.altFormat;le.altFormat=ee.noCalendar||Se?"h:i"+(ee.enableSeconds?":S K":" K"):Ve+(" h:i"+(ee.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Ie("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Ie("max")});var rt=function(He){return function(Qe){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(Qe,"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")}),ee.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,ee);for(var Je=0;Je-1?t.config[we]=La(ue[we]).map(o).concat(t.config[we]):typeof ee[we]>"u"&&(t.config[we]=ue[we])}ee.altInputClass||(t.config.altInputClass=Te().className+" "+t.config.altInputClass),It("onParseConfig")}function Te(){return t.config.wrap?n.querySelector("[data-input]"):n}function nt(){typeof t.config.locale!="object"&&typeof on.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=bn(bn({},on.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?on.l10ns[t.config.locale]:void 0),Sl.D="("+t.l10n.weekdays.shorthand.join("|")+")",Sl.l="("+t.l10n.weekdays.longhand.join("|")+")",Sl.M="("+t.l10n.months.shorthand.join("|")+")",Sl.F="("+t.l10n.months.longhand.join("|")+")",Sl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=bn(bn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&on.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Vy(t),t.parseDate=bu({config:t.config,l10n:t.l10n})}function zt(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){It("onPreCalendarPosition");var ee=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),Se=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Ve=Fe[0],rt=Fe.length>1?Fe[1]:null,Je=ee.getBoundingClientRect(),ue=window.innerHeight-Je.bottom,we=Ve==="above"||Ve!=="below"&&uele,He=window.pageYOffset+Je.top+(we?-le-2:ee.offsetHeight+2);if(On(t.calendarContainer,"arrowTop",!we),On(t.calendarContainer,"arrowBottom",we),!t.config.inline){var Qe=window.pageXOffset+Je.left,at=!1,Wt=!1;rt==="center"?(Qe-=(Se-Je.width)/2,at=!0):rt==="right"&&(Qe-=Se-Je.width,Wt=!0),On(t.calendarContainer,"arrowLeft",!at&&!Wt),On(t.calendarContainer,"arrowCenter",at),On(t.calendarContainer,"arrowRight",Wt);var pn=window.document.body.offsetWidth-(window.pageXOffset+Je.right),mn=Qe+Se>window.document.body.offsetWidth,go=pn+Se>window.document.body.offsetWidth;if(On(t.calendarContainer,"rightMost",mn),!t.config.static)if(t.calendarContainer.style.top=He+"px",!mn)t.calendarContainer.style.left=Qe+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=pn+"px";else{var jl=Ne();if(jl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-Se/2),Ii=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=jl.cssRules.length,Hl="{left:"+Je.left+"px;right:auto;}";On(t.calendarContainer,"rightMost",!1),On(t.calendarContainer,"centerMost",!0),jl.insertRule(Ii+","+pl+Hl,ml),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ne(){for(var X=null,ee=0;eet.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Se,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=fl(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(He,Qe){return He.getTime()-Qe.getTime()}));if(c(),Ve){var Je=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),Je&&(It("onYearChange"),z()),It("onMonthChange")}if(Bi(),R(),Ln(),!Ve&&t.config.mode!=="range"&&t.config.showMonths===1?L(Se):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ue=t.config.mode==="single"&&!t.config.enableTime,we=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ue||we)&&Ut()}h()}}var Pe={locale:[nt,G],showMonths:[B,r,Z],minDate:[S],maxDate:[S],positionElement:[yt],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 jt(X,ee){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Pe[le]!==void 0&&Pe[le].forEach(function(Se){return Se()})}else t.config[X]=ee,Pe[X]!==void 0?Pe[X].forEach(function(Se){return Se()}):Ia.indexOf(X)>-1&&(t.config[X]=La(ee));t.redraw(),Ln(!0)}function Gt(X,ee){var le=[];if(X instanceof Array)le=X.map(function(Se){return t.parseDate(Se,ee)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,ee)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,ee)];break;case"multiple":le=X.split(t.config.conjunction).map(function(Se){return t.parseDate(Se,ee)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(Se){return t.parseDate(Se,ee)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(Se){return Se instanceof Date&&xe(Se,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Se,Fe){return Se.getTime()-Fe.getTime()})}function en(X,ee,le){if(ee===void 0&&(ee=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(ee);Gt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,ee),d(),t.selectedDates.length===0&&t.clear(!1),Ln(ee),ee&&It("onChange")}function mi(X){return X.slice().map(function(ee){return typeof ee=="string"||typeof ee=="number"||ee instanceof Date?t.parseDate(ee,void 0,!0):ee&&typeof ee=="object"&&ee.from&&ee.to?{from:t.parseDate(ee.from,void 0),to:t.parseDate(ee.to,void 0)}:ee}).filter(function(ee){return ee})}function Ei(){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&&Gt(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()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 oi(){if(t.input=Te(),!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=Mt(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"),yt()}function yt(){t._positionElement=t.config.positionElement||t._input}function Jn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Mt("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(ee){t.setDate(Un(ee).value,!1,t.mobileFormatStr),It("onChange"),It("onClose")})}function fn(X){if(t.isOpen===!0)return t.close();t.open(X)}function It(X,ee){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var Se=0;le[Se]&&Se=0&&Vn(X,t.selectedDates[1])<=0}function Bi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,ee){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+ee),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ee].textContent=wr(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.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function cl(X){var ee=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,ee)}).filter(function(le,Se,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===Se}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ln(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=cl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=cl(t.config.altFormat)),X!==!1&&It("onValueUpdate")}function ql(X){var ee=Un(X),le=t.prevMonthNav.contains(ee),Se=t.nextMonthNav.contains(ee);le||Se?pe(le?-1:1):t.yearElements.indexOf(ee)>=0?ee.select():ee.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ee.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function dl(X){X.preventDefault();var ee=X.type==="keydown",le=Un(X),Se=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Qn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(Se.getAttribute("min")),Ve=parseFloat(Se.getAttribute("max")),rt=parseFloat(Se.getAttribute("step")),Je=parseInt(Se.value,10),ue=X.delta||(ee?X.which===38?1:-1:0),we=Je+rt*ue;if(typeof Se.value<"u"&&Se.value.length===2){var He=Se===t.hourElement,Qe=Se===t.minuteElement;weVe&&(we=Se===t.hourElement?we-Ve-Qn(!t.amPM):Fe,Qe&&T(void 0,1,t.hourElement)),t.amPM&&He&&(rt===1?we+Je===23:Math.abs(we-Je)>rt)&&(t.amPM.textContent=t.l10n.amPM[Qn(t.amPM.textContent===t.l10n.amPM[0])]),Se.value=Pn(we)}}return s(),t}function ns(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function hE(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:_=void 0,flatpickr:g=void 0}=e;un(()=>{const T=f??_,O=k(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),_n().then(()=>{t(8,m=!0)})}),t(3,g=on(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const h=wt();function k(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{h(mE(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=ch(E,T);!dh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function $(T){ne[T?"unshift":"push"](()=>{_=T,t(0,_)})}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(1,s=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,_=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&&(dh(a,ch(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(k(d)))g.set(T,O)},[_,s,a,g,u,f,c,d,m,o,l,$]}class uf extends ve{constructor(e){super(),ye(this,e,hE,pE,be,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function _E(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),l=new uf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const _={};m&65536&&(_.id=d[16]),!o&&m&4&&(o=!0,_.value=d[2],$e(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].min,$e(()=>r=!1)),l.$set(_)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function gE(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),l=new uf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const _={};m&65536&&(_.id=d[16]),!o&&m&8&&(o=!0,_.value=d[3],$e(()=>o=!1)),!r&&m&1&&(r=!0,_.formattedValue=d[0].max,$e(()=>r=!1)),l.$set(_)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function bE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[_E,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[gE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function kE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[bE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function yE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=l==null?void 0:l.min,a=l==null?void 0:l.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,l[O]=T.detail[1],l)}function f(T){r=T,t(2,r),t(0,l)}function c(T){n.$$.not_equal(l.min,T)&&(l.min=T,t(0,l))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,l)}function _(T){n.$$.not_equal(l.max,T)&&(l.max=T,t(0,l))}const g=T=>u(T,"max");function h(T){l=T,t(0,l)}function k(T){Le.call(this,n,T)}function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(5,s=lt(e,i)),"field"in T&&t(0,l=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(l==null?void 0:l.min)&&t(2,r=l==null?void 0:l.min),n.$$.dirty&9&&a!=(l==null?void 0:l.max)&&t(3,a=l==null?void 0:l.max)},[l,o,r,a,u,s,f,c,d,m,_,g,h,k,S,$]}class vE extends ve{constructor(e){super(),ye(this,e,yE,kE,be,{field:0,key:1})}}function wE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){w(c,e,d),v(e,t),v(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[3]),u=!0)},p(c,d){d&512&&s!==(s=c[9])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function SE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].convertURLs,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[4]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function TE(n){let e,t,i,s;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[wE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[SE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name="fields."+l[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name="fields."+l[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function $E(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[TE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function CE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=m=>t(0,l.maxSize=parseInt(m.target.value,10),l);function a(){l.convertURLs=this.checked,t(0,l)}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class OE extends ve{constructor(e){super(),ye(this,e,CE,$E,be,{field:0,key:1})}}function ME(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(h){n[3](h)}let g={id:n[9],disabled:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new _o({props:g}),ne.push(()=>ge(r,"value",_)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(f,"class","help-block")},m(h,k){w(h,e,k),v(e,t),v(e,i),v(e,s),w(h,o,k),q(r,h,k),w(h,u,k),w(h,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(h,k){(!c||k&512&&l!==(l=h[9]))&&p(e,"for",l);const S={};k&512&&(S.id=h[9]),k&1&&(S.disabled=!U.isEmpty(h[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=h[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(h){c||(M(r.$$.fragment,h),c=!0)},o(h){D(r.$$.fragment,h),c=!1},d(h){h&&(y(e),y(o),y(u),y(f)),j(r,h),d=!1,m()}}}function EE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(h){n[4](h)}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 _o({props:g}),ne.push(()=>ge(r,"value",_)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]+".onlyDomains"),p(f,"class","help-block")},m(h,k){w(h,e,k),v(e,t),v(e,i),v(e,s),w(h,o,k),q(r,h,k),w(h,u,k),w(h,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(h,k){(!c||k&512&&l!==(l=h[9]+".onlyDomains"))&&p(e,"for",l);const S={};k&512&&(S.id=h[9]+".onlyDomains"),k&1&&(S.disabled=!U.isEmpty(h[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=h[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(h){c||(M(r.$$.fragment,h),c=!0)},o(h){D(r.$$.fragment,h),c=!1},d(h){h&&(y(e),y(o),y(u),y(f)),j(r,h),d=!1,m()}}}function DE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[ME,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[EE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function IE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[DE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function LE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(m){n.$$.not_equal(l.exceptDomains,m)&&(l.exceptDomains=m,t(0,l))}function a(m){n.$$.not_equal(l.onlyDomains,m)&&(l.onlyDomains=m,t(0,l))}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class By extends ve{constructor(e){super(),ye(this,e,LE,IE,be,{field:0,key:1})}}function AE(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),s=C(),l=b("small"),r=W(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),w(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:te,o:te,d(a){a&&(y(e),y(s),y(l))}}}function PE(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class ph extends ve{constructor(e){super(),ye(this,e,PE,AE,be,{item:0})}}const NE=[{ext:"",mimeType:"application/octet-stream"},{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:".apk",mimeType:"application/vnd.android.package-archive"},{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:".mp4",mimeType:"video/mp4"},{ext:".avif",mimeType:"image/avif"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".mj2",mimeType:"video/mj2"},{ext:".dvb",mimeType:"video/vnd.dvb.file"},{ext:".webm",mimeType:"video/webm"},{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:".m3u",mimeType:"application/vnd.apple.mpegurl"},{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:".cbor",mimeType:"application/cbor"},{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:".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:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".parquet",mimeType:"application/vnd.apache.parquet"},{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:"application/atom+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:"text/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"}];function RE(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function FE(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[RE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,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&&(y(e),y(t),y(s),y(l)),j(i,r)}}}function qE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=C(),l=b("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[8]),Y(i,"click",n[9]),Y(l,"click",n[10]),Y(r,"click",n[11])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r)),a=!1,Ee(u)}}}function jE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:ph,optionComponent:ph};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new $n({props:O}),ne.push(()=>ge(r,"keyOfSelected",T)),h=new Dn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),_=b("i"),g=C(),H(h.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(d,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(_,"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){w(E,e,L),v(e,t),v(e,i),v(e,s),w(E,o,L),q(r,E,L),w(E,u,L),w(E,f,L),v(f,c),v(c,d),v(c,m),v(c,_),v(c,g),q(h,c,null),k=!0,S||($=Oe(Re.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&l!==(l=E[23]))&&p(e,"for",l);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),h.$set(A)},i(E){k||(M(r.$$.fragment,E),M(h.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(h.$$.fragment,E),k=!1},d(E){E&&(y(e),y(o),y(u),y(f)),j(r,E),j(h),S=!1,$()}}}function HE(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + `}}function de(){t.calendarContainer.classList.add("hasWeeks");var X=Mt("div","flatpickr-weekwrapper");X.appendChild(Mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var ee=Mt("div","flatpickr-weeks");return X.appendChild(ee),{weekWrapper:X,weekNumbers:ee}}function pe(X,ee){ee===void 0&&(ee=!0);var le=ee?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,It("onYearChange"),z()),R(),It("onMonthChange"),Bi())}function ae(X,ee){if(X===void 0&&(X=!0),ee===void 0&&(ee=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,ee===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var le=Na(t.config),Se=le.hours,Fe=le.minutes,Ve=le.seconds;m(Se,Fe,Ve)}t.redraw(),X&&It("onChange")}function Ce(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),It("onClose")}function Ye(){t.config!==void 0&&It("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 ee=t.calendarContainer.parentNode;if(ee.lastChild&&ee.removeChild(ee.lastChild),ee.parentNode){for(;ee.firstChild;)ee.parentNode.insertBefore(ee.firstChild,ee);ee.parentNode.removeChild(ee)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(le){try{delete t[le]}catch{}})}function Ke(X){return t.calendarContainer.contains(X)}function ct(X){if(t.isOpen&&!t.config.inline){var ee=Un(X),le=Ke(ee),Se=ee===t.input||ee===t.altInput||t.element.contains(ee)||X.path&&X.path.indexOf&&(~X.path.indexOf(t.input)||~X.path.indexOf(t.altInput)),Fe=!Se&&!le&&!Ke(X.relatedTarget),Ve=!t.config.ignoredFocusElements.some(function(rt){return rt.contains(ee)});Fe&&Ve&&(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&&Xt.config.maxDate.getFullYear())){var ee=X,le=t.currentYear!==ee;t.currentYear=ee||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),le&&(t.redraw(),It("onYearChange"),z())}}function xe(X,ee){var le;ee===void 0&&(ee=!0);var Se=t.parseDate(X,void 0,ee);if(t.config.minDate&&Se&&Vn(Se,t.config.minDate,ee!==void 0?ee:!t.minDateHasTime)<0||t.config.maxDate&&Se&&Vn(Se,t.config.maxDate,ee!==void 0?ee:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(Se===void 0)return!1;for(var Fe=!!t.config.enable,Ve=(le=t.config.enable)!==null&&le!==void 0?le:t.config.disable,rt=0,Je=void 0;rt=Je.from.getTime()&&Se.getTime()<=Je.to.getTime())return Fe}return!Fe}function Be(X){return t.daysContainer!==void 0?X.className.indexOf("hidden")===-1&&X.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(X):!1}function ut(X){var ee=X.target===t._input,le=t._input.value.trimEnd()!==cl();ee&&le&&!(X.relatedTarget&&Ke(X.relatedTarget))&&t.setDate(t._input.value,!0,X.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Bt(X){var ee=Un(X),le=t.config.wrap?n.contains(ee):ee===t._input,Se=t.config.allowInput,Fe=t.isOpen&&(!Se||!le),Ve=t.config.inline&&le&&!Se;if(X.keyCode===13&&le){if(Se)return t.setDate(t._input.value,!0,ee===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),ee.blur();t.open()}else if(Ke(ee)||Fe||Ve){var rt=!!t.timeContainer&&t.timeContainer.contains(ee);switch(X.keyCode){case 13:rt?(X.preventDefault(),a(),Ut()):Pt(X);break;case 27:X.preventDefault(),Ut();break;case 8:case 46:le&&!t.config.allowInput&&(X.preventDefault(),t.clear());break;case 37:case 39:if(!rt&&!le){X.preventDefault();var Je=l();if(t.daysContainer!==void 0&&(Se===!1||Je&&Be(Je))){var ue=X.keyCode===39?1:-1;X.ctrlKey?(X.stopPropagation(),pe(ue),P(I(1),0)):P(void 0,ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:X.preventDefault();var we=X.keyCode===40?1:-1;t.daysContainer&&ee.$i!==void 0||ee===t.input||ee===t.altInput?X.ctrlKey?(X.stopPropagation(),et(t.currentYear-we),P(I(1),0)):rt||P(void 0,we*7):ee===t.currentYearElement?et(t.currentYear-we):t.config.enableTime&&(!rt&&t.hourElement&&t.hourElement.focus(),a(X),t._debouncedChange());break;case 9:if(rt){var He=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Wt){return Wt}),Qe=He.indexOf(ee);if(Qe!==-1){var at=He[Qe+(X.shiftKey?-1:1)];X.preventDefault(),(at||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(ee)&&X.shiftKey&&(X.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&ee===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(),Ln();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ln();break}(le||Ke(ee))&&It("onKeyDown",X)}function Ue(X,ee){if(ee===void 0&&(ee="flatpickr-day"),!(t.selectedDates.length!==1||X&&(!X.classList.contains(ee)||X.classList.contains("flatpickr-disabled")))){for(var le=X?X.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),Se=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Fe=Math.min(le,t.selectedDates[0].getTime()),Ve=Math.max(le,t.selectedDates[0].getTime()),rt=!1,Je=0,ue=0,we=Fe;weFe&&weJe)?Je=we:we>Se&&(!ue||we ."+ee));He.forEach(function(Qe){var at=Qe.dateObj,Wt=at.getTime(),pn=Je>0&&Wt0&&Wt>ue;if(pn){Qe.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(mn){Qe.classList.remove(mn)});return}else if(rt&&!pn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(mn){Qe.classList.remove(mn)}),X!==void 0&&(X.classList.add(le<=t.selectedDates[0].getTime()?"startRange":"endRange"),Sele&&Wt===Se&&Qe.classList.add("endRange"),Wt>=Je&&(ue===0||Wt<=ue)&&aE(Wt,Se,le)&&Qe.classList.add("inRange"))})}}function De(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function ot(X,ee){if(ee===void 0&&(ee=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()),It("onOpen");return}else if(t._input.disabled||t.config.inline)return;var Se=t.isOpen;t.isOpen=!0,Se||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),It("onOpen"),zt(ee)),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 Ie(X){return function(ee){var le=t.config["_"+X+"Date"]=t.parseDate(ee,t.config.dateFormat),Se=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),Ln()),t.daysContainer&&(bt(),le!==void 0?t.currentYearElement[X]=le.getFullYear().toString():t.currentYearElement.removeAttribute(X),t.currentYearElement.disabled=!!Se&&le!==void 0&&Se.getFullYear()===le.getFullYear())}}function We(){var X=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],ee=bn(bn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),le={};t.config.parseDate=ee.parseDate,t.config.formatDate=ee.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(He){t.config._enable=mi(He)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(He){t.config._disable=mi(He)}});var Se=ee.mode==="time";if(!ee.dateFormat&&(ee.enableTime||Se)){var Fe=on.defaultConfig.dateFormat||ts.dateFormat;le.dateFormat=ee.noCalendar||Se?"H:i"+(ee.enableSeconds?":S":""):Fe+" H:i"+(ee.enableSeconds?":S":"")}if(ee.altInput&&(ee.enableTime||Se)&&!ee.altFormat){var Ve=on.defaultConfig.altFormat||ts.altFormat;le.altFormat=ee.noCalendar||Se?"h:i"+(ee.enableSeconds?":S K":" K"):Ve+(" h:i"+(ee.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Ie("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Ie("max")});var rt=function(He){return function(Qe){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(Qe,"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")}),ee.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,le,ee);for(var Je=0;Je-1?t.config[we]=La(ue[we]).map(o).concat(t.config[we]):typeof ee[we]>"u"&&(t.config[we]=ue[we])}ee.altInputClass||(t.config.altInputClass=Te().className+" "+t.config.altInputClass),It("onParseConfig")}function Te(){return t.config.wrap?n.querySelector("[data-input]"):n}function nt(){typeof t.config.locale!="object"&&typeof on.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=bn(bn({},on.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?on.l10ns[t.config.locale]:void 0),Sl.D="("+t.l10n.weekdays.shorthand.join("|")+")",Sl.l="("+t.l10n.weekdays.longhand.join("|")+")",Sl.M="("+t.l10n.months.shorthand.join("|")+")",Sl.F="("+t.l10n.months.longhand.join("|")+")",Sl.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var X=bn(bn({},e),JSON.parse(JSON.stringify(n.dataset||{})));X.time_24hr===void 0&&on.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=By(t),t.parseDate=bu({config:t.config,l10n:t.l10n})}function zt(X){if(typeof t.config.position=="function")return void t.config.position(t,X);if(t.calendarContainer!==void 0){It("onPreCalendarPosition");var ee=X||t._positionElement,le=Array.prototype.reduce.call(t.calendarContainer.children,function(gs,Vr){return gs+Vr.offsetHeight},0),Se=t.calendarContainer.offsetWidth,Fe=t.config.position.split(" "),Ve=Fe[0],rt=Fe.length>1?Fe[1]:null,Je=ee.getBoundingClientRect(),ue=window.innerHeight-Je.bottom,we=Ve==="above"||Ve!=="below"&&uele,He=window.pageYOffset+Je.top+(we?-le-2:ee.offsetHeight+2);if(On(t.calendarContainer,"arrowTop",!we),On(t.calendarContainer,"arrowBottom",we),!t.config.inline){var Qe=window.pageXOffset+Je.left,at=!1,Wt=!1;rt==="center"?(Qe-=(Se-Je.width)/2,at=!0):rt==="right"&&(Qe-=Se-Je.width,Wt=!0),On(t.calendarContainer,"arrowLeft",!at&&!Wt),On(t.calendarContainer,"arrowCenter",at),On(t.calendarContainer,"arrowRight",Wt);var pn=window.document.body.offsetWidth-(window.pageXOffset+Je.right),mn=Qe+Se>window.document.body.offsetWidth,go=pn+Se>window.document.body.offsetWidth;if(On(t.calendarContainer,"rightMost",mn),!t.config.static)if(t.calendarContainer.style.top=He+"px",!mn)t.calendarContainer.style.left=Qe+"px",t.calendarContainer.style.right="auto";else if(!go)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=pn+"px";else{var jl=Ne();if(jl===void 0)return;var bo=window.document.body.offsetWidth,_s=Math.max(0,bo/2-Se/2),Ii=".flatpickr-calendar.centerMost:before",pl=".flatpickr-calendar.centerMost:after",ml=jl.cssRules.length,Hl="{left:"+Je.left+"px;right:auto;}";On(t.calendarContainer,"rightMost",!1),On(t.calendarContainer,"centerMost",!0),jl.insertRule(Ii+","+pl+Hl,ml),t.calendarContainer.style.left=_s+"px",t.calendarContainer.style.right="auto"}}}}function Ne(){for(var X=null,ee=0;eet.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=Se,t.config.mode==="single")t.selectedDates=[Fe];else if(t.config.mode==="multiple"){var rt=fl(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(He,Qe){return He.getTime()-Qe.getTime()}));if(c(),Ve){var Je=t.currentYear!==Fe.getFullYear();t.currentYear=Fe.getFullYear(),t.currentMonth=Fe.getMonth(),Je&&(It("onYearChange"),z()),It("onMonthChange")}if(Bi(),R(),Ln(),!Ve&&t.config.mode!=="range"&&t.config.showMonths===1?L(Se):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var ue=t.config.mode==="single"&&!t.config.enableTime,we=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(ue||we)&&Ut()}_()}}var Pe={locale:[nt,G],showMonths:[B,r,Z],minDate:[S],maxDate:[S],positionElement:[yt],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 jt(X,ee){if(X!==null&&typeof X=="object"){Object.assign(t.config,X);for(var le in X)Pe[le]!==void 0&&Pe[le].forEach(function(Se){return Se()})}else t.config[X]=ee,Pe[X]!==void 0?Pe[X].forEach(function(Se){return Se()}):Ia.indexOf(X)>-1&&(t.config[X]=La(ee));t.redraw(),Ln(!0)}function Gt(X,ee){var le=[];if(X instanceof Array)le=X.map(function(Se){return t.parseDate(Se,ee)});else if(X instanceof Date||typeof X=="number")le=[t.parseDate(X,ee)];else if(typeof X=="string")switch(t.config.mode){case"single":case"time":le=[t.parseDate(X,ee)];break;case"multiple":le=X.split(t.config.conjunction).map(function(Se){return t.parseDate(Se,ee)});break;case"range":le=X.split(t.l10n.rangeSeparator).map(function(Se){return t.parseDate(Se,ee)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(X)));t.selectedDates=t.config.allowInvalidPreload?le:le.filter(function(Se){return Se instanceof Date&&xe(Se,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(Se,Fe){return Se.getTime()-Fe.getTime()})}function en(X,ee,le){if(ee===void 0&&(ee=!1),le===void 0&&(le=t.config.dateFormat),X!==0&&!X||X instanceof Array&&X.length===0)return t.clear(ee);Gt(X,le),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,ee),d(),t.selectedDates.length===0&&t.clear(!1),Ln(ee),ee&&It("onChange")}function mi(X){return X.slice().map(function(ee){return typeof ee=="string"||typeof ee=="number"||ee instanceof Date?t.parseDate(ee,void 0,!0):ee&&typeof ee=="object"&&ee.from&&ee.to?{from:t.parseDate(ee.from,void 0),to:t.parseDate(ee.to,void 0)}:ee}).filter(function(ee){return ee})}function Ei(){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&&Gt(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()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 oi(){if(t.input=Te(),!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=Mt(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"),yt()}function yt(){t._positionElement=t.config.positionElement||t._input}function Jn(){var X=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=Mt("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(ee){t.setDate(Un(ee).value,!1,t.mobileFormatStr),It("onChange"),It("onClose")})}function fn(X){if(t.isOpen===!0)return t.close();t.open(X)}function It(X,ee){if(t.config!==void 0){var le=t.config[X];if(le!==void 0&&le.length>0)for(var Se=0;le[Se]&&Se=0&&Vn(X,t.selectedDates[1])<=0}function Bi(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(X,ee){var le=new Date(t.currentYear,t.currentMonth,1);le.setMonth(t.currentMonth+ee),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[ee].textContent=wr(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.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function cl(X){var ee=X||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(le){return t.formatDate(le,ee)}).filter(function(le,Se,Fe){return t.config.mode!=="range"||t.config.enableTime||Fe.indexOf(le)===Se}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ln(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=cl(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=cl(t.config.altFormat)),X!==!1&&It("onValueUpdate")}function ql(X){var ee=Un(X),le=t.prevMonthNav.contains(ee),Se=t.nextMonthNav.contains(ee);le||Se?pe(le?-1:1):t.yearElements.indexOf(ee)>=0?ee.select():ee.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):ee.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function dl(X){X.preventDefault();var ee=X.type==="keydown",le=Un(X),Se=le;t.amPM!==void 0&&le===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Qn(t.amPM.textContent===t.l10n.amPM[0])]);var Fe=parseFloat(Se.getAttribute("min")),Ve=parseFloat(Se.getAttribute("max")),rt=parseFloat(Se.getAttribute("step")),Je=parseInt(Se.value,10),ue=X.delta||(ee?X.which===38?1:-1:0),we=Je+rt*ue;if(typeof Se.value<"u"&&Se.value.length===2){var He=Se===t.hourElement,Qe=Se===t.minuteElement;weVe&&(we=Se===t.hourElement?we-Ve-Qn(!t.amPM):Fe,Qe&&T(void 0,1,t.hourElement)),t.amPM&&He&&(rt===1?we+Je===23:Math.abs(we-Je)>rt)&&(t.amPM.textContent=t.l10n.amPM[Qn(t.amPM.textContent===t.l10n.amPM[0])]),Se.value=Pn(we)}}return s(),t}function ns(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function _E(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=lt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:g=void 0}=e;un(()=>{const T=f??h,O=k(d);return O.onReady.push((E,L,I)=>{a===void 0&&S(E,L,I),_n().then(()=>{t(8,m=!0)})}),t(3,g=on(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=wt();function k(T={}){T=Object.assign({},T);for(const O of r){const E=(L,I,A)=>{_(hE(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=ch(E,T);!dh(a,L)&&(a||L)&&t(2,a=L),t(4,u=O)}function $(T){ne[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(1,s=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&&(dh(a,ch(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[T,O]of Object.entries(k(d)))g.set(T,O)},[h,s,a,g,u,f,c,d,m,o,l,$]}class uf extends ve{constructor(e){super(),ye(this,e,_E,mE,be,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function gE(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].min!==void 0&&(c.formattedValue=n[0].min),l=new uf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=b("label"),t=W("Min date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].min,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function bE(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:U.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].max!==void 0&&(c.formattedValue=n[0].max),l=new uf({props:c}),ne.push(()=>ge(l,"value",u)),ne.push(()=>ge(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=b("label"),t=W("Max date (UTC)"),s=C(),H(l.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].max,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function kE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[gE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[bE,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function yE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[kE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function vE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=l==null?void 0:l.min,a=l==null?void 0:l.max;function u(T,O){T.detail&&T.detail.length==3&&t(0,l[O]=T.detail[1],l)}function f(T){r=T,t(2,r),t(0,l)}function c(T){n.$$.not_equal(l.min,T)&&(l.min=T,t(0,l))}const d=T=>u(T,"min");function m(T){a=T,t(3,a),t(0,l)}function h(T){n.$$.not_equal(l.max,T)&&(l.max=T,t(0,l))}const g=T=>u(T,"max");function _(T){l=T,t(0,l)}function k(T){Le.call(this,n,T)}function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$set=T=>{e=je(je({},e),Kt(T)),t(5,s=lt(e,i)),"field"in T&&t(0,l=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{n.$$.dirty&5&&r!=(l==null?void 0:l.min)&&t(2,r=l==null?void 0:l.min),n.$$.dirty&9&&a!=(l==null?void 0:l.max)&&t(3,a=l==null?void 0:l.max)},[l,o,r,a,u,s,f,c,d,m,h,g,_,k,S,$]}class wE extends ve{constructor(e){super(),ye(this,e,vE,yE,be,{field:0,key:1})}}function SE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[9]),p(o,"type","number"),p(o,"id",r=n[9]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~5MB")},m(c,d){w(c,e,d),v(e,t),v(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[3]),u=!0)},p(c,d){d&512&&s!==(s=c[9])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function TE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Strip urls domain",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].convertURLs,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[4]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function $E(n){let e,t,i,s;return e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[SE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),i=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".convertURLs",$$slots:{default:[TE,({uniqueId:l})=>({9:l}),({uniqueId:l})=>l?512:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&2&&(r.name="fields."+l[1]+".maxSize"),o&1537&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&2&&(a.name="fields."+l[1]+".convertURLs"),o&1537&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function CE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[$E]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function OE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=m=>t(0,l.maxSize=parseInt(m.target.value,10),l);function a(){l.convertURLs=this.checked,t(0,l)}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class ME extends ve{constructor(e){super(),ye(this,e,OE,CE,be,{field:0,key:1})}}function EE(n){let e,t,i,s,l,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 _o({props:g}),ne.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(f,"class","help-block")},m(_,k){w(_,e,k),v(e,t),v(e,i),v(e,s),w(_,o,k),q(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&l!==(l=_[9]))&&p(e,"for",l);const S={};k&512&&(S.id=_[9]),k&1&&(S.disabled=!U.isEmpty(_[0].onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].exceptDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),j(r,_),d=!1,m()}}}function DE(n){let e,t,i,s,l,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 _o({props:g}),ne.push(()=>ge(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]+".onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),v(e,t),v(e,i),v(e,s),w(_,o,k),q(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=Oe(Re.call(null,s,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&512&&l!==(l=_[9]+".onlyDomains"))&&p(e,"for",l);const S={};k&512&&(S.id=_[9]+".onlyDomains"),k&1&&(S.disabled=!U.isEmpty(_[0].exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].onlyDomains,$e(()=>a=!1)),r.$set(S)},i(_){c||(M(r.$$.fragment,_),c=!0)},o(_){D(r.$$.fragment,_),c=!1},d(_){_&&(y(e),y(o),y(u),y(f)),j(r,_),d=!1,m()}}}function IE(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".exceptDomains",$$slots:{default:[EE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".onlyDomains",$$slots:{default:[DE,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function LE(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[IE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function AE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(m){n.$$.not_equal(l.exceptDomains,m)&&(l.exceptDomains=m,t(0,l))}function a(m){n.$$.not_equal(l.onlyDomains,m)&&(l.onlyDomains=m,t(0,l))}function u(m){l=m,t(0,l)}function f(m){Le.call(this,n,m)}function c(m){Le.call(this,n,m)}function d(m){Le.call(this,n,m)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(2,s=lt(e,i)),"field"in m&&t(0,l=m.field),"key"in m&&t(1,o=m.key)},[l,o,s,r,a,u,f,c,d]}class Wy extends ve{constructor(e){super(),ye(this,e,AE,LE,be,{field:0,key:1})}}function PE(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=W(t),s=C(),l=b("small"),r=W(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),w(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:te,o:te,d(a){a&&(y(e),y(s),y(l))}}}function NE(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class ph extends ve{constructor(e){super(),ye(this,e,NE,PE,be,{item:0})}}const RE=[{ext:"",mimeType:"application/octet-stream"},{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:".apk",mimeType:"application/vnd.android.package-archive"},{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:".mp4",mimeType:"video/mp4"},{ext:".avif",mimeType:"image/avif"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".mj2",mimeType:"video/mj2"},{ext:".dvb",mimeType:"video/vnd.dvb.file"},{ext:".webm",mimeType:"video/webm"},{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:".m3u",mimeType:"application/vnd.apple.mpegurl"},{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:".cbor",mimeType:"application/cbor"},{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:".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:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".parquet",mimeType:"application/vnd.apache.parquet"},{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:"application/atom+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:"text/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"}];function FE(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function qE(n){let e,t,i,s,l,o;return i=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[FE,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),q(i,r,a),w(r,s,a),w(r,l,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&&(y(e),y(t),y(s),y(l)),j(i,r)}}}function jE(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=C(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=C(),l=b("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=C(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(l,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[8]),Y(i,"click",n[9]),Y(l,"click",n[10]),Y(r,"click",n[11])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r)),a=!1,Ee(u)}}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$;function T(E){n[7](E)}let O={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:ph,optionComponent:ph};return n[0].mimeTypes!==void 0&&(O.keyOfSelected=n[0].mimeTypes),r=new $n({props:O}),ne.push(()=>ge(r,"keyOfSelected",T)),_=new Dn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[jE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=C(),h=b("i"),g=C(),H(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=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){w(E,e,L),v(e,t),v(e,i),v(e,s),w(E,o,L),q(r,E,L),w(E,u,L),w(E,f,L),v(f,c),v(c,d),v(c,m),v(c,h),v(c,g),q(_,c,null),k=!0,S||($=Oe(Re.call(null,s,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(E,L){(!k||L&8388608&&l!==(l=E[23]))&&p(e,"for",l);const I={};L&8388608&&(I.id=E[23]),L&8&&(I.items=E[3]),!a&&L&1&&(a=!0,I.keyOfSelected=E[0].mimeTypes,$e(()=>a=!1)),r.$set(I);const A={};L&33554433&&(A.$$scope={dirty:L,ctx:E}),_.$set(A)},i(E){k||(M(r.$$.fragment,E),M(_.$$.fragment,E),k=!0)},o(E){D(r.$$.fragment,E),D(_.$$.fragment,E),k=!1},d(E){E&&(y(e),y(o),y(u),y(f)),j(r,E),j(_),S=!1,$()}}}function zE(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH (e.g. 100x50) - crop to WxH viewbox (from center)
  • WxHt (e.g. 100x50t) - crop to WxH viewbox (from top)
  • WxHb (e.g. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf (e.g. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH (e.g. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (e.g. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,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 _o({props:L}),ne.push(()=>ge(r,"value",E)),S=new Dn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[HE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),_=b("span"),_.textContent="Supported formats",g=C(),h=b("i"),k=C(),H(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(c,"class","txt"),p(_,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,A){w(I,e,A),v(e,t),v(e,i),v(e,s),w(I,o,A),q(r,I,A),w(I,u,A),w(I,f,A),v(f,c),v(f,d),v(f,m),v(m,_),v(m,g),v(m,h),v(m,k),q(S,m,null),$=!0,T||(O=Oe(Re.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&l!==(l=I[23]))&&p(e,"for",l);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,$e(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(M(r.$$.fragment,I),M(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(y(e),y(o),y(u),y(f)),j(r,I),j(S),T=!1,O()}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),s=C(),l=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","0"),p(l,"max",Number.MAX_SAFE_INTEGER),l.value=r=n[0].maxSize||"",p(l,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),w(d,a,m),w(d,u,m),f||(c=Y(l,"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(l,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&l.value!==r&&(l.value=r)},d(d){d&&(y(e),y(s),y(l),y(a),y(u)),f=!1,c()}}}function mh(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[VE,({uniqueId:s})=>({23:s}),({uniqueId:s})=>s?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="fields."+s[1]+".maxSelect"),l&41943041&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function VE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"id",o=n[23]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),p(l,"max",Number.MAX_SAFE_INTEGER),l.required=!0,p(l,"placeholder","Default to single")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].maxSelect),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].maxSelect&&me(l,u[0].maxSelect)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function BE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible - (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(s,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){w(c,e,d),e.checked=n[0].protected,w(c,i,d),w(c,s,d),v(s,l),w(c,r,d),w(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(s,"for",o)},d(c){c&&(y(e),y(i),y(s),y(r),y(a)),u=!1,f()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[jE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[zE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[UE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&mh(n);return _=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[BE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),d=C(),h&&h.c(),m=C(),H(_.$$.fragment),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){w(k,e,S),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,a),v(e,u),q(f,u,null),v(e,d),h&&h.m(e,null),v(e,m),q(_,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?h&&(oe(),D(h,1,1,()=>{h=null}),re()):h?(h.p(k,S),S&4&&M(h,1)):(h=mh(k),h.c(),M(h,1),h.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),_.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(h),M(_.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(h),D(_.$$.fragment,k),g=!1},d(k){k&&y(e),j(i),j(o),j(f),h&&h.d(),j(_)}}}function YE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{options:[WE],default:[FE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function KE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=NE.slice(),u=l.maxSelect<=1,f=u;function c(){t(0,l.maxSelect=1,l),t(0,l.thumbs=[],l),t(0,l.mimeTypes=[],l),t(2,u=!0),t(6,f=u)}function d(){if(U.isEmpty(l.mimeTypes))return;const N=[];for(const R of l.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(l.mimeTypes,N)&&(l.mimeTypes=N,t(0,l),t(6,f),t(2,u))}const _=()=>{t(0,l.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{t(0,l.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},h=()=>{t(0,l.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},k=()=>{t(0,l.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function S(N){n.$$.not_equal(l.thumbs,N)&&(l.thumbs=N,t(0,l),t(6,f),t(2,u))}const $=N=>t(0,l.maxSize=parseInt(N.target.value,10),l);function T(){l.maxSelect=mt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.protected=this.checked,t(0,l),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){l=N,t(0,l),t(6,f),t(2,u)}function I(N){Le.call(this,n,N)}function A(N){Le.call(this,n,N)}function P(N){Le.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Kt(N)),t(5,s=lt(e,i)),"field"in N&&t(0,l=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,l.maxSelect=1,l):t(0,l.maxSelect=99,l)),n.$$.dirty&1&&(typeof l.maxSelect>"u"?c():d())},[l,o,u,a,r,s,f,m,_,g,h,k,S,$,T,O,E,L,I,A,P]}class JE extends ve{constructor(e){super(),ye(this,e,KE,YE,be,{field:0,key:1})}}function ZE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~1MB")},m(c,d){w(c,e,d),v(e,t),v(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[4]),u=!0)},p(c,d){d&1024&&s!==(s=c[10])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function GE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function XE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function hh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,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"),s=W("In order to support seamlessly both "),l=b("code"),l.textContent="application/json",o=W(` and + (e.g. 100x0) - resize to W width preserving the aspect ratio`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,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 _o({props:L}),ne.push(()=>ge(r,"value",E)),S=new Dn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[zE]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=C(),s=b("i"),o=C(),H(r.$$.fragment),u=C(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=C(),m=b("button"),h=b("span"),h.textContent="Supported formats",g=C(),_=b("i"),k=C(),H(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=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){w(I,e,A),v(e,t),v(e,i),v(e,s),w(I,o,A),q(r,I,A),w(I,u,A),w(I,f,A),v(f,c),v(f,d),v(f,m),v(m,h),v(m,g),v(m,_),v(m,k),q(S,m,null),$=!0,T||(O=Oe(Re.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(I,A){(!$||A&8388608&&l!==(l=I[23]))&&p(e,"for",l);const P={};A&8388608&&(P.id=I[23]),!a&&A&1&&(a=!0,P.value=I[0].thumbs,$e(()=>a=!1)),r.$set(P);const N={};A&33554432&&(N.$$scope={dirty:A,ctx:I}),S.$set(N)},i(I){$||(M(r.$$.fragment,I),M(S.$$.fragment,I),$=!0)},o(I){D(r.$$.fragment,I),D(S.$$.fragment,I),$=!1},d(I){I&&(y(e),y(o),y(u),y(f)),j(r,I),j(S),T=!1,O()}}}function VE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Max file size"),s=C(),l=b("input"),a=C(),u=b("div"),u.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","0"),p(l,"max",Number.MAX_SAFE_INTEGER),l.value=r=n[0].maxSize||"",p(l,"placeholder","Default to max ~5MB"),p(u,"class","help-block")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),w(d,a,m),w(d,u,m),f||(c=Y(l,"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(l,"id",o),m&1&&r!==(r=d[0].maxSize||"")&&l.value!==r&&(l.value=r)},d(d){d&&(y(e),y(s),y(l),y(a),y(u)),f=!1,c()}}}function mh(n){let e,t,i;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[BE,({uniqueId:s})=>({23:s}),({uniqueId:s})=>s?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="fields."+s[1]+".maxSelect"),l&41943041&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"id",o=n[23]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),p(l,"max",Number.MAX_SAFE_INTEGER),l.required=!0,p(l,"placeholder","Default to single")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].maxSelect),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&mt(l.value)!==u[0].maxSelect&&me(l,u[0].maxSelect)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Protected",r=C(),a=b("small"),a.innerHTML=`it will require View API rule permissions and file token to be accessible + (Learn more)`,p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(s,"for",o=n[23]),p(a,"class","txt-hint")},m(c,d){w(c,e,d),e.checked=n[0].protected,w(c,i,d),w(c,s,d),v(s,l),w(c,r,d),w(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(s,"for",o)},d(c){c&&(y(e),y(i),y(s),y(r),y(a)),u=!1,f()}}}function YE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;i=new fe({props:{class:"form-field",name:"fields."+n[1]+".mimeTypes",$$slots:{default:[HE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".thumbs",$$slots:{default:[UE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSize",$$slots:{default:[VE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}});let _=!n[2]&&mh(n);return h=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".protected",$$slots:{default:[WE,({uniqueId:k})=>({23:k}),({uniqueId:k})=>k?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),d=C(),_&&_.c(),m=C(),H(h.$$.fragment),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(k,S){w(k,e,S),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,a),v(e,u),q(f,u,null),v(e,d),_&&_.m(e,null),v(e,m),q(h,e,null),g=!0},p(k,S){const $={};S&2&&($.name="fields."+k[1]+".mimeTypes"),S&41943049&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.name="fields."+k[1]+".thumbs"),S&41943041&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),(!g||S&4&&r!==(r=k[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const O={};S&2&&(O.name="fields."+k[1]+".maxSize"),S&41943041&&(O.$$scope={dirty:S,ctx:k}),f.$set(O),(!g||S&4&&c!==(c=k[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),k[2]?_&&(oe(),D(_,1,1,()=>{_=null}),re()):_?(_.p(k,S),S&4&&M(_,1)):(_=mh(k),_.c(),M(_,1),_.m(e,m));const E={};S&2&&(E.name="fields."+k[1]+".protected"),S&41943041&&(E.$$scope={dirty:S,ctx:k}),h.$set(E)},i(k){g||(M(i.$$.fragment,k),M(o.$$.fragment,k),M(f.$$.fragment,k),M(_),M(h.$$.fragment,k),g=!0)},o(k){D(i.$$.fragment,k),D(o.$$.fragment,k),D(f.$$.fragment,k),D(_),D(h.$$.fragment,k),g=!1},d(k){k&&y(e),j(i),j(o),j(f),_&&_.d(),j(h)}}}function KE(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{options:[YE],default:[qE,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?vt(s,[a&2&&{key:r[1]},a&32&&At(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function JE(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=RE.slice(),u=l.maxSelect<=1,f=u;function c(){t(0,l.maxSelect=1,l),t(0,l.thumbs=[],l),t(0,l.mimeTypes=[],l),t(2,u=!0),t(6,f=u)}function d(){if(U.isEmpty(l.mimeTypes))return;const N=[];for(const R of l.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(l.mimeTypes,N)&&(l.mimeTypes=N,t(0,l),t(6,f),t(2,u))}const h=()=>{t(0,l.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{t(0,l.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},_=()=>{t(0,l.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},k=()=>{t(0,l.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function S(N){n.$$.not_equal(l.thumbs,N)&&(l.thumbs=N,t(0,l),t(6,f),t(2,u))}const $=N=>t(0,l.maxSize=parseInt(N.target.value,10),l);function T(){l.maxSelect=mt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.protected=this.checked,t(0,l),t(6,f),t(2,u)}function E(N){u=N,t(2,u)}function L(N){l=N,t(0,l),t(6,f),t(2,u)}function I(N){Le.call(this,n,N)}function A(N){Le.call(this,n,N)}function P(N){Le.call(this,n,N)}return n.$$set=N=>{e=je(je({},e),Kt(N)),t(5,s=lt(e,i)),"field"in N&&t(0,l=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{n.$$.dirty&68&&f!=u&&(t(6,f=u),u?t(0,l.maxSelect=1,l):t(0,l.maxSelect=99,l)),n.$$.dirty&1&&(typeof l.maxSelect>"u"?c():d())},[l,o,u,a,r,s,f,m,h,g,_,k,S,$,T,O,E,L,I,A,P]}class ZE extends ve{constructor(e){super(),ye(this,e,JE,KE,be,{field:0,key:1})}}function GE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max size "),i=b("small"),i.textContent="(bytes)",l=C(),o=b("input"),p(e,"for",s=n[10]),p(o,"type","number"),p(o,"id",r=n[10]),p(o,"step","1"),p(o,"min","0"),p(o,"max",Number.MAX_SAFE_INTEGER),o.value=a=n[0].maxSize||"",p(o,"placeholder","Default to max ~1MB")},m(c,d){w(c,e,d),v(e,t),v(e,i),w(c,l,d),w(c,o,d),u||(f=Y(o,"input",n[4]),u=!0)},p(c,d){d&1024&&s!==(s=c[10])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function XE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function QE(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function hh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,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"),s=W("In order to support seamlessly both "),l=b("code"),l.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"),_=b("li"),_.innerHTML=""true" is converted to the json true",g=C(),h=b("li"),h.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=C(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",V=W(` + `),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json true",g=C(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=C(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=C(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",O=C(),E=b("li"),I=W(L),A=W(" is converted to the json "),P=b("code"),P.textContent='{"a":1,"b":2}',N=C(),R=b("li"),R.textContent="numeric strings are converted to json number",z=C(),F=b("li"),F.textContent="double quoted strings are left as they are (aka. without normalizations)",B=C(),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(pe,ae){w(pe,e,ae),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,c),v(i,d),v(i,m),v(m,_),v(m,g),v(m,h),v(m,k),v(m,S),v(m,$),v(m,T),v(m,O),v(m,E),v(E,I),v(E,A),v(E,P),v(m,N),v(m,R),v(m,z),v(m,F),v(m,B),v(m,J),v(i,V),v(i,Z),de=!0},i(pe){de||(pe&&tt(()=>{de&&(G||(G=qe(e,ht,{duration:150},!0)),G.run(1))}),de=!0)},o(pe){pe&&(G||(G=qe(e,ht,{duration:150},!1)),G.run(0)),de=!1},d(pe){pe&&y(e),pe&&G&&G.end()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f,c;e=new fe({props:{class:"form-field m-b-sm",name:"fields."+n[1]+".maxSize",$$slots:{default:[ZE,({uniqueId:h})=>({10:h}),({uniqueId:h})=>h?1024:0]},$$scope:{ctx:n}}});function d(h,k){return h[2]?XE:GE}let m=d(n),_=m(n),g=n[2]&&hh();return{c(){H(e.$$.fragment),t=C(),i=b("button"),s=b("strong"),s.textContent="String value normalizations",l=C(),_.c(),r=C(),g&&g.c(),a=ke(),p(s,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(h,k){q(e,h,k),w(h,t,k),w(h,i,k),v(i,s),v(i,l),_.m(i,null),w(h,r,k),g&&g.m(h,k),w(h,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(h,k){const S={};k&2&&(S.name="fields."+h[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:h}),e.$set(S),m!==(m=d(h))&&(_.d(1),_=m(h),_&&(_.c(),_.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(h[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),h[2]?g?k&4&&M(g,1):(g=hh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(h){u||(M(e.$$.fragment,h),M(g),u=!0)},o(h){D(e.$$.fragment,h),D(g),u=!1},d(h){h&&(y(t),y(i),y(r),y(a)),j(e,h),_.d(),g&&g.d(h),f=!1,c()}}}function xE(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[6](r)}let o={$$slots:{options:[QE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?vt(s,[a&2&&{key:r[1]},a&8&&At(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function eD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=_=>t(0,l.maxSize=parseInt(_.target.value,10),l),u=()=>{t(2,r=!r)};function f(_){l=_,t(0,l)}function c(_){Le.call(this,n,_)}function d(_){Le.call(this,n,_)}function m(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(3,s=lt(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,r,s,a,u,f,c,d,m]}class tD extends ve{constructor(e){super(),ye(this,e,eD,xE,be,{field:0,key:1})}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Min"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].min),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].min&&me(l,u[0].min)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function iD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].max),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].max&&me(l,f[0].max)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function lD(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[nD,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[iD,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function sD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].onlyInt,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[3]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function oD(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[sD,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="fields."+i[1]+".onlyInt"),s&3073&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function rD(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[oD],options:[lD]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function aD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.onlyInt=this.checked,t(0,l)}function a(){l.min=mt(this.value),t(0,l)}function u(){l.max=mt(this.value),t(0,l)}function f(_){l=_,t(0,l)}function c(_){Le.call(this,n,_)}function d(_){Le.call(this,n,_)}function m(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(2,s=lt(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,m]}class uD extends ve{constructor(e){super(),ye(this,e,aD,rD,be,{field:0,key:1})}}function fD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].min||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].min||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function cD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"placeholder","Up to 71 chars"),p(l,"min",r=n[0].min||0),p(l,"max","71"),l.value=a=n[0].max||""},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),u||(f=Y(l,"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(l,"id",o),d&1&&r!==(r=c[0].min||0)&&p(l,"min",r),d&1&&a!==(a=c[0].max||"")&&l.value!==a&&(l.value=a)},d(c){c&&(y(e),y(s),y(l)),u=!1,f()}}}function dD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"placeholder","Default to 10"),p(l,"step","1"),p(l,"min","6"),p(l,"max","31"),l.value=r=n[0].cost||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].cost||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",o=n[12]),p(l,"placeholder","ex. ^\\w+$")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].pattern),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].pattern&&me(l,u[0].pattern)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[fD,({uniqueId:_})=>({12:_}),({uniqueId:_})=>_?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[cD,({uniqueId:_})=>({12:_}),({uniqueId:_})=>_?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[dD,({uniqueId:_})=>({12:_}),({uniqueId:_})=>_?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[pD,({uniqueId:_})=>({12:_}),({uniqueId:_})=>_?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-6"),p(c,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),q(d,c,null),m=!0},p(_,g){const h={};g&2&&(h.name="fields."+_[1]+".min"),g&12289&&(h.$$scope={dirty:g,ctx:_}),i.$set(h);const k={};g&2&&(k.name="fields."+_[1]+".max"),g&12289&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const S={};g&2&&(S.name="fields."+_[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:_}),u.$set(S);const $={};g&2&&($.name="fields."+_[1]+".pattern"),g&12289&&($.$$scope={dirty:g,ctx:_}),d.$set($)},i(_){m||(M(i.$$.fragment,_),M(o.$$.fragment,_),M(u.$$.fragment,_),M(d.$$.fragment,_),m=!0)},o(_){D(i.$$.fragment,_),D(o.$$.fragment,_),D(u.$$.fragment,_),D(d.$$.fragment,_),m=!1},d(_){_&&y(e),j(i),j(o),j(u),j(d)}}}function hD(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[7](r)}let o={$$slots:{options:[mD]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function _D(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.cost=11,l)}const a=h=>t(0,l.min=h.target.value<<0,l),u=h=>t(0,l.max=h.target.value<<0,l),f=h=>t(0,l.cost=h.target.value<<0,l);function c(){l.pattern=this.value,t(0,l)}function d(h){l=h,t(0,l)}function m(h){Le.call(this,n,h)}function _(h){Le.call(this,n,h)}function g(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(2,s=lt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(l.id)&&r()},[l,o,s,a,u,f,c,d,m,_,g]}class gD extends ve{constructor(e){super(),ye(this,e,_D,hD,be,{field:0,key:1})}}function bD(n){let e,t,i,s,l;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function kD(n){let e,t,i;function s(o){n[15](o)}let l={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:[bD]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(l.keyOfSelected=n[0].collectionId),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yD(n){let e,t,i;function s(o){n[16](o)}let l={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function vD(n){let e,t,i,s,l,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[kD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[yD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),q(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),q(r,c,d),w(c,a,d),w(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 _={};d&33554432&&(_.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},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&&(y(e),y(t),y(s),y(l),y(o),y(a),y(u)),j(i,c),j(r,c)}}}function _h(n){let e,t,i,s,l,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[wD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[SD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),q(t,e,null),w(r,i,a),w(r,s,a),q(l,s,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}),l.$set(f)},i(r){o||(M(t.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(y(e),y(i),y(s)),j(t),j(l)}}}function wD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].minSelect||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function SD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"placeholder","Default to single"),p(l,"min",r=n[0].minSelect||1)},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].maxSelect),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].maxSelect&&me(l,f[0].maxSelect)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function TD(n){let e,t,i,s,l,o,r,a,u,f,c,d;function m(g){n[13](g)}let _={id:n[24],items:n[7]};return n[0].cascadeDelete!==void 0&&(_.keyOfSelected=n[0].cascadeDelete),a=new $n({props:_}),ne.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),s=b("i"),r=C(),H(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,h){var k,S;w(g,e,h),v(e,t),v(e,i),v(e,s),w(g,r,h),q(a,g,h),f=!0,c||(d=Oe(l=Re.call(null,s,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + data inside an object, eg.`),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(pe,ae){w(pe,e,ae),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,c),v(i,d),v(i,m),v(m,h),v(m,g),v(m,_),v(m,k),v(m,S),v(m,$),v(m,T),v(m,O),v(m,E),v(E,I),v(E,A),v(E,P),v(m,N),v(m,R),v(m,z),v(m,F),v(m,B),v(m,J),v(i,V),v(i,Z),de=!0},i(pe){de||(pe&&tt(()=>{de&&(G||(G=qe(e,ht,{duration:150},!0)),G.run(1))}),de=!0)},o(pe){pe&&(G||(G=qe(e,ht,{duration:150},!1)),G.run(0)),de=!1},d(pe){pe&&y(e),pe&&G&&G.end()}}}function xE(n){let e,t,i,s,l,o,r,a,u,f,c;e=new fe({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(_,k){return _[2]?QE:XE}let m=d(n),h=m(n),g=n[2]&&hh();return{c(){H(e.$$.fragment),t=C(),i=b("button"),s=b("strong"),s.textContent="String value normalizations",l=C(),h.c(),r=C(),g&&g.c(),a=ke(),p(s,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(_,k){q(e,_,k),w(_,t,k),w(_,i,k),v(i,s),v(i,l),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[5]),f=!0)},p(_,k){const S={};k&2&&(S.name="fields."+_[1]+".maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:_}),e.$set(S),m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?k&4&&M(g,1):(g=hh(),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(_){u||(M(e.$$.fragment,_),M(g),u=!0)},o(_){D(e.$$.fragment,_),D(g),u=!1},d(_){_&&(y(t),y(i),y(r),y(a)),j(e,_),h.d(),g&&g.d(_),f=!1,c()}}}function eD(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[6](r)}let o={$$slots:{options:[xE]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?vt(s,[a&2&&{key:r[1]},a&8&&At(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function tD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=h=>t(0,l.maxSize=parseInt(h.target.value,10),l),u=()=>{t(2,r=!r)};function f(h){l=h,t(0,l)}function c(h){Le.call(this,n,h)}function d(h){Le.call(this,n,h)}function m(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(3,s=lt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,r,s,a,u,f,c,d,m]}class nD extends ve{constructor(e){super(),ye(this,e,tD,eD,be,{field:0,key:1})}}function iD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Min"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].min),r||(a=Y(l,"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(l,"id",o),f&1&&mt(l.value)!==u[0].min&&me(l,u[0].min)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function lD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max"),s=C(),l=b("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].max),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].max&&me(l,f[0].max)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function sD(n){let e,t,i,s,l,o,r;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[iD,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[lD,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,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&&y(e),j(i),j(o)}}}function oD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="No decimals",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].onlyInt,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[3]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function rD(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"fields."+n[1]+".onlyInt",$$slots:{default:[oD,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="fields."+i[1]+".onlyInt"),s&3073&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function aD(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[rD],options:[sD]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function uD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.onlyInt=this.checked,t(0,l)}function a(){l.min=mt(this.value),t(0,l)}function u(){l.max=mt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Le.call(this,n,h)}function d(h){Le.call(this,n,h)}function m(h){Le.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),Kt(h)),t(2,s=lt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,m]}class fD extends ve{constructor(e){super(),ye(this,e,uD,aD,be,{field:0,key:1})}}function cD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].min||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].min||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function dD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Max length"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"step","1"),p(l,"placeholder","Up to 71 chars"),p(l,"min",r=n[0].min||0),p(l,"max","71"),l.value=a=n[0].max||""},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),u||(f=Y(l,"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(l,"id",o),d&1&&r!==(r=c[0].min||0)&&p(l,"min",r),d&1&&a!==(a=c[0].max||"")&&l.value!==a&&(l.value=a)},d(c){c&&(y(e),y(s),y(l)),u=!1,f()}}}function pD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Bcrypt cost"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),p(l,"placeholder","Default to 10"),p(l,"step","1"),p(l,"min","6"),p(l,"max","31"),l.value=r=n[0].cost||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].cost||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function mD(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Validation pattern"),s=C(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",o=n[12]),p(l,"placeholder","ex. ^\\w+$")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].pattern),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].pattern&&me(l,u[0].pattern)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function hD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"fields."+n[1]+".min",$$slots:{default:[cD,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"fields."+n[1]+".max",$$slots:{default:[dD,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"fields."+n[1]+".cost",$$slots:{default:[pD,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"fields."+n[1]+".pattern",$$slots:{default:[mD,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"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){w(h,e,g),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(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 k={};g&2&&(k.name="fields."+h[1]+".max"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const S={};g&2&&(S.name="fields."+h[1]+".cost"),g&12289&&(S.$$scope={dirty:g,ctx:h}),u.$set(S);const $={};g&2&&($.name="fields."+h[1]+".pattern"),g&12289&&($.$$scope={dirty:g,ctx:h}),d.$set($)},i(h){m||(M(i.$$.fragment,h),M(o.$$.fragment,h),M(u.$$.fragment,h),M(d.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),D(o.$$.fragment,h),D(u.$$.fragment,h),D(d.$$.fragment,h),m=!1},d(h){h&&y(e),j(i),j(o),j(u),j(d)}}}function _D(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[7](r)}let o={$$slots:{options:[hD]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",l)),e.$on("rename",n[8]),e.$on("remove",n[9]),e.$on("duplicate",n[10]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?vt(s,[a&2&&{key:r[1]},a&4&&At(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function gD(n,e,t){const i=["field","key"];let s=lt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.cost=11,l)}const a=_=>t(0,l.min=_.target.value<<0,l),u=_=>t(0,l.max=_.target.value<<0,l),f=_=>t(0,l.cost=_.target.value<<0,l);function c(){l.pattern=this.value,t(0,l)}function d(_){l=_,t(0,l)}function m(_){Le.call(this,n,_)}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$set=_=>{e=je(je({},e),Kt(_)),t(2,s=lt(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(l.id)&&r()},[l,o,s,a,u,f,c,d,m,h,g]}class bD extends ve{constructor(e){super(),ye(this,e,gD,_D,be,{field:0,key:1})}}function kD(n){let e,t,i,s,l;return{c(){e=b("hr"),t=C(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function yD(n){let e,t,i;function s(o){n[15](o)}let l={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:[kD]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(l.keyOfSelected=n[0].collectionId),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function vD(n){let e,t,i;function s(o){n[16](o)}let l={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wD(n){let e,t,i,s,l,o,r,a,u,f;return i=new fe({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"fields."+n[1]+".collectionId",$$slots:{default:[yD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[vD,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),H(i.$$.fragment),s=C(),l=b("div"),o=C(),H(r.$$.fragment),a=C(),u=b("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),q(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),q(r,c,d),w(c,a,d),w(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&&(y(e),y(t),y(s),y(l),y(o),y(a),y(u)),j(i,c),j(r,c)}}}function _h(n){let e,t,i,s,l,o;return t=new fe({props:{class:"form-field",name:"fields."+n[1]+".minSelect",$$slots:{default:[SD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field",name:"fields."+n[1]+".maxSelect",$$slots:{default:[TD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),q(t,e,null),w(r,i,a),w(r,s,a),q(l,s,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}),l.$set(f)},i(r){o||(M(t.$$.fragment,r),M(l.$$.fragment,r),o=!0)},o(r){D(t.$$.fragment,r),D(l.$$.fragment,r),o=!1},d(r){r&&(y(e),y(i),y(s)),j(t),j(l)}}}function SD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Min select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"min","0"),p(l,"placeholder","No min limit"),l.value=r=n[0].minSelect||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].minSelect||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function TD(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max select"),s=C(),l=b("input"),p(e,"for",i=n[24]),p(l,"type","number"),p(l,"id",o=n[24]),p(l,"step","1"),p(l,"placeholder","Default to single"),p(l,"min",r=n[0].minSelect||1)},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].maxSelect),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].minSelect||1)&&p(l,"min",r),c&1&&mt(l.value)!==f[0].maxSelect&&me(l,f[0].maxSelect)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function $D(n){let e,t,i,s,l,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 $n({props:h}),ne.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=C(),s=b("i"),r=C(),H(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(g,_){var k,S;w(g,e,_),v(e,t),v(e,i),v(e,s),w(g,r,_),q(a,g,_),f=!0,c||(d=Oe(l=Re.call(null,s,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"})),c=!0)},p(g,h){var S,$;l&&Lt(l.update)&&h&20&&l.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 ${(($=g[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` +`),position:"top"})),c=!0)},p(g,_){var S,$;l&&Lt(l.update)&&_&20&&l.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 ${(($=g[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` -`),position:"top"}),(!f||h&16777216&&o!==(o=g[24]))&&p(e,"for",o);const k={};h&16777216&&(k.id=g[24]),!u&&h&1&&(u=!0,k.keyOfSelected=g[0].cascadeDelete,$e(()=>u=!1)),a.$set(k)},i(g){f||(M(a.$$.fragment,g),f=!0)},o(g){D(a.$$.fragment,g),f=!1},d(g){g&&(y(e),y(r)),j(a,g),c=!1,d()}}}function $D(n){let e,t,i,s,l,o=!n[2]&&_h(n);return s=new fe({props:{class:"form-field",name:"fields."+n[1]+".cascadeDelete",$$slots:{default:[TD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=C(),i=b("div"),H(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),v(e,t),v(e,i),q(s,i,null),l=!0},p(r,a){r[2]?o&&(oe(),D(o,1,1,()=>{o=null}),re()):o?(o.p(r,a),a&4&&M(o,1)):(o=_h(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}),s.$set(u)},i(r){l||(M(o),M(s.$$.fragment,r),l=!0)},o(r){D(o),D(s.$$.fragment,r),l=!1},d(r){r&&y(e),o&&o.d(),j(s)}}}function CD(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[$D],default:[vD,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;fge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return s=new ff({props:u}),n[21](s),s.$on("save",n[22]),{c(){H(e.$$.fragment),i=C(),H(s.$$.fragment)},m(f,c){q(e,f,c),w(f,i,c),q(s,f,c),l=!0},p(f,[c]){const d=c&258?vt(o,[c&2&&{key:f[1]},c&256&&At(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],$e(()=>t=!1)),e.$set(d);const m={};s.$set(m)},i(f){l||(M(e.$$.fragment,f),M(s.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),D(s.$$.fragment,f),l=!1},d(f){f&&y(i),j(e,f),n[21](null),j(s,f)}}}function OD(n,e,t){let i,s;const l=["field","key"];let o=lt(e,l),r;Ge(n,In,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,_=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,_=m)}const h=R=>t(0,a.minSelect=R.target.value<<0,a);function k(){a.maxSelect=mt(this.value),t(0,a),t(9,_),t(2,m)}function S(R){n.$$.not_equal(a.cascadeDelete,R)&&(a.cascadeDelete=R,t(0,a),t(9,_),t(2,m))}const $=()=>d==null?void 0:d.show();function T(R){n.$$.not_equal(a.collectionId,R)&&(a.collectionId=R,t(0,a),t(9,_),t(2,m))}function O(R){m=R,t(2,m)}function E(R){a=R,t(0,a),t(9,_),t(2,m)}function L(R){Le.call(this,n,R)}function I(R){Le.call(this,n,R)}function A(R){Le.call(this,n,R)}function P(R){ne[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),Kt(R)),t(8,o=lt(e,l)),"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&&_!=m&&(t(9,_=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,s=r.find(R=>R.id==a.collectionId)||null)},[a,u,m,d,s,i,f,c,o,_,r,h,k,S,$,T,O,E,L,I,A,P,N]}class MD extends ve{constructor(e){super(),ye(this,e,OD,CD,be,{field:0,key:1})}}function gh(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function bh(n){let e,t;return e=new Dn({props:{class:"dropdown dropdown-block options-dropdown dropdown-left m-t-0 p-0",$$slots:{default:[DD]},$$scope:{ctx:n}}}),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&33554547&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ED(n){let e,t,i=n[22]+"",s,l,o,r,a,u,f;function c(){return n[15](n[22])}return{c(){e=b("div"),t=b("span"),s=W(i),l=C(),o=b("div"),r=C(),a=b("button"),a.innerHTML='',p(t,"class","txt"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(a,"title","Remove"),p(e,"class","dropdown-item plain svelte-3le152")},m(d,m){w(d,e,m),v(e,t),v(t,s),v(e,l),v(e,o),v(e,r),v(e,a),u||(f=Y(a,"click",tn(c)),u=!0)},p(d,m){n=d,m&1&&i!==(i=n[22]+"")&&se(s,i)},d(d){d&&y(e),u=!1,f()}}}function kh(n,e){let t,i,s,l;function o(a){e[16](a)}let r={index:e[24],group:"options_"+e[1],$$slots:{default:[ED]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new hs({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[24]),u&2&&(f.group="options_"+e[1]),u&33554433&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function DD(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,m,_,g=ce(n[0]);const h=k=>k[22];for(let k=0;k
    filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),_=b("hr"),g=C(),h=b("p"),h.innerHTML=`You could also add constraints and query other collections using the + (MAX(balance) + 1) as maxBalance.`,u=C(),g&&g.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),v(e,t),w(_,s,k),m[l].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),g&&g.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=h(_),l===S?m[l].p(_,k):(oe(),D(m[S],1,1,()=>{m[S]=null}),re(),o=m[l],o?o.p(_,k):(o=m[l]=d[l](_),o.c()),M(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,k):(g=$h(_),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(_){_&&(y(e),y(s),y(r),y(a),y(u),y(f)),m[l].d(_),g&&g.d(_)}}}function fI(n){let e,t;return e=new fe({props:{class:"form-field required "+(n[3].length?"error":""),name:"viewQuery",$$slots:{default:[uI,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function cI(n,e,t){let i;Ge(n,Tn,c=>t(4,i=c));let{collection:s}=e,l,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(s==null?void 0:s.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,k=m[h]||h;r.push(U.sentenize(k+": "+_))}}un(async()=>{t(2,o=!0);try{t(1,l=(await $t(async()=>{const{default:c}=await import("./CodeEditor-CTDCRa84.js");return{default:c}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.viewQuery,c)&&(s.viewQuery=c,t(0,s))}const f=()=>{r.length&&Wn("fields")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class dI extends ve{constructor(e){super(),ye(this,e,cI,fI,be,{collection:0})}}function Oh(n,e,t){const i=n.slice();return i[15]=e[t],i}function Mh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A=ce(n[4]),P=[];for(let N=0;N@request filter:",c=C(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.body.* @request.auth.*",m=C(),h=b("hr"),g=C(),_=b("p"),_.innerHTML=`You could also add constraints and query other collections using the @collection filter:`,k=C(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=C(),T=b("hr"),O=C(),E=b("p"),E.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(_,"class","m-t-10 m-b-5"),p(h,"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){w(N,e,R),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let z=0;z{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),dt(P,N),N&&L&&L.end()}}}function Eh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=W(t)},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&16&&t!==(t=s[15]+"")&&se(i,t)},d(s){s&&y(e)}}}function Dh(n){let e=!n[3].includes(n[15]),t,i=e&&Eh(n);return{c(){i&&i.c(),t=ke()},m(s,l){i&&i.m(s,l),w(s,t,l)},p(s,l){l&24&&(e=!s[3].includes(s[15])),e?i?i.p(s,l):(i=Eh(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&y(t),i&&i.d(s)}}}function Ih(n){let e,t,i,s,l,o,r,a,u;function f(h){n[8](h)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[dI,({isSuperuserOnly:h})=>({14:h}),({isSuperuserOnly:h})=>h?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new sl({props:c}),ne.push(()=>ge(e,"rule",f));function d(h){n[9](h)}let m={label:"Update rule",formKey:"updateRule",collection:n[0],$$slots:{afterLabel:[pI,({isSuperuserOnly:h})=>({14:h}),({isSuperuserOnly:h})=>h?16384:0]},$$scope:{ctx:n}};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new sl({props:m}),ne.push(()=>ge(s,"rule",d));function _(h){n[10](h)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new sl({props:g}),ne.push(()=>ge(r,"rule",_)),{c(){H(e.$$.fragment),i=C(),H(s.$$.fragment),o=C(),H(r.$$.fragment)},m(h,k){q(e,h,k),w(h,i,k),q(s,h,k),w(h,o,k),q(r,h,k),u=!0},p(h,k){const S={};k&1&&(S.collection=h[0]),k&278528&&(S.$$scope={dirty:k,ctx:h}),!t&&k&1&&(t=!0,S.rule=h[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=h[0]),k&278528&&($.$$scope={dirty:k,ctx:h}),!l&&k&1&&(l=!0,$.rule=h[0].updateRule,$e(()=>l=!1)),s.$set($);const T={};k&1&&(T.collection=h[0]),!a&&k&1&&(a=!0,T.rule=h[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(h){u||(M(e.$$.fragment,h),M(s.$$.fragment,h),M(r.$$.fragment,h),u=!0)},o(h){D(e.$$.fragment,h),D(s.$$.fragment,h),D(r.$$.fragment,h),u=!1},d(h){h&&(y(i),y(o)),j(e,h),j(s,h),j(r,h)}}}function Lh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"The main record fields hold the values that are going to be inserted in the database.",position:"top"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function dI(n){let e,t=!n[14]&&Lh();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t||(t=Lh(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Ah(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:`The main record fields represent the old/existing record field values. -To target the newly submitted ones you can use @request.body.*`,position:"top"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function pI(n){let e,t=!n[14]&&Ah();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t||(t=Ah(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Ph(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h,k){return h[2]?hI:mI}let m=d(n),_=m(n),g=n[2]&&Nh(n);return{c(){e=b("hr"),t=C(),i=b("button"),s=b("strong"),s.textContent="Additional auth collection rules",l=C(),_.c(),r=C(),g&&g.c(),a=ke(),p(s,"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(h,k){w(h,e,k),w(h,t,k),w(h,i,k),v(i,s),v(i,l),_.m(i,null),w(h,r,k),g&&g.m(h,k),w(h,a,k),u=!0,f||(c=Y(i,"click",n[11]),f=!0)},p(h,k){m!==(m=d(h))&&(_.d(1),_=m(h),_&&(_.c(),_.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(h[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),h[2]?g?(g.p(h,k),k&4&&M(g,1)):(g=Nh(h),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(h){u||(M(g),u=!0)},o(h){D(g),u=!1},d(h){h&&(y(e),y(t),y(i),y(r),y(a)),_.d(),g&&g.d(h),f=!1,c()}}}function mI(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function hI(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Nh(n){let e,t,i,s,l,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[_I]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new sl({props:f}),ne.push(()=>ge(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:[gI]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),l=new sl({props:d}),ne.push(()=>ge(l,"rule",c)),{c(){e=b("div"),H(t.$$.fragment),s=C(),H(l.$$.fragment),p(e,"class","block")},m(m,_){w(m,e,_),q(t,e,null),v(e,s),q(l,e,null),a=!0},p(m,_){const g={};_&1&&(g.collection=m[0]),_&262144&&(g.$$scope={dirty:_,ctx:m}),!i&&_&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const h={};_&1&&(h.required=m[0].manageRule!==null),_&1&&(h.collection=m[0]),_&262144&&(h.$$scope={dirty:_,ctx:m}),!o&&_&1&&(o=!0,h.rule=m[0].manageRule,$e(()=>o=!1)),l.$set(h)},i(m){a||(M(t.$$.fragment,m),M(l.$$.fragment,m),m&&tt(()=>{a&&(r||(r=qe(e,ht,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(l.$$.fragment,m),m&&(r||(r=qe(e,ht,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&y(e),j(t),j(l),m&&r&&r.end()}}}function _I(n){let e,t,i,s,l,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(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){w(N,e,R),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let z=0;z{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(N){N&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(N){N&&y(e),dt(P,N),N&&L&&L.end()}}}function Eh(n){let e,t=n[15]+"",i;return{c(){e=b("code"),i=W(t)},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&16&&t!==(t=s[15]+"")&&se(i,t)},d(s){s&&y(e)}}}function Dh(n){let e=!n[3].includes(n[15]),t,i=e&&Eh(n);return{c(){i&&i.c(),t=ke()},m(s,l){i&&i.m(s,l),w(s,t,l)},p(s,l){l&24&&(e=!s[3].includes(s[15])),e?i?i.p(s,l):(i=Eh(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&y(t),i&&i.d(s)}}}function Ih(n){let e,t,i,s,l,o,r,a,u;function f(_){n[8](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[pI,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new sl({props:c}),ne.push(()=>ge(e,"rule",f));function d(_){n[9](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0],$$slots:{afterLabel:[mI,({isSuperuserOnly:_})=>({14:_}),({isSuperuserOnly:_})=>_?16384:0]},$$scope:{ctx:n}};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new sl({props:m}),ne.push(()=>ge(s,"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 sl({props:g}),ne.push(()=>ge(r,"rule",h)),{c(){H(e.$$.fragment),i=C(),H(s.$$.fragment),o=C(),H(r.$$.fragment)},m(_,k){q(e,_,k),w(_,i,k),q(s,_,k),w(_,o,k),q(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&278528&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,$e(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),k&278528&&($.$$scope={dirty:k,ctx:_}),!l&&k&1&&(l=!0,$.rule=_[0].updateRule,$e(()=>l=!1)),s.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,$e(()=>a=!1)),r.$set(T)},i(_){u||(M(e.$$.fragment,_),M(s.$$.fragment,_),M(r.$$.fragment,_),u=!0)},o(_){D(e.$$.fragment,_),D(s.$$.fragment,_),D(r.$$.fragment,_),u=!1},d(_){_&&(y(i),y(o)),j(e,_),j(s,_),j(r,_)}}}function Lh(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:"The main record fields hold the values that are going to be inserted in the database.",position:"top"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function pI(n){let e,t=!n[14]&&Lh();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t||(t=Lh(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Ah(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,{text:`The main record fields represent the old/existing record field values. +To target the newly submitted ones you can use @request.body.*`,position:"top"})),t=!0)},d(s){s&&y(e),t=!1,i()}}}function mI(n){let e,t=!n[14]&&Ah();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t||(t=Ah(),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Ph(n){let e,t,i,s,l,o,r,a,u,f,c;function d(_,k){return _[2]?_I:hI}let m=d(n),h=m(n),g=n[2]&&Nh(n);return{c(){e=b("hr"),t=C(),i=b("button"),s=b("strong"),s.textContent="Additional auth collection rules",l=C(),h.c(),r=C(),g&&g.c(),a=ke(),p(s,"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(_,k){w(_,e,k),w(_,t,k),w(_,i,k),v(i,s),v(i,l),h.m(i,null),w(_,r,k),g&&g.m(_,k),w(_,a,k),u=!0,f||(c=Y(i,"click",n[11]),f=!0)},p(_,k){m!==(m=d(_))&&(h.d(1),h=m(_),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm m-b-sm "+(_[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),_[2]?g?(g.p(_,k),k&4&&M(g,1)):(g=Nh(_),g.c(),M(g,1),g.m(a.parentNode,a)):g&&(oe(),D(g,1,1,()=>{g=null}),re())},i(_){u||(M(g),u=!0)},o(_){D(g),u=!1},d(_){_&&(y(e),y(t),y(i),y(r),y(a)),h.d(),g&&g.d(_),f=!1,c()}}}function hI(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function _I(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Nh(n){let e,t,i,s,l,o,r,a;function u(m){n[12](m)}let f={label:"Authentication rule",formKey:"authRule",placeholder:"",collection:n[0],$$slots:{default:[gI]},$$scope:{ctx:n}};n[0].authRule!==void 0&&(f.rule=n[0].authRule),t=new sl({props:f}),ne.push(()=>ge(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:[bI]},$$scope:{ctx:n}};return n[0].manageRule!==void 0&&(d.rule=n[0].manageRule),l=new sl({props:d}),ne.push(()=>ge(l,"rule",c)),{c(){e=b("div"),H(t.$$.fragment),s=C(),H(l.$$.fragment),p(e,"class","block")},m(m,h){w(m,e,h),q(t,e,null),v(e,s),q(l,e,null),a=!0},p(m,h){const g={};h&1&&(g.collection=m[0]),h&262144&&(g.$$scope={dirty:h,ctx:m}),!i&&h&1&&(i=!0,g.rule=m[0].authRule,$e(()=>i=!1)),t.$set(g);const _={};h&1&&(_.required=m[0].manageRule!==null),h&1&&(_.collection=m[0]),h&262144&&(_.$$scope={dirty:h,ctx:m}),!o&&h&1&&(o=!0,_.rule=m[0].manageRule,$e(()=>o=!1)),l.$set(_)},i(m){a||(M(t.$$.fragment,m),M(l.$$.fragment,m),m&&tt(()=>{a&&(r||(r=qe(e,ht,{duration:150},!0)),r.run(1))}),a=!0)},o(m){D(t.$$.fragment,m),D(l.$$.fragment,m),m&&(r||(r=qe(e,ht,{duration:150},!1)),r.run(0)),a=!1},d(m){m&&y(e),j(t),j(l),m&&r&&r.end()}}}function gI(n){let e,t,i,s,l,o,r;return{c(){e=b("p"),e.textContent=`This rule is executed every time before authentication allowing you to restrict who can authenticate.`,t=C(),i=b("p"),i.innerHTML=`For example, to allow only verified users you can set it to - verified = true.`,s=C(),l=b("p"),l.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r))}}}function gI(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API + verified = true.`,s=C(),l=b("p"),l.textContent="Leave it empty to allow anyone with an account to authenticate.",o=C(),r=b("p"),r.textContent='To disable authentication entirely you can change it to "Set superusers only".'},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r))}}}function bI(n){let e,t,i;return{c(){e=b("p"),e.innerHTML=`This rule is executed in addition to the create and update API rules.`,t=C(),i=b("p"),i.textContent=`It enables superuser-like permissions to allow fully managing the auth record(s), eg. changing the password without requiring to enter the old one, directly updating the - verified state or email, etc.`},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:te,d(s){s&&(y(e),y(t),y(i))}}}function bI(n){var R,z;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,_,g,h,k,S,$,T,O=n[1]&&Mh(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 sl({props:L}),ne.push(()=>ge(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 sl({props:A}),ne.push(()=>ge(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&Ih(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&Ph(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the + verified state or email, etc.`},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:te,d(s){s&&(y(e),y(t),y(i))}}}function kI(n){var R,z;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O=n[1]&&Mh(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 sl({props:L}),ne.push(()=>ge(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 sl({props:A}),ne.push(()=>ge(m,"rule",I));let P=((R=n[0])==null?void 0:R.type)!=="view"&&Ih(n),N=((z=n[0])==null?void 0:z.type)==="auth"&&Ph(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the PocketBase filter syntax and operators - .`,s=C(),l=b("button"),r=W(o),a=C(),O&&O.c(),u=C(),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),P&&P.c(),h=C(),N&&N.c(),k=ke(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,B){w(F,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),w(F,u,B),q(f,F,B),w(F,d,B),q(m,F,B),w(F,g,B),P&&P.m(F,B),w(F,h,B),N&&N.m(F,B),w(F,k,B),S=!0,$||(T=Y(l,"click",n[5]),$=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&se(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=Mh(F),O.c(),M(O,1),O.m(e,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!_&&B&1&&(_=!0,V.rule=F[0].viewRule,$e(()=>_=!1)),m.$set(V),((Z=F[0])==null?void 0:Z.type)!=="view"?P?(P.p(F,B),B&1&&M(P,1)):(P=Ih(F),P.c(),M(P,1),P.m(h.parentNode,h)):P&&(oe(),D(P,1,1,()=>{P=null}),re()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=Ph(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(oe(),D(N,1,1,()=>{N=null}),re())},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&&(y(e),y(u),y(d),y(g),y(h),y(k)),O&&O.d(),j(f,F),j(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function kI(n,e,t){let i,s,{collection:l}=e,o=!1,r=l.manageRule!==null||l.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(l.listRule,k)&&(l.listRule=k,t(0,l))}function f(k){n.$$.not_equal(l.viewRule,k)&&(l.viewRule=k,t(0,l))}function c(k){n.$$.not_equal(l.createRule,k)&&(l.createRule=k,t(0,l))}function d(k){n.$$.not_equal(l.updateRule,k)&&(l.updateRule=k,t(0,l))}function m(k){n.$$.not_equal(l.deleteRule,k)&&(l.deleteRule=k,t(0,l))}const _=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(l.authRule,k)&&(l.authRule=k,t(0,l))}function h(k){n.$$.not_equal(l.manageRule,k)&&(l.manageRule=k,t(0,l))}return n.$$set=k=>{"collection"in k&&t(0,l=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(l)),n.$$.dirty&1&&t(3,s=(k=l.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[l,o,r,s,i,a,u,f,c,d,m,_,g,h]}class yI extends ve{constructor(e){super(),ye(this,e,kI,bI,be,{collection:0})}}function Rh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function qh(n,e,t){const i=n.slice();return i[33]=e[t],i}function jh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[33]=e[t],i}function zh(n){let e,t,i,s,l,o,r=n[9].length&&Uh();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),r&&r.m(s,null)},p(a,u){a[9].length?r||(r=Uh(),r.c(),r.m(s,null)):r&&(r.d(1),r=null)},d(a){a&&y(e),r&&r.d()}}}function Uh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Vh(n){let e,t,i,s,l,o,r=n[5]&&Bh(n),a=!n[4]&&Wh(n),u=ce(n[3]),f=[];for(let m=0;m.`,s=C(),l=b("button"),r=W(o),a=C(),O&&O.c(),u=C(),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),P&&P.c(),_=C(),N&&N.c(),k=ke(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(F,B){w(F,e,B),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),w(F,u,B),q(f,F,B),w(F,d,B),q(m,F,B),w(F,g,B),P&&P.m(F,B),w(F,_,B),N&&N.m(F,B),w(F,k,B),S=!0,$||(T=Y(l,"click",n[5]),$=!0)},p(F,[B]){var Z,G;(!S||B&2)&&o!==(o=F[1]?"Hide available fields":"Show available fields")&&se(r,o),F[1]?O?(O.p(F,B),B&2&&M(O,1)):(O=Mh(F),O.c(),M(O,1),O.m(e,null)):O&&(oe(),D(O,1,1,()=>{O=null}),re());const J={};B&1&&(J.collection=F[0]),!c&&B&1&&(c=!0,J.rule=F[0].listRule,$e(()=>c=!1)),f.$set(J);const V={};B&1&&(V.collection=F[0]),!h&&B&1&&(h=!0,V.rule=F[0].viewRule,$e(()=>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=Ih(F),P.c(),M(P,1),P.m(_.parentNode,_)):P&&(oe(),D(P,1,1,()=>{P=null}),re()),((G=F[0])==null?void 0:G.type)==="auth"?N?(N.p(F,B),B&1&&M(N,1)):(N=Ph(F),N.c(),M(N,1),N.m(k.parentNode,k)):N&&(oe(),D(N,1,1,()=>{N=null}),re())},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&&(y(e),y(u),y(d),y(g),y(_),y(k)),O&&O.d(),j(f,F),j(m,F),P&&P.d(F),N&&N.d(F),$=!1,T()}}}function yI(n,e,t){let i,s,{collection:l}=e,o=!1,r=l.manageRule!==null||l.authRule!=="";const a=()=>t(1,o=!o);function u(k){n.$$.not_equal(l.listRule,k)&&(l.listRule=k,t(0,l))}function f(k){n.$$.not_equal(l.viewRule,k)&&(l.viewRule=k,t(0,l))}function c(k){n.$$.not_equal(l.createRule,k)&&(l.createRule=k,t(0,l))}function d(k){n.$$.not_equal(l.updateRule,k)&&(l.updateRule=k,t(0,l))}function m(k){n.$$.not_equal(l.deleteRule,k)&&(l.deleteRule=k,t(0,l))}const h=()=>{t(2,r=!r)};function g(k){n.$$.not_equal(l.authRule,k)&&(l.authRule=k,t(0,l))}function _(k){n.$$.not_equal(l.manageRule,k)&&(l.manageRule=k,t(0,l))}return n.$$set=k=>{"collection"in k&&t(0,l=k.collection)},n.$$.update=()=>{var k;n.$$.dirty&1&&t(4,i=U.getAllCollectionIdentifiers(l)),n.$$.dirty&1&&t(3,s=(k=l.fields)==null?void 0:k.filter(S=>S.hidden).map(S=>S.name))},[l,o,r,s,i,a,u,f,c,d,m,h,g,_]}class vI extends ve{constructor(e){super(),ye(this,e,yI,kI,be,{collection:0})}}function Rh(n,e,t){const i=n.slice();return i[27]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[30]=e[t],i}function qh(n,e,t){const i=n.slice();return i[33]=e[t],i}function jh(n,e,t){const i=n.slice();return i[33]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[33]=e[t],i}function zh(n){let e,t,i,s,l,o,r=n[9].length&&Uh();return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),s=b("div"),l=b("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=C(),r&&r.c(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),r&&r.m(s,null)},p(a,u){a[9].length?r||(r=Uh(),r.c(),r.m(s,null)):r&&(r.d(1),r=null)},d(a){a&&y(e),r&&r.d()}}}function Uh(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Vh(n){let e,t,i,s,l,o,r=n[5]&&Bh(n),a=!n[4]&&Wh(n),u=ce(n[3]),f=[];for(let m=0;mCancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[15]),Y(i,"click",n[16])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function TI(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[SI],header:[wI],default:[vI]},$$scope:{ctx:n}};return e=new ln({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&4030|l[1]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[17](null),j(e,s)}}}function $I(n,e,t){let i,s,l,o,r,a,u;const f=wt();let c,d,m,_,g=[],h=[];async function k(F,B,J=!0){t(1,d=F),t(2,m=B),_=J,await O(),I(),await _n(),i||o.length||r.length||a.length||g.length||h.length?c==null||c.show():$()}function S(){c==null||c.hide()}function $(){S(),f("confirm",_)}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(Ce=>Ce.name==Z),de=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Ce=>Ce.name==Z);if(!G||!de)continue;let pe=new URL(G.authURL).host,ae=new URL(de.authURL).host;pe!=ae&&await E(Z)&&g.push({name:Z,oldHost:pe,newHost:ae})}}async function E(F){try{return await he.collection("_externalAuths").getFirstListItem(he.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,h=[]),window.location.protocol!="https:")return;const F=["listRule","viewRule"];s||F.push("createRule","updateRule","deleteRule"),l&&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&&h.push({prop:V,oldRule:B,newRule:J})}const A=()=>S(),P=()=>$();function N(F){ne[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Le.call(this,n,F)}function z(F){Le.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,s=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(l=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!s&&((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=!s&&((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=!s||i||h.length)},[S,d,m,h,s,i,c,g,a,r,o,u,$,L,k,A,P,N,R,z]}class CI extends ve{constructor(e){super(),ye(this,e,$I,TI,be,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Xh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function OI(n){let e,t,i;function s(o){n[44](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new sI({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MI(n){let e,t,i;function s(o){n[43](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new cI({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Qh(n){let e,t,i,s;function l(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new yI({props:o}),ne.push(()=>ge(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){s||(M(t.$$.fragment,r),s=!0)},o(r){D(t.$$.fragment,r),s=!1},d(r){r&&y(e),j(t)}}}function xh(n){let e,t,i,s;function l(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new bM({props:o}),ne.push(()=>ge(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===as)},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===as)},i(r){s||(M(t.$$.fragment,r),s=!0)},o(r){D(t.$$.fragment,r),s=!1},d(r){r&&y(e),j(t)}}}function EI(n){let e,t,i,s,l,o,r;const a=[MI,OI],u=[];function f(m,_){return m[17]?0:1}i=f(n),s=u[i]=a[i](n);let c=!n[15]&&n[3]===io&&Qh(n),d=n[18]&&xh(n);return{c(){e=b("div"),t=b("div"),s.c(),l=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===tl),p(e,"class","tabs-content svelte-xyiw1b")},m(m,_){w(m,e,_),v(e,t),u[i].m(t,null),v(e,l),c&&c.m(e,null),v(e,o),d&&d.m(e,null),r=!0},p(m,_){let g=i;i=f(m),i===g?u[i].p(m,_):(oe(),D(u[g],1,1,()=>{u[g]=null}),re(),s=u[i],s?s.p(m,_):(s=u[i]=a[i](m),s.c()),M(s,1),s.m(t,null)),(!r||_[0]&8)&&x(t,"active",m[3]===tl),!m[15]&&m[3]===io?c?(c.p(m,_),_[0]&32776&&M(c,1)):(c=Qh(m),c.c(),M(c,1),c.m(e,o)):c&&(oe(),D(c,1,1,()=>{c=null}),re()),m[18]?d?(d.p(m,_),_[0]&262144&&M(d,1)):(d=xh(m),d.c(),M(d,1),d.m(e,null)):d&&(oe(),D(d,1,1,()=>{d=null}),re())},i(m){r||(M(s),M(c),M(d),r=!0)},o(m){D(s),D(c),D(d),r=!1},d(m){m&&y(e),u[i].d(),c&&c.d(),d&&d.d()}}}function e_(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[DI]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),w(a,t,u),w(a,i,u),v(i,s),v(i,l),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&&(y(e),y(t),y(i)),j(o)}}}function t_(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(e,"click",n[34]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function n_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function i_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",tn(it(n[36]))),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function DI(n){let e,t,i,s=!n[2].system&&t_(n),l=!n[17]&&n_(n),o=!n[2].system&&i_(n);return{c(){s&&s.c(),e=C(),l&&l.c(),t=C(),o&&o.c(),i=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a)},p(r,a){r[2].system?s&&(s.d(1),s=null):s?s.p(r,a):(s=t_(r),s.c(),s.m(e.parentNode,e)),r[17]?l&&(l.d(1),l=null):l?l.p(r,a):(l=n_(r),l.c(),l.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=i_(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),s&&s.d(r),l&&l.d(r),o&&o.d(r)}}}function l_(n){let e,t,i,s;return i=new Dn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[II]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(l,o){w(l,e,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&(y(e),y(t)),j(i,l)}}}function s_(n){let e,t,i,s,l,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),s=C(),l=b("span"),r=W(o),a=W(" collection"),u=C(),p(t,"class",i=Us(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[59]==n[2].type)},m(m,_){w(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Us(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),_[0]&64&&o!==(o=n[60]+"")&&se(r,o),_[0]&68&&x(e,"selected",n[59]==n[2].type)},d(m){m&&y(e),f=!1,c()}}}function II(n){let e,t=ce(Object.entries(n[6])),i=[];for(let s=0;s{R=null}),re()):R?(R.p(F,B),B[0]&4&&M(R,1)):(R=l_(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)&&x(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=o_(),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&&(y(e),y(s),y(l),y(f),y(c),y(L),y(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function r_(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Oe(t=Re.call(null,e,n[12])),l=!0)},p(r,a){t&&Lt(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&tt(()=>{s&&(i||(i=qe(e,Ct,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Ct,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&y(e),r&&i&&i.end(),l=!1,o()}}}function a_(n){var a,u,f,c,d,m,_;let e,t,i,s=!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((_=n[5])==null?void 0:_.manageRule),l,o,r=s&&u_();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===io)},m(g,h){w(g,e,h),v(e,t),v(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[41]),l=!0)},p(g,h){var k,S,$,T,O,E,L;h[0]&32&&(s=!U.isEmpty((k=g[5])==null?void 0:k.listRule)||!U.isEmpty((S=g[5])==null?void 0:S.viewRule)||!U.isEmpty(($=g[5])==null?void 0:$.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)),s?r?h[0]&32&&M(r,1):(r=u_(),r.c(),M(r,1),r.m(e,null)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),h[0]&8&&x(e,"active",g[3]===io)},d(g){g&&y(e),r&&r.d(),l=!1,o()}}}function u_(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function f_(n){let e,t,i,s=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),l,o,r=s&&c_();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===as)},m(a,u){w(a,e,u),v(e,t),v(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[42]),l=!0)},p(a,u){u[0]&8224&&(s=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),s?r?u[0]&8224&&M(r,1):(r=c_(),r.c(),M(r,1),r.m(e,null)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),u[0]&8&&x(e,"active",a[3]===as)},d(a){a&&y(e),r&&r.d(),l=!1,o()}}}function c_(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function AI(n){let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,m,_=n[17]?"Query":"Fields",g,h,k=!U.isEmpty(n[12]),S,$,T,O,E,L=!!n[2].id&&(!n[2].system||!n[17])&&e_(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[LI,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=k&&r_(n),A=!n[15]&&a_(n),P=n[18]&&f_(n);return{c(){e=b("h4"),i=W(t),s=C(),L&&L.c(),l=C(),o=b("form"),H(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=W(_),h=C(),I&&I.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===tl),p(c,"class","tabs-header stretched")},m(N,R){w(N,e,R),v(e,i),w(N,s,R),L&&L.m(N,R),w(N,l,R),w(N,o,R),q(r,o,null),v(o,a),v(o,u),w(N,f,R),w(N,c,R),v(c,d),v(d,m),v(m,g),v(d,h),I&&I.m(d,null),v(c,S),A&&A.m(c,null),v(c,$),P&&P.m(c,null),T=!0,O||(E=[Y(o,"submit",it(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")&&se(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&M(L,1)):(L=e_(N),L.c(),M(L,1),L.m(l.parentNode,l)):L&&(oe(),D(L,1,1,()=>{L=null}),re());const z={};R[0]&327748|R[1]&134217728|R[2]&2&&(z.$$scope={dirty:R,ctx:N}),r.$set(z),(!T||R[0]&131072)&&_!==(_=N[17]?"Query":"Fields")&&se(g,_),R[0]&4096&&(k=!U.isEmpty(N[12])),k?I?(I.p(N,R),R[0]&4096&&M(I,1)):(I=r_(N),I.c(),M(I,1),I.m(d,null)):I&&(oe(),D(I,1,1,()=>{I=null}),re()),(!T||R[0]&8)&&x(d,"active",N[3]===tl),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=a_(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=f_(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&&(y(e),y(s),y(l),y(o),y(f),y(c)),L&&L.d(N),j(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ee(E)}}}function d_(n){let e,t,i,s,l,o;return s=new Dn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[PI]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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=l=!n[14]||n[9]||n[10]},m(r,a){w(r,e,a),v(e,t),v(e,i),q(s,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),s.$set(u),(!o||a[0]&17920&&l!==(l=!r[14]||r[9]||r[10]))&&(e.disabled=l)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&y(e),j(s)}}}function PI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function NI(n){let e,t,i,s,l,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,_=n[2].id&&d_(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("div"),l=b("button"),o=b("span"),a=W(r),f=C(),_&&_.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(l,"type","button"),p(l,"title","Save and close"),p(l,"class","btn"),l.disabled=u=!n[14]||n[9]||n[10],x(l,"btn-expanded",!n[2].id),x(l,"btn-expanded-sm",!!n[2].id),x(l,"btn-loading",n[9]||n[10]),p(s,"class","btns-group no-gap")},m(g,h){w(g,e,h),v(e,t),w(g,i,h),w(g,s,h),v(s,l),v(l,o),v(o,a),v(s,f),_&&_.m(s,null),c=!0,d||(m=[Y(e,"click",n[31]),Y(l,"click",n[32])],d=!0)},p(g,h){(!c||h[0]&512)&&(e.disabled=g[9]),(!c||h[0]&4)&&r!==(r=g[2].id?"Save changes":"Create")&&se(a,r),(!c||h[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(l.disabled=u),(!c||h[0]&4)&&x(l,"btn-expanded",!g[2].id),(!c||h[0]&4)&&x(l,"btn-expanded-sm",!!g[2].id),(!c||h[0]&1536)&&x(l,"btn-loading",g[9]||g[10]),g[2].id?_?(_.p(g,h),h[0]&4&&M(_,1)):(_=d_(g),_.c(),M(_,1),_.m(s,null)):_&&(oe(),D(_,1,1,()=>{_=null}),re())},i(g){c||(M(_),c=!0)},o(g){D(_),c=!1},d(g){g&&(y(e),y(i),y(s)),_&&_.d(),d=!1,Ee(m)}}}function RI(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[NI],header:[AI],default:[EI]},$$scope:{ctx:n}};e=new ln({props:l}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new CI({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!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){s||(M(e.$$.fragment,r),M(i.$$.fragment,r),s=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),s=!1},d(r){r&&y(t),n[48](null),j(e,r),n[51](null),j(i,r)}}}const tl="schema",io="api_rules",as="options",FI="base",p_="auth",m_="view";function Ra(n){return JSON.stringify(n)}function qI(n,e,t){let i,s,l,o,r,a,u,f,c;Ge(n,Pr,Pe=>t(30,u=Pe)),Ge(n,ii,Pe=>t(53,f=Pe)),Ge(n,Tn,Pe=>t(5,c=Pe));const d={};d[FI]="Base",d[m_]="View",d[p_]="Auth";const m=wt();let _,g,h=null,k={},S=!1,$=!1,T=!1,O=tl,E=Ra(k),L="",I=[];function A(Pe){t(3,O=Pe)}function P(Pe){return z(Pe),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(tl),_==null?void 0:_.show()}function N(){return _==null?void 0:_.hide()}function R(){t(11,T=!1),N()}async function z(Pe){Jt({}),typeof Pe<"u"?(t(28,h=Pe),t(2,k=structuredClone(Pe))):(t(28,h=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await _n(),t(29,E=Ra(k))}async function F(Pe=!0){if(!$){t(10,$=!0);try{k.id?await(g==null?void 0:g.show(h,k,Pe)):await B(Pe)}catch{}t(10,$=!1)}}async function B(Pe=!0){if(S)return;t(9,S=!0);const jt=J(),Gt=!k.id;try{let en;Gt?en=await he.collections.create(jt):en=await he.collections.update(k.id,jt),As(),_3(en),Pe?(t(11,T=!1),N()):z(en),nn(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Gt,collection:en}),Gt&&(En(ii,f=en,f),await b3())}catch(en){he.error(en)}t(9,S=!1)}function J(){const Pe=Object.assign({},k);Pe.fields=Pe.fields.slice(0);for(let jt=Pe.fields.length-1;jt>=0;jt--)Pe.fields[jt]._toDelete&&Pe.fields.splice(jt,1);return Pe}function V(){h!=null&&h.id&&yn(`Do you really want to delete all "${h.name}" records, including their cascade delete references and files?`,()=>he.collections.truncate(h.id).then(()=>{R(),nn(`Successfully truncated collection "${h.name}".`),m("truncate")}).catch(Pe=>{he.error(Pe)}))}function Z(){h!=null&&h.id&&yn(`Do you really want to delete collection "${h.name}" and all its records?`,()=>he.collections.delete(h.id).then(()=>{R(),nn(`Successfully deleted collection "${h.name}".`),m("delete",h),g3(h)}).catch(Pe=>{he.error(Pe)}))}function G(Pe){t(2,k.type=Pe,k),t(2,k=Object.assign(structuredClone(u[Pe]),k)),Wn("fields")}function de(){r?yn("You have unsaved changes. Do you really want to discard them?",()=>{pe()}):pe()}async function pe(){const Pe=h?structuredClone(h):null;if(Pe){if(Pe.id="",Pe.created="",Pe.updated="",Pe.name+="_duplicate",!U.isEmpty(Pe.fields))for(const jt of Pe.fields)jt.id="";if(!U.isEmpty(Pe.indexes))for(let jt=0;jtN(),Ye=()=>F(),Ke=()=>F(!1),ct=()=>de(),et=()=>V(),xe=()=>Z(),Be=Pe=>{t(2,k.name=U.slugify(Pe.target.value),k),Pe.target.value=k.name},ut=Pe=>G(Pe),Bt=()=>{a&&F()},Ue=()=>A(tl),De=()=>A(io),ot=()=>A(as);function Ie(Pe){k=Pe,t(2,k),t(28,h)}function We(Pe){k=Pe,t(2,k),t(28,h)}function Te(Pe){k=Pe,t(2,k),t(28,h)}function nt(Pe){k=Pe,t(2,k),t(28,h)}const zt=()=>r&&T?(yn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ne(Pe){ne[Pe?"unshift":"push"](()=>{_=Pe,t(7,_)})}function Me(Pe){Le.call(this,n,Pe)}function bt(Pe){Le.call(this,n,Pe)}function Ut(Pe){ne[Pe?"unshift":"push"](()=>{g=Pe,t(8,g)})}const Pt=Pe=>B(Pe.detail);return n.$$.update=()=>{var Pe;n.$$.dirty[0]&1073741824&&t(13,I=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(h==null?void 0:h.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Pe=k.indexes)==null?void 0:Pe.map(jt=>U.replaceIndexTableName(jt,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===p_),n.$$.dirty[0]&4&&t(17,s=k.type===m_),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,l=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Ra(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&O===as&&k.type!=="auth"&&A(tl)},[A,N,k,O,r,c,d,_,g,S,$,T,L,I,a,o,l,s,i,F,B,V,Z,G,de,ae,P,R,h,E,u,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt,Ne,Me,bt,Ut,Pt]}class ff extends ve{constructor(e){super(),ye(this,e,qI,RI,be,{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 jI(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(s,l){w(s,e,l),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(s,[l]){l&2&&x(e,"dragging",s[1])},i:te,o:te,d(s){s&&y(e),n[4](null),t=!1,Ee(i)}}}function HI(n,e,t){const i=wt();let{tolerance:s=0}=e,l,o=0,r=0,a=0,u=0,f=!1;function c(h){h.stopPropagation(),o=h.clientX,r=h.clientY,a=h.clientX-l.offsetLeft,u=h.clientY-l.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(h){f&&(h.preventDefault(),t(1,f=!1),l.classList.remove("no-pointer-events"),i("dragstop",{event:h,elem:l})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(h){let k=h.clientX-o,S=h.clientY-r,$=h.clientX-a,T=h.clientY-u;!f&&Math.abs($-l.offsetLeft){l=h,t(0,l)})}const g=h=>{h.button==0&&c(h)};return n.$$set=h=>{"tolerance"in h&&t(3,s=h.tolerance)},[l,f,c,s,_,g]}class zI extends ve{constructor(e){super(),ye(this,e,HI,jI,be,{tolerance:3})}}function UI(n){let e,t,i,s,l;const o=n[5].default,r=Nt(o,n,n[4],null);return s=new zI({}),s.$on("dragstart",n[7]),s.$on("dragging",n[8]),s.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),H(s.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),q(s,a,u),l=!0},p(a,[u]){r&&r.p&&(!l||u&16)&&Ft(r,o,a,a[4],l?Rt(o,a[4],u,null):qt(a[4]),null),(!l||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){l||(M(r,a),M(s.$$.fragment,a),l=!0)},o(a){D(r,a),D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(i)),r&&r.d(a),n[6](null),j(s,a)}}}const h_="@superuserSidebarWidth";function VI(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o,r,a=localStorage.getItem(h_)||null;function u(m){ne[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,l=m.class),"$$scope"in m&&t(4,s=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(h_,a))},[l,o,a,r,s,i,u,f,c,d]}class Wy extends ve{constructor(e){super(),ye(this,e,VI,UI,be,{class:0})}}function __(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(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function BI(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function WI(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function YI(n){var T,O;let e,t,i,s,l,o=n[0].name+"",r,a,u,f,c,d,m,_,g,h=n[0].type=="auth"&&((T=n[0].oauth2)==null?void 0:T.enabled)&&!((O=n[0].oauth2.providers)!=null&&O.length)&&__();function k(E,L){return E[1]?WI:BI}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),s=C(),l=b("span"),r=W(o),a=C(),h&&h.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=Us(U.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(l,"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),x(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){w(E,e,L),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),h&&h.m(e,null),v(e,u),v(e,f),$.m(f,null),_||(g=[Oe(c=Re.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(f,"click",tn(it(n[5]))),Oe(Fn.call(null,e))],_=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=Us(U.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&se(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?h||(h=__(),h.c(),h.m(e,u)):h&&(h.d(1),h=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&Lt(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&&x(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&y(e),h&&h.d(),$.d(),_=!1,Ee(g)}}}function KI(n,e,t){let i,s;Ge(n,ii,u=>t(2,s=u));let{collection:l}=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(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class cf extends ve{constructor(e){super(),ye(this,e,KI,YI,be,{collection:0,pinnedIds:4})}}function g_(n,e,t){const i=n.slice();return i[25]=e[t],i}function b_(n,e,t){const i=n.slice();return i[25]=e[t],i}function k_(n,e,t){const i=n.slice();return i[25]=e[t],i}function y_(n){let e,t,i=[],s=new Map,l,o,r=ce(n[2]);const a=u=>u[25].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function w_(n){let e,t=[],i=new Map,s,l,o=n[2].length&&S_(),r=ce(n[8]);const a=u=>u[25].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function $_(n){let e,t,i,s,l,o,r,a,u,f,c,d=!n[4].length&&C_(n),m=(n[6]||n[4].length)&&O_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",s=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",l=n[6]||n[4].length),e.disabled=o=n[4].length,x(e,"link-hint",!n[4].length)},m(_,g){w(_,e,g),v(e,t),v(e,i),d&&d.m(e,null),w(_,r,g),m&&m.m(_,g),w(_,a,g),u=!0,f||(c=Y(e,"click",n[19]),f=!0)},p(_,g){_[4].length?d&&(d.d(1),d=null):d?d.p(_,g):(d=C_(_),d.c(),d.m(e,null)),(!u||g[0]&64&&s!==(s=_[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",s),(!u||g[0]&80&&l!==(l=_[6]||_[4].length))&&p(e,"aria-expanded",l),(!u||g[0]&16&&o!==(o=_[4].length))&&(e.disabled=o),(!u||g[0]&16)&&x(e,"link-hint",!_[4].length),_[6]||_[4].length?m?(m.p(_,g),g[0]&80&&M(m,1)):(m=O_(_),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(oe(),D(m,1,1,()=>{m=null}),re())},i(_){u||(M(m),u=!0)},o(_){D(m),u=!1},d(_){_&&(y(e),y(r),y(a)),d&&d.d(),m&&m.d(_),f=!1,c()}}}function C_(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,s){w(i,e,s)},p(i,s){s[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&y(e)}}}function O_(n){let e=[],t=new Map,i,s,l=ce(n[7]);const o=r=>r[25].id;for(let r=0;rge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function E_(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function D_(n){let e,t,i,s;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",n[21]),i=!0)},p:te,d(l){l&&y(e),i=!1,s()}}}function JI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$=n[2].length&&y_(n),T=n[8].length&&w_(n),O=n[7].length&&$_(n),E=n[4].length&&!n[3].length&&E_(),L=!n[11]&&D_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),s=b("button"),s.innerHTML='',l=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),O&&O.c(),m=C(),E&&E.c(),_=C(),L&&L.c(),g=ke(),p(s,"type","button"),p(s,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(s,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[10]),x(f,"sidebar-content-compact",n[3].length>20)},m(I,A){w(I,e,A),v(e,t),v(t,i),v(i,s),v(t,l),v(t,o),me(o,n[0]),w(I,r,A),w(I,a,A),w(I,u,A),w(I,f,A),$&&$.m(f,null),v(f,c),T&&T.m(f,null),v(f,d),O&&O.m(f,null),v(f,m),E&&E.m(f,null),w(I,_,A),L&&L.m(I,A),w(I,g,A),h=!0,k||(S=[Y(s,"click",n[15]),Y(o,"input",n[16])],k=!0)},p(I,A){(!h||A[0]&512)&&x(s,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&me(o,I[0]),(!h||A[0]&512)&&x(t,"active",I[9]),I[2].length?$?($.p(I,A),A[0]&4&&M($,1)):($=y_(I),$.c(),M($,1),$.m(f,c)):$&&(oe(),D($,1,1,()=>{$=null}),re()),I[8].length?T?(T.p(I,A),A[0]&256&&M(T,1)):(T=w_(I),T.c(),M(T,1),T.m(f,d)):T&&(oe(),D(T,1,1,()=>{T=null}),re()),I[7].length?O?(O.p(I,A),A[0]&128&&M(O,1)):(O=$_(I),O.c(),M(O,1),O.m(f,m)):O&&(oe(),D(O,1,1,()=>{O=null}),re()),I[4].length&&!I[3].length?E||(E=E_(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!h||A[0]&1024)&&x(f,"fade",I[10]),(!h||A[0]&8)&&x(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=D_(I),L.c(),L.m(g.parentNode,g))},i(I){h||(M($),M(T),M(O),h=!0)},o(I){D($),D(T),D(O),h=!1},d(I){I&&(y(e),y(r),y(a),y(u),y(f),y(_),y(g)),$&&$.d(),T&&T.d(),O&&O.d(),E&&E.d(),L&&L.d(I),k=!1,Ee(S)}}}function ZI(n){let e,t,i,s;e=new Wy({props:{class:"collection-sidebar",$$slots:{default:[JI]},$$scope:{ctx:n}}});let l={};return i=new ff({props:l}),n[22](i),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){q(e,o,r),w(o,t,r),q(i,o,r),s=!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){s||(M(e.$$.fragment,o),M(i.$$.fragment,o),s=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),s=!1},d(o){o&&y(t),j(e,o),n[22](null),j(i,o)}}}const I_="@pinnedCollections";function GI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function XI(n,e,t){let i,s,l,o,r,a,u,f,c,d;Ge(n,In,R=>t(13,u=R)),Ge(n,ii,R=>t(14,f=R)),Ge(n,Zs,R=>t(10,c=R)),Ge(n,Il,R=>t(11,d=R));let m,_="",g=[],h=!1,k;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(I_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function $(){t(1,g=g.filter(R=>!!u.find(z=>z.id==R)))}const T=()=>t(0,_="");function O(){_=this.value,t(0,_)}function E(R){g=R,t(1,g)}function L(R){g=R,t(1,g)}const I=()=>{i.length||t(6,h=!h)};function A(R){g=R,t(1,g)}const P=()=>m==null?void 0:m.show();function N(R){ne[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),GI()),n.$$.dirty[0]&1&&t(4,i=_.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,s=_!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(I_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,l=u.filter(R=>{var z,F,B;return R.id==_||((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=l.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=l.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=l.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,h=!0):t(6,h=!1))},[_,g,o,l,i,m,h,a,r,s,c,d,k,u,f,T,O,E,L,I,A,P,N]}class QI extends ve{constructor(e){super(),ye(this,e,XI,ZI,be,{},null,[-1,-1])}}function xI(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function eL(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=W(n[2]),s=C(),l=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r),a||(u=Oe(Re.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&y(e),a=!1,u()}}}function tL(n){let e;function t(l,o){return l[0]?eL:xI}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function nL(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return U.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class iL extends ve{constructor(e){super(),ye(this,e,nL,tL,be,{date:0})}}function L_(n){let e;function t(l,o){return l[4]==="image"?sL:lL}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function lL(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,s){w(i,e,s),v(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&y(e)}}}function sL(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!wn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&y(e)}}}function oL(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&L_(n);return{c(){i&&i.c(),t=ke()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=L_(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function rL(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[0])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function aL(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W(n[2]),i=C(),s=b("i"),l=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(s,"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){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(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&&se(t,c[2]),d&4&&p(e,"title",c[2])},d(c){c&&(y(e),y(l),y(o),y(r),y(a)),u=!1,Ee(f)}}}function uL(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[aL],header:[rL],default:[oL]},$$scope:{ctx:n}};return e=new ln({props:i}),n[8](e),e.$on("show",n[9]),e.$on("hide",n[10]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&8222&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[8](null),j(e,s)}}}function fL(n,e,t){let i,s,l,o,r="",a;async function u(h){a=h,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(h){h.isAbort||console.warn("openInNewTab file token failure:",h)}}function m(h){ne[h?"unshift":"push"](()=>{o=h,t(3,o)})}function _(h){Le.call(this,n,h)}function g(h){Le.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(7,i=r.indexOf("?")),n.$$.dirty&130&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=U.getFileType(s))},[f,r,s,o,l,d,u,i,m,_,g]}class cL extends ve{constructor(e){super(),ye(this,e,fL,uL,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function dL(n){let e,t,i,s,l;function o(u,f){return u[5]==="image"?_L:u[5]==="video"||u[5]==="audio"?hL:mL}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){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",tn(n[10])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&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&&y(e),a.d(),s=!1,l()}}}function pL(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[2]?`thumb-${n[2]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&4&&t!==(t="thumb "+(i[2]?`thumb-${i[2]}`:""))&&p(e,"class",t)},d(i){i&&y(e)}}}function mL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function hL(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function _L(n){let e,t,i,s,l;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),wn(e.src,t=n[7])||p(e,"src",t),p(e,"alt",n[1]),p(e,"title",i="Preview "+n[1])},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[9]),s=!0)},p(o,r){r&128&&!wn(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&&y(e),s=!1,l()}}}function A_(n){let e,t,i={};return e=new cL({props:i}),n[11](e),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function gL(n){let e,t,i;function s(a,u){return a[4]?pL:dL}let l=s(n),o=l(n),r=n[8]&&A_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ke()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e))),a[8]?r?(r.p(a,u),u&256&&M(r,1)):(r=A_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(y(e),y(t)),o.d(a),r&&r.d(a)}}}function bL(n,e,t){let i,s,{record:l=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 he.getSuperuserFileToken(l.collectionId))}catch(h){console.warn("File token failure:",h)}t(4,c=!1)}function m(){t(7,u="")}const _=async()=>{if(s)try{a==null||a.show(async()=>(t(3,f=await he.getSuperuserFileToken(l.collectionId)),he.files.getURL(l,o,{token:f})))}catch(h){h.isAbort||console.warn("Preview file token failure:",h)}};function g(h){ne[h?"unshift":"push"](()=>{a=h,t(6,a)})}return n.$$set=h=>{"record"in h&&t(0,l=h.record),"filename"in h&&t(1,o=h.filename),"size"in h&&t(2,r=h.size)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=U.getFileType(o)),n.$$.dirty&34&&t(8,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&27&&t(7,u=c?"":he.files.getURL(l,o,{thumb:"100x100",token:f}))},[l,o,r,f,c,i,a,u,s,m,_,g]}class df extends ve{constructor(e){super(),ye(this,e,bL,gL,be,{record:0,filename:1,size:2})}}function kL(n){var r,a;let e,t=((r=n[0])==null?void 0:r.lon)+"",i,s,l=((a=n[0])==null?void 0:a.lat)+"",o;return{c(){e=b("div"),i=W(t),s=W(", "),o=W(l),p(e,"class","txt")},m(u,f){w(u,e,f),v(e,i),v(e,s),v(e,o)},p(u,[f]){var c,d;f&1&&t!==(t=((c=u[0])==null?void 0:c.lon)+"")&&se(i,t),f&1&&l!==(l=((d=u[0])==null?void 0:d.lat)+"")&&se(o,l)},i:te,o:te,d(u){u&&y(e)}}}function yL(n,e,t){let{value:i={}}=e;return n.$$set=s=>{"value"in s&&t(0,i=s.value)},[i]}class Yy extends ve{constructor(e){super(),ye(this,e,yL,kL,be,{value:0})}}function P_(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function N_(n,e,t){const i=n.slice();return i[11]=e[t],i[13]=t,i}function vL(n){var s,l;const e=n.slice(),t=Array.isArray((s=e[0].expand)==null?void 0:s[e[6].name]);e[9]=t;const i=U.toArray((l=e[0].expand)==null?void 0:l[e[6].name]);return e[10]=i,e}function R_(n,e,t){const i=n.slice();i[6]=e[t];const s=U.toArray(i[0][i[6].name]).slice(0,5);return i[14]=s,i}function F_(n,e,t){const i=n.slice();return i[17]=e[t],i}function q_(n){let e,t;return e=new df({props:{record:n[0],filename:n[17],size:"xs"}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[17]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function j_(n){let e=!U.isEmpty(n[17]),t,i,s=e&&q_(n);return{c(){s&&s.c(),t=ke()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!U.isEmpty(l[17])),e?s?(s.p(l,o),o&3&&M(s,1)):(s=q_(l),s.c(),M(s,1),s.m(t.parentNode,t)):s&&(oe(),D(s,1,1,()=>{s=null}),re())},i(l){i||(M(s),i=!0)},o(l){D(s),i=!1},d(l){l&&y(t),s&&s.d(l)}}}function H_(n){let e,t,i=ce(n[14]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oD(r[f],1,1,()=>{r[f]=null});let u=n[9]&&B_();return{c(){l&&l.c(),e=C();for(let f=0;f0&&CL();return t=new Ky({props:{record:n[11]}}),{c(){s&&s.c(),e=C(),H(t.$$.fragment)},m(l,o){s&&s.m(l,o),w(l,e,o),q(t,l,o),i=!0},p(l,o){const r={};o&5&&(r.record=l[11]),t.$set(r)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),s&&s.d(l),j(t,l)}}}function B_(n){let e;return{c(){e=b("span"),e.textContent="]",p(e,"class","expand-end")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function W_(n){let e,t,i,s,l,o=n[8]>0&&wL();const r=[$L,TL,SL],a=[];function u(c,d){var m;return c[6].type=="relation"&&((m=c[0].expand)!=null&&m[c[6].name])?0:c[6].type=="geoPoint"?1:2}function f(c,d){return d===0?vL(c):c}return t=u(n),i=a[t]=r[t](f(n,t)),{c(){o&&o.c(),e=C(),i.c(),s=ke()},m(c,d){o&&o.m(c,d),w(c,e,d),a[t].m(c,d),w(c,s,d),l=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(f(c,t),d):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),i=a[t],i?i.p(f(c,t),d):(i=a[t]=r[t](f(c,t)),i.c()),M(i,1),i.m(s.parentNode,s))},i(c){l||(M(i),l=!0)},o(c){D(i),l=!1},d(c){c&&(y(e),y(s)),o&&o.d(c),a[t].d(c)}}}function OL(n){let e,t,i,s=ce(n[1]),l=[];for(let c=0;cD(l[c],1,1,()=>{l[c]=null});let r=ce(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=z_(n)),{c(){for(let c=0;ct(4,s=u));let{record:l}=e,o=[],r=[];function a(){const u=(i==null?void 0:i.fields)||[];if(t(1,o=u.filter(f=>!f.hidden&&f.presentable&&f.type=="file")),t(2,r=u.filter(f=>!f.hidden&&f.presentable&&f.type!="file")),!o.length&&!r.length){const f=u.find(c=>{var d;return!c.hidden&&c.type=="file"&&c.maxSelect==1&&((d=c.mimeTypes)==null?void 0:d.find(m=>m.startsWith("image/")))});f&&o.push(f)}}return n.$$set=u=>{"record"in u&&t(0,l=u.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=s==null?void 0:s.find(u=>u.id==(l==null?void 0:l.collectionId))),n.$$.dirty&8&&i&&a()},[l,o,r,i,s]}class Ky extends ve{constructor(e){super(),ye(this,e,ML,OL,be,{record:0})}}function EL(n){let e,t,i,s,l,o,r,a,u,f;return t=new Ky({props:{record:n[0]}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("a"),l=b("i"),p(l,"class","ri-external-link-line txt-sm"),p(s,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(s,"target","_blank"),p(s,"class","record-link link-hint"),p(s,"rel","noopener noreferrer"),p(e,"class","record-info-excerpt")},m(c,d){w(c,e,d),q(t,e,null),v(e,i),v(e,s),v(s,l),a=!0,u||(f=[Oe(r=Re.call(null,s,{text:`Open relation record in new tab: -`+U.truncate(JSON.stringify(U.truncateObject(Y_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(s,"click",tn(n[1])),Y(s,"keydown",tn(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(s,"href",o),r&&Lt(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab: -`+U.truncate(JSON.stringify(U.truncateObject(Y_(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&&y(e),j(t),u=!1,Ee(f)}}}function Y_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function DL(n,e,t){let{record:i}=e;function s(o){Le.call(this,n,o)}function l(o){Le.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,s,l]}class Ur extends ve{constructor(e){super(),ye(this,e,DL,EL,be,{record:0})}}function K_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function J_(n,e,t){const i=n.slice();return i[14]=e[t],i}function Z_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function G_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function IL(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 LL(n){var l,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[11]=i;const s=e[2]?20:500;return e[12]=s,e}function AL(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function PL(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,s){w(i,e,s),v(e,t)},p(i,s){s&8&&se(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function NL(n){let e,t=U.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=U.truncate(n[3]))},m(l,o){w(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=U.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=U.truncate(l[3]))&&p(e,"title",s)},i:te,o:te,d(l){l&&y(e)}}}function RL(n){let e,t,i;return t=new Yy({props:{value:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","label")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&8&&(o.value=s[3]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function FL(n){let e,t=[],i=new Map,s,l,o=ce(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&Q_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=Q_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&x(e,"multiple",u[1].maxSelect!=1)},i(u){if(!l){for(let f=0;fn[12]&&tg();return{c(){e=b("div"),i.c(),s=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,s)),f[10].length>f[12]?u||(u=tg(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(M(i),l=!0)},o(f){D(i),l=!1},d(f){f&&y(e),r[t].d(),u&&u.d()}}}function jL(n){let e,t=[],i=new Map,s=ce(U.toArray(n[3]));const l=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function UL(n){let e,t=U.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),v(e,i),s||(l=[Oe(Re.call(null,e,"Open in new tab")),Y(e,"click",tn(n[5]))],s=!0)},p(o,r){r&8&&t!==(t=U.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&y(e),s=!1,Ee(l)}}}function VL(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s&8&&se(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function BL(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","label"),x(e,"label-success",!!n[3])},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t),l&8&&x(e,"label-success",!!s[3])},i:te,o:te,d(s){s&&y(e)}}}function WL(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function YL(n){let e,t,i,s;const l=[xL,QL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function KL(n){let e,t,i,s,l,o,r,a;t=new Oi({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&lg();return{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("div"),l=W(n[3]),o=C(),u&&u.c(),r=ke(),p(s,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),v(e,s),v(s,l),w(f,o,c),u&&u.m(f,c),w(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&se(l,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=lg(),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&&(y(e),y(o),y(r)),j(t),u&&u.d(f)}}}function X_(n,e){let t,i,s;return i=new df({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(i,l)}}}function Q_(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function JL(n){let e,t=ce(n[10].slice(0,n[12])),i=[];for(let s=0;sr[9]+r[7];for(let r=0;r500&&ig(n);return{c(){e=b("span"),i=W(t),s=C(),r&&r.c(),l=ke(),p(e,"class","txt")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=U.truncate(a[6],500,!0)+"")&&se(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=ig(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(y(e),y(s),y(l)),r&&r.d(a)}}}function xL(n){let e,t=U.truncate(n[6])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=U.truncate(s[6])+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function ig(n){let e,t;return e=new Oi({props:{value:JSON.stringify(n[3],null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function lg(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function eA(n){let e,t,i,s,l;const o=[KL,YL,WL,BL,VL,UL,zL,HL,jL,qL,FL,RL,NL,PL],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[1].type==="geoPoint"?11:f[2]?12:13)}function u(f,c){return c===1?AL(f):c===9?LL(f):c===10?IL(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ke()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),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(s.parentNode,s))},i(f){l||(M(i),l=!0)},o(f){D(i),l=!1},d(f){f&&y(s),r[t].d(f)}}}function tA(n,e,t){let i,s;Ge(n,Lr,u=>t(4,s=u));let{record:l}=e,{field:o}=e,{short:r=!1}=e;function a(u){Le.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,l=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=l==null?void 0:l[o.name])},[l,o,r,i,s,a]}class Jy extends ve{constructor(e){super(),ye(this,e,tA,eA,be,{record:0,field:1,short:2})}}function sg(n,e,t){const i=n.slice();return i[13]=e[t],i}function og(n){let e,t,i=n[13].name+"",s,l,o,r,a,u;return r=new Jy({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=W(i),l=C(),o=b("td"),H(r.$$.fragment),a=C(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){w(f,e,c),v(e,t),v(t,s),v(e,l),v(e,o),q(r,o,null),v(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&se(s,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&&y(e),j(r)}}}function nA(n){var r;let e,t,i,s=ce((r=n[0])==null?void 0:r.fields),l=[];for(let a=0;aD(l[a],1,1,()=>{l[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;aClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[7]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function sA(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[lA],header:[iA],default:[nA]},$$scope:{ctx:n}};return e=new ln({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.class="record-preview-panel "+(s[5]?"overlay-panel-xl":"overlay-panel-lg")),l&65561&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[8](null),j(e,s)}}}function oA(n,e,t){let i,{collection:s}=e,l,o={},r=!1;function a(h){return f(h),l==null?void 0:l.show()}function u(){return t(4,r=!1),l==null?void 0:l.hide()}async function f(h){t(3,o={}),t(4,r=!0),t(3,o=await c(h)||{}),t(4,r=!1)}async function c(h){if(h&&typeof h=="string"){try{return await he.collection(s.id).getOne(h)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Mi(`Unable to load record with id "${h}"`))}return null}return h}const d=()=>u();function m(h){ne[h?"unshift":"push"](()=>{l=h,t(2,l)})}function _(h){Le.call(this,n,h)}function g(h){Le.call(this,n,h)}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{var h;n.$$.dirty&1&&t(5,i=!!((h=s==null?void 0:s.fields)!=null&&h.find(k=>k.type==="editor")))},[s,u,l,o,r,i,a,d,m,_,g]}class rA extends ve{constructor(e){super(),ye(this,e,oA,sA,be,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function aA(n){let e,t,i,s;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Oe(t=Re.call(null,e,{text:n[0].join(` + `),R=b("i"),z=C(),B=W("."),J=C(),p(a,"class","txt-strikethrough txt-hint"),p(d,"class","ri-arrow-right-line txt-sm"),p(h,"class","txt"),p(r,"class","inline-flex m-l-5"),p(E,"class","txt-sm"),p(P,"class","txt-sm"),p(R,"class","ri-external-link-line txt-sm"),p(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){w(V,e,Z),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(r,c),v(r,d),v(r,m),v(r,h),v(h,_),v(e,k),v(e,S),v(e,$),v(e,T),v(T,O),v(T,E),v(T,L),v(T,I),v(I,A),v(I,P),v(I,N),v(I,R),v(I,z),v(T,B),v(e,J)},p(V,Z){Z[0]&128&&s!==(s=V[27].name+"")&&se(l,s),Z[0]&128&&u!==(u=V[27].oldHost+"")&&se(f,u),Z[0]&128&&g!==(g=V[27].newHost+"")&&se(_,g),Z[0]&128&&F!==(F=V[13](V[27].name))&&p(I,"href",F)},d(V){V&&y(e)}}}function wI(n){let e,t,i=(n[5]||n[9].length||n[10].length)&&zh(n),s=n[11]&&Vh(n);return{c(){i&&i.c(),e=C(),s&&s.c(),t=ke()},m(l,o){i&&i.m(l,o),w(l,e,o),s&&s.m(l,o),w(l,t,o)},p(l,o){l[5]||l[9].length||l[10].length?i?i.p(l,o):(i=zh(l),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),l[11]?s?s.p(l,o):(s=Vh(l),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(l){l&&(y(e),y(t)),i&&i.d(l),s&&s.d(l)}}}function SI(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function TI(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='Cancel',t=C(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[15]),Y(i,"click",n[16])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function $I(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[TI],header:[SI],default:[wI]},$$scope:{ctx:n}};return e=new ln({props:i}),n[17](e),e.$on("hide",n[18]),e.$on("show",n[19]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&4030|l[1]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[17](null),j(e,s)}}}function CI(n,e,t){let i,s,l,o,r,a,u;const f=wt();let c,d,m,h,g=[],_=[];async function k(F,B,J=!0){t(1,d=F),t(2,m=B),h=J,await O(),I(),await _n(),i||o.length||r.length||a.length||g.length||_.length?c==null||c.show():$()}function S(){c==null||c.hide()}function $(){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(Ce=>Ce.name==Z),de=(V=(J=m==null?void 0:m.oauth2)==null?void 0:J.providers)==null?void 0:V.find(Ce=>Ce.name==Z);if(!G||!de)continue;let pe=new URL(G.authURL).host,ae=new URL(de.authURL).host;pe!=ae&&await E(Z)&&g.push({name:Z,oldHost:pe,newHost:ae})}}async function E(F){try{return await he.collection("_externalAuths").getFirstListItem(he.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"];s||F.push("createRule","updateRule","deleteRule"),l&&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=()=>$();function N(F){ne[F?"unshift":"push"](()=>{c=F,t(6,c)})}function R(F){Le.call(this,n,F)}function z(F){Le.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,s=(m==null?void 0:m.type)==="view"),n.$$.dirty[0]&4&&(l=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&20&&t(10,o=!s&&((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=!s&&((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=!s||i||_.length)},[S,d,m,_,s,i,c,g,a,r,o,u,$,L,k,A,P,N,R,z]}class OI extends ve{constructor(e){super(),ye(this,e,CI,$I,be,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Xh(n,e,t){const i=n.slice();return i[59]=e[t][0],i[60]=e[t][1],i}function MI(n){let e,t,i;function s(o){n[44](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new oI({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function EI(n){let e,t,i;function s(o){n[43](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new dI({props:l}),ne.push(()=>ge(e,"collection",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Qh(n){let e,t,i,s;function l(r){n[45](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new vI({props:o}),ne.push(()=>ge(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u)},i(r){s||(M(t.$$.fragment,r),s=!0)},o(r){D(t.$$.fragment,r),s=!1},d(r){r&&y(e),j(t)}}}function xh(n){let e,t,i,s;function l(r){n[46](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new kM({props:o}),ne.push(()=>ge(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===as)},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],$e(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===as)},i(r){s||(M(t.$$.fragment,r),s=!0)},o(r){D(t.$$.fragment,r),s=!1},d(r){r&&y(e),j(t)}}}function DI(n){let e,t,i,s,l,o,r;const a=[EI,MI],u=[];function f(m,h){return m[17]?0:1}i=f(n),s=u[i]=a[i](n);let c=!n[15]&&n[3]===io&&Qh(n),d=n[18]&&xh(n);return{c(){e=b("div"),t=b("div"),s.c(),l=C(),c&&c.c(),o=C(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===tl),p(e,"class","tabs-content svelte-xyiw1b")},m(m,h){w(m,e,h),v(e,t),u[i].m(t,null),v(e,l),c&&c.m(e,null),v(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):(oe(),D(u[g],1,1,()=>{u[g]=null}),re(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),M(s,1),s.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===tl),!m[15]&&m[3]===io?c?(c.p(m,h),h[0]&32776&&M(c,1)):(c=Qh(m),c.c(),M(c,1),c.m(e,o)):c&&(oe(),D(c,1,1,()=>{c=null}),re()),m[18]?d?(d.p(m,h),h[0]&262144&&M(d,1)):(d=xh(m),d.c(),M(d,1),d.m(e,null)):d&&(oe(),D(d,1,1,()=>{d=null}),re())},i(m){r||(M(s),M(c),M(d),r=!0)},o(m){D(s),D(c),D(d),r=!1},d(m){m&&y(e),u[i].d(),c&&c.d(),d&&d.d()}}}function e_(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[II]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),w(a,t,u),w(a,i,u),v(i,s),v(i,l),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&&(y(e),y(t),y(i)),j(o)}}}function t_(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=C(),i=b("hr"),p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(e,"click",n[34]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function n_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Truncate',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function i_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",tn(it(n[36]))),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function II(n){let e,t,i,s=!n[2].system&&t_(n),l=!n[17]&&n_(n),o=!n[2].system&&i_(n);return{c(){s&&s.c(),e=C(),l&&l.c(),t=C(),o&&o.c(),i=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a)},p(r,a){r[2].system?s&&(s.d(1),s=null):s?s.p(r,a):(s=t_(r),s.c(),s.m(e.parentNode,e)),r[17]?l&&(l.d(1),l=null):l?l.p(r,a):(l=n_(r),l.c(),l.m(t.parentNode,t)),r[2].system?o&&(o.d(1),o=null):o?o.p(r,a):(o=i_(r),o.c(),o.m(i.parentNode,i))},d(r){r&&(y(e),y(t),y(i)),s&&s.d(r),l&&l.d(r),o&&o.d(r)}}}function l_(n){let e,t,i,s;return i=new Dn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[LI]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=C(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(l,o){w(l,e,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[2]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&(y(e),y(t)),j(i,l)}}}function s_(n){let e,t,i,s,l,o=n[60]+"",r,a,u,f,c;function d(){return n[38](n[59])}return{c(){e=b("button"),t=b("i"),s=C(),l=b("span"),r=W(o),a=W(" collection"),u=C(),p(t,"class",i=Us(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[59]==n[2].type)},m(m,h){w(m,e,h),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Us(U.getCollectionTypeIcon(n[59]))+" svelte-xyiw1b")&&p(t,"class",i),h[0]&64&&o!==(o=n[60]+"")&&se(r,o),h[0]&68&&x(e,"selected",n[59]==n[2].type)},d(m){m&&y(e),f=!1,c()}}}function LI(n){let e,t=ce(Object.entries(n[6])),i=[];for(let s=0;s{R=null}),re()):R?(R.p(F,B),B[0]&4&&M(R,1)):(R=l_(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)&&x(d,"btn-disabled",!!F[2].id),F[2].system?z||(z=o_(),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&&(y(e),y(s),y(l),y(f),y(c),y(L),y(I)),R&&R.d(),z&&z.d(F),P=!1,N()}}}function r_(n){let e,t,i,s,l,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Oe(t=Re.call(null,e,n[12])),l=!0)},p(r,a){t&&Lt(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&tt(()=>{s&&(i||(i=qe(e,Ct,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Ct,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&y(e),r&&i&&i.end(),l=!1,o()}}}function a_(n){var a,u,f,c,d,m,h;let e,t,i,s=!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),l,o,r=s&&u_();return{c(){e=b("button"),t=b("span"),t.textContent="API Rules",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===io)},m(g,_){w(g,e,_),v(e,t),v(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[41]),l=!0)},p(g,_){var k,S,$,T,O,E,L;_[0]&32&&(s=!U.isEmpty((k=g[5])==null?void 0:k.listRule)||!U.isEmpty((S=g[5])==null?void 0:S.viewRule)||!U.isEmpty(($=g[5])==null?void 0:$.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)),s?r?_[0]&32&&M(r,1):(r=u_(),r.c(),M(r,1),r.m(e,null)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),_[0]&8&&x(e,"active",g[3]===io)},d(g){g&&y(e),r&&r.d(),l=!1,o()}}}function u_(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function f_(n){let e,t,i,s=n[5]&&n[25](n[5],n[13].concat(["manageRule","authRule"])),l,o,r=s&&c_();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=C(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===as)},m(a,u){w(a,e,u),v(e,t),v(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[42]),l=!0)},p(a,u){u[0]&8224&&(s=a[5]&&a[25](a[5],a[13].concat(["manageRule","authRule"]))),s?r?u[0]&8224&&M(r,1):(r=c_(),r.c(),M(r,1),r.m(e,null)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),u[0]&8&&x(e,"active",a[3]===as)},d(a){a&&y(e),r&&r.d(),l=!1,o()}}}function c_(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function PI(n){let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,m,h=n[17]?"Query":"Fields",g,_,k=!U.isEmpty(n[12]),S,$,T,O,E,L=!!n[2].id&&(!n[2].system||!n[17])&&e_(n);r=new fe({props:{class:"form-field collection-field-name required m-b-0",name:"name",$$slots:{default:[AI,({uniqueId:N})=>({58:N}),({uniqueId:N})=>[0,N?134217728:0]]},$$scope:{ctx:n}}});let I=k&&r_(n),A=!n[15]&&a_(n),P=n[18]&&f_(n);return{c(){e=b("h4"),i=W(t),s=C(),L&&L.c(),l=C(),o=b("form"),H(r.$$.fragment),a=C(),u=b("input"),f=C(),c=b("div"),d=b("button"),m=b("span"),g=W(h),_=C(),I&&I.c(),S=C(),A&&A.c(),$=C(),P&&P.c(),p(e,"class","upsert-panel-title svelte-xyiw1b"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===tl),p(c,"class","tabs-header stretched")},m(N,R){w(N,e,R),v(e,i),w(N,s,R),L&&L.m(N,R),w(N,l,R),w(N,o,R),q(r,o,null),v(o,a),v(o,u),w(N,f,R),w(N,c,R),v(c,d),v(d,m),v(m,g),v(d,_),I&&I.m(d,null),v(c,S),A&&A.m(c,null),v(c,$),P&&P.m(c,null),T=!0,O||(E=[Y(o,"submit",it(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")&&se(i,t),N[2].id&&(!N[2].system||!N[17])?L?(L.p(N,R),R[0]&131076&&M(L,1)):(L=e_(N),L.c(),M(L,1),L.m(l.parentNode,l)):L&&(oe(),D(L,1,1,()=>{L=null}),re());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")&&se(g,h),R[0]&4096&&(k=!U.isEmpty(N[12])),k?I?(I.p(N,R),R[0]&4096&&M(I,1)):(I=r_(N),I.c(),M(I,1),I.m(d,null)):I&&(oe(),D(I,1,1,()=>{I=null}),re()),(!T||R[0]&8)&&x(d,"active",N[3]===tl),N[15]?A&&(A.d(1),A=null):A?A.p(N,R):(A=a_(N),A.c(),A.m(c,$)),N[18]?P?P.p(N,R):(P=f_(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&&(y(e),y(s),y(l),y(o),y(f),y(c)),L&&L.d(N),j(r),I&&I.d(),A&&A.d(),P&&P.d(),O=!1,Ee(E)}}}function d_(n){let e,t,i,s,l,o;return s=new Dn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[NI]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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=l=!n[14]||n[9]||n[10]},m(r,a){w(r,e,a),v(e,t),v(e,i),q(s,e,null),o=!0},p(r,a){const u={};a[2]&2&&(u.$$scope={dirty:a,ctx:r}),s.$set(u),(!o||a[0]&17920&&l!==(l=!r[14]||r[9]||r[10]))&&(e.disabled=l)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&y(e),j(s)}}}function NI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function RI(n){let e,t,i,s,l,o,r=n[2].id?"Save changes":"Create",a,u,f,c,d,m,h=n[2].id&&d_(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("div"),l=b("button"),o=b("span"),a=W(r),f=C(),h&&h.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(o,"class","txt"),p(l,"type","button"),p(l,"title","Save and close"),p(l,"class","btn"),l.disabled=u=!n[14]||n[9]||n[10],x(l,"btn-expanded",!n[2].id),x(l,"btn-expanded-sm",!!n[2].id),x(l,"btn-loading",n[9]||n[10]),p(s,"class","btns-group no-gap")},m(g,_){w(g,e,_),v(e,t),w(g,i,_),w(g,s,_),v(s,l),v(l,o),v(o,a),v(s,f),h&&h.m(s,null),c=!0,d||(m=[Y(e,"click",n[31]),Y(l,"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")&&se(a,r),(!c||_[0]&17920&&u!==(u=!g[14]||g[9]||g[10]))&&(l.disabled=u),(!c||_[0]&4)&&x(l,"btn-expanded",!g[2].id),(!c||_[0]&4)&&x(l,"btn-expanded-sm",!!g[2].id),(!c||_[0]&1536)&&x(l,"btn-loading",g[9]||g[10]),g[2].id?h?(h.p(g,_),_[0]&4&&M(h,1)):(h=d_(g),h.c(),M(h,1),h.m(s,null)):h&&(oe(),D(h,1,1,()=>{h=null}),re())},i(g){c||(M(h),c=!0)},o(g){D(h),c=!1},d(g){g&&(y(e),y(i),y(s)),h&&h.d(),d=!1,Ee(m)}}}function FI(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[47],$$slots:{footer:[RI],header:[PI],default:[DI]},$$scope:{ctx:n}};e=new ln({props:l}),n[48](e),e.$on("hide",n[49]),e.$on("show",n[50]);let o={};return i=new OI({props:o}),n[51](i),i.$on("confirm",n[52]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!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){s||(M(e.$$.fragment,r),M(i.$$.fragment,r),s=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),s=!1},d(r){r&&y(t),n[48](null),j(e,r),n[51](null),j(i,r)}}}const tl="schema",io="api_rules",as="options",qI="base",p_="auth",m_="view";function Ra(n){return JSON.stringify(n)}function jI(n,e,t){let i,s,l,o,r,a,u,f,c;Ge(n,Pr,Pe=>t(30,u=Pe)),Ge(n,ii,Pe=>t(53,f=Pe)),Ge(n,Tn,Pe=>t(5,c=Pe));const d={};d[qI]="Base",d[m_]="View",d[p_]="Auth";const m=wt();let h,g,_=null,k={},S=!1,$=!1,T=!1,O=tl,E=Ra(k),L="",I=[];function A(Pe){t(3,O=Pe)}function P(Pe){return z(Pe),t(11,T=!0),t(10,$=!1),t(9,S=!1),A(tl),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(Pe){Jt({}),typeof Pe<"u"?(t(28,_=Pe),t(2,k=structuredClone(Pe))):(t(28,_=null),t(2,k=structuredClone(u.base)),k.fields.push({type:"autodate",name:"created",onCreate:!0}),k.fields.push({type:"autodate",name:"updated",onCreate:!0,onUpdate:!0})),t(2,k.fields=k.fields||[],k),t(2,k._originalName=k.name||"",k),await _n(),t(29,E=Ra(k))}async function F(Pe=!0){if(!$){t(10,$=!0);try{k.id?await(g==null?void 0:g.show(_,k,Pe)):await B(Pe)}catch{}t(10,$=!1)}}async function B(Pe=!0){if(S)return;t(9,S=!0);const jt=J(),Gt=!k.id;try{let en;Gt?en=await he.collections.create(jt):en=await he.collections.update(k.id,jt),As(),g3(en),Pe?(t(11,T=!1),N()):z(en),nn(k.id?"Successfully updated collection.":"Successfully created collection."),m("save",{isNew:Gt,collection:en}),Gt&&(En(ii,f=en,f),await k3())}catch(en){he.error(en)}t(9,S=!1)}function J(){const Pe=Object.assign({},k);Pe.fields=Pe.fields.slice(0);for(let jt=Pe.fields.length-1;jt>=0;jt--)Pe.fields[jt]._toDelete&&Pe.fields.splice(jt,1);return Pe}function V(){_!=null&&_.id&&yn(`Do you really want to delete all "${_.name}" records, including their cascade delete references and files?`,()=>he.collections.truncate(_.id).then(()=>{R(),nn(`Successfully truncated collection "${_.name}".`),m("truncate")}).catch(Pe=>{he.error(Pe)}))}function Z(){_!=null&&_.id&&yn(`Do you really want to delete collection "${_.name}" and all its records?`,()=>he.collections.delete(_.id).then(()=>{R(),nn(`Successfully deleted collection "${_.name}".`),m("delete",_),b3(_)}).catch(Pe=>{he.error(Pe)}))}function G(Pe){t(2,k.type=Pe,k),t(2,k=Object.assign(structuredClone(u[Pe]),k)),Wn("fields")}function de(){r?yn("You have unsaved changes. Do you really want to discard them?",()=>{pe()}):pe()}async function pe(){const Pe=_?structuredClone(_):null;if(Pe){if(Pe.id="",Pe.created="",Pe.updated="",Pe.name+="_duplicate",!U.isEmpty(Pe.fields))for(const jt of Pe.fields)jt.id="";if(!U.isEmpty(Pe.indexes))for(let jt=0;jtN(),Ye=()=>F(),Ke=()=>F(!1),ct=()=>de(),et=()=>V(),xe=()=>Z(),Be=Pe=>{t(2,k.name=U.slugify(Pe.target.value),k),Pe.target.value=k.name},ut=Pe=>G(Pe),Bt=()=>{a&&F()},Ue=()=>A(tl),De=()=>A(io),ot=()=>A(as);function Ie(Pe){k=Pe,t(2,k),t(28,_)}function We(Pe){k=Pe,t(2,k),t(28,_)}function Te(Pe){k=Pe,t(2,k),t(28,_)}function nt(Pe){k=Pe,t(2,k),t(28,_)}const zt=()=>r&&T?(yn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,T=!1),N()}),!1):!0;function Ne(Pe){ne[Pe?"unshift":"push"](()=>{h=Pe,t(7,h)})}function Me(Pe){Le.call(this,n,Pe)}function bt(Pe){Le.call(this,n,Pe)}function Ut(Pe){ne[Pe?"unshift":"push"](()=>{g=Pe,t(8,g)})}const Pt=Pe=>B(Pe.detail);return n.$$.update=()=>{var Pe;n.$$.dirty[0]&1073741824&&t(13,I=Object.keys(u.base||{})),n.$$.dirty[0]&4&&k.type==="view"&&(t(2,k.createRule=null,k),t(2,k.updateRule=null,k),t(2,k.deleteRule=null,k),t(2,k.indexes=[],k)),n.$$.dirty[0]&268435460&&k.name&&(_==null?void 0:_.name)!=k.name&&k.indexes.length>0&&t(2,k.indexes=(Pe=k.indexes)==null?void 0:Pe.map(jt=>U.replaceIndexTableName(jt,k.name)),k),n.$$.dirty[0]&4&&t(18,i=k.type===p_),n.$$.dirty[0]&4&&t(17,s=k.type===m_),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,l=!!k.id&&k.system),n.$$.dirty[0]&4&&t(15,o=!!k.id&&k.system&&k.name=="_superusers"),n.$$.dirty[0]&536870916&&t(4,r=E!=Ra(k)),n.$$.dirty[0]&20&&t(14,a=!k.id||r),n.$$.dirty[0]&12&&O===as&&k.type!=="auth"&&A(tl)},[A,N,k,O,r,c,d,h,g,S,$,T,L,I,a,o,l,s,i,F,B,V,Z,G,de,ae,P,R,_,E,u,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt,Ne,Me,bt,Ut,Pt]}class ff extends ve{constructor(e){super(),ye(this,e,jI,FI,be,{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 HI(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(s,l){w(s,e,l),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(s,[l]){l&2&&x(e,"dragging",s[1])},i:te,o:te,d(s){s&&y(e),n[4](null),t=!1,Ee(i)}}}function zI(n,e,t){const i=wt();let{tolerance:s=0}=e,l,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-l.offsetLeft,u=_.clientY-l.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),l.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:l})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-l.offsetLeft){l=_,t(0,l)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,s=_.tolerance)},[l,f,c,s,h,g]}class UI extends ve{constructor(e){super(),ye(this,e,zI,HI,be,{tolerance:3})}}function VI(n){let e,t,i,s,l;const o=n[5].default,r=Nt(o,n,n[4],null);return s=new UI({}),s.$on("dragstart",n[7]),s.$on("dragging",n[8]),s.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=C(),H(s.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),q(s,a,u),l=!0},p(a,[u]){r&&r.p&&(!l||u&16)&&Ft(r,o,a,a[4],l?Rt(o,a[4],u,null):qt(a[4]),null),(!l||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){l||(M(r,a),M(s.$$.fragment,a),l=!0)},o(a){D(r,a),D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(i)),r&&r.d(a),n[6](null),j(s,a)}}}const h_="@superuserSidebarWidth";function BI(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o,r,a=localStorage.getItem(h_)||null;function u(m){ne[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,l=m.class),"$$scope"in m&&t(4,s=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(h_,a))},[l,o,a,r,s,i,u,f,c,d]}class Yy extends ve{constructor(e){super(),ye(this,e,BI,VI,be,{class:0})}}function __(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(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,"OAuth2 auth is enabled but the collection doesn't have any registered providers")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function WI(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function YI(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-5oh3nd")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function KI(n){var T,O;let e,t,i,s,l,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)&&__();function k(E,L){return E[1]?YI:WI}let S=k(n),$=S(n);return{c(){var E;e=b("a"),t=b("i"),s=C(),l=b("span"),r=W(o),a=C(),_&&_.c(),u=C(),f=b("span"),$.c(),p(t,"class",i=Us(U.getCollectionTypeIcon(n[0].type))+" svelte-5oh3nd"),p(t,"aria-hidden","true"),p(l,"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),x(e,"active",((E=n[2])==null?void 0:E.id)===n[0].id)},m(E,L){w(E,e,L),v(e,t),v(e,s),v(e,l),v(l,r),v(e,a),_&&_.m(e,null),v(e,u),v(e,f),$.m(f,null),h||(g=[Oe(c=Re.call(null,f,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(f,"click",tn(it(n[5]))),Oe(Fn.call(null,e))],h=!0)},p(E,[L]){var I,A,P;L&1&&i!==(i=Us(U.getCollectionTypeIcon(E[0].type))+" svelte-5oh3nd")&&p(t,"class",i),L&1&&o!==(o=E[0].name+"")&&se(r,o),E[0].type=="auth"&&((I=E[0].oauth2)!=null&&I.enabled)&&!((A=E[0].oauth2.providers)!=null&&A.length)?_||(_=__(),_.c(),_.m(e,u)):_&&(_.d(1),_=null),S!==(S=k(E))&&($.d(1),$=S(E),$&&($.c(),$.m(f,null))),c&&Lt(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&&x(e,"active",((P=E[2])==null?void 0:P.id)===E[0].id)},i:te,o:te,d(E){E&&y(e),_&&_.d(),$.d(),h=!1,Ee(g)}}}function JI(n,e,t){let i,s;Ge(n,ii,u=>t(2,s=u));let{collection:l}=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(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class cf extends ve{constructor(e){super(),ye(this,e,JI,KI,be,{collection:0,pinnedIds:4})}}function g_(n,e,t){const i=n.slice();return i[25]=e[t],i}function b_(n,e,t){const i=n.slice();return i[25]=e[t],i}function k_(n,e,t){const i=n.slice();return i[25]=e[t],i}function y_(n){let e,t,i=[],s=new Map,l,o,r=ce(n[2]);const a=u=>u[25].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&4&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function w_(n){let e,t=[],i=new Map,s,l,o=n[2].length&&S_(),r=ce(n[8]);const a=u=>u[25].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&256&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function $_(n){let e,t,i,s,l,o,r,a,u,f,c,d=!n[4].length&&C_(n),m=(n[6]||n[4].length)&&O_(n);return{c(){e=b("button"),t=b("span"),t.textContent="System",i=C(),d&&d.c(),r=C(),m&&m.c(),a=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","sidebar-title m-b-xs"),p(e,"aria-label",s=n[6]?"Expand system collections":"Collapse system collections"),p(e,"aria-expanded",l=n[6]||n[4].length),e.disabled=o=n[4].length,x(e,"link-hint",!n[4].length)},m(h,g){w(h,e,g),v(e,t),v(e,i),d&&d.m(e,null),w(h,r,g),m&&m.m(h,g),w(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=C_(h),d.c(),d.m(e,null)),(!u||g[0]&64&&s!==(s=h[6]?"Expand system collections":"Collapse system collections"))&&p(e,"aria-label",s),(!u||g[0]&80&&l!==(l=h[6]||h[4].length))&&p(e,"aria-expanded",l),(!u||g[0]&16&&o!==(o=h[4].length))&&(e.disabled=o),(!u||g[0]&16)&&x(e,"link-hint",!h[4].length),h[6]||h[4].length?m?(m.p(h,g),g[0]&80&&M(m,1)):(m=O_(h),m.c(),M(m,1),m.m(a.parentNode,a)):m&&(oe(),D(m,1,1,()=>{m=null}),re())},i(h){u||(M(m),u=!0)},o(h){D(m),u=!1},d(h){h&&(y(e),y(r),y(a)),d&&d.d(),m&&m.d(h),f=!1,c()}}}function C_(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,s){w(i,e,s)},p(i,s){s[0]&64&&t!==(t="ri-arrow-"+(i[6]?"up":"down")+"-s-line")&&p(e,"class",t)},d(i){i&&y(e)}}}function O_(n){let e=[],t=new Map,i,s,l=ce(n[7]);const o=r=>r[25].id;for(let r=0;rge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&128&&(f.collection=e[25]),!s&&u[0]&2&&(s=!0,f.pinnedIds=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function E_(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function D_(n){let e,t,i,s;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),v(e,t),i||(s=Y(t,"click",n[21]),i=!0)},p:te,d(l){l&&y(e),i=!1,s()}}}function ZI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$=n[2].length&&y_(n),T=n[8].length&&w_(n),O=n[7].length&&$_(n),E=n[4].length&&!n[3].length&&E_(),L=!n[11]&&D_(n);return{c(){e=b("header"),t=b("div"),i=b("div"),s=b("button"),s.innerHTML='',l=C(),o=b("input"),r=C(),a=b("hr"),u=C(),f=b("div"),$&&$.c(),c=C(),T&&T.c(),d=C(),O&&O.c(),m=C(),E&&E.c(),h=C(),L&&L.c(),g=ke(),p(s,"type","button"),p(s,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(s,"hidden",!n[9]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[9]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[10]),x(f,"sidebar-content-compact",n[3].length>20)},m(I,A){w(I,e,A),v(e,t),v(t,i),v(i,s),v(t,l),v(t,o),me(o,n[0]),w(I,r,A),w(I,a,A),w(I,u,A),w(I,f,A),$&&$.m(f,null),v(f,c),T&&T.m(f,null),v(f,d),O&&O.m(f,null),v(f,m),E&&E.m(f,null),w(I,h,A),L&&L.m(I,A),w(I,g,A),_=!0,k||(S=[Y(s,"click",n[15]),Y(o,"input",n[16])],k=!0)},p(I,A){(!_||A[0]&512)&&x(s,"hidden",!I[9]),A[0]&1&&o.value!==I[0]&&me(o,I[0]),(!_||A[0]&512)&&x(t,"active",I[9]),I[2].length?$?($.p(I,A),A[0]&4&&M($,1)):($=y_(I),$.c(),M($,1),$.m(f,c)):$&&(oe(),D($,1,1,()=>{$=null}),re()),I[8].length?T?(T.p(I,A),A[0]&256&&M(T,1)):(T=w_(I),T.c(),M(T,1),T.m(f,d)):T&&(oe(),D(T,1,1,()=>{T=null}),re()),I[7].length?O?(O.p(I,A),A[0]&128&&M(O,1)):(O=$_(I),O.c(),M(O,1),O.m(f,m)):O&&(oe(),D(O,1,1,()=>{O=null}),re()),I[4].length&&!I[3].length?E||(E=E_(),E.c(),E.m(f,null)):E&&(E.d(1),E=null),(!_||A[0]&1024)&&x(f,"fade",I[10]),(!_||A[0]&8)&&x(f,"sidebar-content-compact",I[3].length>20),I[11]?L&&(L.d(1),L=null):L?L.p(I,A):(L=D_(I),L.c(),L.m(g.parentNode,g))},i(I){_||(M($),M(T),M(O),_=!0)},o(I){D($),D(T),D(O),_=!1},d(I){I&&(y(e),y(r),y(a),y(u),y(f),y(h),y(g)),$&&$.d(),T&&T.d(),O&&O.d(),E&&E.d(),L&&L.d(I),k=!1,Ee(S)}}}function GI(n){let e,t,i,s;e=new Yy({props:{class:"collection-sidebar",$$slots:{default:[ZI]},$$scope:{ctx:n}}});let l={};return i=new ff({props:l}),n[22](i),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){q(e,o,r),w(o,t,r),q(i,o,r),s=!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){s||(M(e.$$.fragment,o),M(i.$$.fragment,o),s=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),s=!1},d(o){o&&y(t),j(e,o),n[22](null),j(i,o)}}}const I_="@pinnedCollections";function XI(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function QI(n,e,t){let i,s,l,o,r,a,u,f,c,d;Ge(n,In,R=>t(13,u=R)),Ge(n,ii,R=>t(14,f=R)),Ge(n,Zs,R=>t(10,c=R)),Ge(n,Il,R=>t(11,d=R));let m,h="",g=[],_=!1,k;S();function S(){t(1,g=[]);try{const R=localStorage.getItem(I_);R&&t(1,g=JSON.parse(R)||[])}catch{}}function $(){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){ne[R?"unshift":"push"](()=>{m=R,t(5,m)})}return n.$$.update=()=>{n.$$.dirty[0]&8192&&u&&($(),XI()),n.$$.dirty[0]&1&&t(4,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty[0]&1&&t(9,s=h!==""),n.$$.dirty[0]&2&&g&&localStorage.setItem(I_,JSON.stringify(g)),n.$$.dirty[0]&8209&&t(3,l=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=l.filter(R=>g.includes(R.id))),n.$$.dirty[0]&10&&t(8,r=l.filter(R=>!R.system&&!g.includes(R.id))),n.$$.dirty[0]&10&&t(7,a=l.filter(R=>R.system&&!g.includes(R.id))),n.$$.dirty[0]&20484&&f!=null&&f.id&&k!=f.id&&(t(12,k=f.id),f.system&&!o.find(R=>R.id==f.id)?t(6,_=!0):t(6,_=!1))},[h,g,o,l,i,m,_,a,r,s,c,d,k,u,f,T,O,E,L,I,A,P,N]}class xI extends ve{constructor(e){super(),ye(this,e,QI,GI,be,{},null,[-1,-1])}}function eL(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function tL(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=W(n[2]),s=C(),l=b("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r),a||(u=Oe(Re.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&y(e),a=!1,u()}}}function nL(n){let e;function t(l,o){return l[0]?tL:eL}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function iL(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return U.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class lL extends ve{constructor(e){super(),ye(this,e,iL,nL,be,{date:0})}}function L_(n){let e;function t(l,o){return l[4]==="image"?oL:sL}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function sL(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,s){w(i,e,s),v(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&y(e)}}}function oL(n){let e,t,i;return{c(){e=b("img"),wn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!wn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&y(e)}}}function rL(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&L_(n);return{c(){i&&i.c(),t=ke()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=L_(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&y(t),i&&i.d(l)}}}function aL(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[0])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function uL(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=W(n[2]),i=C(),s=b("i"),l=C(),o=b("div"),r=C(),a=b("button"),a.textContent="Close",p(s,"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){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(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&&se(t,c[2]),d&4&&p(e,"title",c[2])},d(c){c&&(y(e),y(l),y(o),y(r),y(a)),u=!1,Ee(f)}}}function fL(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[uL],header:[aL],default:[rL]},$$scope:{ctx:n}};return e=new ln({props:i}),n[8](e),e.$on("show",n[9]),e.$on("hide",n[10]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&8222&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[8](null),j(e,s)}}}function cL(n,e,t){let i,s,l,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(_){ne[_?"unshift":"push"](()=>{o=_,t(3,o)})}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(7,i=r.indexOf("?")),n.$$.dirty&130&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=U.getFileType(s))},[f,r,s,o,l,d,u,i,m,h,g]}class dL extends ve{constructor(e){super(),ye(this,e,cL,fL,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function pL(n){let e,t,i,s,l;function o(u,f){return u[5]==="image"?gL:u[5]==="video"||u[5]==="audio"?_L:hL}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){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",tn(n[10])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&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&&y(e),a.d(),s=!1,l()}}}function mL(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[2]?`thumb-${n[2]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&4&&t!==(t="thumb "+(i[2]?`thumb-${i[2]}`:""))&&p(e,"class",t)},d(i){i&&y(e)}}}function hL(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function _L(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function gL(n){let e,t,i,s,l;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),wn(e.src,t=n[7])||p(e,"src",t),p(e,"alt",n[1]),p(e,"title",i="Preview "+n[1])},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[9]),s=!0)},p(o,r){r&128&&!wn(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&&y(e),s=!1,l()}}}function A_(n){let e,t,i={};return e=new dL({props:i}),n[11](e),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function bL(n){let e,t,i;function s(a,u){return a[4]?mL:pL}let l=s(n),o=l(n),r=n[8]&&A_(n);return{c(){o.c(),e=C(),r&&r.c(),t=ke()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e))),a[8]?r?(r.p(a,u),u&256&&M(r,1)):(r=A_(a),r.c(),M(r,1),r.m(t.parentNode,t)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){i||(M(r),i=!0)},o(a){D(r),i=!1},d(a){a&&(y(e),y(t)),o.d(a),r&&r.d(a)}}}function kL(n,e,t){let i,s,{record:l=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 he.getSuperuserFileToken(l.collectionId))}catch(_){console.warn("File token failure:",_)}t(4,c=!1)}function m(){t(7,u="")}const h=async()=>{if(s)try{a==null||a.show(async()=>(t(3,f=await he.getSuperuserFileToken(l.collectionId)),he.files.getURL(l,o,{token:f})))}catch(_){_.isAbort||console.warn("Preview file token failure:",_)}};function g(_){ne[_?"unshift":"push"](()=>{a=_,t(6,a)})}return n.$$set=_=>{"record"in _&&t(0,l=_.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,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&27&&t(7,u=c?"":he.files.getURL(l,o,{thumb:"100x100",token:f}))},[l,o,r,f,c,i,a,u,s,m,h,g]}class df extends ve{constructor(e){super(),ye(this,e,kL,bL,be,{record:0,filename:1,size:2})}}function yL(n){var r,a;let e,t=((r=n[0])==null?void 0:r.lon)+"",i,s,l=((a=n[0])==null?void 0:a.lat)+"",o;return{c(){e=b("div"),i=W(t),s=W(", "),o=W(l),p(e,"class","txt")},m(u,f){w(u,e,f),v(e,i),v(e,s),v(e,o)},p(u,[f]){var c,d;f&1&&t!==(t=((c=u[0])==null?void 0:c.lon)+"")&&se(i,t),f&1&&l!==(l=((d=u[0])==null?void 0:d.lat)+"")&&se(o,l)},i:te,o:te,d(u){u&&y(e)}}}function vL(n,e,t){let{value:i={}}=e;return n.$$set=s=>{"value"in s&&t(0,i=s.value)},[i]}class Ky extends ve{constructor(e){super(),ye(this,e,vL,yL,be,{value:0})}}function P_(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function N_(n,e,t){const i=n.slice();return i[11]=e[t],i[13]=t,i}function wL(n){var s,l;const e=n.slice(),t=Array.isArray((s=e[0].expand)==null?void 0:s[e[6].name]);e[9]=t;const i=U.toArray((l=e[0].expand)==null?void 0:l[e[6].name]);return e[10]=i,e}function R_(n,e,t){const i=n.slice();i[6]=e[t];const s=U.toArray(i[0][i[6].name]).slice(0,5);return i[14]=s,i}function F_(n,e,t){const i=n.slice();return i[17]=e[t],i}function q_(n){let e,t;return e=new df({props:{record:n[0],filename:n[17],size:"xs"}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[17]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function j_(n){let e=!U.isEmpty(n[17]),t,i,s=e&&q_(n);return{c(){s&&s.c(),t=ke()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!U.isEmpty(l[17])),e?s?(s.p(l,o),o&3&&M(s,1)):(s=q_(l),s.c(),M(s,1),s.m(t.parentNode,t)):s&&(oe(),D(s,1,1,()=>{s=null}),re())},i(l){i||(M(s),i=!0)},o(l){D(s),i=!1},d(l){l&&y(t),s&&s.d(l)}}}function H_(n){let e,t,i=ce(n[14]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oD(a[d],1,1,()=>{a[d]=null});let f=n[10].length>2&&B_(n),c=n[9]&&W_();return{c(){o&&o.c(),e=C();for(let d=0;d2?f?f.p(d,m):(f=B_(d),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),d[9]?c||(c=W_(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null)},i(d){if(!l){for(let m=0;m0&&OL();return t=new Jy({props:{record:n[11]}}),{c(){s&&s.c(),e=C(),H(t.$$.fragment)},m(l,o){s&&s.m(l,o),w(l,e,o),q(t,l,o),i=!0},p(l,o){const r={};o&5&&(r.record=l[11]),t.$set(r)},i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){D(t.$$.fragment,l),i=!1},d(l){l&&y(e),s&&s.d(l),j(t,l)}}}function B_(n){let e,t,i,s,l=n[10].length-2+"",o,r;return{c(){e=b("span"),e.textContent="|",t=C(),i=b("small"),s=W("("),o=W(l),r=W(" more)"),p(e,"class","delimiter"),p(i,"class","txt-hint")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),v(i,s),v(i,o),v(i,r)},p(a,u){u&5&&l!==(l=a[10].length-2+"")&&se(o,l)},d(a){a&&(y(e),y(t),y(i))}}}function W_(n){let e;return{c(){e=b("span"),e.textContent="]",p(e,"class","expand-end")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Y_(n){let e,t,i,s,l,o=n[8]>0&&SL();const r=[CL,$L,TL],a=[];function u(c,d){var m;return c[6].type=="relation"&&((m=c[0].expand)!=null&&m[c[6].name])?0:c[6].type=="geoPoint"?1:2}function f(c,d){return d===0?wL(c):c}return t=u(n),i=a[t]=r[t](f(n,t)),{c(){o&&o.c(),e=C(),i.c(),s=ke()},m(c,d){o&&o.m(c,d),w(c,e,d),a[t].m(c,d),w(c,s,d),l=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(f(c,t),d):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),i=a[t],i?i.p(f(c,t),d):(i=a[t]=r[t](f(c,t)),i.c()),M(i,1),i.m(s.parentNode,s))},i(c){l||(M(i),l=!0)},o(c){D(i),l=!1},d(c){c&&(y(e),y(s)),o&&o.d(c),a[t].d(c)}}}function ML(n){let e,t,i,s=ce(n[1]),l=[];for(let c=0;cD(l[c],1,1,()=>{l[c]=null});let r=ce(n[2]),a=[];for(let c=0;cD(a[c],1,1,()=>{a[c]=null});let f=null;return r.length||(f=z_(n)),{c(){for(let c=0;ct(4,s=u));let{record:l}=e,o=[],r=[];function a(){const u=(i==null?void 0:i.fields)||[];if(t(1,o=u.filter(f=>!f.hidden&&f.presentable&&f.type=="file")),t(2,r=u.filter(f=>!f.hidden&&f.presentable&&f.type!="file")),!o.length&&!r.length){const f=u.find(c=>{var d;return!c.hidden&&c.type=="file"&&c.maxSelect==1&&((d=c.mimeTypes)==null?void 0:d.find(m=>m.startsWith("image/")))});f&&o.push(f)}}return n.$$set=u=>{"record"in u&&t(0,l=u.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=s==null?void 0:s.find(u=>u.id==(l==null?void 0:l.collectionId))),n.$$.dirty&8&&i&&a()},[l,o,r,i,s]}class Jy extends ve{constructor(e){super(),ye(this,e,EL,ML,be,{record:0})}}function DL(n){let e,t,i,s,l,o,r,a,u,f;return t=new Jy({props:{record:n[0]}}),{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("a"),l=b("i"),p(l,"class","ri-external-link-line txt-sm"),p(s,"href",o="#/collections?collection="+n[0].collectionId+"&recordId="+n[0].id),p(s,"target","_blank"),p(s,"class","record-link link-hint"),p(s,"rel","noopener noreferrer"),p(e,"class","record-info-excerpt")},m(c,d){w(c,e,d),q(t,e,null),v(e,i),v(e,s),v(s,l),a=!0,u||(f=[Oe(r=Re.call(null,s,{text:`Open relation record in new tab: +`+U.truncate(JSON.stringify(U.truncateObject(K_(n[0],"expand")),null,2),800,!0),class:"code",position:"left"})),Y(s,"click",tn(n[1])),Y(s,"keydown",tn(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(s,"href",o),r&&Lt(r.update)&&d&1&&r.update.call(null,{text:`Open relation record in new tab: +`+U.truncate(JSON.stringify(U.truncateObject(K_(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&&y(e),j(t),u=!1,Ee(f)}}}function K_(n,...e){const t=Object.assign({},n);for(let i of e)delete t[i];return t}function IL(n,e,t){let{record:i}=e;function s(o){Le.call(this,n,o)}function l(o){Le.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record)},[i,s,l]}class Ur extends ve{constructor(e){super(),ye(this,e,IL,DL,be,{record:0})}}function J_(n,e,t){const i=n.slice();return i[19]=e[t],i[9]=t,i}function Z_(n,e,t){const i=n.slice();return i[14]=e[t],i}function G_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function X_(n,e,t){const i=n.slice();return i[7]=e[t],i[9]=t,i}function LL(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 AL(n){var l,o;const e=n.slice(),t=U.toArray(e[3]);e[10]=t;const i=U.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[11]=i;const s=e[2]?20:500;return e[12]=s,e}function PL(n){const e=n.slice(),t=U.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[6]=t,e}function NL(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,s){w(i,e,s),v(e,t)},p(i,s){s&8&&se(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function RL(n){let e,t=U.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=U.truncate(n[3]))},m(l,o){w(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=U.truncate(l[3])+"")&&se(i,t),o&8&&s!==(s=U.truncate(l[3]))&&p(e,"title",s)},i:te,o:te,d(l){l&&y(e)}}}function FL(n){let e,t,i;return t=new Ky({props:{value:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","label")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&8&&(o.value=s[3]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function qL(n){let e,t=[],i=new Map,s,l,o=ce(n[17].slice(0,n[18]));const r=u=>u[9]+u[19];for(let u=0;un[18]&&x_();return{c(){e=b("div");for(let u=0;uu[18]?a||(a=x_(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&x(e,"multiple",u[1].maxSelect!=1)},i(u){if(!l){for(let f=0;fn[12]&&ng();return{c(){e=b("div"),i.c(),s=C(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),M(i,1),i.m(e,s)),f[10].length>f[12]?u||(u=ng(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(M(i),l=!0)},o(f){D(i),l=!1},d(f){f&&y(e),r[t].d(),u&&u.d()}}}function HL(n){let e,t=[],i=new Map,s=ce(U.toArray(n[3]));const l=o=>o[9]+o[7];for(let o=0;o{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function VL(n){let e,t=U.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),v(e,i),s||(l=[Oe(Re.call(null,e,"Open in new tab")),Y(e,"click",tn(n[5]))],s=!0)},p(o,r){r&8&&t!==(t=U.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:te,o:te,d(o){o&&y(e),s=!1,Ee(l)}}}function BL(n){let e,t;return{c(){e=b("span"),t=W(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),v(e,t)},p(i,s){s&8&&se(t,i[3])},i:te,o:te,d(i){i&&y(e)}}}function WL(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=W(t),p(e,"class","label"),x(e,"label-success",!!n[3])},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&se(i,t),l&8&&x(e,"label-success",!!s[3])},i:te,o:te,d(s){s&&y(e)}}}function YL(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function KL(n){let e,t,i,s;const l=[eA,xL],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function JL(n){let e,t,i,s,l,o,r,a;t=new Oi({props:{value:n[3]}});let u=n[0].collectionName=="_superusers"&&n[0].id==n[4].id&&sg();return{c(){e=b("div"),H(t.$$.fragment),i=C(),s=b("div"),l=W(n[3]),o=C(),u&&u.c(),r=ke(),p(s,"class","txt txt-ellipsis"),p(e,"class","label")},m(f,c){w(f,e,c),q(t,e,null),v(e,i),v(e,s),v(s,l),w(f,o,c),u&&u.m(f,c),w(f,r,c),a=!0},p(f,c){const d={};c&8&&(d.value=f[3]),t.$set(d),(!a||c&8)&&se(l,f[3]),f[0].collectionName=="_superusers"&&f[0].id==f[4].id?u||(u=sg(),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&&(y(e),y(o),y(r)),j(t),u&&u.d(f)}}}function Q_(n,e){let t,i,s;return i=new df({props:{record:e[0],filename:e[19],size:"sm"}}),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[19]),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(i,l)}}}function x_(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function ZL(n){let e,t=ce(n[10].slice(0,n[12])),i=[];for(let s=0;sr[9]+r[7];for(let r=0;r500&&lg(n);return{c(){e=b("span"),i=W(t),s=C(),r&&r.c(),l=ke(),p(e,"class","txt")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=U.truncate(a[6],500,!0)+"")&&se(i,t),a[6].length>500?r?(r.p(a,u),u&8&&M(r,1)):(r=lg(a),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(oe(),D(r,1,1,()=>{r=null}),re())},i(a){o||(M(r),o=!0)},o(a){D(r),o=!1},d(a){a&&(y(e),y(s),y(l)),r&&r.d(a)}}}function eA(n){let e,t=U.truncate(n[6])+"",i;return{c(){e=b("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=U.truncate(s[6])+"")&&se(i,t)},i:te,o:te,d(s){s&&y(e)}}}function lg(n){let e,t;return e=new Oi({props:{value:JSON.stringify(n[3],null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function sg(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function tA(n){let e,t,i,s,l;const o=[JL,KL,YL,WL,BL,VL,UL,zL,HL,jL,qL,FL,RL,NL],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[1].type==="geoPoint"?11:f[2]?12:13)}function u(f,c){return c===1?PL(f):c===9?AL(f):c===10?LL(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ke()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),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(s.parentNode,s))},i(f){l||(M(i),l=!0)},o(f){D(i),l=!1},d(f){f&&y(s),r[t].d(f)}}}function nA(n,e,t){let i,s;Ge(n,Lr,u=>t(4,s=u));let{record:l}=e,{field:o}=e,{short:r=!1}=e;function a(u){Le.call(this,n,u)}return n.$$set=u=>{"record"in u&&t(0,l=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=l==null?void 0:l[o.name])},[l,o,r,i,s,a]}class Zy extends ve{constructor(e){super(),ye(this,e,nA,tA,be,{record:0,field:1,short:2})}}function og(n,e,t){const i=n.slice();return i[13]=e[t],i}function rg(n){let e,t,i=n[13].name+"",s,l,o,r,a,u;return r=new Zy({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=W(i),l=C(),o=b("td"),H(r.$$.fragment),a=C(),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(f,c){w(f,e,c),v(e,t),v(t,s),v(e,l),v(e,o),q(r,o,null),v(e,a),u=!0},p(f,c){(!u||c&1)&&i!==(i=f[13].name+"")&&se(s,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&&y(e),j(r)}}}function iA(n){var r;let e,t,i,s=ce((r=n[0])==null?void 0:r.fields),l=[];for(let a=0;aD(l[a],1,1,()=>{l[a]=null});return{c(){e=b("table"),t=b("tbody");for(let a=0;aClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[7]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function oA(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[sA],header:[lA],default:[iA]},$$scope:{ctx:n}};return e=new ln({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.class="record-preview-panel "+(s[5]?"overlay-panel-xl":"overlay-panel-lg")),l&65561&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[8](null),j(e,s)}}}function rA(n,e,t){let i,{collection:s}=e,l,o={},r=!1;function a(_){return f(_),l==null?void 0:l.show()}function u(){return t(4,r=!1),l==null?void 0:l.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 he.collection(s.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),Mi(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){ne[_?"unshift":"push"](()=>{l=_,t(2,l)})}function h(_){Le.call(this,n,_)}function g(_){Le.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,s=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=s==null?void 0:s.fields)!=null&&_.find(k=>k.type==="editor")))},[s,u,l,o,r,i,a,d,m,h,g]}class aA extends ve{constructor(e){super(),ye(this,e,rA,oA,be,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function uA(n){let e,t,i,s;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Oe(t=Re.call(null,e,{text:n[0].join(` `),position:"left"})),i=!0)},p(l,[o]){t&&Lt(t.update)&&o&1&&t.update.call(null,{text:l[0].join(` -`),position:"left"})},i:te,o:te,d(l){l&&y(e),i=!1,s()}}}const uA="yyyy-MM-dd HH:mm:ss.SSS";function fA(n,e,t){let i,s;Ge(n,In,a=>t(2,s=a));let{record:l}=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(l[u.name],uA)+" Local")}return n.$$set=a=>{"record"in a&&t(1,l=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=l&&s.find(a=>a.id==l.collectionId)),n.$$.dirty&2&&l&&r()},[o,l,s]}class cA extends ve{constructor(e){super(),ye(this,e,fA,aA,be,{record:1})}}function rg(n,e,t){const i=n.slice();return i[9]=e[t],i}function dA(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function pA(n){let e,t=ce(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ag(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,_,g,h,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),l=C(),o=b("span"),a=W(r),u=C(),f=b("div"),c=W("ID: "),m=W(d),_=C(),g=b("button"),g.innerHTML='',h=C(),wn(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(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){w(T,e,O),v(e,t),v(t,i),v(e,l),v(e,o),v(o,a),v(e,u),v(e,f),v(f,c),v(f,m),v(e,_),v(e,g),v(e,h),k||(S=Y(g,"click",$),k=!0)},p(T,O){var E;n=T,O&2&&!wn(i.src,s="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",s),O&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),O&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(T){T&&y(e),k=!1,S()}}}function hA(n){let e;function t(l,o){var r;return l[2]?mA:(r=l[0])!=null&&r.id&&l[1].length?pA:dA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function _A(n,e,t){const i=wt();let{record:s}=e,l=[],o=!1;function r(d){return af.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(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await he.collection("_externalAuths").getFullList({filter:he.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:s.collectionId,recordId:s.id})}))}catch(d){he.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||yn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>he.collection("_externalAuths").delete(d.id).then(()=>{nn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{he.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class gA extends ve{constructor(e){super(),ye(this,e,_A,hA,be,{record:0})}}function bA(n){let e,t,i,s,l,o,r,a,u,f;return l=new Oi({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),s=C(),H(l.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-175mmkj"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),v(e,t),v(t,i),n[6](t),v(e,s),q(l,e,null),v(e,o),v(e,r),a=!0,u||(f=[Oe(Re.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),l.$set(m)},i(c){a||(M(l.$$.fragment,c),a=!0)},o(c){D(l.$$.fragment,c),a=!1},d(c){c&&y(e),n[6](null),j(l),u=!1,Ee(f)}}}function kA(n){let e,t,i,s,l,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[bA]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Dn({props:d}),ne.push(()=>ge(s,"active",c)),s.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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-175mmkj")},m(m,_){w(m,e,_),v(e,t),v(e,i),q(s,e,null),a=!0,u||(f=Oe(r=Re.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[_]){const g={};_&518&&(g.$$scope={dirty:_,ctx:m}),!l&&_&8&&(l=!0,g.active=m[3],$e(()=>l=!1)),s.$set(g),(!a||_&1&&o!==(o="btn btn-circle "+m[0]+" svelte-175mmkj"))&&p(e,"class",o),r&&Lt(r.update)&&_&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(s.$$.fragment,m),a=!0)},o(m){D(s.$$.fragment,m),a=!1},d(m){m&&y(e),j(s),u=!1,f()}}}function yA(n,e,t){const i=wt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=U.randomSecret(l)),i("generate",o),await _n(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ne[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,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class vA extends ve{constructor(e){super(),ye(this,e,yA,kA,be,{class:0,length:5})}}function ug(n){let e,t,i,s,l=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=W("Public: "),o=W(l),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){w(f,e,c),v(e,t),v(t,i),v(i,s),v(i,o),a||(u=[Oe(Re.call(null,t,{text:"Make email public or private",position:"top-right"})),Y(t,"click",it(n[7]))],a=!0)},p(f,c){c&1&&l!==(l=f[0].emailVisibility?"On":"Off")&&se(o,l),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&y(e),a=!1,Ee(u)}}}function wA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=!n[5]&&ug(n);return{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=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(_,g){w(_,e,g),v(e,t),v(e,i),v(e,s),w(_,o,g),m&&m.m(_,g),w(_,r,g),w(_,a,g),me(a,n[0].email),n[1]&&a.focus(),c||(d=Y(a,"input",n[8]),c=!0)},p(_,g){g&16384&&l!==(l=_[14])&&p(e,"for",l),_[5]?m&&(m.d(1),m=null):m?m.p(_,g):(m=ug(_),m.c(),m.m(r.parentNode,r)),g&2&&(a.autofocus=_[1]),g&16384&&u!==(u=_[14])&&p(a,"id",u),g&16&&f!==(f=_[4].required)&&(a.required=f),g&1&&a.value!==_[0].email&&me(a,_[0].email)},d(_){_&&(y(e),y(o),y(r),y(a)),m&&m.d(_),c=!1,d()}}}function fg(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[SA,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&49156&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function SA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function cg(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[TA,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[$A,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){w(f,e,c),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&x(t,"p-t-xs",f[2])},i(f){u||(M(s.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(s.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),j(s),j(r),f&&a&&a.end()}}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_;return c=new vA({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),H(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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,h){w(g,e,h),v(e,t),v(e,i),v(e,s),w(g,o,h),w(g,r,h),me(r,n[0].password),w(g,u,h),w(g,f,h),q(c,f,null),d=!0,m||(_=Y(r,"input",n[10]),m=!0)},p(g,h){(!d||h&16384&&l!==(l=g[14]))&&p(e,"for",l),(!d||h&16384&&a!==(a=g[14]))&&p(r,"id",a),h&1&&r.value!==g[0].password&&me(r,g[0].password);const k={};h&8&&(k.length=Math.max(15,g[3].min||0)),c.$set(k)},i(g){d||(M(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(y(e),y(o),y(r),y(u),y(f)),j(c),m=!1,_()}}}function $A(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[11]),u=!0)},p(c,d){d&16384&&l!==(l=c[14])&&p(e,"for",l),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&me(r,c[0].passwordConfirm)},d(c){c&&(y(e),y(o),y(r)),u=!1,f()}}}function dg(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[CA,({uniqueId:s})=>({14:s}),({uniqueId:s})=>s?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-lg-12")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&49155&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),v(s,l),r||(a=[Y(e,"change",n[12]),Y(e,"change",it(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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,Ee(a)}}}function OA(n){var d;let e,t,i,s,l,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[wA,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&fg(n),f=(n[1]||n[2])&&cg(n),c=!n[5]&&dg(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(l,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,_){w(m,e,_),v(e,t),q(i,t,null),v(e,s),v(e,l),u&&u.m(l,null),v(l,o),f&&f.m(l,null),v(e,r),c&&c.m(e,null),a=!0},p(m,[_]){var h;const g={};_&16&&(g.class="form-field "+((h=m[4])!=null&&h.required?"required":"")),_&49203&&(g.$$scope={dirty:_,ctx:m}),i.$set(g),m[1]?u&&(oe(),D(u,1,1,()=>{u=null}),re()):u?(u.p(m,_),_&2&&M(u,1)):(u=fg(m),u.c(),M(u,1),u.m(l,o)),m[1]||m[2]?f?(f.p(m,_),_&6&&M(f,1)):(f=cg(m),f.c(),M(f,1),f.m(l,null)):f&&(oe(),D(f,1,1,()=>{f=null}),re()),m[5]?c&&(oe(),D(c,1,1,()=>{c=null}),re()):c?(c.p(m,_),_&32&&M(c,1)):(c=dg(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&&y(e),j(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function MA(n,e,t){let i,s,l,{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 _(){o.passwordConfirm=this.value,t(0,o),t(2,u)}function g(){o.verified=this.checked,t(0,o),t(2,u)}const h=k=>{a||yn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,s=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,l=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Wn("password"),Wn("passwordConfirm")))},[o,a,u,l,s,i,r,f,c,d,m,_,g,h]}class EA extends ve{constructor(e){super(),ye(this,e,MA,OA,be,{record:0,collection:6,isNew:1})}}function pg(n){let e;function t(l,o){return l[1].primaryKey?IA:DA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function DA(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[1].type))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t=U.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function IA(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function mg(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function LA(n){let e,t,i,s=n[1].name+"",l,o,r,a,u=n[2]&&pg(n),f=n[1].hidden&&mg();const c=n[4].default,d=Nt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),l=W(s),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,_){w(m,e,_),u&&u.m(e,null),v(e,t),v(e,i),v(i,l),v(e,o),f&&f.m(e,null),v(e,r),d&&d.m(e,null),a=!0},p(m,[_]){m[2]?u?u.p(m,_):(u=pg(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||_&2)&&s!==(s=m[1].name+"")&&se(l,s),m[1].hidden?f||(f=mg(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||_&8)&&Ft(d,c,m,m[3],a?Rt(c,m[3],_,null):qt(m[3]),null),(!a||_&1)&&p(e,"for",m[0])},i(m){a||(M(d,m),a=!0)},o(m){D(d,m),a=!1},d(m){m&&y(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function AA(n,e,t){let{$$slots:i={},$$scope:s}=e,{uniqueId:l}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,l=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,s=a.$$scope)},[l,o,r,s,i]}class Kn extends ve{constructor(e){super(),ye(this,e,AA,LA,be,{uniqueId:0,field:1,icon:2})}}function PA(n){let e,t,i,s,l,o,r;return s=new Kn({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),H(s.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){w(a,e,u),e.checked=n[0],w(a,i,u),q(s,a,u),l=!0,o||(r=Y(e,"change",n[2]),o=!0)},p(a,u){(!l||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]),s.$set(f)},i(a){l||(M(s.$$.fragment,a),l=!0)},o(a){D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(i)),j(s,a),o=!1,r()}}}function NA(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[PA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RA(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class FA extends ve{constructor(e){super(),ye(this,e,RA,NA,be,{field:1,value:0})}}function hg(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),v(e,t),i||(s=[Oe(Re.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:te,d(l){l&&y(e),i=!1,Ee(s)}}}function qA(n){let e,t,i,s,l,o,r;e=new Kn({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&hg(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]),s=new uf({props:c}),ne.push(()=>ge(s,"value",u)),ne.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[3]),{c(){H(e.$$.fragment),t=C(),a&&a.c(),i=C(),H(s.$$.fragment)},m(d,m){q(e,d,m),w(d,t,m),a&&a.m(d,m),w(d,i,m),q(s,d,m),r=!0},p(d,m){const _={};m&256&&(_.uniqueId=d[8]),m&2&&(_.field=d[1]),e.$set(_),d[0]&&!d[1].required?a?a.p(d,m):(a=hg(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!l&&m&4&&(l=!0,g.value=d[2],$e(()=>l=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),s.$set(g)},i(d){r||(M(e.$$.fragment,d),M(s.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(s.$$.fragment,d),r=!1},d(d){d&&(y(t),y(i)),j(e,d),a&&a.d(d),j(s,d)}}}function jA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qA,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function HA(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class zA extends ve{constructor(e){super(),ye(this,e,HA,jA,be,{field:1,value:0})}}function _g(n,e,t){const i=n.slice();i[44]=e[t];const s=i[19](i[44]);return i[45]=s,i}function gg(n,e,t){const i=n.slice();return i[48]=e[t],i}function bg(n,e,t){const i=n.slice();return i[51]=e[t],i}function UA(n){let e,t,i=[],s=new Map,l,o,r,a,u,f,c,d,m,_,g,h=ce(n[7]);const k=S=>S[51].id;for(let S=0;SNew record
    ',c=C(),H(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){w(S,e,$),v(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function kg(n,e){let t,i=e[51].name+"",s,l,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),s=W(i),l=C(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),v(t,s),v(t,l),o||(r=Y(t,"click",it(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(s,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&y(t),o=!1,r()}}}function BA(n){var l;let e,t,i,s=((l=n[4])==null?void 0:l.length)&&yg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),v(e,t),v(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?s?s.p(o,r):(s=yg(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function WA(n){let e=[],t=new Map,i,s=ce(n[5]);const l=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[17])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function YA(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function KA(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),wn(e.src,t=he.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(s,l){w(s,e,l)},p(s,l){l[0]&32&&!wn(e.src,t=he.files.getURL(s[44],s[48],{thumb:"100x100"}))&&p(e,"src",t),l[0]&32&&i!==(i=s[48])&&p(e,"alt",i)},d(s){s&&y(e)}}}function vg(n){let e,t,i,s,l,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!U.hasImageExtension(f[48])),t?KA:YA}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),v(e,i),l||(o=[Oe(s=Re.call(null,e,n[48]+` +`),position:"left"})},i:te,o:te,d(l){l&&y(e),i=!1,s()}}}const fA="yyyy-MM-dd HH:mm:ss.SSS";function cA(n,e,t){let i,s;Ge(n,In,a=>t(2,s=a));let{record:l}=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(l[u.name],fA)+" Local")}return n.$$set=a=>{"record"in a&&t(1,l=a.record)},n.$$.update=()=>{n.$$.dirty&6&&(i=l&&s.find(a=>a.id==l.collectionId)),n.$$.dirty&2&&l&&r()},[o,l,s]}class dA extends ve{constructor(e){super(),ye(this,e,cA,uA,be,{record:1})}}function ag(n,e,t){const i=n.slice();return i[9]=e[t],i}function pA(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function mA(n){let e,t=ce(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ug(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,g,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),l=C(),o=b("span"),a=W(r),u=C(),f=b("div"),c=W("ID: "),m=W(d),h=C(),g=b("button"),g.innerHTML='',_=C(),wn(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(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){w(T,e,O),v(e,t),v(t,i),v(e,l),v(e,o),v(o,a),v(e,u),v(e,f),v(f,c),v(f,m),v(e,h),v(e,g),v(e,_),k||(S=Y(g,"click",$),k=!0)},p(T,O){var E;n=T,O&2&&!wn(i.src,s="./images/oauth2/"+((E=n[3](n[9].provider))==null?void 0:E.logo))&&p(i,"src",s),O&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),O&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(T){T&&y(e),k=!1,S()}}}function _A(n){let e;function t(l,o){var r;return l[2]?hA:(r=l[0])!=null&&r.id&&l[1].length?mA:pA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function gA(n,e,t){const i=wt();let{record:s}=e,l=[],o=!1;function r(d){return af.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(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await he.collection("_externalAuths").getFullList({filter:he.filter("collectionRef = {:collectionId} && recordRef = {:recordId}",{collectionId:s.collectionId,recordId:s.id})}))}catch(d){he.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||yn(`Do you really want to unlink the ${a(d.provider)} provider?`,()=>he.collection("_externalAuths").delete(d.id).then(()=>{nn(`Successfully unlinked the ${a(d.provider)} provider.`),i("unlink",d.provider),u()}).catch(m=>{he.error(m)}))}u();const c=d=>f(d);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class bA extends ve{constructor(e){super(),ye(this,e,gA,_A,be,{record:0})}}function kA(n){let e,t,i,s,l,o,r,a,u,f;return l=new Oi({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=W(n[1]),s=C(),H(l.$$.fragment),o=C(),r=b("i"),p(t,"class","secret svelte-175mmkj"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),v(e,t),v(t,i),n[6](t),v(e,s),q(l,e,null),v(e,o),v(e,r),a=!0,u||(f=[Oe(Re.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),l.$set(m)},i(c){a||(M(l.$$.fragment,c),a=!0)},o(c){D(l.$$.fragment,c),a=!1},d(c){c&&y(e),n[6](null),j(l),u=!1,Ee(f)}}}function yA(n){let e,t,i,s,l,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[kA]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Dn({props:d}),ne.push(()=>ge(s,"active",c)),s.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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-175mmkj")},m(m,h){w(m,e,h),v(e,t),v(e,i),q(s,e,null),a=!0,u||(f=Oe(r=Re.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const g={};h&518&&(g.$$scope={dirty:h,ctx:m}),!l&&h&8&&(l=!0,g.active=m[3],$e(()=>l=!1)),s.$set(g),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-175mmkj"))&&p(e,"class",o),r&&Lt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(M(s.$$.fragment,m),a=!0)},o(m){D(s.$$.fragment,m),a=!1},d(m){m&&y(e),j(s),u=!1,f()}}}function vA(n,e,t){const i=wt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=U.randomSecret(l)),i("generate",o),await _n(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){ne[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,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class wA extends ve{constructor(e){super(),ye(this,e,vA,yA,be,{class:0,length:5})}}function fg(n){let e,t,i,s,l=n[0].emailVisibility?"On":"Off",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=W("Public: "),o=W(l),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){w(f,e,c),v(e,t),v(t,i),v(i,s),v(i,o),a||(u=[Oe(Re.call(null,t,{text:"Make email public or private",position:"top-right"})),Y(t,"click",it(n[7]))],a=!0)},p(f,c){c&1&&l!==(l=f[0].emailVisibility?"On":"Off")&&se(o,l),c&1&&r!==(r="btn btn-sm btn-transparent "+(f[0].emailVisibility?"btn-success":"btn-hint"))&&p(t,"class",r)},d(f){f&&y(e),a=!1,Ee(u)}}}function SA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=!n[5]&&fg(n);return{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="email",o=C(),m&&m.c(),r=C(),a=b("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=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){w(h,e,g),v(e,t),v(e,i),v(e,s),w(h,o,g),m&&m.m(h,g),w(h,r,g),w(h,a,g),me(a,n[0].email),n[1]&&a.focus(),c||(d=Y(a,"input",n[8]),c=!0)},p(h,g){g&16384&&l!==(l=h[14])&&p(e,"for",l),h[5]?m&&(m.d(1),m=null):m?m.p(h,g):(m=fg(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&&me(a,h[0].email)},d(h){h&&(y(e),y(o),y(r),y(a)),m&&m.d(h),c=!1,d()}}}function cg(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[TA,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&49156&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function dg(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[$A,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[CA,({uniqueId:f})=>({14:f}),({uniqueId:f})=>f?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){w(f,e,c),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&49161&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&49153&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&x(t,"p-t-xs",f[2])},i(f){u||(M(s.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(s.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),j(s),j(r),f&&a&&a.end()}}}function $A(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return c=new wA({props:{length:Math.max(15,n[3].min||0)}}),{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="Password",o=C(),r=b("input"),u=C(),f=b("div"),H(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=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,_){w(g,e,_),v(e,t),v(e,i),v(e,s),w(g,o,_),w(g,r,_),me(r,n[0].password),w(g,u,_),w(g,f,_),q(c,f,null),d=!0,m||(h=Y(r,"input",n[10]),m=!0)},p(g,_){(!d||_&16384&&l!==(l=g[14]))&&p(e,"for",l),(!d||_&16384&&a!==(a=g[14]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&me(r,g[0].password);const k={};_&8&&(k.length=Math.max(15,g[3].min||0)),c.$set(k)},i(g){d||(M(c.$$.fragment,g),d=!0)},o(g){D(c.$$.fragment,g),d=!1},d(g){g&&(y(e),y(o),y(r),y(u),y(f)),j(c),m=!1,h()}}}function CA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="Password confirm",o=C(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[14]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[14]),r.required=!0},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[11]),u=!0)},p(c,d){d&16384&&l!==(l=c[14])&&p(e,"for",l),d&16384&&a!==(a=c[14])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&me(r,c[0].passwordConfirm)},d(c){c&&(y(e),y(o),y(r)),u=!1,f()}}}function pg(n){let e,t,i;return t=new fe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[OA,({uniqueId:s})=>({14:s}),({uniqueId:s})=>s?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","col-lg-12")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&49155&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function OA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),v(s,l),r||(a=[Y(e,"change",n[12]),Y(e,"change",it(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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,Ee(a)}}}function MA(n){var d;let e,t,i,s,l,o,r,a;i=new fe({props:{class:"form-field "+((d=n[4])!=null&&d.required?"required":""),name:"email",$$slots:{default:[SA,({uniqueId:m})=>({14:m}),({uniqueId:m})=>m?16384:0]},$$scope:{ctx:n}}});let u=!n[1]&&cg(n),f=(n[1]||n[2])&&dg(n),c=!n[5]&&pg(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),u&&u.c(),o=C(),f&&f.c(),r=C(),c&&c.c(),p(t,"class","col-lg-12"),p(l,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(m,h){w(m,e,h),v(e,t),q(i,t,null),v(e,s),v(e,l),u&&u.m(l,null),v(l,o),f&&f.m(l,null),v(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&&(oe(),D(u,1,1,()=>{u=null}),re()):u?(u.p(m,h),h&2&&M(u,1)):(u=cg(m),u.c(),M(u,1),u.m(l,o)),m[1]||m[2]?f?(f.p(m,h),h&6&&M(f,1)):(f=dg(m),f.c(),M(f,1),f.m(l,null)):f&&(oe(),D(f,1,1,()=>{f=null}),re()),m[5]?c&&(oe(),D(c,1,1,()=>{c=null}),re()):c?(c.p(m,h),h&32&&M(c,1)):(c=pg(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&&y(e),j(i),u&&u.d(),f&&f.d(),c&&c.d()}}}function EA(n,e,t){let i,s,l,{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 _=k=>{a||yn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,o.verified=!k.target.checked,o)})};return n.$$set=k=>{"record"in k&&t(0,o=k.record),"collection"in k&&t(6,r=k.collection),"isNew"in k&&t(1,a=k.isNew)},n.$$.update=()=>{var k,S;n.$$.dirty&64&&t(5,i=(r==null?void 0:r.name)=="_superusers"),n.$$.dirty&64&&t(4,s=((k=r==null?void 0:r.fields)==null?void 0:k.find($=>$.name=="email"))||{}),n.$$.dirty&64&&t(3,l=((S=r==null?void 0:r.fields)==null?void 0:S.find($=>$.name=="password"))||{}),n.$$.dirty&4&&(u||(t(0,o.password=void 0,o),t(0,o.passwordConfirm=void 0,o),Wn("password"),Wn("passwordConfirm")))},[o,a,u,l,s,i,r,f,c,d,m,h,g,_]}class DA extends ve{constructor(e){super(),ye(this,e,EA,MA,be,{record:0,collection:6,isNew:1})}}function mg(n){let e;function t(l,o){return l[1].primaryKey?LA:IA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function IA(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[1].type))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t=U.getFieldTypeIcon(i[1].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function LA(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function hg(n){let e;return{c(){e=b("small"),e.textContent="Hidden",p(e,"class","label label-sm label-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function AA(n){let e,t,i,s=n[1].name+"",l,o,r,a,u=n[2]&&mg(n),f=n[1].hidden&&hg();const c=n[4].default,d=Nt(c,n,n[3],null);return{c(){e=b("label"),u&&u.c(),t=C(),i=b("span"),l=W(s),o=C(),f&&f.c(),r=C(),d&&d.c(),p(i,"class","txt"),p(e,"for",n[0])},m(m,h){w(m,e,h),u&&u.m(e,null),v(e,t),v(e,i),v(i,l),v(e,o),f&&f.m(e,null),v(e,r),d&&d.m(e,null),a=!0},p(m,[h]){m[2]?u?u.p(m,h):(u=mg(m),u.c(),u.m(e,t)):u&&(u.d(1),u=null),(!a||h&2)&&s!==(s=m[1].name+"")&&se(l,s),m[1].hidden?f||(f=hg(),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d&&d.p&&(!a||h&8)&&Ft(d,c,m,m[3],a?Rt(c,m[3],h,null):qt(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&&y(e),u&&u.d(),f&&f.d(),d&&d.d(m)}}}function PA(n,e,t){let{$$slots:i={},$$scope:s}=e,{uniqueId:l}=e,{field:o}=e,{icon:r=!0}=e;return n.$$set=a=>{"uniqueId"in a&&t(0,l=a.uniqueId),"field"in a&&t(1,o=a.field),"icon"in a&&t(2,r=a.icon),"$$scope"in a&&t(3,s=a.$$scope)},[l,o,r,s,i]}class Kn extends ve{constructor(e){super(),ye(this,e,PA,AA,be,{uniqueId:0,field:1,icon:2})}}function NA(n){let e,t,i,s,l,o,r;return s=new Kn({props:{uniqueId:n[3],field:n[1],icon:!1}}),{c(){e=b("input"),i=C(),H(s.$$.fragment),p(e,"type","checkbox"),p(e,"id",t=n[3])},m(a,u){w(a,e,u),e.checked=n[0],w(a,i,u),q(s,a,u),l=!0,o||(r=Y(e,"change",n[2]),o=!0)},p(a,u){(!l||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]),s.$set(f)},i(a){l||(M(s.$$.fragment,a),l=!0)},o(a){D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(i)),j(s,a),o=!1,r()}}}function RA(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[NA,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FA(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class qA extends ve{constructor(e){super(),ye(this,e,FA,RA,be,{field:1,value:0})}}function _g(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),v(e,t),i||(s=[Oe(Re.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:te,d(l){l&&y(e),i=!1,Ee(s)}}}function jA(n){let e,t,i,s,l,o,r;e=new Kn({props:{uniqueId:n[8],field:n[1]}});let a=n[0]&&!n[1].required&&_g(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]),s=new uf({props:c}),ne.push(()=>ge(s,"value",u)),ne.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[3]),{c(){H(e.$$.fragment),t=C(),a&&a.c(),i=C(),H(s.$$.fragment)},m(d,m){q(e,d,m),w(d,t,m),a&&a.m(d,m),w(d,i,m),q(s,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=_g(d),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null);const g={};m&256&&(g.id=d[8]),!l&&m&4&&(l=!0,g.value=d[2],$e(()=>l=!1)),!o&&m&1&&(o=!0,g.formattedValue=d[0],$e(()=>o=!1)),s.$set(g)},i(d){r||(M(e.$$.fragment,d),M(s.$$.fragment,d),r=!0)},o(d){D(e.$$.fragment,d),D(s.$$.fragment,d),r=!1},d(d){d&&(y(t),y(i)),j(e,d),a&&a.d(d),j(s,d)}}}function HA(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jA,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zA(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class UA extends ve{constructor(e){super(),ye(this,e,zA,HA,be,{field:1,value:0})}}function gg(n,e,t){const i=n.slice();i[44]=e[t];const s=i[19](i[44]);return i[45]=s,i}function bg(n,e,t){const i=n.slice();return i[48]=e[t],i}function kg(n,e,t){const i=n.slice();return i[51]=e[t],i}function VA(n){let e,t,i=[],s=new Map,l,o,r,a,u,f,c,d,m,h,g,_=ce(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=kg(n,_,S),T=k($);s.set(T,i[S]=yg(T,$))}return a=new Rr({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Uu({props:{class:"files-list",vThreshold:100,$$slots:{default:[ZA]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=C(),H(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){w(S,e,$),v(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function yg(n,e){let t,i=e[51].name+"",s,l,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),s=W(i),l=C(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),v(t,s),v(t,l),o||(r=Y(t,"click",it(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(s,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&y(t),o=!1,r()}}}function WA(n){var l;let e,t,i,s=((l=n[4])==null?void 0:l.length)&&vg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=C(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),v(e,t),v(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?s?s.p(o,r):(s=vg(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function YA(n){let e=[],t=new Map,i,s=ce(n[5]);const l=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",it(n[17])),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function KA(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function JA(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),wn(e.src,t=he.files.getURL(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(s,l){w(s,e,l)},p(s,l){l[0]&32&&!wn(e.src,t=he.files.getURL(s[44],s[48],{thumb:"100x100"}))&&p(e,"src",t),l[0]&32&&i!==(i=s[48])&&p(e,"alt",i)},d(s){s&&y(e)}}}function wg(n){let e,t,i,s,l,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!U.hasImageExtension(f[48])),t?JA:KA}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=C(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),v(e,i),l||(o=[Oe(s=Re.call(null,e,n[48]+` (record: `+n[44].id+")")),Y(e,"click",it(function(){Lt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],l=!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))),s&&Lt(s.update)&&c[0]&32&&s.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&y(e),u.d(),l=!1,Ee(o)}}}function wg(n,e){let t,i,s=ce(e[45]),l=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function JA(n){let e,t;function i(r,a){if(r[15])return WA;if(!r[6])return BA}let s=i(n),l=s&&s(n),o=n[6]&&Sg();return{c(){l&&l.c(),e=C(),o&&o.c(),t=ke()},m(r,a){l&&l.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){s===(s=i(r))&&l?l.p(r,a):(l&&l.d(1),l=s&&s(r),l&&(l.c(),l.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&&(y(e),y(t)),l&&l.d(r),o&&o.d(r)}}}function ZA(n){let e,t,i,s;const l=[VA,UA],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function GA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&1&&se(t,i[0])},d(i){i&&y(e)}}}function Tg(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[XA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&8402944|s[1]&8388608&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XA(n){let e,t,i;function s(o){n[28](o)}let l={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(l.keyOfSelected=n[12]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QA(n){var _;let e,t,i,s=U.hasImageExtension((_=n[9])==null?void 0:_.name),l,o,r,a,u,f,c,d,m=s&&Tg(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),l=C(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,h){w(g,e,h),v(e,t),w(g,i,h),m&&m.m(g,h),w(g,l,h),w(g,o,h),v(o,r),v(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,h){var k;(!f||h[0]&64)&&(e.disabled=g[6]),h[0]&512&&(s=U.hasImageExtension((k=g[9])==null?void 0:k.name)),s?m?(m.p(g,h),h[0]&512&&M(m,1)):(m=Tg(g),m.c(),M(m,1),m.m(l.parentNode,l)):m&&(oe(),D(m,1,1,()=>{m=null}),re()),(!f||h[0]&2)&&se(a,g[1]),(!f||h[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&&(y(e),y(i),y(l),y(o)),m&&m.d(g),c=!1,Ee(d)}}}function xA(n){let e,t,i,s;const l=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[QA],header:[GA],default:[ZA]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ue));const f=wt(),c="file_picker_"+U.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:_=["image","document","video","audio","file"]}=e,g,h,k="",S=[],$=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,k="")}async function J(Ue=!1){if(A!=null&&A.id){t(6,O=!0),Ue&&F();try{const De=Ue?1:$+1,ot=U.getAllCollectionIdentifiers(A);let Ie=U.normalizeSearchFilter(k,ot)||"";Ie&&(Ie+=" && "),Ie+="("+L.map(nt=>`${nt.name}:length>0`).join("||")+")";let We="";A.type!="view"&&(We="-@rowid");const Te=await he.collection(A.id).getList(De,$g,{filter:Ie,sort:We,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=U.filterDuplicatesByKey(S.concat(Te.items))),$=Te.page,t(26,T=Te.items.length),t(6,O=!1)}catch(De){De.isAbort||(he.error(De),t(6,O=!1))}}}function V(){var De;let Ue=["100x100"];if((De=P==null?void 0:P.record)!=null&&De.id){for(const ot of L)if(U.toArray(P.record[ot.name]).includes(P.name)){Ue=Ue.concat(U.toArray(ot.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const ot of Ue)I.push({label:`${ot} thumb`,value:ot});N&&!Ue.includes(N)&&t(12,N="")}function Z(Ue){let De=[];for(const ot of L){const Ie=U.toArray(Ue[ot.name]);for(const We of Ie)_.includes(U.getFileType(We))&&De.push(We)}return De}function G(Ue,De){t(9,P={record:Ue,name:De})}function de(){o&&(f("submit",Object.assign({size:N},P)),z())}function pe(Ue){N=Ue,t(12,N)}const ae=Ue=>{t(8,A=Ue)},Ce=Ue=>t(4,k=Ue.detail),Ye=()=>h==null?void 0:h.show(),Ke=()=>{l&&J()};function ct(Ue){ne[Ue?"unshift":"push"](()=>{g=Ue,t(3,g)})}function et(Ue){Le.call(this,n,Ue)}function xe(Ue){Le.call(this,n,Ue)}function Be(Ue){ne[Ue?"unshift":"push"](()=>{h=Ue,t(10,h)})}const ut=Ue=>{U.removeByKey(S,"id",Ue.detail.record.id),S.unshift(Ue.detail.record),t(5,S);const De=Z(Ue.detail.record);De.length>0&&G(Ue.detail.record,De[0])},Bt=Ue=>{var De;((De=P==null?void 0:P.record)==null?void 0:De.id)==Ue.detail.id&&t(9,P={}),U.removeByKey(S,"id",Ue.detail.id),t(5,S)};return n.$$set=Ue=>{e=je(je({},e),Kt(Ue)),t(22,a=lt(e,r)),"title"in Ue&&t(0,d=Ue.title),"submitText"in Ue&&t(1,m=Ue.submitText),"fileTypes"in Ue&&t(24,_=Ue.fileTypes)},n.$$.update=()=>{var Ue;n.$$.dirty[0]&134217728&&t(7,E=u.filter(De=>De.type!=="view"&&!!U.toArray(De.fields).find(ot=>{var Ie,We;return ot.type==="file"&&!ot.protected&&(!((Ie=ot.mimeTypes)!=null&&Ie.length)||!!((We=ot.mimeTypes)!=null&&We.find(Te=>Te.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ue=A==null?void 0:A.fields)==null?void 0:Ue.filter(De=>De.type==="file"&&!De.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 k<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(De,ot)=>{var Ie;return(P==null?void 0:P.name)==ot&&((Ie=P==null?void 0:P.record)==null?void 0:Ie.id)==De.id}),n.$$.dirty[0]&32&&t(15,s=S.find(De=>Z(De).length>0)),n.$$.dirty[0]&67108928&&t(14,l=!O&&T==$g),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,g,k,S,O,E,A,P,h,I,N,o,l,s,i,B,J,Z,G,de,a,c,_,R,T,u,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt]}class tP extends ve{constructor(e){super(),ye(this,e,eP,xA,be,{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 nP(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function iP(n){let e,t,i;function s(o){n[6](o)}let l={id:n[11],conf:n[5]};return n[0]!==void 0&&(l.value=n[0]),e=new Pu({props:l}),ne.push(()=>ge(e,"value",s)),e.$on("init",n[7]),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function lP(n){let e,t,i,s,l,o;e=new Kn({props:{uniqueId:n[11],field:n[1]}});const r=[iP,nP],a=[];function u(f,c){return f[4]?0:1}return i=u(n),s=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),s.c(),l=ke()},m(f,c){q(e,f,c),w(f,t,c),a[i].m(f,c),w(f,l,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):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(e.$$.fragment,f),M(s),o=!0)},o(f){D(e.$$.fragment,f),D(s),o=!1},d(f){f&&(y(t),y(l)),j(e,f),a[i].d(f)}}}function sP(n){let e,t,i,s;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[lP,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let l={title:"Select an image",fileTypes:["image"]};return i=new tP({props:l}),n[8](i),i.$on("submit",n[9]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){q(e,o,r),w(o,t,r),q(i,o,r),s=!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){s||(M(e.$$.fragment,o),M(i.$$.fragment,o),s=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),s=!1},d(o){o&&y(t),j(e,o),n[8](null),j(i,o)}}}function oP(n,e,t){let i,{field:s}=e,{value:l=""}=e,o,r,a=!1,u=null;un(async()=>(typeof l>"u"&&t(0,l=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(_){l=_,t(0,l)}const c=_=>{t(3,r=_.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(_){ne[_?"unshift":"push"](()=>{o=_,t(2,o)})}const m=_=>{r==null||r.execCommand("InsertImage",!1,he.files.getURL(_.detail.record,_.detail.name,{thumb:_.detail.size}))};return n.$$set=_=>{"field"in _&&t(1,s=_.field),"value"in _&&t(0,l=_.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(U.defaultEditorOptions(),{convert_urls:s.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof l>"u"&&t(0,l="")},[l,s,o,r,a,i,f,c,d,m]}class rP extends ve{constructor(e){super(),ye(this,e,oP,sP,be,{field:1,value:0})}}function aP(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",s=n[3]),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function uP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[aP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function fP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class cP extends ve{constructor(e){super(),ye(this,e,fP,uP,be,{field:1,value:0})}}function dP(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&y(e)}}}function pP(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),wn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!wn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&y(e)}}}function mP(n){let e;function t(l,o){return l[2]?pP:dP}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function hP(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){U.hasImageExtension(s==null?void 0:s.name)?U.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class _P extends ve{constructor(e){super(),ye(this,e,hP,mP,be,{file:0,size:1})}}function Cg(n,e,t){const i=n.slice();return i[31]=e[t],i[33]=t,i}function Og(n,e,t){const i=n.slice();i[36]=e[t],i[33]=t;const s=i[2].includes(i[36]);return i[37]=s,i}function gP(n){let e,t,i;function s(){return n[19](n[36])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function bP(n){let e,t,i;function s(){return n[18](n[36])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,i()}}}function kP(n){let e,t,i,s,l,o,r=n[36]+"",a,u,f,c,d,m,_;i=new df({props:{record:n[3],filename:n[36]}});function g(){return n[16](n[36])}function h(){return n[17](n[36])}function k(T,O){return T[37]?bP:gP}let S=k(n),$=S(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("button"),a=W(r),f=C(),c=b("div"),$.c(),x(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(l,"class","content"),p(c,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m(T,O){w(T,e,O),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),v(o,a),v(e,f),v(e,c),$.m(c,null),d=!0,m||(_=[Y(o,"auxclick",g),Y(o,"click",h)],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)&&x(t,"fade",n[37]),(!d||O[0]&32)&&r!==(r=n[36]+"")&&se(a,r),(!d||O[0]&36&&u!==(u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")))&&p(o,"class",u),S===(S=k(n))&&$?$.p(n,O):($.d(1),$=S(n),$&&($.c(),$.m(c,null))),(!d||O[1]&8)&&x(e,"dragging",n[34]),(!d||O[1]&16)&&x(e,"dragover",n[35])},i(T){d||(M(i.$$.fragment,T),d=!0)},o(T){D(i.$$.fragment,T),d=!1},d(T){T&&y(e),j(i),$.d(),m=!1,Ee(_)}}}function Mg(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_uploaded",index:e[33],disabled:!e[6],$$slots:{default:[kP,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&44|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function yP(n){let e,t,i,s,l,o,r,a,u=n[31].name+"",f,c,d,m,_,g,h;i=new _P({props:{file:n[31]}});function k(){return n[21](n[33])}return{c(){e=b("div"),t=b("figure"),H(i.$$.fragment),s=C(),l=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=W(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"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"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m(S,$){w(S,e,$),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,d),v(e,m),_=!0,g||(h=[Oe(Re.call(null,m,"Remove file")),Y(m,"click",k)],g=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[31]),i.$set(T),(!_||$[0]&2)&&u!==(u=n[31].name+"")&&se(f,u),(!_||$[0]&2&&c!==(c=n[31].name))&&p(l,"title",c),(!_||$[1]&8)&&x(e,"dragging",n[34]),(!_||$[1]&16)&&x(e,"dragover",n[35])},i(S){_||(M(i.$$.fragment,S),_=!0)},o(S){D(i.$$.fragment,S),_=!1},d(S){S&&y(e),j(i),g=!1,Ee(h)}}}function Eg(n,e){let t,i,s,l;function o(a){e[22](a)}let r={group:e[4].name+"_new",index:e[33],disabled:!e[6],$$slots:{default:[yP,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function vP(n){let e,t,i,s=[],l=new Map,o,r=[],a=new Map,u,f,c,d,m,_,g,h,k,S,$,T;e=new Kn({props:{uniqueId:n[30],field:n[4]}});let O=ce(n[5]);const E=A=>A[36]+A[3].id;for(let A=0;AA[31].name+A[33];for(let A=0;A',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function ZA(n){let e,t;function i(r,a){if(r[15])return YA;if(!r[6])return WA}let s=i(n),l=s&&s(n),o=n[6]&&Tg();return{c(){l&&l.c(),e=C(),o&&o.c(),t=ke()},m(r,a){l&&l.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){s===(s=i(r))&&l?l.p(r,a):(l&&l.d(1),l=s&&s(r),l&&(l.c(),l.m(e.parentNode,e))),r[6]?o||(o=Tg(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(y(e),y(t)),l&&l.d(r),o&&o.d(r)}}}function GA(n){let e,t,i,s;const l=[BA,VA],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function XA(n){let e,t;return{c(){e=b("h4"),t=W(n[0])},m(i,s){w(i,e,s),v(e,t)},p(i,s){s[0]&1&&se(t,i[0])},d(i){i&&y(e)}}}function $g(n){let e,t;return e=new fe({props:{class:"form-field file-picker-size-select",$$slots:{default:[QA,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&8402944|s[1]&8388608&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QA(n){let e,t,i;function s(o){n[28](o)}let l={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(l.keyOfSelected=n[12]),e=new $n({props:l}),ne.push(()=>ge(e,"keyOfSelected",s)),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xA(n){var h;let e,t,i,s=U.hasImageExtension((h=n[9])==null?void 0:h.name),l,o,r,a,u,f,c,d,m=s&&$g(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),m&&m.c(),l=C(),o=b("button"),r=b("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){w(g,e,_),v(e,t),w(g,i,_),m&&m.m(g,_),w(g,l,_),w(g,o,_),v(o,r),v(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var k;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(s=U.hasImageExtension((k=g[9])==null?void 0:k.name)),s?m?(m.p(g,_),_[0]&512&&M(m,1)):(m=$g(g),m.c(),M(m,1),m.m(l.parentNode,l)):m&&(oe(),D(m,1,1,()=>{m=null}),re()),(!f||_[0]&2)&&se(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&&(y(e),y(i),y(l),y(o)),m&&m.d(g),c=!1,Ee(d)}}}function eP(n){let e,t,i,s;const l=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[xA],header:[XA],default:[GA]},$$scope:{ctx:n}};for(let a=0;at(27,u=Ue));const f=wt(),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,_,k="",S=[],$=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,k="")}async function J(Ue=!1){if(A!=null&&A.id){t(6,O=!0),Ue&&F();try{const De=Ue?1:$+1,ot=U.getAllCollectionIdentifiers(A);let Ie=U.normalizeSearchFilter(k,ot)||"";Ie&&(Ie+=" && "),Ie+="("+L.map(nt=>`${nt.name}:length>0`).join("||")+")";let We="";A.type!="view"&&(We="-@rowid");const Te=await he.collection(A.id).getList(De,Cg,{filter:Ie,sort:We,fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=U.filterDuplicatesByKey(S.concat(Te.items))),$=Te.page,t(26,T=Te.items.length),t(6,O=!1)}catch(De){De.isAbort||(he.error(De),t(6,O=!1))}}}function V(){var De;let Ue=["100x100"];if((De=P==null?void 0:P.record)!=null&&De.id){for(const ot of L)if(U.toArray(P.record[ot.name]).includes(P.name)){Ue=Ue.concat(U.toArray(ot.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const ot of Ue)I.push({label:`${ot} thumb`,value:ot});N&&!Ue.includes(N)&&t(12,N="")}function Z(Ue){let De=[];for(const ot of L){const Ie=U.toArray(Ue[ot.name]);for(const We of Ie)h.includes(U.getFileType(We))&&De.push(We)}return De}function G(Ue,De){t(9,P={record:Ue,name:De})}function de(){o&&(f("submit",Object.assign({size:N},P)),z())}function pe(Ue){N=Ue,t(12,N)}const ae=Ue=>{t(8,A=Ue)},Ce=Ue=>t(4,k=Ue.detail),Ye=()=>_==null?void 0:_.show(),Ke=()=>{l&&J()};function ct(Ue){ne[Ue?"unshift":"push"](()=>{g=Ue,t(3,g)})}function et(Ue){Le.call(this,n,Ue)}function xe(Ue){Le.call(this,n,Ue)}function Be(Ue){ne[Ue?"unshift":"push"](()=>{_=Ue,t(10,_)})}const ut=Ue=>{U.removeByKey(S,"id",Ue.detail.record.id),S.unshift(Ue.detail.record),t(5,S);const De=Z(Ue.detail.record);De.length>0&&G(Ue.detail.record,De[0])},Bt=Ue=>{var De;((De=P==null?void 0:P.record)==null?void 0:De.id)==Ue.detail.id&&t(9,P={}),U.removeByKey(S,"id",Ue.detail.id),t(5,S)};return n.$$set=Ue=>{e=je(je({},e),Kt(Ue)),t(22,a=lt(e,r)),"title"in Ue&&t(0,d=Ue.title),"submitText"in Ue&&t(1,m=Ue.submitText),"fileTypes"in Ue&&t(24,h=Ue.fileTypes)},n.$$.update=()=>{var Ue;n.$$.dirty[0]&134217728&&t(7,E=u.filter(De=>De.type!=="view"&&!!U.toArray(De.fields).find(ot=>{var Ie,We;return ot.type==="file"&&!ot.protected&&(!((Ie=ot.mimeTypes)!=null&&Ie.length)||!!((We=ot.mimeTypes)!=null&&We.find(Te=>Te.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(A!=null&&A.id)&&E.length>0&&t(8,A=E[0]),n.$$.dirty[0]&256&&(L=(Ue=A==null?void 0:A.fields)==null?void 0:Ue.filter(De=>De.type==="file"&&!De.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 k<"u"&&A!=null&&A.id&&g!=null&&g.isActive()&&J(!0),n.$$.dirty[0]&512&&t(16,i=(De,ot)=>{var Ie;return(P==null?void 0:P.name)==ot&&((Ie=P==null?void 0:P.record)==null?void 0:Ie.id)==De.id}),n.$$.dirty[0]&32&&t(15,s=S.find(De=>Z(De).length>0)),n.$$.dirty[0]&67108928&&t(14,l=!O&&T==Cg),n.$$.dirty[0]&576&&t(13,o=!O&&!!(P!=null&&P.name))},[d,m,z,g,k,S,O,E,A,P,_,I,N,o,l,s,i,B,J,Z,G,de,a,c,h,R,T,u,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt]}class nP extends ve{constructor(e){super(),ye(this,e,tP,eP,be,{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 iP(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function lP(n){let e,t,i;function s(o){n[6](o)}let l={id:n[11],conf:n[5]};return n[0]!==void 0&&(l.value=n[0]),e=new Pu({props:l}),ne.push(()=>ge(e,"value",s)),e.$on("init",n[7]),{c(){H(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],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function sP(n){let e,t,i,s,l,o;e=new Kn({props:{uniqueId:n[11],field:n[1]}});const r=[lP,iP],a=[];function u(f,c){return f[4]?0:1}return i=u(n),s=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),s.c(),l=ke()},m(f,c){q(e,f,c),w(f,t,c),a[i].m(f,c),w(f,l,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):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(e.$$.fragment,f),M(s),o=!0)},o(f){D(e.$$.fragment,f),D(s),o=!1},d(f){f&&(y(t),y(l)),j(e,f),a[i].d(f)}}}function oP(n){let e,t,i,s;e=new fe({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sP,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let l={title:"Select an image",fileTypes:["image"]};return i=new nP({props:l}),n[8](i),i.$on("submit",n[9]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(o,r){q(e,o,r),w(o,t,r),q(i,o,r),s=!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){s||(M(e.$$.fragment,o),M(i.$$.fragment,o),s=!0)},o(o){D(e.$$.fragment,o),D(i.$$.fragment,o),s=!1},d(o){o&&y(t),j(e,o),n[8](null),j(i,o)}}}function rP(n,e,t){let i,{field:s}=e,{value:l=""}=e,o,r,a=!1,u=null;un(async()=>(typeof l>"u"&&t(0,l=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){l=h,t(0,l)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){ne[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,he.files.getURL(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,s=h.field),"value"in h&&t(0,l=h.value)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=Object.assign(U.defaultEditorOptions(),{convert_urls:s.convertURLs,relative_urls:!1})),n.$$.dirty&1&&typeof l>"u"&&t(0,l="")},[l,s,o,r,a,i,f,c,d,m]}class aP extends ve{constructor(e){super(),ye(this,e,rP,oP,be,{field:1,value:0})}}function uP(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","email"),p(i,"id",s=n[3]),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function fP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[uP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function cP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class dP extends ve{constructor(e){super(),ye(this,e,cP,fP,be,{field:1,value:0})}}function pP(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&y(e)}}}function mP(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),wn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!wn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&y(e)}}}function hP(n){let e;function t(l,o){return l[2]?mP:pP}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){l&&y(e),s.d(l)}}}function _P(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){U.hasImageExtension(s==null?void 0:s.name)?U.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class gP extends ve{constructor(e){super(),ye(this,e,_P,hP,be,{file:0,size:1})}}function Og(n,e,t){const i=n.slice();return i[31]=e[t],i[33]=t,i}function Mg(n,e,t){const i=n.slice();i[36]=e[t],i[33]=t;const s=i[2].includes(i[36]);return i[37]=s,i}function bP(n){let e,t,i;function s(){return n[19](n[36])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Oe(Re.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,Ee(i)}}}function kP(n){let e,t,i;function s(){return n[18](n[36])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&y(e),t=!1,i()}}}function yP(n){let e,t,i,s,l,o,r=n[36]+"",a,u,f,c,d,m,h;i=new df({props:{record:n[3],filename:n[36]}});function g(){return n[16](n[36])}function _(){return n[17](n[36])}function k(T,O){return T[37]?kP:bP}let S=k(n),$=S(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("button"),a=W(r),f=C(),c=b("div"),$.c(),x(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(l,"class","content"),p(c,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m(T,O){w(T,e,O),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),v(o,a),v(e,f),v(e,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)&&x(t,"fade",n[37]),(!d||O[0]&32)&&r!==(r=n[36]+"")&&se(a,r),(!d||O[0]&36&&u!==(u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")))&&p(o,"class",u),S===(S=k(n))&&$?$.p(n,O):($.d(1),$=S(n),$&&($.c(),$.m(c,null))),(!d||O[1]&8)&&x(e,"dragging",n[34]),(!d||O[1]&16)&&x(e,"dragover",n[35])},i(T){d||(M(i.$$.fragment,T),d=!0)},o(T){D(i.$$.fragment,T),d=!1},d(T){T&&y(e),j(i),$.d(),m=!1,Ee(h)}}}function Eg(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_uploaded",index:e[33],disabled:!e[6],$$slots:{default:[yP,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&44|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function vP(n){let e,t,i,s,l,o,r,a,u=n[31].name+"",f,c,d,m,h,g,_;i=new gP({props:{file:n[31]}});function k(){return n[21](n[33])}return{c(){e=b("div"),t=b("figure"),H(i.$$.fragment),s=C(),l=b("div"),o=b("small"),o.textContent="New",r=C(),a=b("span"),f=W(u),d=C(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"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"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m(S,$){w(S,e,$),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,d),v(e,m),h=!0,g||(_=[Oe(Re.call(null,m,"Remove file")),Y(m,"click",k)],g=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[31]),i.$set(T),(!h||$[0]&2)&&u!==(u=n[31].name+"")&&se(f,u),(!h||$[0]&2&&c!==(c=n[31].name))&&p(l,"title",c),(!h||$[1]&8)&&x(e,"dragging",n[34]),(!h||$[1]&16)&&x(e,"dragover",n[35])},i(S){h||(M(i.$$.fragment,S),h=!0)},o(S){D(i.$$.fragment,S),h=!1},d(S){S&&y(e),j(i),g=!1,Ee(_)}}}function Dg(n,e){let t,i,s,l;function o(a){e[22](a)}let r={group:e[4].name+"_new",index:e[33],disabled:!e[6],$$slots:{default:[vP,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function wP(n){let e,t,i,s=[],l=new Map,o,r=[],a=new Map,u,f,c,d,m,h,g,_,k,S,$,T;e=new Kn({props:{uniqueId:n[30],field:n[4]}});let O=ce(n[5]);const E=A=>A[36]+A[3].id;for(let A=0;AA[31].name+A[33];for(let A=0;A({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),q(t,e,null),i=!0,s||(l=[Y(e,"dragover",it(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + `,name:n[4].name,$$slots:{default:[wP,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),q(t,e,null),i=!0,s||(l=[Y(e,"dragover",it(n[27])),Y(e,"dragleave",n[28]),Y(e,"drop",n[14])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` form-field form-field-list form-field-file `+(o[4].required?"required":"")+` `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&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&&y(e),j(t),s=!1,Ee(l)}}}function SP(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1;function _(V){U.removeByValue(f,V),t(2,f)}function g(V){U.pushUnique(f,V),t(2,f)}function h(V){U.isEmpty(u[V])||u.splice(V,1),t(1,u)}function k(){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(!(l||!Z.length)){for(const de of Z){const pe=s.length+u.length-f.length;if(r.maxSelect<=pe)break;u.push(de)}t(1,u)}}async function $(V){try{let Z=await he.getSuperuserFileToken(o.collectionId),G=he.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>$(V),O=V=>$(V),E=V=>_(V),L=V=>g(V);function I(V){a=V,t(0,a),t(6,i),t(4,r)}const A=V=>h(V);function P(V){u=V,t(1,u)}function N(V){ne[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){ne[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,s=U.toArray(a)),n.$$.dirty[0]&54&&t(10,l=(s.length||u.length)&&r.maxSelect<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&k()},[a,u,f,o,r,s,i,c,d,m,l,_,g,h,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J]}class TP extends ve{constructor(e){super(),ye(this,e,SP,wP,be,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function $P(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function CP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function OP(n){let e,t,i,s;function l(a,u){return a[4]?CP:$P}let o=l(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){w(a,e,u),r.m(e,null),i||(s=Oe(t=Re.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=l(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&Lt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,s()}}}function MP(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function EP(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Ht(s,l(n)),e.$on("change",n[5])),{c(){e&&H(e.$$.fragment),t=ke()},m(o,r){e&&q(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){oe();const a=e;D(a.$$.fragment,1,0,()=>{j(a,1)}),re()}s?(e=Ht(s,l(o)),e.$on("change",o[5]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){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&&y(t),e&&j(e,o)}}}function DP(n){let e,t,i,s,l,o;e=new Kn({props:{uniqueId:n[6],field:n[1],$$slots:{default:[OP]},$$scope:{ctx:n}}});const r=[EP,MP],a=[];function u(f,c){return f[3]?0:1}return i=u(n),s=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),s.c(),l=ke()},m(f,c){q(e,f,c),w(f,t,c),a[i].m(f,c),w(f,l,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):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(e.$$.fragment,f),M(s),o=!0)},o(f){D(e.$$.fragment,f),D(s),o=!1},d(f){f&&(y(t),y(l)),j(e,f),a[i].d(f)}}}function IP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[DP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Dg(n){return typeof n=="string"&&Zy(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Zy(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function LP(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=Dg(l);un(async()=>{try{t(3,o=(await $t(async()=>{const{default:u}=await import("./CodeEditor-oVf9mPjW.js");return{default:u}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=Dg(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=Zy(r))},[l,s,r,o,i,a]}class AP extends ve{constructor(e){super(),ye(this,e,LP,IP,be,{field:1,value:0})}}function PP(n){let e,t,i,s,l,o,r,a,u,f;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",s=n[3]),i.required=l=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),w(c,t,d),w(c,i,d),me(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&&s!==(s=c[3]))&&p(i,"id",s),(!a||d&2&&l!==(l=c[1].required))&&(i.required=l),(!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&&mt(i.value)!==c[0]&&me(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),j(e,c),u=!1,f()}}}function NP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[PP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=mt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class FP extends ve{constructor(e){super(),ye(this,e,RP,NP,be,{field:1,value:0})}}function qP(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",s=n[3]),p(i,"autocomplete","new-password"),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function jP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[qP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function HP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class zP extends ve{constructor(e){super(),ye(this,e,HP,jP,be,{field:1,value:0})}}function Ig(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function UP(n,e){e=Ig(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=Ig(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Lg(n,e,t){const i=n.slice();return i[52]=e[t],i[54]=t,i}function Ag(n,e,t){const i=n.slice();i[52]=e[t];const s=i[10](i[52]);return i[6]=s,i}function Pg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Ng(n){let e,t=!n[14]&&Rg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Rg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Rg(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Fg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),v(e,t),v(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=Fg(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function Fg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function VP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function BP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function WP(n){let e,t;return e=new Ur({props:{record:n[52]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&256&&(l.record=i[52]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function YP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-xs active")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function qg(n){let e,t,i,s;function l(){return n[34](n[52])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),v(e,t),i||(s=[Oe(Re.call(null,t,"Edit")),Y(t,"keydown",tn(n[29])),Y(t,"click",tn(l))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ee(s)}}}function jg(n,e){let t,i,s,l,o,r,a,u,f;function c(T,O){return T[6]?BP:VP}let d=c(e),m=d(e);const _=[YP,WP],g=[];function h(T,O){return T[9][T[52].id]?0:1}l=h(e),o=g[l]=_[l](e);let k=!e[12]&&qg(e);function S(){return e[35](e[52])}function $(...T){return e[36](e[52],...T)}return{key:n,first:null,c(){t=b("div"),m.c(),i=C(),s=b("div"),o.c(),r=C(),k&&k.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",e[9][e[52].id]||!e[6]&&e[4]>1&&!e[11]),this.first=t},m(T,O){w(T,t,O),m.m(t,null),v(t,i),v(t,s),g[l].m(s,null),v(t,r),k&&k.m(t,null),a=!0,u||(f=[Y(t,"click",S),Y(t,"keydown",$)],u=!0)},p(T,O){e=T,d!==(d=c(e))&&(m.d(1),m=d(e),m&&(m.c(),m.m(t,i)));let E=l;l=h(e),l===E?g[l].p(e,O):(oe(),D(g[E],1,1,()=>{g[E]=null}),re(),o=g[l],o?o.p(e,O):(o=g[l]=_[l](e),o.c()),M(o,1),o.m(s,null)),e[12]?k&&(k.d(1),k=null):k?k.p(e,O):(k=qg(e),k.c(),k.m(t,null)),(!a||O[0]&1280)&&x(t,"selected",e[6]),(!a||O[0]&3856)&&x(t,"disabled",e[9][e[52].id]||!e[6]&&e[4]>1&&!e[11])},i(T){a||(M(o),a=!0)},o(T){D(o),a=!1},d(T){T&&y(t),m.d(),g[l].d(),k&&k.d(),u=!1,Ee(f)}}}function Hg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function zg(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=W("("),i=W(t),s=W(" of MAX "),l=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&(y(e),y(i),y(s),y(l),y(o))}}}function KP(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function JP(n){let e,t,i=ce(n[6]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){e=b("div");for(let o=0;o',o=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[55]),x(e,"label-warning",n[56])},m(_,g){w(_,e,g),c[t].m(e,null),v(e,s),v(e,l),w(_,o,g),r=!0,a||(u=Y(l,"click",m),a=!0)},p(_,g){n=_;let h=t;t=d(n),t===h?c[t].p(n,g):(oe(),D(c[h],1,1,()=>{c[h]=null}),re(),i=c[t],i?i.p(n,g):(i=c[t]=f[t](n),i.c()),M(i,1),i.m(e,s)),(!r||g[1]&16777216)&&x(e,"label-danger",n[55]),(!r||g[1]&33554432)&&x(e,"label-warning",n[56])},i(_){r||(M(i),r=!0)},o(_){D(i),r=!1},d(_){_&&(y(e),y(o)),c[t].d(),a=!1,u()}}}function Ug(n){let e,t,i;function s(o){n[40](o)}let l={index:n[54],$$slots:{default:[XP,({dragging:o,dragover:r})=>({55:o,56:r}),({dragging:o,dragover:r})=>[0,(o?16777216:0)|(r?33554432:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new hs({props:l}),ne.push(()=>ge(e,"list",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&576|r[1]&318767104&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function QP(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,m,_,g,h,k,S,$;t=new Rr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[32]);let T=!n[12]&&Pg(n),O=ce(n[8]);const E=z=>z[52].id;for(let z=0;z1&&zg(n);const P=[JP,KP],N=[];function R(z,F){return z[6].length?0:1}return _=R(n),g=N[_]=P[_](n),{c(){e=b("div"),H(t.$$.fragment),i=C(),T&&T.c(),s=C(),l=b("div");for(let z=0;z1?A?A.p(z,F):(A=zg(z),A.c(),A.m(c,null)):A&&(A.d(1),A=null);let J=_;_=R(z),_===J?N[_].p(z,F):(oe(),D(N[J],1,1,()=>{N[J]=null}),re(),g=N[_],g?g.p(z,F):(g=N[_]=P[_](z),g.c()),M(g,1),g.m(h.parentNode,h))},i(z){if(!k){M(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[30]),Y(i,"click",n[31])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function t7(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[21]];let o={$$slots:{footer:[e7],header:[xP],default:[QP]},$$scope:{ctx:n}};for(let a=0;at(28,m=Ne));const _=wt(),g="picker_"+U.randomString(5);let{value:h}=e,{field:k}=e,S,$,T="",O=[],E=[],L=1,I=0,A=!1,P=!1,N={};function R(){return t(2,T=""),t(8,O=[]),t(6,E=[]),B(),J(!0),S==null?void 0:S.show()}function z(){return S==null?void 0:S.hide()}function F(){var bt;let Ne=[];const Me=(bt=l==null?void 0:l.fields)==null?void 0:bt.filter(Ut=>!Ut.hidden&&Ut.presentable&&Ut.type=="relation");for(const Ut of Me)Ne=Ne.concat(U.getExpandPresentableRelFields(Ut,m,2));return Ne.join(",")}async function B(){const Ne=U.toArray(h);if(!s||!Ne.length)return;t(26,P=!0);let Me=[];const bt=Ne.slice(),Ut=[];for(;bt.length>0;){const Pt=[];for(const Pe of bt.splice(0,Jo))Pt.push(`id="${Pe}"`);Ut.push(he.collection(s).getFullList({batch:Jo,filter:Pt.join("||"),fields:"*:excerpt(200)",expand:F(),requestKey:null}))}try{await Promise.all(Ut).then(Pt=>{Me=Me.concat(...Pt)}),t(6,E=[]);for(const Pt of Ne){const Pe=U.findByKey(Me,"id",Pt);Pe&&E.push(Pe)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(26,P=!1)}catch(Pt){Pt.isAbort||(he.error(Pt),t(26,P=!1))}}async function J(Ne=!1){if(s){t(3,A=!0),Ne&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{const Me=Ne?1:L+1,bt=U.getAllCollectionIdentifiers(l);let Ut="";o||(Ut="-@rowid");const Pt=await he.collection(s).getList(Me,Jo,{filter:U.normalizeSearchFilter(T,bt),sort:Ut,fields:"*:excerpt(200)",skipTotal:1,expand:F(),requestKey:g+"loadList"});t(8,O=U.filterDuplicatesByKey(O.concat(Pt.items))),L=Pt.page,t(25,I=Pt.items.length),t(3,A=!1)}catch(Me){Me.isAbort||(he.error(Me),t(3,A=!1))}}}async function V(Ne){if(Ne!=null&&Ne.id){t(9,N[Ne.id]=!0,N);try{const Me=await he.collection(s).getOne(Ne.id,{fields:"*:excerpt(200)",expand:F(),requestKey:g+"reload"+Ne.id});U.pushOrReplaceByKey(E,Me),U.pushOrReplaceByKey(O,Me),t(6,E),t(8,O),t(9,N[Ne.id]=!1,N)}catch(Me){Me.isAbort||(he.error(Me),t(9,N[Ne.id]=!1,N))}}}function Z(Ne){i==1?t(6,E=[Ne]):u&&(U.pushOrReplaceByKey(E,Ne),t(6,E))}function G(Ne){U.removeByKey(E,"id",Ne.id),t(6,E)}function de(Ne){f(Ne)?G(Ne):Z(Ne)}function pe(){var Ne;i!=1?t(22,h=E.map(Me=>Me.id)):t(22,h=((Ne=E==null?void 0:E[0])==null?void 0:Ne.id)||""),_("save",E),z()}function ae(Ne){Le.call(this,n,Ne)}const Ce=()=>z(),Ye=()=>pe(),Ke=Ne=>t(2,T=Ne.detail),ct=()=>$==null?void 0:$.show(),et=Ne=>$==null?void 0:$.show(Ne.id),xe=Ne=>de(Ne),Be=(Ne,Me)=>{(Me.code==="Enter"||Me.code==="Space")&&(Me.preventDefault(),Me.stopPropagation(),de(Ne))},ut=()=>t(2,T=""),Bt=()=>{a&&!A&&J()},Ue=Ne=>G(Ne);function De(Ne){E=Ne,t(6,E)}function ot(Ne){ne[Ne?"unshift":"push"](()=>{S=Ne,t(1,S)})}function Ie(Ne){Le.call(this,n,Ne)}function We(Ne){Le.call(this,n,Ne)}function Te(Ne){ne[Ne?"unshift":"push"](()=>{$=Ne,t(7,$)})}const nt=Ne=>{U.removeByKey(O,"id",Ne.detail.record.id),O.unshift(Ne.detail.record),t(8,O),Z(Ne.detail.record),V(Ne.detail.record)},zt=Ne=>{U.removeByKey(O,"id",Ne.detail.id),t(8,O),G(Ne.detail)};return n.$$set=Ne=>{e=je(je({},e),Kt(Ne)),t(21,d=lt(e,c)),"value"in Ne&&t(22,h=Ne.value),"field"in Ne&&t(23,k=Ne.field)},n.$$.update=()=>{n.$$.dirty[0]&8388608&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&8388608&&t(27,s=k==null?void 0:k.collectionId),n.$$.dirty[0]&402653184&&t(5,l=m.find(Ne=>Ne.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&J(!0),n.$$.dirty[0]&32&&t(12,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&67108872&&t(14,r=A||P),n.$$.dirty[0]&33554432&&t(13,a=I==Jo),n.$$.dirty[0]&80&&t(11,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(10,f=function(Ne){return U.findByKey(E,"id",Ne.id)})},[z,S,T,A,i,l,E,$,O,N,f,u,o,a,r,J,V,Z,G,de,pe,d,h,k,R,I,P,s,m,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt]}class i7 extends ve{constructor(e){super(),ye(this,e,n7,t7,be,{value:22,field:23,show:24,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[24]}get hide(){return this.$$.ctx[0]}}function Vg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Bg(n,e,t){const i=n.slice();return i[27]=e[t],i}function Wg(n){let e,t,i,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Oe(t=Re.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(l,o){t&&Lt(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: "+l[6].join(", ")})},d(l){l&&y(e),i=!1,s()}}}function l7(n){let e,t=n[6].length&&Wg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[6].length?t?t.p(i,s):(t=Wg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Yg(n){let e,t=n[5]&&Kg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Kg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Kg(n){let e,t=ce(U.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function s7(n){let e,t,i,s,l,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[25]),x(e,"dragover",n[26])},m(d,m){w(d,e,m),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),w(d,r,m),a=!0,u||(f=[Oe(Re.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,m){n=d;const _={};m&16&&(_.record=n[22]),i.$set(_),(!a||m&33554432)&&x(e,"dragging",n[25]),(!a||m&67108864)&&x(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),j(i),u=!1,Ee(f)}}}function Zg(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[s7,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function o7(n){let e,t,i,s,l=[],o=new Map,r,a,u,f,c,d;e=new Kn({props:{uniqueId:n[21],field:n[2],$$slots:{default:[l7]},$$scope:{ctx:n}}});let m=ce(n[4]);const _=h=>h[22].id;for(let h=0;h Open picker',p(s,"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(h,k){q(e,h,k),w(h,t,k),w(h,i,k),v(i,s);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new i7({props:o}),n[16](i),i.$on("save",n[17]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&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){s||(M(e.$$.fragment,r),M(i.$$.fragment,r),s=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),s=!1},d(r){r&&y(t),n[15](null),j(e,r),n[16](null),j(i,r)}}}const Gg=100;function a7(n,e,t){let i,s;Ge(n,In,I=>t(18,s=I));let{field:l}=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 _(){var z,F;const I=U.toArray(o);if(t(4,u=[]),t(6,d=[]),!(l!=null&&l.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A=[];const P=(F=(z=s.find(B=>B.id==l.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(B=>!B.hidden&&B.presentable&&B.type=="relation");for(const B of P)A=A.concat(U.getExpandPresentableRelFields(B,s,2));const N=I.slice(),R=[];for(;N.length>0;){const B=[];for(const J of N.splice(0,Gg))B.push(`id="${J}"`);R.push(he.collection(l.collectionId).getFullList(Gg,{filter:B.join("||"),fields:"*:excerpt(200)",expand:A.join(","),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),h()}catch(B){he.error(B)}t(5,f=!1)}function g(I){U.removeByKey(u,"id",I.id),t(4,u),h()}function h(){var I;i?t(0,o=u.map(A=>A.id)):t(0,o=((I=u[0])==null?void 0:I.id)||"")}ro(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{h()},T=()=>r==null?void 0:r.show();function O(I){ne[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ne[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,l=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=l.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(_,0)))},[o,r,l,a,u,f,d,i,g,h,c,k,S,$,T,O,E,L]}class u7 extends ve{constructor(e){super(),ye(this,e,a7,r7,be,{field:2,value:0,picker:1})}}function Xg(n){let e,t,i,s;return{c(){e=b("div"),t=W("Select up to "),i=W(n[2]),s=W(" items."),p(e,"class","help-block")},m(l,o){w(l,e,o),v(e,t),v(e,i),v(e,s)},p(l,o){o&4&&se(i,l[2])},d(l){l&&y(e)}}}function f7(n){var c,d;let e,t,i,s,l,o,r;e=new Kn({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 ms({props:u}),ne.push(()=>ge(i,"selected",a));let f=n[3]&&Xg(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),f&&f.c(),o=ke()},m(m,_){q(e,m,_),w(m,t,_),q(i,m,_),w(m,l,_),f&&f.m(m,_),w(m,o,_),r=!0},p(m,_){var k,S;const g={};_&32&&(g.uniqueId=m[5]),_&2&&(g.field=m[1]),e.$set(g);const h={};_&32&&(h.id=m[5]),_&10&&(h.toggle=!m[1].required||m[3]),_&8&&(h.multiple=m[3]),_&11&&(h.closable=!m[3]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),_&2&&(h.items=m[1].values),_&2&&(h.searchable=((S=m[1].values)==null?void 0:S.length)>5),!s&&_&1&&(s=!0,h.selected=m[0],$e(()=>s=!1)),i.$set(h),m[3]?f?f.p(m,_):(f=Xg(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&&(y(t),y(l),y(o)),j(e,m),j(i,m),f&&f.d(m)}}}function c7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[f7,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function d7(n,e,t){let i,s,{field:l}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,l),t(2,s)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=l.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,s=l.maxSelect||l.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>l.values.includes(a))),o.length>s&&t(0,o=o.slice(o.length-s)))},[o,l,s,i,r]}class p7 extends ve{constructor(e){super(),ye(this,e,d7,c7,be,{field:1,value:0})}}function m7(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const _=r.closest("form");_!=null&&_.requestSubmit&&_.requestSubmit()}}un(()=>(u(),()=>clearTimeout(a)));function c(m){ne[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(3,s=lt(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class _7 extends ve{constructor(e){super(),ye(this,e,h7,m7,be,{value:0,maxHeight:4})}}function g7(n){let e,t,i,s,l;e=new Kn({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 _7({props:r}),ne.push(()=>ge(i,"value",o)),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),l=!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...":""),!s&&u&1&&(s=!0,c.value=a[0],$e(()=>s=!1)),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&&y(t),j(e,a),j(i,a)}}}function b7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[g7,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field "+(i[3]?"required":"")),s&2&&(l.name=i[1].name),s&207&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function k7(n,e,t){let i,s,{original:l}=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,l=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)&&!(l!=null&&l.id)),n.$$.dirty&6&&t(3,s=o.required&&!i)},[r,o,i,s,l,a]}class y7 extends ve{constructor(e){super(),ye(this,e,k7,b7,be,{original:4,field:1,value:0})}}function v7(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",s=n[3]),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function w7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v7,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S7(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class T7 extends ve{constructor(e){super(),ye(this,e,S7,w7,be,{field:1,value:0})}}function $7(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Longitude:"),s=C(),l=b("input"),p(e,"for",i=n[14]),p(l,"type","number"),p(l,"id",o=n[14]),l.required=r=n[1].required,p(l,"placeholder","0"),p(l,"step","any"),p(l,"min","-180"),p(l,"max","180")},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].lon),a||(u=Y(l,"input",n[7]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(l,"id",o),c&2&&r!==(r=f[1].required)&&(l.required=r),c&1&&mt(l.value)!==f[0].lon&&me(l,f[0].lon)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function C7(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Latitude:"),s=C(),l=b("input"),p(e,"for",i=n[14]),p(l,"type","number"),p(l,"id",o=n[14]),l.required=r=n[1].required,p(l,"placeholder","0"),p(l,"step","any"),p(l,"min","-90"),p(l,"max","90")},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].lat),a||(u=Y(l,"input",n[8]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(l,"id",o),c&2&&r!==(r=f[1].required)&&(l.required=r),c&1&&mt(l.value)!==f[0].lat&&me(l,f[0].lat)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function Qg(n){let e,t,i,s,l;const o=[M7,O7],r=[];function a(u,f){return u[3]?0:1}return t=a(n),i=r[t]=o[t](n),{c(){e=b("div"),i.c(),p(e,"class","block"),h0(e,"height","200px")},m(u,f){w(u,e,f),r[t].m(e,null),l=!0},p(u,f){let c=t;t=a(u),t===c?r[t].p(u,f):(oe(),D(r[c],1,1,()=>{r[c]=null}),re(),i=r[t],i?i.p(u,f):(i=r[t]=o[t](u),i.c()),M(i,1),i.m(e,null))},i(u){l||(M(i),u&&tt(()=>{l&&(s||(s=qe(e,ht,{duration:150},!0)),s.run(1))}),l=!0)},o(u){D(i),u&&(s||(s=qe(e,ht,{duration:150},!1)),s.run(0)),l=!1},d(u){u&&y(e),r[t].d(),u&&s&&s.end()}}}function O7(n){let e,t,i,s;function l(a){n[9](a)}var o=n[2];function r(a,u){let f={height:200};return a[0]!==void 0&&(f.point=a[0]),{props:f}}return o&&(e=Ht(o,r(n)),ne.push(()=>ge(e,"point",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&4&&o!==(o=a[2])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"point",l)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};!t&&u&1&&(t=!0,f.point=a[0],$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function M7(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center p-base")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function E7(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$;e=new Kn({props:{uniqueId:n[14],field:n[1]}}),l=new fe({props:{class:"form-field form-field-inline m-0",$$slots:{default:[$7,({uniqueId:O})=>({14:O}),({uniqueId:O})=>O?16384:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field form-field-inline m-0",$$slots:{default:[C7,({uniqueId:O})=>({14:O}),({uniqueId:O})=>O?16384:0]},$$scope:{ctx:n}}});let T=n[4]&&Qg(n);return{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("span"),a=C(),H(u.$$.fragment),f=C(),c=b("span"),d=C(),m=b("button"),_=b("i"),h=C(),T&&T.c(),p(r,"class","separator svelte-m6kyna"),p(c,"class","separator svelte-m6kyna"),p(_,"class","ri-map-2-line"),p(m,"type","button"),p(m,"class",g="btn btn-circle btn-sm btn-circle "+(n[4]?"btn-secondary":"btn-hint btn-transparent")),p(m,"aria-label","Toggle map"),p(s,"class","list-item svelte-m6kyna"),p(i,"class","list")},m(O,E){q(e,O,E),w(O,t,E),w(O,i,E),v(i,s),q(l,s,null),v(s,o),v(s,r),v(s,a),q(u,s,null),v(s,f),v(s,c),v(s,d),v(s,m),v(m,_),v(i,h),T&&T.m(i,null),k=!0,S||($=[Oe(Re.call(null,m,"Toggle map")),Y(m,"click",n[5])],S=!0)},p(O,E){const L={};E&16384&&(L.uniqueId=O[14]),E&2&&(L.field=O[1]),e.$set(L);const I={};E&49155&&(I.$$scope={dirty:E,ctx:O}),l.$set(I);const A={};E&49155&&(A.$$scope={dirty:E,ctx:O}),u.$set(A),(!k||E&16&&g!==(g="btn btn-circle btn-sm btn-circle "+(O[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(m,"class",g),O[4]?T?(T.p(O,E),E&16&&M(T,1)):(T=Qg(O),T.c(),M(T,1),T.m(i,null)):T&&(oe(),D(T,1,1,()=>{T=null}),re())},i(O){k||(M(e.$$.fragment,O),M(l.$$.fragment,O),M(u.$$.fragment,O),M(T),k=!0)},o(O){D(e.$$.fragment,O),D(l.$$.fragment,O),D(u.$$.fragment,O),D(T),k=!1},d(O){O&&(y(t),y(i)),j(e,O),j(l),j(u),T&&T.d(),S=!1,Ee($)}}}function D7(n){let e,t;return e=new fe({props:{class:"form-field form-field-list "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E7,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-list "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&49183&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function I7(n,e,t){let{original:i}=e,{field:s}=e,{value:l=void 0}=e,o,r=!1,a=!1;function u(){l.lat>90&&t(0,l.lat=90,l),l.lat<-90&&t(0,l.lat=-90,l),l.lon>180&&t(0,l.lon=180,l),l.lon<-180&&t(0,l.lon=-180,l)}function f(){a?d():c()}function c(){m(),t(4,a=!0)}function d(){t(4,a=!1)}async function m(){o||r||(t(3,r=!0),t(2,o=(await $t(async()=>{const{default:k}=await import("./Leaflet-D3mFU3hI.js");return{default:k}},__vite__mapDeps([14,15]),import.meta.url)).default),t(3,r=!1))}function _(){l.lon=mt(this.value),t(0,l)}function g(){l.lat=mt(this.value),t(0,l)}function h(k){l=k,t(0,l)}return n.$$set=k=>{"original"in k&&t(6,i=k.original),"field"in k&&t(1,s=k.field),"value"in k&&t(0,l=k.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof l>"u"&&t(0,l={lat:0,lon:0}),n.$$.dirty&1&&l&&u()},[l,s,o,r,a,f,i,_,g,h]}class L7 extends ve{constructor(e){super(),ye(this,e,I7,D7,be,{original:6,field:1,value:0})}}function xg(n,e,t){const i=n.slice();return i[6]=e[t],i}function e1(n,e,t){const i=n.slice();return i[6]=e[t],i}function t1(n,e){let t,i,s=e[6].title+"",l,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),l=W(s),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(f,c){w(f,t,c),v(t,i),v(i,l),v(t,o),r||(a=Y(t,"click",u),r=!0)},p(f,c){e=f,c&4&&s!==(s=e[6].title+"")&&se(l,s),c&6&&x(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function n1(n,e){let t,i,s,l,o,r,a=e[6].title+"",u,f,c,d,m;return i=new of({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("em"),r=b("a"),u=W(a),f=W(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(l,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(_,g){w(_,t,g),q(i,t,null),v(t,s),v(t,l),v(l,o),v(o,r),v(r,u),v(r,f),v(t,d),m=!0},p(_,g){e=_;const h={};g&4&&(h.language=e[6].language),g&4&&(h.content=e[6].content),i.$set(h),(!m||g&4)&&a!==(a=e[6].title+"")&&se(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&x(t,"active",e[1]===e[6].language)},i(_){m||(M(i.$$.fragment,_),m=!0)},o(_){D(i.$$.fragment,_),m=!1},d(_){_&&y(t),j(i)}}}function A7(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f,c=ce(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,s=u.class),"js"in u&&t(3,l=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(i1,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:l,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[s,r,i,l,o,a]}class N7 extends ve{constructor(e){super(),ye(this,e,P7,A7,be,{class:0,js:3,dart:4})}}function R7(n){let e,t,i,s,l,o=U.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[q7,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),s=W(`Generate a nonrenewable auth token for - `),l=b("strong"),r=W(o),a=W(":"),u=C(),H(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(_,g){w(_,e,g),v(e,t),v(t,i),v(i,s),v(i,l),v(l,r),v(l,a),v(e,u),q(f,e,null),c=!0,d||(m=Y(e,"submit",it(n[9])),d=!0)},p(_,g){(!c||g&2)&&o!==(o=U.displayValue(_[1])+"")&&se(r,o);const h={};g&3145761&&(h.$$scope={dirty:g,ctx:_}),f.$set(h)},i(_){c||(M(f.$$.fragment,_),c=!0)},o(_){D(f.$$.fragment,_),c=!1},d(_){_&&y(e),j(f),d=!1,m()}}}function F7(n){let e,t,i,s=n[3].authStore.token+"",l,o,r,a,u,f;return r=new Oi({props:{value:n[3].authStore.token}}),u=new N7({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&&y(e),j(t),s=!1,Ee(l)}}}function TP(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1;function h(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 k(){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(!(l||!Z.length)){for(const de of Z){const pe=s.length+u.length-f.length;if(r.maxSelect<=pe)break;u.push(de)}t(1,u)}}async function $(V){try{let Z=await he.getSuperuserFileToken(o.collectionId),G=he.files.getURL(o,V,{token:Z});window.open(G,"_blank","noreferrer, noopener")}catch(Z){console.warn("openInNewTab file token failure:",Z)}}const T=V=>$(V),O=V=>$(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){ne[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){ne[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,s=U.toArray(a)),n.$$.dirty[0]&54&&t(10,l=(s.length||u.length)&&r.maxSelect<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&k()},[a,u,f,o,r,s,i,c,d,m,l,h,g,_,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J]}class $P extends ve{constructor(e){super(),ye(this,e,TP,SP,be,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function CP(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function OP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function MP(n){let e,t,i,s;function l(a,u){return a[4]?OP:CP}let o=l(n),r=o(n);return{c(){e=b("span"),r.c(),p(e,"class","json-state svelte-p6ecb8")},m(a,u){w(a,e,u),r.m(e,null),i||(s=Oe(t=Re.call(null,e,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),i=!0)},p(a,u){o!==(o=l(a))&&(r.d(1),r=o(a),r&&(r.c(),r.m(e,null))),t&&Lt(t.update)&&u&16&&t.update.call(null,{position:"left",text:a[4]?"Valid JSON":"Invalid JSON"})},d(a){a&&y(e),r.d(),i=!1,s()}}}function EP(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function DP(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Ht(s,l(n)),e.$on("change",n[5])),{c(){e&&H(e.$$.fragment),t=ke()},m(o,r){e&&q(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){oe();const a=e;D(a.$$.fragment,1,0,()=>{j(a,1)}),re()}s?(e=Ht(s,l(o)),e.$on("change",o[5]),H(e.$$.fragment),M(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else if(s){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&&y(t),e&&j(e,o)}}}function IP(n){let e,t,i,s,l,o;e=new Kn({props:{uniqueId:n[6],field:n[1],$$slots:{default:[MP]},$$scope:{ctx:n}}});const r=[DP,EP],a=[];function u(f,c){return f[3]?0:1}return i=u(n),s=a[i]=r[i](n),{c(){H(e.$$.fragment),t=C(),s.c(),l=ke()},m(f,c){q(e,f,c),w(f,t,c),a[i].m(f,c),w(f,l,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):(oe(),D(a[m],1,1,()=>{a[m]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(e.$$.fragment,f),M(s),o=!0)},o(f){D(e.$$.fragment,f),D(s),o=!1},d(f){f&&(y(t),y(l)),j(e,f),a[i].d(f)}}}function LP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[IP,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Ig(n){return typeof n=="string"&&Gy(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function Gy(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function AP(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=Ig(l);un(async()=>{try{t(3,o=(await $t(async()=>{const{default:u}=await import("./CodeEditor-CTDCRa84.js");return{default:u}},__vite__mapDeps([13,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=Ig(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=Gy(r))},[l,s,r,o,i,a]}class PP extends ve{constructor(e){super(),ye(this,e,AP,LP,be,{field:1,value:0})}}function NP(n){let e,t,i,s,l,o,r,a,u,f;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","number"),p(i,"id",s=n[3]),i.required=l=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),w(c,t,d),w(c,i,d),me(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&&s!==(s=c[3]))&&p(i,"id",s),(!a||d&2&&l!==(l=c[1].required))&&(i.required=l),(!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&&mt(i.value)!==c[0]&&me(i,c[0])},i(c){a||(M(e.$$.fragment,c),a=!0)},o(c){D(e.$$.fragment,c),a=!1},d(c){c&&(y(t),y(i)),j(e,c),u=!1,f()}}}function RP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[NP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function FP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=mt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class qP extends ve{constructor(e){super(),ye(this,e,FP,RP,be,{field:1,value:0})}}function jP(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","password"),p(i,"id",s=n[3]),p(i,"autocomplete","new-password"),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function HP(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jP,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zP(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class UP extends ve{constructor(e){super(),ye(this,e,zP,HP,be,{field:1,value:0})}}function Lg(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function VP(n,e){e=Lg(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=Lg(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Ag(n,e,t){const i=n.slice();return i[52]=e[t],i[54]=t,i}function Pg(n,e,t){const i=n.slice();i[52]=e[t];const s=i[10](i[52]);return i[6]=s,i}function Ng(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Rg(n){let e,t=!n[14]&&Fg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[14]?t&&(t.d(1),t=null):t?t.p(i,s):(t=Fg(i),t.c(),t.m(e.parentNode,e))},d(i){i&&y(e),t&&t.d(i)}}}function Fg(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&qg(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=C(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),v(e,t),v(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=qg(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&y(e),s&&s.d()}}}function qg(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function BP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function WP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function YP(n){let e,t;return e=new Ur({props:{record:n[52]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&256&&(l.record=i[52]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function KP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-xs active")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function jg(n){let e,t,i,s;function l(){return n[34](n[52])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),v(e,t),i||(s=[Oe(Re.call(null,t,"Edit")),Y(t,"keydown",tn(n[29])),Y(t,"click",tn(l))],i=!0)},p(o,r){n=o},d(o){o&&y(e),i=!1,Ee(s)}}}function Hg(n,e){let t,i,s,l,o,r,a,u,f;function c(T,O){return T[6]?WP:BP}let d=c(e),m=d(e);const h=[KP,YP],g=[];function _(T,O){return T[9][T[52].id]?0:1}l=_(e),o=g[l]=h[l](e);let k=!e[12]&&jg(e);function S(){return e[35](e[52])}function $(...T){return e[36](e[52],...T)}return{key:n,first:null,c(){t=b("div"),m.c(),i=C(),s=b("div"),o.c(),r=C(),k&&k.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",e[9][e[52].id]||!e[6]&&e[4]>1&&!e[11]),this.first=t},m(T,O){w(T,t,O),m.m(t,null),v(t,i),v(t,s),g[l].m(s,null),v(t,r),k&&k.m(t,null),a=!0,u||(f=[Y(t,"click",S),Y(t,"keydown",$)],u=!0)},p(T,O){e=T,d!==(d=c(e))&&(m.d(1),m=d(e),m&&(m.c(),m.m(t,i)));let E=l;l=_(e),l===E?g[l].p(e,O):(oe(),D(g[E],1,1,()=>{g[E]=null}),re(),o=g[l],o?o.p(e,O):(o=g[l]=h[l](e),o.c()),M(o,1),o.m(s,null)),e[12]?k&&(k.d(1),k=null):k?k.p(e,O):(k=jg(e),k.c(),k.m(t,null)),(!a||O[0]&1280)&&x(t,"selected",e[6]),(!a||O[0]&3856)&&x(t,"disabled",e[9][e[52].id]||!e[6]&&e[4]>1&&!e[11])},i(T){a||(M(o),a=!0)},o(T){D(o),a=!1},d(T){T&&y(t),m.d(),g[l].d(),k&&k.d(),u=!1,Ee(f)}}}function zg(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Ug(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=W("("),i=W(t),s=W(" of MAX "),l=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(l,r[4])},d(r){r&&(y(e),y(i),y(s),y(l),y(o))}}}function JP(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function ZP(n){let e,t,i=ce(n[6]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){e=b("div");for(let o=0;o',o=C(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[55]),x(e,"label-warning",n[56])},m(h,g){w(h,e,g),c[t].m(e,null),v(e,s),v(e,l),w(h,o,g),r=!0,a||(u=Y(l,"click",m),a=!0)},p(h,g){n=h;let _=t;t=d(n),t===_?c[t].p(n,g):(oe(),D(c[_],1,1,()=>{c[_]=null}),re(),i=c[t],i?i.p(n,g):(i=c[t]=f[t](n),i.c()),M(i,1),i.m(e,s)),(!r||g[1]&16777216)&&x(e,"label-danger",n[55]),(!r||g[1]&33554432)&&x(e,"label-warning",n[56])},i(h){r||(M(i),r=!0)},o(h){D(i),r=!1},d(h){h&&(y(e),y(o)),c[t].d(),a=!1,u()}}}function Vg(n){let e,t,i;function s(o){n[40](o)}let l={index:n[54],$$slots:{default:[QP,({dragging:o,dragover:r})=>({55:o,56:r}),({dragging:o,dragover:r})=>[0,(o?16777216:0)|(r?33554432:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new hs({props:l}),ne.push(()=>ge(e,"list",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&576|r[1]&318767104&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function xP(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,m,h,g,_,k,S,$;t=new Rr({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[32]);let T=!n[12]&&Ng(n),O=ce(n[8]);const E=z=>z[52].id;for(let z=0;z1&&Ug(n);const P=[ZP,JP],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"),H(t.$$.fragment),i=C(),T&&T.c(),s=C(),l=b("div");for(let z=0;z1?A?A.p(z,F):(A=Ug(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):(oe(),D(N[J],1,1,()=>{N[J]=null}),re(),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(!k){M(t.$$.fragment,z);for(let F=0;FCancel',t=C(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[30]),Y(i,"click",n[31])],s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,Ee(l)}}}function n7(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[21]];let o={$$slots:{footer:[t7],header:[e7],default:[xP]},$$scope:{ctx:n}};for(let a=0;at(28,m=Ne));const h=wt(),g="picker_"+U.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",O=[],E=[],L=1,I=0,A=!1,P=!1,N={};function R(){return t(2,T=""),t(8,O=[]),t(6,E=[]),B(),J(!0),S==null?void 0:S.show()}function z(){return S==null?void 0:S.hide()}function F(){var bt;let Ne=[];const Me=(bt=l==null?void 0:l.fields)==null?void 0:bt.filter(Ut=>!Ut.hidden&&Ut.presentable&&Ut.type=="relation");for(const Ut of Me)Ne=Ne.concat(U.getExpandPresentableRelFields(Ut,m,2));return Ne.join(",")}async function B(){const Ne=U.toArray(_);if(!s||!Ne.length)return;t(26,P=!0);let Me=[];const bt=Ne.slice(),Ut=[];for(;bt.length>0;){const Pt=[];for(const Pe of bt.splice(0,Jo))Pt.push(`id="${Pe}"`);Ut.push(he.collection(s).getFullList({batch:Jo,filter:Pt.join("||"),fields:"*:excerpt(200)",expand:F(),requestKey:null}))}try{await Promise.all(Ut).then(Pt=>{Me=Me.concat(...Pt)}),t(6,E=[]);for(const Pt of Ne){const Pe=U.findByKey(Me,"id",Pt);Pe&&E.push(Pe)}T.trim()||t(8,O=U.filterDuplicatesByKey(E.concat(O))),t(26,P=!1)}catch(Pt){Pt.isAbort||(he.error(Pt),t(26,P=!1))}}async function J(Ne=!1){if(s){t(3,A=!0),Ne&&(T.trim()?t(8,O=[]):t(8,O=U.toArray(E).slice()));try{const Me=Ne?1:L+1,bt=U.getAllCollectionIdentifiers(l);let Ut="";o||(Ut="-@rowid");const Pt=await he.collection(s).getList(Me,Jo,{filter:U.normalizeSearchFilter(T,bt),sort:Ut,fields:"*:excerpt(200)",skipTotal:1,expand:F(),requestKey:g+"loadList"});t(8,O=U.filterDuplicatesByKey(O.concat(Pt.items))),L=Pt.page,t(25,I=Pt.items.length),t(3,A=!1)}catch(Me){Me.isAbort||(he.error(Me),t(3,A=!1))}}}async function V(Ne){if(Ne!=null&&Ne.id){t(9,N[Ne.id]=!0,N);try{const Me=await he.collection(s).getOne(Ne.id,{fields:"*:excerpt(200)",expand:F(),requestKey:g+"reload"+Ne.id});U.pushOrReplaceByKey(E,Me),U.pushOrReplaceByKey(O,Me),t(6,E),t(8,O),t(9,N[Ne.id]=!1,N)}catch(Me){Me.isAbort||(he.error(Me),t(9,N[Ne.id]=!1,N))}}}function Z(Ne){i==1?t(6,E=[Ne]):u&&(U.pushOrReplaceByKey(E,Ne),t(6,E))}function G(Ne){U.removeByKey(E,"id",Ne.id),t(6,E)}function de(Ne){f(Ne)?G(Ne):Z(Ne)}function pe(){var Ne;i!=1?t(22,_=E.map(Me=>Me.id)):t(22,_=((Ne=E==null?void 0:E[0])==null?void 0:Ne.id)||""),h("save",E),z()}function ae(Ne){Le.call(this,n,Ne)}const Ce=()=>z(),Ye=()=>pe(),Ke=Ne=>t(2,T=Ne.detail),ct=()=>$==null?void 0:$.show(),et=Ne=>$==null?void 0:$.show(Ne.id),xe=Ne=>de(Ne),Be=(Ne,Me)=>{(Me.code==="Enter"||Me.code==="Space")&&(Me.preventDefault(),Me.stopPropagation(),de(Ne))},ut=()=>t(2,T=""),Bt=()=>{a&&!A&&J()},Ue=Ne=>G(Ne);function De(Ne){E=Ne,t(6,E)}function ot(Ne){ne[Ne?"unshift":"push"](()=>{S=Ne,t(1,S)})}function Ie(Ne){Le.call(this,n,Ne)}function We(Ne){Le.call(this,n,Ne)}function Te(Ne){ne[Ne?"unshift":"push"](()=>{$=Ne,t(7,$)})}const nt=Ne=>{U.removeByKey(O,"id",Ne.detail.record.id),O.unshift(Ne.detail.record),t(8,O),Z(Ne.detail.record),V(Ne.detail.record)},zt=Ne=>{U.removeByKey(O,"id",Ne.detail.id),t(8,O),G(Ne.detail)};return n.$$set=Ne=>{e=je(je({},e),Kt(Ne)),t(21,d=lt(e,c)),"value"in Ne&&t(22,_=Ne.value),"field"in Ne&&t(23,k=Ne.field)},n.$$.update=()=>{n.$$.dirty[0]&8388608&&t(4,i=(k==null?void 0:k.maxSelect)||null),n.$$.dirty[0]&8388608&&t(27,s=k==null?void 0:k.collectionId),n.$$.dirty[0]&402653184&&t(5,l=m.find(Ne=>Ne.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&J(!0),n.$$.dirty[0]&32&&t(12,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&67108872&&t(14,r=A||P),n.$$.dirty[0]&33554432&&t(13,a=I==Jo),n.$$.dirty[0]&80&&t(11,u=i<=0||i>E.length),n.$$.dirty[0]&64&&t(10,f=function(Ne){return U.findByKey(E,"id",Ne.id)})},[z,S,T,A,i,l,E,$,O,N,f,u,o,a,r,J,V,Z,G,de,pe,d,_,k,R,I,P,s,m,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt]}class l7 extends ve{constructor(e){super(),ye(this,e,i7,n7,be,{value:22,field:23,show:24,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[24]}get hide(){return this.$$.ctx[0]}}function Bg(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Wg(n,e,t){const i=n.slice();return i[27]=e[t],i}function Yg(n){let e,t,i,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Oe(t=Re.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(l,o){t&&Lt(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: "+l[6].join(", ")})},d(l){l&&y(e),i=!1,s()}}}function s7(n){let e,t=n[6].length&&Yg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[6].length?t?t.p(i,s):(t=Yg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Kg(n){let e,t=n[5]&&Jg(n);return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Jg(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&y(e),t&&t.d(i)}}}function Jg(n){let e,t=ce(U.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function o7(n){let e,t,i,s,l,o,r,a,u,f;i=new Ur({props:{record:n[22]}});function c(){return n[11](n[22])}return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("button"),o.innerHTML='',r=C(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[25]),x(e,"dragover",n[26])},m(d,m){w(d,e,m),v(e,t),q(i,t,null),v(e,s),v(e,l),v(l,o),w(d,r,m),a=!0,u||(f=[Oe(Re.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)&&x(e,"dragging",n[25]),(!a||m&67108864)&&x(e,"dragover",n[26])},i(d){a||(M(i.$$.fragment,d),a=!0)},o(d){D(i.$$.fragment,d),a=!1},d(d){d&&(y(e),y(r)),j(i),u=!1,Ee(f)}}}function Gg(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[24],disabled:!e[7],$$slots:{default:[o7,({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 hs({props:r}),ne.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[24]),u&128&&(f.disabled=!e[7]),u&1174405136&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function r7(n){let e,t,i,s,l=[],o=new Map,r,a,u,f,c,d;e=new Kn({props:{uniqueId:n[21],field:n[2],$$slots:{default:[s7]},$$scope:{ctx:n}}});let m=ce(n[4]);const h=_=>_[22].id;for(let _=0;_ Open picker',p(s,"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(_,k){q(e,_,k),w(_,t,k),w(_,i,k),v(i,s);for(let S=0;S({21:r}),({uniqueId:r})=>r?2097152:0]},$$scope:{ctx:n}};e=new fe({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new l7({props:o}),n[16](i),i.$on("save",n[17]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&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){s||(M(e.$$.fragment,r),M(i.$$.fragment,r),s=!0)},o(r){D(e.$$.fragment,r),D(i.$$.fragment,r),s=!1},d(r){r&&y(t),n[15](null),j(e,r),n[16](null),j(i,r)}}}const Xg=100;function u7(n,e,t){let i,s;Ge(n,In,I=>t(18,s=I));let{field:l}=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=[]),!(l!=null&&l.collectionId)||!I.length){t(5,f=!1);return}t(5,f=!0);let A=[];const P=(F=(z=s.find(B=>B.id==l.collectionId))==null?void 0:z.fields)==null?void 0:F.filter(B=>!B.hidden&&B.presentable&&B.type=="relation");for(const B of P)A=A.concat(U.getExpandPresentableRelFields(B,s,2));const N=I.slice(),R=[];for(;N.length>0;){const B=[];for(const J of N.splice(0,Xg))B.push(`id="${J}"`);R.push(he.collection(l.collectionId).getFullList(Xg,{filter:B.join("||"),fields:"*:excerpt(200)",expand:A.join(","),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){he.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)||"")}ro(()=>{clearTimeout(c)});const k=I=>g(I);function S(I){u=I,t(4,u)}const $=()=>{_()},T=()=>r==null?void 0:r.show();function O(I){ne[I?"unshift":"push"](()=>{a=I,t(3,a)})}function E(I){ne[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,l=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=l.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,l,a,u,f,d,i,g,_,c,k,S,$,T,O,E,L]}class f7 extends ve{constructor(e){super(),ye(this,e,u7,a7,be,{field:2,value:0,picker:1})}}function Qg(n){let e,t,i,s;return{c(){e=b("div"),t=W("Select up to "),i=W(n[2]),s=W(" items."),p(e,"class","help-block")},m(l,o){w(l,e,o),v(e,t),v(e,i),v(e,s)},p(l,o){o&4&&se(i,l[2])},d(l){l&&y(e)}}}function c7(n){var c,d;let e,t,i,s,l,o,r;e=new Kn({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 ms({props:u}),ne.push(()=>ge(i,"selected",a));let f=n[3]&&Qg(n);return{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),l=C(),f&&f.c(),o=ke()},m(m,h){q(e,m,h),w(m,t,h),q(i,m,h),w(m,l,h),f&&f.m(m,h),w(m,o,h),r=!0},p(m,h){var k,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]||((k=m[0])==null?void 0:k.length)>=m[1].maxSelect),h&2&&(_.items=m[1].values),h&2&&(_.searchable=((S=m[1].values)==null?void 0:S.length)>5),!s&&h&1&&(s=!0,_.selected=m[0],$e(()=>s=!1)),i.$set(_),m[3]?f?f.p(m,h):(f=Qg(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&&(y(t),y(l),y(o)),j(e,m),j(i,m),f&&f.d(m)}}}function d7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[c7,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function p7(n,e,t){let i,s,{field:l}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(3,i),t(1,l),t(2,s)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{n.$$.dirty&2&&t(3,i=l.maxSelect>1),n.$$.dirty&9&&typeof o>"u"&&t(0,o=i?[]:""),n.$$.dirty&2&&t(2,s=l.maxSelect||l.values.length),n.$$.dirty&15&&i&&Array.isArray(o)&&(t(0,o=o.filter(a=>l.values.includes(a))),o.length>s&&t(0,o=o.slice(o.length-s)))},[o,l,s,i,r]}class m7 extends ve{constructor(e){super(),ye(this,e,p7,d7,be,{field:1,value:0})}}function h7(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}un(()=>(u(),()=>clearTimeout(a)));function c(m){ne[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=je(je({},e),Kt(m)),t(3,s=lt(e,i)),"value"in m&&t(0,l=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class g7 extends ve{constructor(e){super(),ye(this,e,_7,h7,be,{value:0,maxHeight:4})}}function b7(n){let e,t,i,s,l;e=new Kn({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 g7({props:r}),ne.push(()=>ge(i,"value",o)),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),l=!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...":""),!s&&u&1&&(s=!0,c.value=a[0],$e(()=>s=!1)),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&&y(t),j(e,a),j(i,a)}}}function k7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[3]?"required":""),name:n[1].name,$$slots:{default:[b7,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field "+(i[3]?"required":"")),s&2&&(l.name=i[1].name),s&207&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function y7(n,e,t){let i,s,{original:l}=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,l=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)&&!(l!=null&&l.id)),n.$$.dirty&6&&t(3,s=o.required&&!i)},[r,o,i,s,l,a]}class v7 extends ve{constructor(e){super(),ye(this,e,y7,k7,be,{original:4,field:1,value:0})}}function w7(n){let e,t,i,s,l,o,r,a;return e=new Kn({props:{uniqueId:n[3],field:n[1]}}),{c(){H(e.$$.fragment),t=C(),i=b("input"),p(i,"type","url"),p(i,"id",s=n[3]),i.required=l=n[1].required},m(u,f){q(e,u,f),w(u,t,f),w(u,i,f),me(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&&s!==(s=u[3]))&&p(i,"id",s),(!o||f&2&&l!==(l=u[1].required))&&(i.required=l),f&1&&i.value!==u[0]&&me(i,u[0])},i(u){o||(M(e.$$.fragment,u),o=!0)},o(u){D(e.$$.fragment,u),o=!1},d(u){u&&(y(t),y(i)),j(e,u),r=!1,a()}}}function S7(n){let e,t;return e=new fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[w7,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function T7(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class $7 extends ve{constructor(e){super(),ye(this,e,T7,S7,be,{field:1,value:0})}}function C7(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Longitude:"),s=C(),l=b("input"),p(e,"for",i=n[14]),p(l,"type","number"),p(l,"id",o=n[14]),l.required=r=n[1].required,p(l,"placeholder","0"),p(l,"step","any"),p(l,"min","-180"),p(l,"max","180")},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].lon),a||(u=Y(l,"input",n[7]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(l,"id",o),c&2&&r!==(r=f[1].required)&&(l.required=r),c&1&&mt(l.value)!==f[0].lon&&me(l,f[0].lon)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function O7(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Latitude:"),s=C(),l=b("input"),p(e,"for",i=n[14]),p(l,"type","number"),p(l,"id",o=n[14]),l.required=r=n[1].required,p(l,"placeholder","0"),p(l,"step","any"),p(l,"min","-90"),p(l,"max","90")},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),me(l,n[0].lat),a||(u=Y(l,"input",n[8]),a=!0)},p(f,c){c&16384&&i!==(i=f[14])&&p(e,"for",i),c&16384&&o!==(o=f[14])&&p(l,"id",o),c&2&&r!==(r=f[1].required)&&(l.required=r),c&1&&mt(l.value)!==f[0].lat&&me(l,f[0].lat)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function xg(n){let e,t,i,s,l;const o=[E7,M7],r=[];function a(u,f){return u[3]?0:1}return t=a(n),i=r[t]=o[t](n),{c(){e=b("div"),i.c(),p(e,"class","block"),_0(e,"height","200px")},m(u,f){w(u,e,f),r[t].m(e,null),l=!0},p(u,f){let c=t;t=a(u),t===c?r[t].p(u,f):(oe(),D(r[c],1,1,()=>{r[c]=null}),re(),i=r[t],i?i.p(u,f):(i=r[t]=o[t](u),i.c()),M(i,1),i.m(e,null))},i(u){l||(M(i),u&&tt(()=>{l&&(s||(s=qe(e,ht,{duration:150},!0)),s.run(1))}),l=!0)},o(u){D(i),u&&(s||(s=qe(e,ht,{duration:150},!1)),s.run(0)),l=!1},d(u){u&&y(e),r[t].d(),u&&s&&s.end()}}}function M7(n){let e,t,i,s;function l(a){n[9](a)}var o=n[2];function r(a,u){let f={height:200};return a[0]!==void 0&&(f.point=a[0]),{props:f}}return o&&(e=Ht(o,r(n)),ne.push(()=>ge(e,"point",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&4&&o!==(o=a[2])){if(e){oe();const f=e;D(f.$$.fragment,1,0,()=>{j(f,1)}),re()}o?(e=Ht(o,r(a)),ne.push(()=>ge(e,"point",l)),H(e.$$.fragment),M(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else if(o){const f={};!t&&u&1&&(t=!0,f.point=a[0],$e(()=>t=!1)),e.$set(f)}},i(a){s||(e&&M(e.$$.fragment,a),s=!0)},o(a){e&&D(e.$$.fragment,a),s=!1},d(a){a&&y(i),e&&j(e,a)}}}function E7(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center p-base")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function D7(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$;e=new Kn({props:{uniqueId:n[14],field:n[1]}}),l=new fe({props:{class:"form-field form-field-inline m-0",$$slots:{default:[C7,({uniqueId:O})=>({14:O}),({uniqueId:O})=>O?16384:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field form-field-inline m-0",$$slots:{default:[O7,({uniqueId:O})=>({14:O}),({uniqueId:O})=>O?16384:0]},$$scope:{ctx:n}}});let T=n[4]&&xg(n);return{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("span"),a=C(),H(u.$$.fragment),f=C(),c=b("span"),d=C(),m=b("button"),h=b("i"),_=C(),T&&T.c(),p(r,"class","separator svelte-m6kyna"),p(c,"class","separator svelte-m6kyna"),p(h,"class","ri-map-2-line"),p(m,"type","button"),p(m,"class",g="btn btn-circle btn-sm btn-circle "+(n[4]?"btn-secondary":"btn-hint btn-transparent")),p(m,"aria-label","Toggle map"),p(s,"class","list-item svelte-m6kyna"),p(i,"class","list")},m(O,E){q(e,O,E),w(O,t,E),w(O,i,E),v(i,s),q(l,s,null),v(s,o),v(s,r),v(s,a),q(u,s,null),v(s,f),v(s,c),v(s,d),v(s,m),v(m,h),v(i,_),T&&T.m(i,null),k=!0,S||($=[Oe(Re.call(null,m,"Toggle map")),Y(m,"click",n[5])],S=!0)},p(O,E){const L={};E&16384&&(L.uniqueId=O[14]),E&2&&(L.field=O[1]),e.$set(L);const I={};E&49155&&(I.$$scope={dirty:E,ctx:O}),l.$set(I);const A={};E&49155&&(A.$$scope={dirty:E,ctx:O}),u.$set(A),(!k||E&16&&g!==(g="btn btn-circle btn-sm btn-circle "+(O[4]?"btn-secondary":"btn-hint btn-transparent")))&&p(m,"class",g),O[4]?T?(T.p(O,E),E&16&&M(T,1)):(T=xg(O),T.c(),M(T,1),T.m(i,null)):T&&(oe(),D(T,1,1,()=>{T=null}),re())},i(O){k||(M(e.$$.fragment,O),M(l.$$.fragment,O),M(u.$$.fragment,O),M(T),k=!0)},o(O){D(e.$$.fragment,O),D(l.$$.fragment,O),D(u.$$.fragment,O),D(T),k=!1},d(O){O&&(y(t),y(i)),j(e,O),j(l),j(u),T&&T.d(),S=!1,Ee($)}}}function I7(n){let e,t;return e=new fe({props:{class:"form-field form-field-list "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[D7,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-list "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&49183&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function L7(n,e,t){let{original:i}=e,{field:s}=e,{value:l=void 0}=e,o,r=!1,a=!1;function u(){l.lat>90&&t(0,l.lat=90,l),l.lat<-90&&t(0,l.lat=-90,l),l.lon>180&&t(0,l.lon=180,l),l.lon<-180&&t(0,l.lon=-180,l)}function f(){a?d():c()}function c(){m(),t(4,a=!0)}function d(){t(4,a=!1)}async function m(){o||r||(t(3,r=!0),t(2,o=(await $t(async()=>{const{default:k}=await import("./Leaflet-U8ucILHG.js");return{default:k}},__vite__mapDeps([14,15]),import.meta.url)).default),t(3,r=!1))}function h(){l.lon=mt(this.value),t(0,l)}function g(){l.lat=mt(this.value),t(0,l)}function _(k){l=k,t(0,l)}return n.$$set=k=>{"original"in k&&t(6,i=k.original),"field"in k&&t(1,s=k.field),"value"in k&&t(0,l=k.value)},n.$$.update=()=>{n.$$.dirty&1&&typeof l>"u"&&t(0,l={lat:0,lon:0}),n.$$.dirty&1&&l&&u()},[l,s,o,r,a,f,i,h,g,_]}class A7 extends ve{constructor(e){super(),ye(this,e,L7,I7,be,{original:6,field:1,value:0})}}function e1(n,e,t){const i=n.slice();return i[6]=e[t],i}function t1(n,e,t){const i=n.slice();return i[6]=e[t],i}function n1(n,e){let t,i,s=e[6].title+"",l,o,r,a;function u(){return e[5](e[6])}return{key:n,first:null,c(){t=b("button"),i=b("div"),l=W(s),o=C(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(f,c){w(f,t,c),v(t,i),v(i,l),v(t,o),r||(a=Y(t,"click",u),r=!0)},p(f,c){e=f,c&4&&s!==(s=e[6].title+"")&&se(l,s),c&6&&x(t,"active",e[1]===e[6].language)},d(f){f&&y(t),r=!1,a()}}}function i1(n,e){let t,i,s,l,o,r,a=e[6].title+"",u,f,c,d,m;return i=new of({props:{language:e[6].language,content:e[6].content}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),o=b("em"),r=b("a"),u=W(a),f=W(" SDK"),d=C(),p(r,"href",c=e[6].url),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","txt-sm txt-hint"),p(l,"class","txt-right"),p(t,"class","tab-item svelte-1maocj6"),x(t,"active",e[1]===e[6].language),this.first=t},m(h,g){w(h,t,g),q(i,t,null),v(t,s),v(t,l),v(l,o),v(o,r),v(r,u),v(r,f),v(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+"")&&se(u,a),(!m||g&4&&c!==(c=e[6].url))&&p(r,"href",c),(!m||g&6)&&x(t,"active",e[1]===e[6].language)},i(h){m||(M(i.$$.fragment,h),m=!0)},o(h){D(i.$$.fragment,h),m=!1},d(h){h&&y(t),j(i)}}}function P7(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f,c=ce(n[2]);const d=g=>g[6].language;for(let g=0;gg[6].language;for(let g=0;gt(1,r=u.language);return n.$$set=u=>{"class"in u&&t(0,s=u.class),"js"in u&&t(3,l=u.js),"dart"in u&&t(4,o=u.dart)},n.$$.update=()=>{n.$$.dirty&2&&r&&localStorage.setItem(l1,r),n.$$.dirty&24&&t(2,i=[{title:"JavaScript",language:"javascript",content:l,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:o,url:"https://github.com/pocketbase/dart-sdk"}])},[s,r,i,l,o,a]}class R7 extends ve{constructor(e){super(),ye(this,e,N7,P7,be,{class:0,js:3,dart:4})}}function F7(n){let e,t,i,s,l,o=U.displayValue(n[1])+"",r,a,u,f,c,d,m;return f=new fe({props:{class:"form-field m-b-xs m-t-sm",name:"duration",$$slots:{default:[j7,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("p"),s=W(`Generate a nonrenewable auth token for + `),l=b("strong"),r=W(o),a=W(":"),u=C(),H(f.$$.fragment),p(t,"class","content"),p(e,"id",n[8])},m(h,g){w(h,e,g),v(e,t),v(t,i),v(i,s),v(i,l),v(l,r),v(l,a),v(e,u),q(f,e,null),c=!0,d||(m=Y(e,"submit",it(n[9])),d=!0)},p(h,g){(!c||g&2)&&o!==(o=U.displayValue(h[1])+"")&&se(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&&y(e),j(f),d=!1,m()}}}function q7(n){let e,t,i,s=n[3].authStore.token+"",l,o,r,a,u,f;return r=new Oi({props:{value:n[3].authStore.token}}),u=new R7({props:{class:"m-b-0",js:` import PocketBase from 'pocketbase'; const token = "..."; @@ -142,7 +142,7 @@ To target the newly submitted ones you can use @request.body.*`,position:"top"}) final pb = PocketBase('${n[7]}'); pb.authStore.save(token, null); - `}}),{c(){e=b("div"),t=b("div"),i=b("span"),l=W(s),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){w(c,e,d),v(e,t),v(t,i),v(i,l),v(t,o),q(r,t,null),w(c,a,d),q(u,c,d),f=!0},p(c,d){(!f||d&8)&&s!==(s=c[3].authStore.token+"")&&se(l,s);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const _={};d&128&&(_.js=` + `}}),{c(){e=b("div"),t=b("div"),i=b("span"),l=W(s),o=C(),H(r.$$.fragment),a=C(),H(u.$$.fragment),p(i,"class","txt token-holder svelte-1i56uix"),p(t,"class","content txt-bold"),p(e,"class","alert alert-success")},m(c,d){w(c,e,d),v(e,t),v(t,i),v(i,l),v(t,o),q(r,t,null),w(c,a,d),q(u,c,d),f=!0},p(c,d){(!f||d&8)&&s!==(s=c[3].authStore.token+"")&&se(l,s);const m={};d&8&&(m.value=c[3].authStore.token),r.$set(m);const h={};d&128&&(h.js=` import PocketBase from 'pocketbase'; const token = "..."; @@ -150,7 +150,7 @@ To target the newly submitted ones you can use @request.body.*`,position:"top"}) const pb = new PocketBase('${c[7]}'); pb.authStore.save(token, null); - `),d&128&&(_.dart=` + `),d&128&&(h.dart=` import 'package:pocketbase/pocketbase.dart'; final token = "..."; @@ -158,74 +158,74 @@ To target the newly submitted ones you can use @request.body.*`,position:"top"}) final pb = PocketBase('${c[7]}'); pb.authStore.save(token, null); - `),u.$set(_)},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&&(y(e),y(a)),j(r),j(u,c)}}}function q7(n){let e,t,i,s,l,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),s=C(),l=b("input"),p(e,"for",i=n[20]),p(l,"type","number"),p(l,"id",o=n[20]),p(l,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(l,"min","0"),p(l,"step","1"),l.value=a=n[5]||""},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){var m,_;d&1048576&&i!==(i=c[20])&&p(e,"for",i),d&1048576&&o!==(o=c[20])&&p(l,"id",o),d&1&&r!==(r="Default to the collection setting ("+(((_=(m=c[0])==null?void 0:m.authToken)==null?void 0:_.duration)||0)+"s)")&&p(l,"placeholder",r),d&32&&a!==(a=c[5]||"")&&l.value!==a&&(l.value=a)},d(c){c&&(y(e),y(s),y(l)),u=!1,f()}}}function j7(n){let e,t,i,s,l,o;const r=[F7,R7],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),s=a[i]=r[i](n),{c(){e=b("div"),t=C(),s.c(),l=ke(),p(e,"class","clearfix")},m(f,c){w(f,e,c),w(f,t,c),a[i].m(f,c),w(f,l,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(oe(),D(a[d],1,1,()=>{a[d]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(s),o=!0)},o(f){D(s),o=!1},d(f){f&&(y(e),y(t),y(l)),a[i].d(f)}}}function H7(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function z7(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],x(e,"btn-loading",n[6])},m(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[13]),i=!0)},p(l,o){o&64&&(e.disabled=l[6]),o&64&&x(e,"btn-loading",l[6])},d(l){l&&y(e),i=!1,s()}}}function U7(n){let e,t,i,s;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(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&64&&(e.disabled=l[6])},d(l){l&&y(e),i=!1,s()}}}function V7(n){let e,t,i,s,l,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?U7:z7}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){w(f,e,c),v(e,t),w(f,i,c),u.m(f,c),w(f,s,c),l||(o=Y(e,"click",n[2]),l=!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(s.parentNode,s)))},d(f){f&&(y(e),y(i),y(s)),u.d(f),l=!1,o()}}}function B7(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[V7],header:[H7],default:[j7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&64&&(o.escClose=!s[6]),l&64&&(o.beforeHide=s[15]),l&2097387&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function W7(n,e,t){let i;const s=wt(),l="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 _(){if(!(f||!o||!r)){t(6,f=!0);try{t(3,c=await he.collection(o.name).impersonate(r.id,u)),s("submit",c)}catch(L){he.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const h=()=>g(),k=()=>_(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ne[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Le.call(this,n,L)}function E(L){Le.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,l,_,g,d,h,k,S,$,T,O,E]}class Y7 extends ve{constructor(e){super(),ye(this,e,W7,B7,be,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function l1(n,e,t){const i=n.slice();return i[85]=e[t],i[86]=e,i[87]=t,i}function s1(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=C(),l=b("div"),o=W(`The record has previous unsaved changes. - `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(h,k){w(h,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(t,a),v(t,u),v(e,f),v(e,c),m=!0,_||(g=[Y(r,"click",n[48]),Oe(Re.call(null,u,"Discard draft")),Y(u,"click",it(n[49]))],_=!0)},p:te,i(h){m||(d&&d.end(1),m=!0)},o(h){h&&(d=Tu(e,ht,{duration:150})),m=!1},d(h){h&&y(e),h&&d&&d.end(),_=!1,Ee(g)}}}function o1(n){let e,t,i;return t=new cA({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function K7(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$=!n[6]&&o1(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="id",l=C(),o=b("span"),a=C(),$&&$.c(),u=C(),f=b("input"),p(t,"class",Us(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[88]),p(f,"type","text"),p(f,"id",c=n[88]),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",_=((E=n[19])==null?void 0:E.max)||null),f.readOnly=g=!n[6]},m(T,O){w(T,e,O),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),w(T,a,O),$&&$.m(T,O),w(T,u,O),w(T,f,O),me(f,n[3].id),h=!0,k||(S=Y(f,"input",n[50]),k=!0)},p(T,O){var E,L,I;(!h||O[2]&67108864&&r!==(r=T[88]))&&p(e,"for",r),T[6]?$&&(oe(),D($,1,1,()=>{$=null}),re()):$?($.p(T,O),O[0]&64&&M($,1)):($=o1(T),$.c(),M($,1),$.m(u.parentNode,u)),(!h||O[2]&67108864&&c!==(c=T[88]))&&p(f,"id",c),(!h||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),(!h||O[0]&524288&&m!==(m=((L=T[19])==null?void 0:L.min)||null))&&p(f,"minlength",m),(!h||O[0]&524288&&_!==(_=((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&&me(f,T[3].id)},i(T){h||(M($),h=!0)},o(T){D($),h=!1},d(T){T&&(y(e),y(a),y(u),y(f)),$&&$.d(T),k=!1,S()}}}function r1(n){let e,t,i,s,l;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new EA({props:r}),ne.push(()=>ge(e,"record",o));let a=n[16].length&&a1();return{c(){H(e.$$.fragment),i=C(),a&&a.c(),s=ke()},m(u,f){q(e,u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=a1(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(u){l||(M(e.$$.fragment,u),l=!0)},o(u){D(e.$$.fragment,u),l=!1},d(u){u&&(y(i),y(s)),j(e,u),a&&a.d(u)}}}function a1(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function J7(n){let e,t,i;function s(o){n[66](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new L7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Z7(n){let e,t,i;function s(o){n[65](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new zP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G7(n){let e,t,i;function s(o){n[64](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new u7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function X7(n){let e,t,i,s,l;function o(f){n[61](f,n[85])}function r(f){n[62](f,n[85])}function a(f){n[63](f,n[85])}let u={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(u.value=n[3][n[85].name]),n[4][n[85].name]!==void 0&&(u.uploadedFiles=n[4][n[85].name]),n[5][n[85].name]!==void 0&&(u.deletedFileNames=n[5][n[85].name]),e=new TP({props:u}),ne.push(()=>ge(e,"value",o)),ne.push(()=>ge(e,"uploadedFiles",r)),ne.push(()=>ge(e,"deletedFileNames",a)),{c(){H(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[85]),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[85].name],$e(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[85].name],$e(()=>i=!1)),!s&&c[0]&65568&&(s=!0,d.deletedFileNames=n[5][n[85].name],$e(()=>s=!1)),e.$set(d)},i(f){l||(M(e.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function Q7(n){let e,t,i;function s(o){n[60](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new AP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function x7(n){let e,t,i;function s(o){n[59](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new p7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eN(n){let e,t,i;function s(o){n[58](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new zA({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function tN(n){let e,t,i;function s(o){n[57](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new rP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function nN(n){let e,t,i;function s(o){n[56](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new T7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function iN(n){let e,t,i;function s(o){n[55](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new cP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function lN(n){let e,t,i;function s(o){n[54](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new FA({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function sN(n){let e,t,i;function s(o){n[53](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new FP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function oN(n){let e,t,i;function s(o){n[52](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new y7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function u1(n,e){let t,i,s,l,o;const r=[oN,sN,lN,iN,nN,tN,eN,x7,Q7,X7,G7,Z7,J7],a=[];function u(f,c){return f[85].type==="text"?0:f[85].type==="number"?1:f[85].type==="bool"?2:f[85].type==="email"?3:f[85].type==="url"?4:f[85].type==="editor"?5:f[85].type==="date"?6:f[85].type==="select"?7:f[85].type==="json"?8:f[85].type==="file"?9:f[85].type==="relation"?10:f[85].type==="password"?11:f[85].type==="geoPoint"?12:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),s&&s.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(oe(),D(a[d],1,1,()=>{a[d]=null}),re()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),M(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(M(s),o=!0)},o(f){D(s),o=!1},d(f){f&&(y(t),y(l)),~i&&a[i].d(f)}}}function f1(n){let e,t,i;return t=new gA({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[15]===lo)},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&32768)&&x(e,"active",s[15]===lo)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function rN(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&s1(n);s=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[K7,({uniqueId:S})=>({88:S}),({uniqueId:S})=>[0,0,S?67108864:0]]},$$scope:{ctx:n}}});let _=n[9]&&r1(n),g=ce(n[16]);const h=S=>S[85].name;for(let S=0;S{m=null}),re());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&201326592&&(T.$$scope={dirty:$,ctx:S}),s.$set(T),S[9]?_?(_.p(S,$),$[0]&512&&M(_,1)):(_=r1(S),_.c(),M(_,1),_.m(t,o)):_&&(oe(),D(_,1,1,()=>{_=null}),re()),$[0]&65596&&(g=ce(S[16]),oe(),r=kt(r,$,h,1,S,g,a,t,Yt,u1,null,l1),re()),(!f||$[0]&128)&&x(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&x(t,"active",S[15]===Dl),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&M(k,1)):(k=f1(S),k.c(),M(k,1),k.m(e,null)):k&&(oe(),D(k,1,1,()=>{k=null}),re())},i(S){if(!f){M(m),M(s.$$.fragment,S),M(_);for(let $=0;${d=null}),re()):d?(d.p(_,g),g[0]&64&&M(d,1)):(d=c1(_),d.c(),M(d,1),d.m(f.parentNode,f))},i(_){c||(M(d),c=!0)},o(_){D(d),c=!1},d(_){_&&(y(e),y(u),y(f)),d&&d.d(_)}}}function uN(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:te,i:te,o:te,d(s){s&&(y(e),y(t),y(i))}}}function c1(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[fN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),w(a,t,u),w(a,i,u),v(i,s),v(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&134217728&&(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&&(y(e),y(t),y(i)),j(o)}}}function d1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function p1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[41]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function m1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Impersonate',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[42]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function fN(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&d1(n),_=n[9]&&n[2].email&&p1(n),g=n[9]&&m1(n);return{c(){m&&m.c(),e=C(),_&&_.c(),t=C(),g&&g.c(),i=C(),s=b("button"),s.innerHTML=' Copy raw JSON',l=C(),o=b("button"),o.innerHTML=' Duplicate',r=C(),a=b("hr"),u=C(),f=b("button"),f.innerHTML=' Delete',p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"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(h,k){m&&m.m(h,k),w(h,e,k),_&&_.m(h,k),w(h,t,k),g&&g.m(h,k),w(h,i,k),w(h,s,k),w(h,l,k),w(h,o,k),w(h,r,k),w(h,a,k),w(h,u,k),w(h,f,k),c||(d=[Y(s,"click",n[43]),Y(o,"click",n[44]),Y(f,"click",tn(it(n[45])))],c=!0)},p(h,k){h[9]&&!h[2].verified&&h[2].email?m?m.p(h,k):(m=d1(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),h[9]&&h[2].email?_?_.p(h,k):(_=p1(h),_.c(),_.m(t.parentNode,t)):_&&(_.d(1),_=null),h[9]?g?g.p(h,k):(g=m1(h),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(h){h&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r),y(a),y(u),y(f)),m&&m.d(h),_&&_.d(h),g&&g.d(h),c=!1,Ee(d)}}}function h1(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[15]===Dl),p(s,"type","button"),p(s,"class","tab-item"),x(s,"active",n[15]===lo),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[Y(t,"click",n[46]),Y(s,"click",n[47])],l=!0)},p(r,a){a[0]&32768&&x(t,"active",r[15]===Dl),a[0]&32768&&x(s,"active",r[15]===lo)},d(r){r&&y(e),l=!1,Ee(o)}}}function cN(n){let e,t,i,s,l;const o=[uN,aN],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]&&h1(n);return{c(){t.c(),i=C(),u&&u.c(),s=ke()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,s,c),l=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),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=h1(f),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(f){l||(M(t),l=!0)},o(f){D(t),l=!1},d(f){f&&(y(i),y(s)),r[e].d(f),u&&u.d(f)}}}function _1(n){let e,t,i,s,l,o;return s=new Dn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[dN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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=l=!n[18]||n[13]},m(r,a){w(r,e,a),v(e,t),v(e,i),q(s,e,null),o=!0},p(r,a){const u={};a[2]&134217728&&(u.$$scope={dirty:a,ctx:r}),s.$set(u),(!o||a[0]&270336&&l!==(l=!r[18]||r[13]))&&(e.disabled=l)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&y(e),j(s)}}}function dN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function pN(n){let e,t,i,s,l,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,_,g=!n[6]&&_1(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",s=C(),l=b("div"),o=b("button"),r=b("span"),u=W(a),c=C(),g&&g.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],x(o,"btn-expanded",n[6]),x(o,"btn-expanded-sm",!n[6]),x(o,"btn-loading",n[13]||n[7]),p(l,"class","btns-group no-gap")},m(h,k){w(h,e,k),v(e,t),w(h,s,k),w(h,l,k),v(l,o),v(o,r),v(r,u),v(l,c),g&&g.m(l,null),d=!0,m||(_=Y(e,"click",n[38]),m=!0)},p(h,k){(!d||k[0]&8320&&i!==(i=h[13]||h[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=h[6]?"Create":"Save changes")&&se(u,a),(!d||k[0]&270336&&f!==(f=!h[18]||h[13]))&&(o.disabled=f),(!d||k[0]&64)&&x(o,"btn-expanded",h[6]),(!d||k[0]&64)&&x(o,"btn-expanded-sm",!h[6]),(!d||k[0]&8320)&&x(o,"btn-loading",h[13]||h[7]),h[6]?g&&(oe(),D(g,1,1,()=>{g=null}),re()):g?(g.p(h,k),k[0]&64&&M(g,1)):(g=_1(h),g.c(),M(g,1),g.m(l,null))},i(h){d||(M(g),d=!0)},o(h){D(g),d=!1},d(h){h&&(y(e),y(s),y(l)),g&&g.d(),m=!1,_()}}}function g1(n){let e,t,i={record:n[3],collection:n[0]};return e=new Y7({props:i}),n[71](e),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),l[0]&1&&(o.collection=s[0]),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[71](null),j(e,s)}}}function mN(n){let e,t,i,s,l={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&&(y(e),y(a)),j(r),j(u,c)}}}function j7(n){let e,t,i,s,l,o,r,a,u,f;return{c(){var c,d;e=b("label"),t=W("Token duration (in seconds)"),s=C(),l=b("input"),p(e,"for",i=n[20]),p(l,"type","number"),p(l,"id",o=n[20]),p(l,"placeholder",r="Default to the collection setting ("+(((d=(c=n[0])==null?void 0:c.authToken)==null?void 0:d.duration)||0)+"s)"),p(l,"min","0"),p(l,"step","1"),l.value=a=n[5]||""},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),u||(f=Y(l,"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(l,"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(l,"placeholder",r),d&32&&a!==(a=c[5]||"")&&l.value!==a&&(l.value=a)},d(c){c&&(y(e),y(s),y(l)),u=!1,f()}}}function H7(n){let e,t,i,s,l,o;const r=[q7,F7],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),s=a[i]=r[i](n),{c(){e=b("div"),t=C(),s.c(),l=ke(),p(e,"class","clearfix")},m(f,c){w(f,e,c),w(f,t,c),a[i].m(f,c),w(f,l,c),o=!0},p(f,c){let d=i;i=u(f),i===d?a[i].p(f,c):(oe(),D(a[d],1,1,()=>{a[d]=null}),re(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),M(s,1),s.m(l.parentNode,l))},i(f){o||(M(s),o=!0)},o(f){D(s),o=!1},d(f){f&&(y(e),y(t),y(l)),a[i].d(f)}}}function z7(n){let e;return{c(){e=b("h4"),e.textContent="Impersonate auth token"},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function U7(n){let e,t,i,s;return{c(){e=b("button"),t=b("span"),t.textContent="Generate token",p(t,"class","txt"),p(e,"type","submit"),p(e,"form",n[8]),p(e,"class","btn btn-expanded"),e.disabled=n[6],x(e,"btn-loading",n[6])},m(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[13]),i=!0)},p(l,o){o&64&&(e.disabled=l[6]),o&64&&x(e,"btn-loading",l[6])},d(l){l&&y(e),i=!1,s()}}}function V7(n){let e,t,i,s;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(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&64&&(e.disabled=l[6])},d(l){l&&y(e),i=!1,s()}}}function B7(n){let e,t,i,s,l,o;function r(f,c){var d,m;return(m=(d=f[3])==null?void 0:d.authStore)!=null&&m.token?V7:U7}let a=r(n),u=a(n);return{c(){e=b("button"),t=b("span"),t.textContent="Close",i=C(),u.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[6]},m(f,c){w(f,e,c),v(e,t),w(f,i,c),u.m(f,c),w(f,s,c),l||(o=Y(e,"click",n[2]),l=!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(s.parentNode,s)))},d(f){f&&(y(e),y(i),y(s)),u.d(f),l=!1,o()}}}function W7(n){let e,t,i={overlayClose:!1,escClose:!n[6],beforeHide:n[15],popup:!0,$$slots:{footer:[B7],header:[z7],default:[H7]},$$scope:{ctx:n}};return e=new ln({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&64&&(o.escClose=!s[6]),l&64&&(o.beforeHide=s[15]),l&2097387&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}function Y7(n,e,t){let i;const s=wt(),l="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 he.collection(o.name).impersonate(r.id,u)),s("submit",c)}catch(L){he.error(L)}t(6,f=!1)}}function g(){t(5,u=0),t(3,c=void 0)}const _=()=>g(),k=()=>h(),S=L=>t(5,u=L.target.value<<0),$=()=>!f;function T(L){ne[L?"unshift":"push"](()=>{a=L,t(4,a)})}function O(L){Le.call(this,n,L)}function E(L){Le.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,l,h,g,d,_,k,S,$,T,O,E]}class K7 extends ve{constructor(e){super(),ye(this,e,Y7,W7,be,{collection:0,record:1,show:11,hide:2})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[2]}}function s1(n,e,t){const i=n.slice();return i[85]=e[t],i[86]=e,i[87]=t,i}function o1(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=C(),l=b("div"),o=W(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=C(),u=b("button"),u.innerHTML='',f=C(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,k){w(_,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(t,a),v(t,u),v(e,f),v(e,c),m=!0,h||(g=[Y(r,"click",n[48]),Oe(Re.call(null,u,"Discard draft")),Y(u,"click",it(n[49]))],h=!0)},p:te,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=Tu(e,ht,{duration:150})),m=!1},d(_){_&&y(e),_&&d&&d.end(),h=!1,Ee(g)}}}function r1(n){let e,t,i;return t=new dA({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function J7(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$=!n[6]&&r1(n);return{c(){var T,O,E;e=b("label"),t=b("i"),i=C(),s=b("span"),s.textContent="id",l=C(),o=b("span"),a=C(),$&&$.c(),u=C(),f=b("input"),p(t,"class",Us(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[88]),p(f,"type","text"),p(f,"id",c=n[88]),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){w(T,e,O),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),w(T,a,O),$&&$.m(T,O),w(T,u,O),w(T,f,O),me(f,n[3].id),_=!0,k||(S=Y(f,"input",n[50]),k=!0)},p(T,O){var E,L,I;(!_||O[2]&67108864&&r!==(r=T[88]))&&p(e,"for",r),T[6]?$&&(oe(),D($,1,1,()=>{$=null}),re()):$?($.p(T,O),O[0]&64&&M($,1)):($=r1(T),$.c(),M($,1),$.m(u.parentNode,u)),(!_||O[2]&67108864&&c!==(c=T[88]))&&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&&me(f,T[3].id)},i(T){_||(M($),_=!0)},o(T){D($),_=!1},d(T){T&&(y(e),y(a),y(u),y(f)),$&&$.d(T),k=!1,S()}}}function a1(n){let e,t,i,s,l;function o(u){n[51](u)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new DA({props:r}),ne.push(()=>ge(e,"record",o));let a=n[16].length&&u1();return{c(){H(e.$$.fragment),i=C(),a&&a.c(),s=ke()},m(u,f){q(e,u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,f){const c={};f[0]&64&&(c.isNew=u[6]),f[0]&1&&(c.collection=u[0]),!t&&f[0]&8&&(t=!0,c.record=u[3],$e(()=>t=!1)),e.$set(c),u[16].length?a||(a=u1(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(u){l||(M(e.$$.fragment,u),l=!0)},o(u){D(e.$$.fragment,u),l=!1},d(u){u&&(y(i),y(s)),j(e,u),a&&a.d(u)}}}function u1(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Z7(n){let e,t,i;function s(o){n[66](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new A7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G7(n){let e,t,i;function s(o){n[65](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new UP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function X7(n){let e,t,i;function s(o){n[64](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new f7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Q7(n){let e,t,i,s,l;function o(f){n[61](f,n[85])}function r(f){n[62](f,n[85])}function a(f){n[63](f,n[85])}let u={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(u.value=n[3][n[85].name]),n[4][n[85].name]!==void 0&&(u.uploadedFiles=n[4][n[85].name]),n[5][n[85].name]!==void 0&&(u.deletedFileNames=n[5][n[85].name]),e=new $P({props:u}),ne.push(()=>ge(e,"value",o)),ne.push(()=>ge(e,"uploadedFiles",r)),ne.push(()=>ge(e,"deletedFileNames",a)),{c(){H(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&65536&&(d.field=n[85]),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[85].name],$e(()=>t=!1)),!i&&c[0]&65552&&(i=!0,d.uploadedFiles=n[4][n[85].name],$e(()=>i=!1)),!s&&c[0]&65568&&(s=!0,d.deletedFileNames=n[5][n[85].name],$e(()=>s=!1)),e.$set(d)},i(f){l||(M(e.$$.fragment,f),l=!0)},o(f){D(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function x7(n){let e,t,i;function s(o){n[60](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new PP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function eN(n){let e,t,i;function s(o){n[59](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new m7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function tN(n){let e,t,i;function s(o){n[58](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new UA({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function nN(n){let e,t,i;function s(o){n[57](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new aP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function iN(n){let e,t,i;function s(o){n[56](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new $7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function lN(n){let e,t,i;function s(o){n[55](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new dP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function sN(n){let e,t,i;function s(o){n[54](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new qA({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function oN(n){let e,t,i;function s(o){n[53](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new qP({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function rN(n){let e,t,i;function s(o){n[52](o,n[85])}let l={field:n[85],original:n[2],record:n[3]};return n[3][n[85].name]!==void 0&&(l.value=n[3][n[85].name]),e=new v7({props:l}),ne.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&65536&&(a.field=n[85]),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[85].name],$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function f1(n,e){let t,i,s,l,o;const r=[rN,oN,sN,lN,iN,nN,tN,eN,x7,Q7,X7,G7,Z7],a=[];function u(f,c){return f[85].type==="text"?0:f[85].type==="number"?1:f[85].type==="bool"?2:f[85].type==="email"?3:f[85].type==="url"?4:f[85].type==="editor"?5:f[85].type==="date"?6:f[85].type==="select"?7:f[85].type==="json"?8:f[85].type==="file"?9:f[85].type==="relation"?10:f[85].type==="password"?11:f[85].type==="geoPoint"?12:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),s&&s.c(),l=ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(oe(),D(a[d],1,1,()=>{a[d]=null}),re()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),M(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(M(s),o=!0)},o(f){D(s),o=!1},d(f){f&&(y(t),y(l)),~i&&a[i].d(f)}}}function c1(n){let e,t,i;return t=new bA({props:{record:n[3]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[15]===lo)},m(s,l){w(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&32768)&&x(e,"active",s[15]===lo)},i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function aN(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[12]&&!n[7]&&o1(n);s=new fe({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[J7,({uniqueId:S})=>({88:S}),({uniqueId:S})=>[0,0,S?67108864:0]]},$$scope:{ctx:n}}});let h=n[9]&&a1(n),g=ce(n[16]);const _=S=>S[85].name;for(let S=0;S{m=null}),re());const T={};$[0]&64&&(T.class="form-field "+(S[6]?"":"readonly")),$[0]&524488|$[2]&201326592&&(T.$$scope={dirty:$,ctx:S}),s.$set(T),S[9]?h?(h.p(S,$),$[0]&512&&M(h,1)):(h=a1(S),h.c(),M(h,1),h.m(t,o)):h&&(oe(),D(h,1,1,()=>{h=null}),re()),$[0]&65596&&(g=ce(S[16]),oe(),r=kt(r,$,_,1,S,g,a,t,Yt,f1,null,s1),re()),(!f||$[0]&128)&&x(t,"no-pointer-events",S[7]),(!f||$[0]&32768)&&x(t,"active",S[15]===Dl),S[9]&&!S[17]&&!S[6]?k?(k.p(S,$),$[0]&131648&&M(k,1)):(k=c1(S),k.c(),M(k,1),k.m(e,null)):k&&(oe(),D(k,1,1,()=>{k=null}),re())},i(S){if(!f){M(m),M(s.$$.fragment,S),M(h);for(let $=0;${d=null}),re()):d?(d.p(h,g),g[0]&64&&M(d,1)):(d=d1(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&&(y(e),y(u),y(f)),d&&d.d(h)}}}function fN(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:te,i:te,o:te,d(s){s&&(y(e),y(t),y(i))}}}function d1(n){let e,t,i,s,l,o,r;return o=new Dn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[cN]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=C(),i=b("div"),s=b("i"),l=C(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(s,"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){w(a,e,u),w(a,t,u),w(a,i,u),v(i,s),v(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[0]&2564|u[2]&134217728&&(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&&(y(e),y(t),y(i)),j(o)}}}function p1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function m1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[41]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function h1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Impersonate',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[42]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function cN(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=n[9]&&!n[2].verified&&n[2].email&&p1(n),h=n[9]&&n[2].email&&m1(n),g=n[9]&&h1(n);return{c(){m&&m.c(),e=C(),h&&h.c(),t=C(),g&&g.c(),i=C(),s=b("button"),s.innerHTML=' Copy raw JSON',l=C(),o=b("button"),o.innerHTML=' Duplicate',r=C(),a=b("hr"),u=C(),f=b("button"),f.innerHTML=' Delete',p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"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(_,k){m&&m.m(_,k),w(_,e,k),h&&h.m(_,k),w(_,t,k),g&&g.m(_,k),w(_,i,k),w(_,s,k),w(_,l,k),w(_,o,k),w(_,r,k),w(_,a,k),w(_,u,k),w(_,f,k),c||(d=[Y(s,"click",n[43]),Y(o,"click",n[44]),Y(f,"click",tn(it(n[45])))],c=!0)},p(_,k){_[9]&&!_[2].verified&&_[2].email?m?m.p(_,k):(m=p1(_),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_[9]&&_[2].email?h?h.p(_,k):(h=m1(_),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),_[9]?g?g.p(_,k):(g=h1(_),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null)},d(_){_&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r),y(a),y(u),y(f)),m&&m.d(_),h&&h.d(_),g&&g.d(_),c=!1,Ee(d)}}}function _1(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=C(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[15]===Dl),p(s,"type","button"),p(s,"class","tab-item"),x(s,"active",n[15]===lo),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[Y(t,"click",n[46]),Y(s,"click",n[47])],l=!0)},p(r,a){a[0]&32768&&x(t,"active",r[15]===Dl),a[0]&32768&&x(s,"active",r[15]===lo)},d(r){r&&y(e),l=!1,Ee(o)}}}function dN(n){let e,t,i,s,l;const o=[fN,uN],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]&&_1(n);return{c(){t.c(),i=C(),u&&u.c(),s=ke()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,s,c),l=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(oe(),D(r[d],1,1,()=>{r[d]=null}),re(),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=_1(f),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(f){l||(M(t),l=!0)},o(f){D(t),l=!1},d(f){f&&(y(i),y(s)),r[e].d(f),u&&u.d(f)}}}function g1(n){let e,t,i,s,l,o;return s=new Dn({props:{class:"dropdown dropdown-upside dropdown-right dropdown-nowrap m-b-5",$$slots:{default:[pN]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("i"),i=C(),H(s.$$.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=l=!n[18]||n[13]},m(r,a){w(r,e,a),v(e,t),v(e,i),q(s,e,null),o=!0},p(r,a){const u={};a[2]&134217728&&(u.$$scope={dirty:a,ctx:r}),s.$set(u),(!o||a[0]&270336&&l!==(l=!r[18]||r[13]))&&(e.disabled=l)},i(r){o||(M(s.$$.fragment,r),o=!0)},o(r){D(s.$$.fragment,r),o=!1},d(r){r&&y(e),j(s)}}}function pN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Save and continue',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function mN(n){let e,t,i,s,l,o,r,a=n[6]?"Create":"Save changes",u,f,c,d,m,h,g=!n[6]&&g1(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",s=C(),l=b("div"),o=b("button"),r=b("span"),u=W(a),c=C(),g&&g.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[13]||n[7],p(r,"class","txt"),p(o,"type","submit"),p(o,"form",n[21]),p(o,"title","Save and close"),p(o,"class","btn"),o.disabled=f=!n[18]||n[13],x(o,"btn-expanded",n[6]),x(o,"btn-expanded-sm",!n[6]),x(o,"btn-loading",n[13]||n[7]),p(l,"class","btns-group no-gap")},m(_,k){w(_,e,k),v(e,t),w(_,s,k),w(_,l,k),v(l,o),v(o,r),v(r,u),v(l,c),g&&g.m(l,null),d=!0,m||(h=Y(e,"click",n[38]),m=!0)},p(_,k){(!d||k[0]&8320&&i!==(i=_[13]||_[7]))&&(e.disabled=i),(!d||k[0]&64)&&a!==(a=_[6]?"Create":"Save changes")&&se(u,a),(!d||k[0]&270336&&f!==(f=!_[18]||_[13]))&&(o.disabled=f),(!d||k[0]&64)&&x(o,"btn-expanded",_[6]),(!d||k[0]&64)&&x(o,"btn-expanded-sm",!_[6]),(!d||k[0]&8320)&&x(o,"btn-loading",_[13]||_[7]),_[6]?g&&(oe(),D(g,1,1,()=>{g=null}),re()):g?(g.p(_,k),k[0]&64&&M(g,1)):(g=g1(_),g.c(),M(g,1),g.m(l,null))},i(_){d||(M(g),d=!0)},o(_){D(g),d=!1},d(_){_&&(y(e),y(s),y(l)),g&&g.d(),m=!1,h()}}}function b1(n){let e,t,i={record:n[3],collection:n[0]};return e=new K7({props:i}),n[71](e),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),l[0]&1&&(o.collection=s[0]),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[71](null),j(e,s)}}}function hN(n){let e,t,i,s,l={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[67],$$slots:{footer:[pN],header:[cN],default:[rN]},$$scope:{ctx:n}};e=new ln({props:l}),n[68](e),e.$on("hide",n[69]),e.$on("show",n[70]);let o=n[9]&&g1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1180224&&(u.class=` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[67],$$slots:{footer:[mN],header:[dN],default:[aN]},$$scope:{ctx:n}};e=new ln({props:l}),n[68](e),e.$on("hide",n[69]),e.$on("show",n[70]);let o=n[9]&&b1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!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[67]),a[0]&1031165|a[2]&134217728&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=g1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},i(r){s||(M(e.$$.fragment,r),M(o),s=!0)},o(r){D(e.$$.fragment,r),D(o),s=!1},d(r){r&&(y(t),y(i)),n[68](null),j(e,r),o&&o.d(r)}}}const Dl="form",lo="providers";function hN(n,e,t){let i,s,l,o,r,a,u,f;const c=wt(),d="record_"+U.randomString(5);let{collection:m}=e,_,g,h={},k={},S=null,$=!1,T=!1,O={},E={},L=JSON.stringify(h),I=L,A=Dl,P=!0,N=!0,R=m,z=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(ue){return pe(ue),t(14,T=!0),t(15,A=Dl),_==null?void 0:_.show()}function V(){return _==null?void 0:_.hide()}function Z(){t(14,T=!1),V()}function G(){t(35,R=m),_!=null&&_.isActive()&&(Ke(JSON.stringify(k)),Z())}async function de(ue){if(!ue)return null;let we=typeof ue=="string"?ue:ue==null?void 0:ue.id;if(we)try{return await he.collection(m.id).getOne(we)}catch(He){He.isAbort||(Z(),console.warn("resolveModel:",He),Mi(`Unable to load record with id "${we}"`))}return typeof ue=="object"?ue:null}async function pe(ue){t(7,N=!0),Jt({}),t(4,O={}),t(5,E={}),t(2,h=typeof ue=="string"?{id:ue,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:ue||{}),t(3,k=structuredClone(h)),t(2,h=await de(ue)||{}),t(3,k=structuredClone(h)),await _n(),t(12,S=Ye()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,N=!1)}async function ae(ue){var He,Qe;Jt({}),t(2,h=ue||{}),t(4,O={}),t(5,E={});const we=((Qe=(He=m==null?void 0:m.fields)==null?void 0:He.filter(at=>at.type!="file"))==null?void 0:Qe.map(at=>at.name))||[];for(let at in ue)we.includes(at)||t(3,k[at]=ue[at],k);await _n(),t(33,L=JSON.stringify(k)),xe()}function Ce(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((h==null?void 0:h.id)||"")}function Ye(ue){try{const we=window.localStorage.getItem(Ce());if(we)return JSON.parse(we)}catch{}return ue}function Ke(ue){try{window.localStorage.setItem(Ce(),ue)}catch(we){console.warn("updateDraft failure:",we),window.localStorage.removeItem(Ce())}}function ct(){S&&(t(3,k=S),t(12,S=null))}function et(ue,we){var pn;const He=structuredClone(ue||{}),Qe=structuredClone(we||{}),at=(pn=m==null?void 0:m.fields)==null?void 0:pn.filter(mn=>mn.type==="file");for(let mn of at)delete He[mn.name],delete Qe[mn.name];const Wt=["expand","password","passwordConfirm"];for(let mn of Wt)delete He[mn],delete Qe[mn];return JSON.stringify(He)==JSON.stringify(Qe)}function xe(){t(12,S=null),window.localStorage.removeItem(Ce())}async function Be(ue=!0){var we;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const He=Bt();let Qe;if(P?Qe=await he.collection(m.id).create(He):Qe=await he.collection(m.id).update(k.id,He),nn(P?"Successfully created record.":"Successfully updated record."),xe(),s&&(k==null?void 0:k.id)==((we=he.authStore.record)==null?void 0:we.id)&&He.get("password"))return he.logout();ue?Z():ae(Qe),c("save",{isNew:P,record:Qe})}catch(He){he.error(He)}t(13,$=!1)}}function ut(){h!=null&&h.id&&yn("Do you really want to delete the selected record?",()=>he.collection(h.collectionId).delete(h.id).then(()=>{Z(),nn("Successfully deleted record."),c("delete",h)}).catch(ue=>{he.error(ue)}))}function Bt(){const ue=structuredClone(k||{}),we=new FormData,He={},Qe={};for(const at of(m==null?void 0:m.fields)||[])at.type=="autodate"||i&&at.type=="password"||(He[at.name]=!0,at.type=="json"&&(Qe[at.name]=!0));i&&ue.password&&(He.password=!0),i&&ue.passwordConfirm&&(He.passwordConfirm=!0);for(const at in ue)if(He[at]){if(typeof ue[at]>"u"&&(ue[at]=null),Qe[at]&&ue[at]!=="")try{JSON.parse(ue[at])}catch(Wt){const pn={};throw pn[at]={code:"invalid_json",message:Wt.toString()},new jn({status:400,response:{data:pn}})}U.addValueToFormData(we,at,ue[at])}for(const at in O){const Wt=U.toArray(O[at]);for(const pn of Wt)we.append(at+"+",pn)}for(const at in E){const Wt=U.toArray(E[at]);for(const pn of Wt)we.append(at+"-",pn)}return we}function Ue(){!(m!=null&&m.id)||!(h!=null&&h.email)||yn(`Do you really want to sent verification email to ${h.email}?`,()=>he.collection(m.id).requestVerification(h.email).then(()=>{nn(`Successfully sent verification email to ${h.email}.`)}).catch(ue=>{he.error(ue)}))}function De(){!(m!=null&&m.id)||!(h!=null&&h.email)||yn(`Do you really want to sent password reset email to ${h.email}?`,()=>he.collection(m.id).requestPasswordReset(h.email).then(()=>{nn(`Successfully sent password reset email to ${h.email}.`)}).catch(ue=>{he.error(ue)}))}function ot(){a?yn("You have unsaved changes. Do you really want to discard them?",()=>{Ie()}):Ie()}async function Ie(){let ue=h?structuredClone(h):null;if(ue){const we=["file","autodate"],He=(m==null?void 0:m.fields)||[];for(const Qe of He)we.includes(Qe.type)&&delete ue[Qe.name];ue.id=""}xe(),J(ue),await _n(),t(33,L="")}function We(ue){(ue.ctrlKey||ue.metaKey)&&ue.code=="KeyS"&&(ue.preventDefault(),ue.stopPropagation(),Be(!1))}function Te(){U.copyToClipboard(JSON.stringify(h,null,2)),Js("The record JSON was copied to your clipboard!",3e3)}const nt=()=>V(),zt=()=>Be(!1),Ne=()=>Ue(),Me=()=>De(),bt=()=>g==null?void 0:g.show(),Ut=()=>Te(),Pt=()=>ot(),Pe=()=>ut(),jt=()=>t(15,A=Dl),Gt=()=>t(15,A=lo),en=()=>ct(),mi=()=>xe();function Ei(){k.id=this.value,t(3,k)}function oi(ue){k=ue,t(3,k)}function yt(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Jn(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function fn(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function It(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Di(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function fl(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Vi(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Bi(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function cl(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Ln(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function ql(ue,we){n.$$.not_equal(O[we.name],ue)&&(O[we.name]=ue,t(4,O))}function dl(ue,we){n.$$.not_equal(E[we.name],ue)&&(E[we.name]=ue,t(5,E))}function X(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function ee(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function le(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}const Se=()=>a&&T?(yn("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Jt({}),xe(),!0);function Fe(ue){ne[ue?"unshift":"push"](()=>{_=ue,t(10,_)})}function Ve(ue){Le.call(this,n,ue)}function rt(ue){Le.call(this,n,ue)}function Je(ue){ne[ue?"unshift":"push"](()=>{g=ue,t(11,g)})}return n.$$set=ue=>{"collection"in ue&&t(0,m=ue.collection)},n.$$.update=()=>{var ue,we,He;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,s=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,l=!!((ue=m==null?void 0:m.fields)!=null&&ue.find(Qe=>Qe.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(we=m==null?void 0:m.fields)==null?void 0:we.find(Qe=>Qe.name==="id")),n.$$.dirty[0]&48&&t(37,r=U.hasNonEmptyProps(O)||U.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(k)),n.$$.dirty[1]&76&&t(8,a=r||L!=I),n.$$.dirty[0]&4&&t(6,P=!h||!h.id),n.$$.dirty[0]&448&&t(18,u=!N&&(P||a)),n.$$.dirty[0]&128|n.$$.dirty[1]&8&&(N||Ke(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=((He=m==null?void 0:m.fields)==null?void 0:He.filter(Qe=>!f.includes(Qe.name)&&Qe.type!="autodate"))||[])},[m,V,h,k,O,E,P,N,a,i,_,g,S,$,T,A,z,s,u,o,l,d,Z,ct,xe,Be,ut,Ue,De,ot,We,Te,J,L,I,R,f,r,nt,zt,Ne,Me,bt,Ut,Pt,Pe,jt,Gt,en,mi,Ei,oi,yt,Jn,fn,It,Di,fl,Vi,Bi,cl,Ln,ql,dl,X,ee,le,Se,Fe,Ve,rt,Je]}class pf extends ve{constructor(e){super(),ye(this,e,hN,mN,be,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function _N(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),s=b("span"),o=W(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,s),v(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&se(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&y(e)}}}function gN(n,e,t){const i=wt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=U.getAllCollectionIdentifiers(s),c=await he.collection(s.id).getList(1,1,{filter:U.normalizeSearchFilter(l,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,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class bN extends ve{constructor(e){super(),ye(this,e,gN,_N,be,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function b1(n,e,t){const i=n.slice();return i[58]=e[t],i}function k1(n,e,t){const i=n.slice();return i[61]=e[t],i}function y1(n,e,t){const i=n.slice();return i[61]=e[t],i}function v1(n,e,t){const i=n.slice();return i[54]=e[t],i}function w1(n){let e;function t(l,o){return l[9]?yN:kN}let i=t(n),s=i(n);return{c(){e=b("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&y(e),s.d()}}}function kN(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=C(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),v(e,t),v(e,s),v(e,l),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&&y(e),o=!1,r()}}}function yN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function vN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[61].type))},m(i,s){w(i,e,s)},p(i,s){s[0]&32768&&t!==(t=U.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function wN(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function SN(n){let e,t,i,s=n[61].name+"",l;function o(u,f){return u[61].primaryKey?wN:vN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),l=W(s),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){w(u,e,f),a.m(e,null),v(e,t),v(e,i),v(i,l)},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&&s!==(s=u[61].name+"")&&se(l,s)},d(u){u&&y(e),a.d()}}}function S1(n,e){let t,i,s,l;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:[SN]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new er({props:r}),ne.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!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}),!s&&u[0]&1&&(s=!0,f.sort=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function T1(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[33](e)},p:te,d(t){t&&y(e),n[33](null)}}}function $1(n){let e;function t(l,o){return l[9]?$N:TN}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function TN(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return ON;if(!a[16])return CN}let o=l(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),v(e,t),v(t,i),v(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&y(e),r&&r.d()}}}function $N(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function CN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[38]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function ON(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function C1(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[58].id),i.checked=l=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){w(d,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[Y(i,"change",c),Y(t,"click",tn(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[58].id)&&p(i,"id",s),m[0]&24&&l!==(l=n[4][n[58].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&y(e),u=!1,Ee(f)}}}function O1(n,e){let t,i,s,l;return i=new Jy({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",s="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){w(o,t,r),q(i,t,null),l=!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),(!l||r[0]&32768&&s!==(s="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",s)},i(o){l||(M(i.$$.fragment,o),l=!0)},o(o){D(i.$$.fragment,o),l=!1},d(o){o&&y(t),j(i)}}}function M1(n,e){let t,i,s=[],l=new Map,o,r,a,u,f,c=!e[16]&&C1(e),d=ce(e[15]);const m=h=>h[61].id;for(let h=0;h',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(h,k){w(h,t,k),c&&c.m(t,null),v(t,i);for(let S=0;SL[61].id;for(let L=0;LL[16]?L[58]:L[58].id;for(let L=0;L<$.length;L+=1){let I=b1(n,$,L),A=T(I);d.set(A,c[L]=M1(A,I))}let O=null;$.length||(O=$1(n));let E=n[3].length&&n[14]&&E1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),s=C();for(let L=0;L({57:l}),({uniqueId:l})=>[0,l?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(i,l)}}}function DN(n){let e,t,i=[],s=new Map,l,o,r=ce(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),re())},i(s){t||(M(i),t=!0)},o(s){D(i),t=!1},d(s){s&&y(e),i&&i.d(s)}}}function L1(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,_,g,h,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),s=b("strong"),l=W(n[6]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),_=b("button"),_.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(_,"type","button"),p(_,"class","btn btn-sm btn-transparent btn-danger"),x(_,"btn-loading",n[10]),x(_,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){w($,e,T),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),v(e,_),h=!0,k||(S=[Y(f,"click",n[41]),Y(_,"click",n[42])],k=!0)},p($,T){(!h||T[0]&64)&&se(l,$[6]),(!h||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&se(a,r),(!h||T[0]&1024)&&x(f,"btn-disabled",$[10]),(!h||T[0]&1024)&&x(_,"btn-loading",$[10]),(!h||T[0]&1024)&&x(_,"btn-disabled",$[10])},i($){h||($&&tt(()=>{h&&(g||(g=qe(e,Hn,{duration:150,y:5},!0)),g.run(1))}),h=!0)},o($){$&&(g||(g=qe(e,Hn,{duration:150,y:5},!1)),g.run(0)),h=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ee(S)}}}function LN(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[IN],default:[MN]},$$scope:{ctx:n}};e=new Uu({props:l}),n[40](e);let o=n[6]&&L1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!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=L1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},i(r){s||(M(e.$$.fragment,r),M(o),s=!0)},o(r){D(e.$$.fragment,r),D(o),s=!1},d(r){r&&(y(t),y(i)),n[40](null),j(e,r),o&&o.d(r)}}}const AN=/^([\+\-])?(\w+)$/,A1=40;function PN(n,e,t){let i,s,l,o,r,a,u,f,c,d,m;Ge(n,In,Me=>t(47,d=Me)),Ge(n,Zs,Me=>t(28,m=Me));const _=wt();let{collection:g}=e,{sort:h=""}=e,{filter:k=""}=e,S,$=[],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 Me=localStorage.getItem(z);Me&&t(5,N=JSON.parse(Me)||[])}catch{}}function V(Me){return!!$.find(bt=>bt.id==Me)}async function Z(){const Me=T;for(let bt=1;bt<=Me;bt++)(bt===1||u)&&await G(bt,!1)}async function G(Me=1,bt=!0){var mi,Ei,oi;if(!(g!=null&&g.id))return;t(9,L=!0);let Ut=h;const Pt=Ut.match(AN),Pe=Pt?r.find(yt=>yt.name===Pt[2]):null;if(Pt&&Pe){const yt=((oi=(Ei=(mi=d==null?void 0:d.find(fn=>fn.id==Pe.collectionId))==null?void 0:mi.fields)==null?void 0:Ei.filter(fn=>fn.presentable))==null?void 0:oi.map(fn=>fn.name))||[],Jn=[];for(const fn of yt)Jn.push((Pt[1]||"")+Pt[2]+"."+fn);Jn.length>0&&(Ut=Jn.join(","))}const jt=U.getAllCollectionIdentifiers(g),Gt=o.map(yt=>yt.name+":excerpt(200)").concat(r.map(yt=>"expand."+yt.name+".*:excerpt(200)"));Gt.length&&Gt.unshift("*");let en=[];for(const yt of r)en=en.concat(U.getExpandPresentableRelFields(yt,d,2));return he.collection(g.id).getList(Me,A1,{sort:Ut,skipTotal:1,filter:U.normalizeSearchFilter(k,jt),expand:en.join(","),fields:Gt.join(","),requestKey:"records_list"}).then(async yt=>{var Jn;if(Me<=1&&de(),t(9,L=!1),t(8,T=yt.page),t(25,O=yt.items.length),_("load",$.concat(yt.items)),o.length)for(let fn of yt.items)fn._partial=!0;if(bt){const fn=++A;for(;(Jn=yt.items)!=null&&Jn.length&&A==fn;){const It=yt.items.splice(0,20);for(let Di of It)U.pushOrReplaceByKey($,Di);t(3,$),await U.yieldToMain()}}else{for(let fn of yt.items)U.pushOrReplaceByKey($,fn);t(3,$)}}).catch(yt=>{yt!=null&&yt.isAbort||(t(9,L=!1),console.warn(yt),de(),he.error(yt,!k||(yt==null?void 0:yt.status)!=400))})}function de(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,O=0),t(4,E={})}function pe(){c?ae():Ce()}function ae(){t(4,E={})}function Ce(){for(const Me of $)t(4,E[Me.id]=Me,E);t(4,E)}function Ye(Me){E[Me.id]?delete E[Me.id]:t(4,E[Me.id]=Me,E),t(4,E)}function Ke(){yn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ct)}async function ct(){if(I||!f||!(g!=null&&g.id))return;let Me=[];for(const bt of Object.keys(E))Me.push(he.collection(g.id).delete(bt));return t(10,I=!0),Promise.all(Me).then(()=>{nn(`Successfully deleted the selected ${f===1?"record":"records"}.`),_("delete",E),ae()}).catch(bt=>{he.error(bt)}).finally(()=>(t(10,I=!1),Z()))}function et(Me){Le.call(this,n,Me)}const xe=(Me,bt)=>{bt.target.checked?U.removeByValue(N,Me.id):U.pushUnique(N,Me.id),t(5,N)},Be=()=>pe();function ut(Me){h=Me,t(0,h)}function Bt(Me){ne[Me?"unshift":"push"](()=>{P=Me,t(11,P)})}const Ue=Me=>Ye(Me),De=Me=>_("select",Me),ot=(Me,bt)=>{bt.code==="Enter"&&(bt.preventDefault(),_("select",Me))},Ie=()=>t(1,k=""),We=()=>_("new"),Te=()=>G(T+1);function nt(Me){ne[Me?"unshift":"push"](()=>{S=Me,t(7,S)})}const zt=()=>ae(),Ne=()=>Ke();return n.$$set=Me=>{"collection"in Me&&t(22,g=Me.collection),"sort"in Me&&t(0,h=Me.sort),"filter"in Me&&t(1,k=Me.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,s=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,l=((g==null?void 0:g.fields)||[]).filter(Me=>!Me.hidden&&(!s||!F.includes(Me.name)))),n.$$.dirty[0]&67108864&&(o=l.filter(Me=>Me.type==="editor")),n.$$.dirty[0]&67108864&&(r=l.filter(Me=>Me.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=l.filter(Me=>!N.includes(Me.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&h!==-1&&k!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=O>=A1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&B(),n.$$.dirty[0]&67108864&&t(12,R=l.filter(Me=>!Me.primaryKey).map(Me=>({id:Me.id,name:Me.name})))},[h,k,G,$,E,N,f,S,T,L,I,P,R,c,u,a,i,_,pe,ae,Ye,Ke,g,V,Z,O,l,s,m,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt,Ne]}class NN extends ve{constructor(e){super(),ye(this,e,PN,LN,be,{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 RN(n){let e,t,i,s;return e=new QI({}),i=new si({props:{class:"flex-content",$$slots:{footer:[HN],default:[jN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function FN(n){let e,t;return e=new si({props:{center:!0,$$slots:{default:[VN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&32768&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function qN(n){let e,t;return e=new si({props:{center:!0,$$slots:{default:[BN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&32768&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function P1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[21])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function N1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function jN(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N=!n[12]&&P1(n);c=new Fr({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&N1(n);k=new Rr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new NN({props:B}),n[26](O),ne.push(()=>ge(O,"filter",z)),ne.push(()=>ge(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",s=C(),l=b("div"),r=W(o),a=C(),u=b("div"),N&&N.c(),f=C(),H(c.$$.fragment),d=C(),m=b("div"),_=b("button"),_.innerHTML=' API Preview',g=C(),R&&R.c(),h=C(),H(k.$$.fragment),S=C(),$=b("div"),T=C(),H(O.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(_,"type","button"),p(_,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,V){w(J,e,V),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),N&&N.m(u,null),v(u,f),q(c,u,null),v(e,d),v(e,m),v(m,_),v(m,g),R&&R.m(m,null),w(J,h,V),q(k,J,V),w(J,S,V),w(J,$,V),w(J,T,V),q(O,J,V),I=!0,A||(P=Y(_,"click",n[23]),A=!0)},p(J,V){(!I||V[0]&4)&&o!==(o=J[2].name+"")&&se(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,V):(N=P1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,V):(R=N1(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]),k.$set(Z);const G={};V[0]&4&&(G.collection=J[2]),!E&&V[0]&1&&(E=!0,G.filter=J[0],$e(()=>E=!1)),!L&&V[0]&2&&(L=!0,G.sort=J[1],$e(()=>L=!1)),O.$set(G)},i(J){I||(M(c.$$.fragment,J),M(k.$$.fragment,J),M(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(y(e),y(h),y(S),y($),y(T)),N&&N.d(),j(c),R&&R.d(),j(k,J),n[26](null),j(O,J),A=!1,P()}}}function HN(n){let e,t,i;function s(o){n[20](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new bN({props:l}),n[19](e),ne.push(()=>ge(e,"totalCount",s)),{c(){H(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],$e(()=>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),j(e,o)}}}function zN(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[18]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function UN(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function VN(n){let e,t,i;function s(r,a){return r[12]?UN:zN}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),v(e,t),v(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&y(e),o.d()}}}function BN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function WN(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[qN,FN,RN],m=[];function _($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=_(n),t=m[e]=d[e](n);let g={};s=new ff({props:g}),n[32](s),s.$on("truncate",n[33]);let h={};o=new dC({props:h}),n[34](o);let k={collection:n[2]};a=new pf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new rA({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),q(s,$,T),w($,l,T),q(o,$,T),w($,r,T),q(a,$,T),w($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=_($),e===O?m[e].p($,T):(oe(),D(m[O],1,1,()=>{m[O]=null}),re(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),M(t,1),t.m(i.parentNode,i));const E={};s.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(M(t),M(s.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(f.$$.fragment,$),c=!0)},o($){D(t),D(s.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(y(i),y(l),y(r),y(u)),m[e].d($),n[32](null),j(s,$),n[34](null),j(o,$),n[35](null),j(a,$),n[39](null),j(f,$)}}}function YN(n,e,t){let i,s,l,o,r,a,u,f;Ge(n,ii,De=>t(2,l=De)),Ge(n,an,De=>t(41,o=De)),Ge(n,Zs,De=>t(3,r=De)),Ge(n,zu,De=>t(17,a=De)),Ge(n,In,De=>t(11,u=De)),Ge(n,Il,De=>t(12,f=De));const c=new URLSearchParams(a);let d,m,_,g,h,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(l==null?void 0:l.id),O=0;ju(T);async function E(De){await _n(),(l==null?void 0:l.type)==="view"?g.show(De):_==null||_.show(De)}function L(){t(14,T=l==null?void 0:l.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const De=U.getAllCollectionIdentifiers(l),ot=$.split(",").map(Ie=>Ie.startsWith("+")||Ie.startsWith("-")?Ie.substring(1):Ie);ot.filter(Ie=>De.includes(Ie)).length!=ot.length&&((l==null?void 0:l.type)!="view"?t(1,$="-@rowid"):De.includes("created")?t(1,$="-created"):t(1,$=""))}function A(De={}){const ot=Object.assign({collection:(l==null?void 0:l.id)||"",filter:S,sort:$},De);U.replaceHashQueryParams(ot)}const P=()=>d==null?void 0:d.show();function N(De){ne[De?"unshift":"push"](()=>{k=De,t(9,k)})}function R(De){O=De,t(10,O)}const z=()=>d==null?void 0:d.show(l),F=()=>{h==null||h.load(),k==null||k.reload()},B=()=>m==null?void 0:m.show(l),J=()=>_==null?void 0:_.show(),V=De=>t(0,S=De.detail);function Z(De){ne[De?"unshift":"push"](()=>{h=De,t(8,h)})}function G(De){S=De,t(0,S)}function de(De){$=De,t(1,$)}const pe=De=>{A({recordId:De.detail.id});let ot=De.detail._partial?De.detail.id:De.detail;l.type==="view"?g==null||g.show(ot):_==null||_.show(ot)},ae=()=>{k==null||k.reload()},Ce=()=>_==null?void 0:_.show();function Ye(De){ne[De?"unshift":"push"](()=>{d=De,t(4,d)})}const Ke=()=>{h==null||h.load(),k==null||k.reload()};function ct(De){ne[De?"unshift":"push"](()=>{m=De,t(5,m)})}function et(De){ne[De?"unshift":"push"](()=>{_=De,t(6,_)})}const xe=()=>{A({recordId:null})},Be=De=>{S?k==null||k.reload():De.detail.isNew&&t(10,O++,O),h==null||h.reloadLoadedPages()},ut=De=>{(!S||h!=null&&h.hasRecord(De.detail.id))&&t(10,O--,O),h==null||h.reloadLoadedPages()};function Bt(De){ne[De?"unshift":"push"](()=>{g=De,t(7,g)})}const Ue=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,s=i.get("collection")),n.$$.dirty[0]&49164&&!r&&s&&s!=T&&s!=(l==null?void 0:l.id)&&s!=(l==null?void 0:l.name)&&h3(s),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&T!=l.name&&L(),n.$$.dirty[0]&4&&l!=null&&l.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||l!=null&&l.id)&&A(),n.$$.dirty[0]&4&&En(an,o=(l==null?void 0:l.name)||"Collections",o)},[S,$,l,r,d,m,_,g,h,k,O,u,f,A,T,s,i,a,P,N,R,z,F,B,J,V,Z,G,de,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue]}class KN extends ve{constructor(e){super(),ye(this,e,YN,WN,be,{},null,[-1,-1])}}function R1(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',s=C(),l=b("a"),l.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(l,"href","/settings/import-collections"),p(l,"class","sidebar-list-item")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Oe(Si.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Fn.call(null,i)),Oe(Si.call(null,l,{path:"/settings/import-collections/?.*"})),Oe(Fn.call(null,l))],o=!0)},d(a){a&&(y(e),y(t),y(i),y(s),y(l)),o=!1,Ee(r)}}}function JN(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h=!n[0]&&R1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),s=b("a"),s.innerHTML=' Application',l=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),d=b("a"),d.innerHTML=' Crons',m=C(),h&&h.c(),p(t,"class","sidebar-title"),p(s,"href","/settings"),p(s,"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(d,"href","/settings/crons"),p(d,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(k,S){w(k,e,S),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),v(e,r),v(e,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),h&&h.m(e,null),_||(g=[Oe(Si.call(null,s,{path:"/settings"})),Oe(Fn.call(null,s)),Oe(Si.call(null,o,{path:"/settings/mail/?.*"})),Oe(Fn.call(null,o)),Oe(Si.call(null,a,{path:"/settings/storage/?.*"})),Oe(Fn.call(null,a)),Oe(Si.call(null,f,{path:"/settings/backups/?.*"})),Oe(Fn.call(null,f)),Oe(Si.call(null,d,{path:"/settings/crons/?.*"})),Oe(Fn.call(null,d))],_=!0)},p(k,S){k[0]?h&&(h.d(1),h=null):h||(h=R1(),h.c(),h.m(e,null))},d(k){k&&y(e),h&&h.d(),_=!1,Ee(g)}}}function ZN(n){let e,t;return e=new Wy({props:{class:"settings-sidebar",$$slots:{default:[JN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function GN(n,e,t){let i;return Ge(n,Il,s=>t(0,i=s)),[i]}class Fl extends ve{constructor(e){super(),ye(this,e,GN,ZN,be,{})}}function XN(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(s,"for",r=n[8])},m(f,c){w(f,e,c),e.checked=n[0].batch.enabled,w(f,i,c),w(f,s,c),v(s,l),v(s,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(s,"for",r)},d(f){f&&(y(e),y(i),y(s)),a=!1,u()}}}function QN(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Max requests in a batch",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(r,"type","number"),p(r,"id",a=n[8]),p(r,"min","0"),p(r,"step","1"),r.required=n[1]},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].batch.maxRequests),u||(f=[Oe(Re.call(null,s,{text:"Rate limiting (if enabled) also applies for the batch create/update/upsert/delete requests.",position:"right"})),Y(r,"input",n[5])],u=!0)},p(c,d){d&256&&l!==(l=c[8])&&p(e,"for",l),d&256&&a!==(a=c[8])&&p(r,"id",a),d&2&&(r.required=c[1]),d&1&&mt(r.value)!==c[0].batch.maxRequests&&me(r,c[0].batch.maxRequests)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function xN(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",s=C(),l=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),l.required=n[1]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].batch.timeout),r||(a=Y(l,"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(l,"id",o),f&2&&(l.required=u[1]),f&1&&mt(l.value)!==u[0].batch.timeout&&me(l,u[0].batch.timeout)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function eR(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),p(l,"placeholder","Default to 128MB"),l.value=r=n[0].batch.maxBodySize||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function tR(n){let e,t,i,s,l,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[XN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[QN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[xN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[eR,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(c.$$.fragment),p(s,"class","col-lg-4"),p(r,"class","col-lg-4"),p(f,"class","col-lg-4"),p(i,"class","grid")},m(m,_){q(e,m,_),w(m,t,_),w(m,i,_),v(i,s),q(l,s,null),v(i,o),v(i,r),q(a,r,null),v(i,u),v(i,f),q(c,f,null),d=!0},p(m,_){const g={};_&769&&(g.$$scope={dirty:_,ctx:m}),e.$set(g);const h={};_&2&&(h.class="form-field "+(m[1]?"required":"")),_&771&&(h.$$scope={dirty:_,ctx:m}),l.$set(h);const k={};_&2&&(k.class="form-field "+(m[1]?"required":"")),_&771&&(k.$$scope={dirty:_,ctx:m}),a.$set(k);const S={};_&769&&(S.$$scope={dirty:_,ctx:m}),c.$set(S)},i(m){d||(M(e.$$.fragment,m),M(l.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(l.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(y(t),y(i)),j(e,m),j(l),j(a),j(c)}}}function nR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function iR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function F1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function lR(n){let e,t,i,s,l,o;function r(c,d){return c[1]?iR:nR}let a=r(n),u=a(n),f=n[2]&&F1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&M(f,1):(f=F1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function sR(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[lR],default:[tR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function oR(n,e,t){let i,s,l;Ge(n,Tn,c=>t(3,l=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=mt(this.value),t(0,o)}function u(){o.batch.timeout=mt(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(l==null?void 0:l.batch)),n.$$.dirty&1&&t(1,s=!!((c=o.batch)!=null&&c.enabled))},[o,s,i,l,r,a,u,f]}class rR extends ve{constructor(e){super(),ye(this,e,oR,sR,be,{formSettings:0})}}function q1(n,e,t){const i=n.slice();return i[17]=e[t],i}function j1(n){let e,t=n[17]+"",i,s,l,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),s=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&se(i,t)},d(a){a&&(y(e),y(s)),l=!1,o()}}}function aR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),l=new _o({props:S}),ne.push(()=>ge(l,"value",k));let $=ce(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=j1(q1(n,$,O));return{c(){e=b("label"),t=W("Trusted IP proxy headers"),s=C(),H(l.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as: - `);for(let O=0;Oo=!1)),l.$set(L),(!_||E&1)&&x(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){$=ce(O[2]);let I;for(I=0;I<$.length;I+=1){const A=q1(O,$,I);T[I]?T[I].p(A,E):(T[I]=j1(A),T[I].c(),T[I].m(d,null))}for(;Ige(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16])},m(_,g){w(_,e,g),v(e,t),v(e,i),v(e,s),w(_,o,g),q(r,_,g),u=!0,f||(c=Oe(Re.call(null,s,{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(_,g){(!u||g&65536&&l!==(l=_[16]))&&p(e,"for",l);const h={};!a&&g&1&&(a=!0,h.keyOfSelected=_[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(h)},i(_){u||(M(r.$$.fragment,_),u=!0)},o(_){D(r.$$.fragment,_),u=!1},d(_){_&&(y(e),y(o)),j(r,_),f=!1,c()}}}function fR(n){let e,t,i,s,l,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,_,g,h,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,E,L,I,A,P,N,R,z,F,B;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[aR,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[uR,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),s=b("span"),s.textContent="Resolved user IP:",l=C(),o=b("strong"),a=W(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),_=b("div"),g=b("span"),g.textContent="Detected proxy header:",h=C(),k=b("strong"),$=W(S),T=C(),O=b("div"),O.innerHTML=`

    When PocketBase is deployed on platforms like Fly or it is accessible through proxies such as + `),a[0]&128&&(u.btnClose=!r[7]),a[0]&128&&(u.escClose=!r[7]),a[0]&128&&(u.overlayClose=!r[7]),a[0]&16640&&(u.beforeHide=r[67]),a[0]&1031165|a[2]&134217728&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[9]?o?(o.p(r,a),a[0]&512&&M(o,1)):(o=b1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},i(r){s||(M(e.$$.fragment,r),M(o),s=!0)},o(r){D(e.$$.fragment,r),D(o),s=!1},d(r){r&&(y(t),y(i)),n[68](null),j(e,r),o&&o.d(r)}}}const Dl="form",lo="providers";function _N(n,e,t){let i,s,l,o,r,a,u,f;const c=wt(),d="record_"+U.randomString(5);let{collection:m}=e,h,g,_={},k={},S=null,$=!1,T=!1,O={},E={},L=JSON.stringify(_),I=L,A=Dl,P=!0,N=!0,R=m,z=[];const F=["id"],B=F.concat("email","emailVisibility","verified","tokenKey","password");function J(ue){return pe(ue),t(14,T=!0),t(15,A=Dl),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()&&(Ke(JSON.stringify(k)),Z())}async function de(ue){if(!ue)return null;let we=typeof ue=="string"?ue:ue==null?void 0:ue.id;if(we)try{return await he.collection(m.id).getOne(we)}catch(He){He.isAbort||(Z(),console.warn("resolveModel:",He),Mi(`Unable to load record with id "${we}"`))}return typeof ue=="object"?ue:null}async function pe(ue){t(7,N=!0),Jt({}),t(4,O={}),t(5,E={}),t(2,_=typeof ue=="string"?{id:ue,collectionId:m==null?void 0:m.id,collectionName:m==null?void 0:m.name}:ue||{}),t(3,k=structuredClone(_)),t(2,_=await de(ue)||{}),t(3,k=structuredClone(_)),await _n(),t(12,S=Ye()),!S||et(k,S)?t(12,S=null):(delete S.password,delete S.passwordConfirm),t(33,L=JSON.stringify(k)),t(7,N=!1)}async function ae(ue){var He,Qe;Jt({}),t(2,_=ue||{}),t(4,O={}),t(5,E={});const we=((Qe=(He=m==null?void 0:m.fields)==null?void 0:He.filter(at=>at.type!="file"))==null?void 0:Qe.map(at=>at.name))||[];for(let at in ue)we.includes(at)||t(3,k[at]=ue[at],k);await _n(),t(33,L=JSON.stringify(k)),xe()}function Ce(){return"record_draft_"+((m==null?void 0:m.id)||"")+"_"+((_==null?void 0:_.id)||"")}function Ye(ue){try{const we=window.localStorage.getItem(Ce());if(we)return JSON.parse(we)}catch{}return ue}function Ke(ue){try{window.localStorage.setItem(Ce(),ue)}catch(we){console.warn("updateDraft failure:",we),window.localStorage.removeItem(Ce())}}function ct(){S&&(t(3,k=S),t(12,S=null))}function et(ue,we){var pn;const He=structuredClone(ue||{}),Qe=structuredClone(we||{}),at=(pn=m==null?void 0:m.fields)==null?void 0:pn.filter(mn=>mn.type==="file");for(let mn of at)delete He[mn.name],delete Qe[mn.name];const Wt=["expand","password","passwordConfirm"];for(let mn of Wt)delete He[mn],delete Qe[mn];return JSON.stringify(He)==JSON.stringify(Qe)}function xe(){t(12,S=null),window.localStorage.removeItem(Ce())}async function Be(ue=!0){var we;if(!($||!u||!(m!=null&&m.id))){t(13,$=!0);try{const He=Bt();let Qe;if(P?Qe=await he.collection(m.id).create(He):Qe=await he.collection(m.id).update(k.id,He),nn(P?"Successfully created record.":"Successfully updated record."),xe(),s&&(k==null?void 0:k.id)==((we=he.authStore.record)==null?void 0:we.id)&&He.get("password"))return he.logout();ue?Z():ae(Qe),c("save",{isNew:P,record:Qe})}catch(He){he.error(He)}t(13,$=!1)}}function ut(){_!=null&&_.id&&yn("Do you really want to delete the selected record?",()=>he.collection(_.collectionId).delete(_.id).then(()=>{Z(),nn("Successfully deleted record."),c("delete",_)}).catch(ue=>{he.error(ue)}))}function Bt(){const ue=structuredClone(k||{}),we=new FormData,He={},Qe={};for(const at of(m==null?void 0:m.fields)||[])at.type=="autodate"||i&&at.type=="password"||(He[at.name]=!0,at.type=="json"&&(Qe[at.name]=!0));i&&ue.password&&(He.password=!0),i&&ue.passwordConfirm&&(He.passwordConfirm=!0);for(const at in ue)if(He[at]){if(typeof ue[at]>"u"&&(ue[at]=null),Qe[at]&&ue[at]!=="")try{JSON.parse(ue[at])}catch(Wt){const pn={};throw pn[at]={code:"invalid_json",message:Wt.toString()},new jn({status:400,response:{data:pn}})}U.addValueToFormData(we,at,ue[at])}for(const at in O){const Wt=U.toArray(O[at]);for(const pn of Wt)we.append(at+"+",pn)}for(const at in E){const Wt=U.toArray(E[at]);for(const pn of Wt)we.append(at+"-",pn)}return we}function Ue(){!(m!=null&&m.id)||!(_!=null&&_.email)||yn(`Do you really want to sent verification email to ${_.email}?`,()=>he.collection(m.id).requestVerification(_.email).then(()=>{nn(`Successfully sent verification email to ${_.email}.`)}).catch(ue=>{he.error(ue)}))}function De(){!(m!=null&&m.id)||!(_!=null&&_.email)||yn(`Do you really want to sent password reset email to ${_.email}?`,()=>he.collection(m.id).requestPasswordReset(_.email).then(()=>{nn(`Successfully sent password reset email to ${_.email}.`)}).catch(ue=>{he.error(ue)}))}function ot(){a?yn("You have unsaved changes. Do you really want to discard them?",()=>{Ie()}):Ie()}async function Ie(){let ue=_?structuredClone(_):null;if(ue){const we=["file","autodate"],He=(m==null?void 0:m.fields)||[];for(const Qe of He)we.includes(Qe.type)&&delete ue[Qe.name];ue.id=""}xe(),J(ue),await _n(),t(33,L="")}function We(ue){(ue.ctrlKey||ue.metaKey)&&ue.code=="KeyS"&&(ue.preventDefault(),ue.stopPropagation(),Be(!1))}function Te(){U.copyToClipboard(JSON.stringify(_,null,2)),Js("The record JSON was copied to your clipboard!",3e3)}const nt=()=>V(),zt=()=>Be(!1),Ne=()=>Ue(),Me=()=>De(),bt=()=>g==null?void 0:g.show(),Ut=()=>Te(),Pt=()=>ot(),Pe=()=>ut(),jt=()=>t(15,A=Dl),Gt=()=>t(15,A=lo),en=()=>ct(),mi=()=>xe();function Ei(){k.id=this.value,t(3,k)}function oi(ue){k=ue,t(3,k)}function yt(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Jn(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function fn(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function It(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Di(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function fl(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Vi(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Bi(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function cl(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function Ln(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function ql(ue,we){n.$$.not_equal(O[we.name],ue)&&(O[we.name]=ue,t(4,O))}function dl(ue,we){n.$$.not_equal(E[we.name],ue)&&(E[we.name]=ue,t(5,E))}function X(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function ee(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}function le(ue,we){n.$$.not_equal(k[we.name],ue)&&(k[we.name]=ue,t(3,k))}const Se=()=>a&&T?(yn("You have unsaved changes. Do you really want to close the panel?",()=>{Z()}),!1):(Jt({}),xe(),!0);function Fe(ue){ne[ue?"unshift":"push"](()=>{h=ue,t(10,h)})}function Ve(ue){Le.call(this,n,ue)}function rt(ue){Le.call(this,n,ue)}function Je(ue){ne[ue?"unshift":"push"](()=>{g=ue,t(11,g)})}return n.$$set=ue=>{"collection"in ue&&t(0,m=ue.collection)},n.$$.update=()=>{var ue,we,He;n.$$.dirty[0]&1&&t(9,i=(m==null?void 0:m.type)==="auth"),n.$$.dirty[0]&1&&t(17,s=(m==null?void 0:m.name)==="_superusers"),n.$$.dirty[0]&1&&t(20,l=!!((ue=m==null?void 0:m.fields)!=null&&ue.find(Qe=>Qe.type==="editor"))),n.$$.dirty[0]&1&&t(19,o=(we=m==null?void 0:m.fields)==null?void 0:we.find(Qe=>Qe.name==="id")),n.$$.dirty[0]&48&&t(37,r=U.hasNonEmptyProps(O)||U.hasNonEmptyProps(E)),n.$$.dirty[0]&8&&t(34,I=JSON.stringify(k)),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||Ke(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=((He=m==null?void 0:m.fields)==null?void 0:He.filter(Qe=>!f.includes(Qe.name)&&Qe.type!="autodate"))||[])},[m,V,_,k,O,E,P,N,a,i,h,g,S,$,T,A,z,s,u,o,l,d,Z,ct,xe,Be,ut,Ue,De,ot,We,Te,J,L,I,R,f,r,nt,zt,Ne,Me,bt,Ut,Pt,Pe,jt,Gt,en,mi,Ei,oi,yt,Jn,fn,It,Di,fl,Vi,Bi,cl,Ln,ql,dl,X,ee,le,Se,Fe,Ve,rt,Je]}class pf extends ve{constructor(e){super(),ye(this,e,_N,hN,be,{collection:0,show:32,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[32]}get hide(){return this.$$.ctx[1]}}function gN(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=C(),s=b("span"),o=W(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),v(e,t),v(e,i),v(e,s),v(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&se(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:te,o:te,d(a){a&&y(e)}}}function bN(n,e,t){const i=wt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=U.getAllCollectionIdentifiers(s),c=await he.collection(s.id).getList(1,1,{filter:U.normalizeSearchFilter(l,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,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class kN extends ve{constructor(e){super(),ye(this,e,bN,gN,be,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function k1(n,e,t){const i=n.slice();return i[58]=e[t],i}function y1(n,e,t){const i=n.slice();return i[61]=e[t],i}function v1(n,e,t){const i=n.slice();return i[61]=e[t],i}function w1(n,e,t){const i=n.slice();return i[54]=e[t],i}function S1(n){let e;function t(l,o){return l[9]?vN:yN}let i=t(n),s=i(n);return{c(){e=b("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&y(e),s.d()}}}function yN(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=C(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[13],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),v(e,t),v(e,s),v(e,l),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&&y(e),o=!1,r()}}}function vN(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function wN(n){let e,t;return{c(){e=b("i"),p(e,"class",t=U.getFieldTypeIcon(n[61].type))},m(i,s){w(i,e,s)},p(i,s){s[0]&32768&&t!==(t=U.getFieldTypeIcon(i[61].type))&&p(e,"class",t)},d(i){i&&y(e)}}}function SN(n){let e;return{c(){e=b("i"),p(e,"class",U.getFieldTypeIcon("primary"))},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function TN(n){let e,t,i,s=n[61].name+"",l;function o(u,f){return u[61].primaryKey?SN:wN}let r=o(n),a=r(n);return{c(){e=b("div"),a.c(),t=C(),i=b("span"),l=W(s),p(i,"class","txt"),p(e,"class","col-header-content")},m(u,f){w(u,e,f),a.m(e,null),v(e,t),v(e,i),v(i,l)},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&&s!==(s=u[61].name+"")&&se(l,s)},d(u){u&&y(e),a.d()}}}function T1(n,e){let t,i,s,l;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:[TN]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new er({props:r}),ne.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!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}),!s&&u[0]&1&&(s=!0,f.sort=e[0],$e(()=>s=!1)),i.$set(f)},i(a){l||(M(i.$$.fragment,a),l=!0)},o(a){D(i.$$.fragment,a),l=!1},d(a){a&&y(t),j(i,a)}}}function $1(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[33](e)},p:te,d(t){t&&y(e),n[33](null)}}}function C1(n){let e;function t(l,o){return l[9]?CN:$N}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function $N(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return MN;if(!a[16])return ON}let o=l(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=C(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),v(e,t),v(t,i),v(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&y(e),r&&r.d()}}}function CN(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ON(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[38]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function MN(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[37]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function O1(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[34](n[58])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=C(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[58].id),i.checked=l=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){w(d,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[Y(i,"change",c),Y(t,"click",tn(n[29]))],u=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[58].id)&&p(i,"id",s),m[0]&24&&l!==(l=n[4][n[58].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[58].id)&&p(r,"for",a)},d(d){d&&y(e),u=!1,Ee(f)}}}function M1(n,e){let t,i,s,l;return i=new Zy({props:{short:!0,record:e[58],field:e[61]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",s="col-type-"+e[61].type+" col-field-"+e[61].name),this.first=t},m(o,r){w(o,t,r),q(i,t,null),l=!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),(!l||r[0]&32768&&s!==(s="col-type-"+e[61].type+" col-field-"+e[61].name))&&p(t,"class",s)},i(o){l||(M(i.$$.fragment,o),l=!0)},o(o){D(i.$$.fragment,o),l=!1},d(o){o&&y(t),j(i)}}}function E1(n,e){let t,i,s=[],l=new Map,o,r,a,u,f,c=!e[16]&&O1(e),d=ce(e[15]);const m=_=>_[61].id;for(let _=0;_',p(r,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(_,k){w(_,t,k),c&&c.m(t,null),v(t,i);for(let S=0;SL[61].id;for(let L=0;L<_.length;L+=1){let I=v1(n,_,L),A=k(I);o.set(A,l[L]=T1(A,I))}let S=n[12].length&&$1(n),$=ce(n[3]);const T=L=>L[16]?L[58]:L[58].id;for(let L=0;L<$.length;L+=1){let I=k1(n,$,L),A=T(I);d.set(A,c[L]=E1(A,I))}let O=null;$.length||(O=C1(n));let E=n[3].length&&n[14]&&D1(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),g&&g.c(),s=C();for(let L=0;L({57:l}),({uniqueId:l})=>[0,l?67108864:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4128|o[1]&67108864|o[2]&16&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(M(i.$$.fragment,l),s=!0)},o(l){D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(i,l)}}}function IN(n){let e,t,i=[],s=new Map,l,o,r=ce(n[12]);const a=u=>u[54].id+u[54].name;for(let u=0;u{i=null}),re())},i(s){t||(M(i),t=!0)},o(s){D(i),t=!1},d(s){s&&y(e),i&&i.d(s)}}}function A1(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,g,_,k,S;return{c(){e=b("div"),t=b("div"),i=W("Selected "),s=b("strong"),l=W(n[6]),o=C(),a=W(r),u=C(),f=b("button"),f.innerHTML='Reset',c=C(),d=b("div"),m=C(),h=b("button"),h.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[10]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[10]),x(h,"btn-disabled",n[10]),p(e,"class","bulkbar")},m($,T){w($,e,T),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),v(e,h),_=!0,k||(S=[Y(f,"click",n[41]),Y(h,"click",n[42])],k=!0)},p($,T){(!_||T[0]&64)&&se(l,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&se(a,r),(!_||T[0]&1024)&&x(f,"btn-disabled",$[10]),(!_||T[0]&1024)&&x(h,"btn-loading",$[10]),(!_||T[0]&1024)&&x(h,"btn-disabled",$[10])},i($){_||($&&tt(()=>{_&&(g||(g=qe(e,Hn,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o($){$&&(g||(g=qe(e,Hn,{duration:150,y:5},!1)),g.run(0)),_=!1},d($){$&&y(e),$&&g&&g.end(),k=!1,Ee(S)}}}function AN(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[LN],default:[EN]},$$scope:{ctx:n}};e=new Uu({props:l}),n[40](e);let o=n[6]&&A1(n);return{c(){H(e.$$.fragment),t=C(),o&&o.c(),i=ke()},m(r,a){q(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!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=A1(r),o.c(),M(o,1),o.m(i.parentNode,i)):o&&(oe(),D(o,1,1,()=>{o=null}),re())},i(r){s||(M(e.$$.fragment,r),M(o),s=!0)},o(r){D(e.$$.fragment,r),D(o),s=!1},d(r){r&&(y(t),y(i)),n[40](null),j(e,r),o&&o.d(r)}}}const PN=/^([\+\-])?(\w+)$/,P1=40;function NN(n,e,t){let i,s,l,o,r,a,u,f,c,d,m;Ge(n,In,Me=>t(47,d=Me)),Ge(n,Zs,Me=>t(28,m=Me));const h=wt();let{collection:g}=e,{sort:_=""}=e,{filter:k=""}=e,S,$=[],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 Me=localStorage.getItem(z);Me&&t(5,N=JSON.parse(Me)||[])}catch{}}function V(Me){return!!$.find(bt=>bt.id==Me)}async function Z(){const Me=T;for(let bt=1;bt<=Me;bt++)(bt===1||u)&&await G(bt,!1)}async function G(Me=1,bt=!0){var mi,Ei,oi;if(!(g!=null&&g.id))return;t(9,L=!0);let Ut=_;const Pt=Ut.match(PN),Pe=Pt?r.find(yt=>yt.name===Pt[2]):null;if(Pt&&Pe){const yt=((oi=(Ei=(mi=d==null?void 0:d.find(fn=>fn.id==Pe.collectionId))==null?void 0:mi.fields)==null?void 0:Ei.filter(fn=>fn.presentable))==null?void 0:oi.map(fn=>fn.name))||[],Jn=[];for(const fn of yt)Jn.push((Pt[1]||"")+Pt[2]+"."+fn);Jn.length>0&&(Ut=Jn.join(","))}const jt=U.getAllCollectionIdentifiers(g),Gt=o.map(yt=>yt.name+":excerpt(200)").concat(r.map(yt=>"expand."+yt.name+".*:excerpt(200)"));Gt.length&&Gt.unshift("*");let en=[];for(const yt of r)en=en.concat(U.getExpandPresentableRelFields(yt,d,2));return he.collection(g.id).getList(Me,P1,{sort:Ut,skipTotal:1,filter:U.normalizeSearchFilter(k,jt),expand:en.join(","),fields:Gt.join(","),requestKey:"records_list"}).then(async yt=>{var Jn;if(Me<=1&&de(),t(9,L=!1),t(8,T=yt.page),t(25,O=yt.items.length),h("load",$.concat(yt.items)),o.length)for(let fn of yt.items)fn._partial=!0;if(bt){const fn=++A;for(;(Jn=yt.items)!=null&&Jn.length&&A==fn;){const It=yt.items.splice(0,20);for(let Di of It)U.pushOrReplaceByKey($,Di);t(3,$),await U.yieldToMain()}}else{for(let fn of yt.items)U.pushOrReplaceByKey($,fn);t(3,$)}}).catch(yt=>{yt!=null&&yt.isAbort||(t(9,L=!1),console.warn(yt),de(),he.error(yt,!k||(yt==null?void 0:yt.status)!=400))})}function de(){S==null||S.resetVerticalScroll(),t(3,$=[]),t(8,T=1),t(25,O=0),t(4,E={})}function pe(){c?ae():Ce()}function ae(){t(4,E={})}function Ce(){for(const Me of $)t(4,E[Me.id]=Me,E);t(4,E)}function Ye(Me){E[Me.id]?delete E[Me.id]:t(4,E[Me.id]=Me,E),t(4,E)}function Ke(){yn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,ct)}async function ct(){if(I||!f||!(g!=null&&g.id))return;let Me=[];for(const bt of Object.keys(E))Me.push(he.collection(g.id).delete(bt));return t(10,I=!0),Promise.all(Me).then(()=>{nn(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",E),ae()}).catch(bt=>{he.error(bt)}).finally(()=>(t(10,I=!1),Z()))}function et(Me){Le.call(this,n,Me)}const xe=(Me,bt)=>{bt.target.checked?U.removeByValue(N,Me.id):U.pushUnique(N,Me.id),t(5,N)},Be=()=>pe();function ut(Me){_=Me,t(0,_)}function Bt(Me){ne[Me?"unshift":"push"](()=>{P=Me,t(11,P)})}const Ue=Me=>Ye(Me),De=Me=>h("select",Me),ot=(Me,bt)=>{bt.code==="Enter"&&(bt.preventDefault(),h("select",Me))},Ie=()=>t(1,k=""),We=()=>h("new"),Te=()=>G(T+1);function nt(Me){ne[Me?"unshift":"push"](()=>{S=Me,t(7,S)})}const zt=()=>ae(),Ne=()=>Ke();return n.$$set=Me=>{"collection"in Me&&t(22,g=Me.collection),"sort"in Me&&t(0,_=Me.sort),"filter"in Me&&t(1,k=Me.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,s=(g==null?void 0:g.type)==="auth"&&g.name==="_superusers"),n.$$.dirty[0]&138412032&&t(26,l=((g==null?void 0:g.fields)||[]).filter(Me=>!Me.hidden&&(!s||!F.includes(Me.name)))),n.$$.dirty[0]&67108864&&(o=l.filter(Me=>Me.type==="editor")),n.$$.dirty[0]&67108864&&(r=l.filter(Me=>Me.type==="relation")),n.$$.dirty[0]&67108896&&t(15,a=l.filter(Me=>!N.includes(Me.id))),n.$$.dirty[0]&272629763&&!m&&g!=null&&g.id&&_!==-1&&k!==-1&&G(1),n.$$.dirty[0]&33554432&&t(14,u=O>=P1),n.$$.dirty[0]&16&&t(6,f=Object.keys(E).length),n.$$.dirty[0]&72&&t(13,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&B(),n.$$.dirty[0]&67108864&&t(12,R=l.filter(Me=>!Me.primaryKey).map(Me=>({id:Me.id,name:Me.name})))},[_,k,G,$,E,N,f,S,T,L,I,P,R,c,u,a,i,h,pe,ae,Ye,Ke,g,V,Z,O,l,s,m,et,xe,Be,ut,Bt,Ue,De,ot,Ie,We,Te,nt,zt,Ne]}class RN extends ve{constructor(e){super(),ye(this,e,NN,AN,be,{collection:22,sort:0,filter:1,hasRecord:23,reloadLoadedPages:24,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[23]}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[2]}}function FN(n){let e,t,i,s;return e=new xI({}),i=new si({props:{class:"flex-content",$$slots:{footer:[zN],default:[HN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&32768&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function qN(n){let e,t;return e=new si({props:{center:!0,$$slots:{default:[BN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&32768&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jN(n){let e,t;return e=new si({props:{center:!0,$$slots:{default:[WN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&32768&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function N1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Oe(Re.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[21])],t=!0)},p:te,d(s){s&&y(e),t=!1,Ee(i)}}}function R1(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function HN(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N=!n[12]&&N1(n);c=new Fr({}),c.$on("refresh",n[22]);let R=n[2].type!=="view"&&R1(n);k=new Rr({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[25]);function z(J){n[27](J)}function F(J){n[28](J)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),O=new RN({props:B}),n[26](O),ne.push(()=>ge(O,"filter",z)),ne.push(()=>ge(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",s=C(),l=b("div"),r=W(o),a=C(),u=b("div"),N&&N.c(),f=C(),H(c.$$.fragment),d=C(),m=b("div"),h=b("button"),h.innerHTML=' API Preview',g=C(),R&&R.c(),_=C(),H(k.$$.fragment),S=C(),$=b("div"),T=C(),H(O.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(J,V){w(J,e,V),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),N&&N.m(u,null),v(u,f),q(c,u,null),v(e,d),v(e,m),v(m,h),v(m,g),R&&R.m(m,null),w(J,_,V),q(k,J,V),w(J,S,V),w(J,$,V),w(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+"")&&se(r,o),J[12]?N&&(N.d(1),N=null):N?N.p(J,V):(N=N1(J),N.c(),N.m(u,f)),J[2].type!=="view"?R?R.p(J,V):(R=R1(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]),k.$set(Z);const G={};V[0]&4&&(G.collection=J[2]),!E&&V[0]&1&&(E=!0,G.filter=J[0],$e(()=>E=!1)),!L&&V[0]&2&&(L=!0,G.sort=J[1],$e(()=>L=!1)),O.$set(G)},i(J){I||(M(c.$$.fragment,J),M(k.$$.fragment,J),M(O.$$.fragment,J),I=!0)},o(J){D(c.$$.fragment,J),D(k.$$.fragment,J),D(O.$$.fragment,J),I=!1},d(J){J&&(y(e),y(_),y(S),y($),y(T)),N&&N.d(),j(c),R&&R.d(),j(k,J),n[26](null),j(O,J),A=!1,P()}}}function zN(n){let e,t,i;function s(o){n[20](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new kN({props:l}),n[19](e),ne.push(()=>ge(e,"totalCount",s)),{c(){H(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],$e(()=>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),j(e,o)}}}function UN(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=C(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[18]),s=!0)},p:te,d(o){o&&(y(e),y(t),y(i)),s=!1,l()}}}function VN(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function BN(n){let e,t,i;function s(r,a){return r[12]?VN:UN}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=C(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),v(e,t),v(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&y(e),o.d()}}}function WN(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function YN(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[jN,qN,FN],m=[];function h($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};s=new ff({props:g}),n[32](s),s.$on("truncate",n[33]);let _={};o=new pC({props:_}),n[34](o);let k={collection:n[2]};a=new pf({props:k}),n[35](a),a.$on("hide",n[36]),a.$on("save",n[37]),a.$on("delete",n[38]);let S={collection:n[2]};return f=new aA({props:S}),n[39](f),f.$on("hide",n[40]),{c(){t.c(),i=C(),H(s.$$.fragment),l=C(),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),H(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),q(s,$,T),w($,l,T),q(o,$,T),w($,r,T),q(a,$,T),w($,u,T),q(f,$,T),c=!0},p($,T){let O=e;e=h($),e===O?m[e].p($,T):(oe(),D(m[O],1,1,()=>{m[O]=null}),re(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),M(t,1),t.m(i.parentNode,i));const E={};s.$set(E);const L={};o.$set(L);const I={};T[0]&4&&(I.collection=$[2]),a.$set(I);const A={};T[0]&4&&(A.collection=$[2]),f.$set(A)},i($){c||(M(t),M(s.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(f.$$.fragment,$),c=!0)},o($){D(t),D(s.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(f.$$.fragment,$),c=!1},d($){$&&(y(i),y(l),y(r),y(u)),m[e].d($),n[32](null),j(s,$),n[34](null),j(o,$),n[35](null),j(a,$),n[39](null),j(f,$)}}}function KN(n,e,t){let i,s,l,o,r,a,u,f;Ge(n,ii,De=>t(2,l=De)),Ge(n,an,De=>t(41,o=De)),Ge(n,Zs,De=>t(3,r=De)),Ge(n,zu,De=>t(17,a=De)),Ge(n,In,De=>t(11,u=De)),Ge(n,Il,De=>t(12,f=De));const c=new URLSearchParams(a);let d,m,h,g,_,k,S=c.get("filter")||"",$=c.get("sort")||"-@rowid",T=c.get("collection")||(l==null?void 0:l.id),O=0;ju(T);async function E(De){await _n(),(l==null?void 0:l.type)==="view"?g.show(De):h==null||h.show(De)}function L(){t(14,T=l==null?void 0:l.id),t(0,S=""),t(1,$="-@rowid"),I(),A({recordId:null}),d==null||d.forceHide(),m==null||m.hide()}async function I(){if(!$)return;const De=U.getAllCollectionIdentifiers(l),ot=$.split(",").map(Ie=>Ie.startsWith("+")||Ie.startsWith("-")?Ie.substring(1):Ie);ot.filter(Ie=>De.includes(Ie)).length!=ot.length&&((l==null?void 0:l.type)!="view"?t(1,$="-@rowid"):De.includes("created")?t(1,$="-created"):t(1,$=""))}function A(De={}){const ot=Object.assign({collection:(l==null?void 0:l.id)||"",filter:S,sort:$},De);U.replaceHashQueryParams(ot)}const P=()=>d==null?void 0:d.show();function N(De){ne[De?"unshift":"push"](()=>{k=De,t(9,k)})}function R(De){O=De,t(10,O)}const z=()=>d==null?void 0:d.show(l),F=()=>{_==null||_.load(),k==null||k.reload()},B=()=>m==null?void 0:m.show(l),J=()=>h==null?void 0:h.show(),V=De=>t(0,S=De.detail);function Z(De){ne[De?"unshift":"push"](()=>{_=De,t(8,_)})}function G(De){S=De,t(0,S)}function de(De){$=De,t(1,$)}const pe=De=>{A({recordId:De.detail.id});let ot=De.detail._partial?De.detail.id:De.detail;l.type==="view"?g==null||g.show(ot):h==null||h.show(ot)},ae=()=>{k==null||k.reload()},Ce=()=>h==null?void 0:h.show();function Ye(De){ne[De?"unshift":"push"](()=>{d=De,t(4,d)})}const Ke=()=>{_==null||_.load(),k==null||k.reload()};function ct(De){ne[De?"unshift":"push"](()=>{m=De,t(5,m)})}function et(De){ne[De?"unshift":"push"](()=>{h=De,t(6,h)})}const xe=()=>{A({recordId:null})},Be=De=>{S?k==null||k.reload():De.detail.isNew&&t(10,O++,O),_==null||_.reloadLoadedPages()},ut=De=>{(!S||_!=null&&_.hasRecord(De.detail.id))&&t(10,O--,O),_==null||_.reloadLoadedPages()};function Bt(De){ne[De?"unshift":"push"](()=>{g=De,t(7,g)})}const Ue=()=>{A({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&131072&&t(16,i=new URLSearchParams(a)),n.$$.dirty[0]&65536&&t(15,s=i.get("collection")),n.$$.dirty[0]&49164&&!r&&s&&s!=T&&s!=(l==null?void 0:l.id)&&s!=(l==null?void 0:l.name)&&_3(s),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&T!=l.name&&L(),n.$$.dirty[0]&4&&l!=null&&l.id&&I(),n.$$.dirty[0]&8&&!r&&c.get("recordId")&&E(c.get("recordId")),n.$$.dirty[0]&15&&!r&&($||S||l!=null&&l.id)&&A(),n.$$.dirty[0]&4&&En(an,o=(l==null?void 0:l.name)||"Collections",o)},[S,$,l,r,d,m,h,g,_,k,O,u,f,A,T,s,i,a,P,N,R,z,F,B,J,V,Z,G,de,pe,ae,Ce,Ye,Ke,ct,et,xe,Be,ut,Bt,Ue]}class JN extends ve{constructor(e){super(),ye(this,e,KN,YN,be,{},null,[-1,-1])}}function F1(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),e.innerHTML='Sync',t=C(),i=b("a"),i.innerHTML=' Export collections',s=C(),l=b("a"),l.innerHTML=' Import collections',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(l,"href","/settings/import-collections"),p(l,"class","sidebar-list-item")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Oe(Si.call(null,i,{path:"/settings/export-collections/?.*"})),Oe(Fn.call(null,i)),Oe(Si.call(null,l,{path:"/settings/import-collections/?.*"})),Oe(Fn.call(null,l))],o=!0)},d(a){a&&(y(e),y(t),y(i),y(s),y(l)),o=!1,Ee(r)}}}function ZN(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_=!n[0]&&F1();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=C(),s=b("a"),s.innerHTML=' Application',l=C(),o=b("a"),o.innerHTML=' Mail settings',r=C(),a=b("a"),a.innerHTML=' Files storage',u=C(),f=b("a"),f.innerHTML=' Backups',c=C(),d=b("a"),d.innerHTML=' Crons',m=C(),_&&_.c(),p(t,"class","sidebar-title"),p(s,"href","/settings"),p(s,"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(d,"href","/settings/crons"),p(d,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(k,S){w(k,e,S),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),v(e,r),v(e,a),v(e,u),v(e,f),v(e,c),v(e,d),v(e,m),_&&_.m(e,null),h||(g=[Oe(Si.call(null,s,{path:"/settings"})),Oe(Fn.call(null,s)),Oe(Si.call(null,o,{path:"/settings/mail/?.*"})),Oe(Fn.call(null,o)),Oe(Si.call(null,a,{path:"/settings/storage/?.*"})),Oe(Fn.call(null,a)),Oe(Si.call(null,f,{path:"/settings/backups/?.*"})),Oe(Fn.call(null,f)),Oe(Si.call(null,d,{path:"/settings/crons/?.*"})),Oe(Fn.call(null,d))],h=!0)},p(k,S){k[0]?_&&(_.d(1),_=null):_||(_=F1(),_.c(),_.m(e,null))},d(k){k&&y(e),_&&_.d(),h=!1,Ee(g)}}}function GN(n){let e,t;return e=new Yy({props:{class:"settings-sidebar",$$slots:{default:[ZN]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function XN(n,e,t){let i;return Ge(n,Il,s=>t(0,i=s)),[i]}class Fl extends ve{constructor(e){super(),ye(this,e,XN,GN,be,{})}}function QN(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[8]),p(o,"class","txt-hint"),p(s,"for",r=n[8])},m(f,c){w(f,e,c),e.checked=n[0].batch.enabled,w(f,i,c),w(f,s,c),v(s,l),v(s,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(s,"for",r)},d(f){f&&(y(e),y(i),y(s)),a=!1,u()}}}function xN(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Max requests in a batch",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(r,"type","number"),p(r,"id",a=n[8]),p(r,"min","0"),p(r,"step","1"),r.required=n[1]},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].batch.maxRequests),u||(f=[Oe(Re.call(null,s,{text:"Rate limiting (if enabled) also applies for the batch create/update/upsert/delete requests.",position:"right"})),Y(r,"input",n[5])],u=!0)},p(c,d){d&256&&l!==(l=c[8])&&p(e,"for",l),d&256&&a!==(a=c[8])&&p(r,"id",a),d&2&&(r.required=c[1]),d&1&&mt(r.value)!==c[0].batch.maxRequests&&me(r,c[0].batch.maxRequests)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function eR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=b("span"),t.textContent="Max processing time (in seconds)",s=C(),l=b("input"),p(t,"class","txt"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),l.required=n[1]},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].batch.timeout),r||(a=Y(l,"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(l,"id",o),f&2&&(l.required=u[1]),f&1&&mt(l.value)!==u[0].batch.timeout&&me(l,u[0].batch.timeout)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function tR(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=W("Max body size (in bytes)"),s=C(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","number"),p(l,"id",o=n[8]),p(l,"min","0"),p(l,"step","1"),p(l,"placeholder","Default to 128MB"),l.value=r=n[0].batch.maxBodySize||""},m(f,c){w(f,e,c),v(e,t),w(f,s,c),w(f,l,c),a||(u=Y(l,"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(l,"id",o),c&1&&r!==(r=f[0].batch.maxBodySize||"")&&l.value!==r&&(l.value=r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function nR(n){let e,t,i,s,l,o,r,a,u,f,c,d;return e=new fe({props:{class:"form-field form-field-toggle m-b-sm",name:"batch.enabled",$$slots:{default:[QN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.maxRequests",$$slots:{default:[xN,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field "+(n[1]?"required":""),name:"batch.timeout",$$slots:{default:[eR,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new fe({props:{class:"form-field",name:"batch.maxBodySize",$$slots:{default:[tR,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),i=b("div"),s=b("div"),H(l.$$.fragment),o=C(),r=b("div"),H(a.$$.fragment),u=C(),f=b("div"),H(c.$$.fragment),p(s,"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),w(m,t,h),w(m,i,h),v(i,s),q(l,s,null),v(i,o),v(i,r),q(a,r,null),v(i,u),v(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}),l.$set(_);const k={};h&2&&(k.class="form-field "+(m[1]?"required":"")),h&771&&(k.$$scope={dirty:h,ctx:m}),a.$set(k);const S={};h&769&&(S.$$scope={dirty:h,ctx:m}),c.$set(S)},i(m){d||(M(e.$$.fragment,m),M(l.$$.fragment,m),M(a.$$.fragment,m),M(c.$$.fragment,m),d=!0)},o(m){D(e.$$.fragment,m),D(l.$$.fragment,m),D(a.$$.fragment,m),D(c.$$.fragment,m),d=!1},d(m){m&&(y(t),y(i)),j(e,m),j(l),j(a),j(c)}}}function iR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function lR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function q1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function sR(n){let e,t,i,s,l,o;function r(c,d){return c[1]?lR:iR}let a=r(n),u=a(n),f=n[2]&&q1();return{c(){e=b("div"),e.innerHTML=' Batch API',t=C(),i=b("div"),s=C(),u.c(),l=C(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&M(f,1):(f=q1(),f.c(),M(f,1),f.m(o.parentNode,o)):f&&(oe(),D(f,1,1,()=>{f=null}),re())},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),u.d(c),f&&f.d(c)}}}function oR(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[sR],default:[nR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function rR(n,e,t){let i,s,l;Ge(n,Tn,c=>t(3,l=c));let{formSettings:o}=e;function r(){o.batch.enabled=this.checked,t(0,o)}function a(){o.batch.maxRequests=mt(this.value),t(0,o)}function u(){o.batch.timeout=mt(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(l==null?void 0:l.batch)),n.$$.dirty&1&&t(1,s=!!((c=o.batch)!=null&&c.enabled))},[o,s,i,l,r,a,u,f]}class aR extends ve{constructor(e){super(),ye(this,e,rR,oR,be,{formSettings:0})}}function j1(n,e,t){const i=n.slice();return i[17]=e[t],i}function H1(n){let e,t=n[17]+"",i,s,l,o;function r(){return n[13](n[17])}return{c(){e=b("button"),i=W(t),s=W(" "),p(e,"type","button"),p(e,"class","label label-sm link-primary txt-mono")},m(a,u){w(a,e,u),v(e,i),w(a,s,u),l||(o=Y(e,"click",r),l=!0)},p(a,u){n=a,u&4&&t!==(t=n[17]+"")&&se(i,t)},d(a){a&&(y(e),y(s)),l=!1,o()}}}function uR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;function k(O){n[11](O)}let S={id:n[16],placeholder:"Leave empty to disable"};n[0].trustedProxy.headers!==void 0&&(S.value=n[0].trustedProxy.headers),l=new _o({props:S}),ne.push(()=>ge(l,"value",k));let $=ce(n[2]),T=[];for(let O=0;O<$.length;O+=1)T[O]=H1(j1(n,$,O));return{c(){e=b("label"),t=W("Trusted IP proxy headers"),s=C(),H(l.$$.fragment),r=C(),a=b("div"),u=b("button"),u.textContent="Clear",f=C(),c=b("div"),d=b("p"),m=W(`Comma separated list of headers such as: + `);for(let O=0;Oo=!1)),l.$set(L),(!h||E&1)&&x(u,"hidden",U.isEmpty(O[0].trustedProxy.headers)),E&68){$=ce(O[2]);let I;for(I=0;I<$.length;I+=1){const A=j1(O,$,I);T[I]?T[I].p(A,E):(T[I]=H1(A),T[I].c(),T[I].m(d,null))}for(;Ige(r,"keyOfSelected",d)),{c(){e=b("label"),t=b("span"),t.textContent="IP priority selection",i=C(),s=b("i"),o=C(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16])},m(h,g){w(h,e,g),v(e,t),v(e,i),v(e,s),w(h,o,g),q(r,h,g),u=!0,f||(c=Oe(Re.call(null,s,{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&&l!==(l=h[16]))&&p(e,"for",l);const _={};!a&&g&1&&(a=!0,_.keyOfSelected=h[0].trustedProxy.useLeftmostIP,$e(()=>a=!1)),r.$set(_)},i(h){u||(M(r.$$.fragment,h),u=!0)},o(h){D(r.$$.fragment,h),u=!1},d(h){h&&(y(e),y(o)),j(r,h),f=!1,c()}}}function cR(n){let e,t,i,s,l,o,r=(n[1].realIP||"N/A")+"",a,u,f,c,d,m,h,g,_,k,S=(n[1].possibleProxyHeader||"N/A")+"",$,T,O,E,L,I,A,P,N,R,z,F,B;return A=new fe({props:{class:"form-field m-b-0",name:"trustedProxy.headers",$$slots:{default:[uR,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),R=new fe({props:{class:"form-field m-0",name:"trustedProxy.useLeftmostIP",$$slots:{default:[fR,({uniqueId:J})=>({16:J}),({uniqueId:J})=>J?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),s=b("span"),s.textContent="Resolved user IP:",l=C(),o=b("strong"),a=W(r),u=C(),f=b("i"),c=C(),d=b("br"),m=C(),h=b("div"),g=b("span"),g.textContent="Detected proxy header:",_=C(),k=b("strong"),$=W(S),T=C(),O=b("div"),O.innerHTML=`

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

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

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

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

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

    `,E=C(),L=b("div"),I=b("div"),H(A.$$.fragment),P=C(),N=b("div"),H(R.$$.fragment),p(f,"class","ri-information-line txt-sm link-hint"),p(i,"class","inline-flex flex-gap-5"),p(_,"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){w(J,e,V),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(i,u),v(i,f),v(t,c),v(t,d),v(t,m),v(t,_),v(_,g),v(_,h),v(_,k),v(k,$),w(J,T,V),w(J,O,V),w(J,E,V),w(J,L,V),v(L,I),q(A,I,null),v(L,P),v(L,N),q(R,N,null),z=!0,F||(B=Oe(Re.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")+"")&&se(a,r),(!z||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&se($,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&&(y(e),y(T),y(O),y(E),y(L)),j(A),j(R),F=!1,B()}}}function cR(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function dR(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,`Detected proxy header. -It is recommend to list it as trusted.`)),t=!0)},d(s){s&&y(e),t=!1,i()}}}function pR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function mR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function H1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function hR(n){let e,t,i,s,l,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return dR;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return cR}let m=d(n,-1),_=m&&m(n);function g($,T){return $[3]?mR:pR}let h=g(n),k=h(n),S=n[4]&&H1();return{c(){e=b("div"),t=b("i"),i=C(),s=b("span"),s.textContent="User IP proxy headers",l=C(),_&&_.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ke(),p(t,"class","ri-route-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){w($,e,T),v(e,t),v(e,i),v(e,s),v(e,l),_&&_.m(e,null),w($,r,T),w($,a,T),w($,u,T),k.m($,T),w($,f,T),S&&S.m($,T),w($,c,T)},p($,T){m!==(m=d($,T))&&(_&&_.d(1),_=m&&m($),_&&(_.c(),_.m(e,null))),h!==(h=g($))&&(k.d(1),k=h($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&M(S,1):(S=H1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(oe(),D(S,1,1,()=>{S=null}),re())},d($){$&&(y(e),y(r),y(a),y(u),y(f),y(c)),_&&_.d(),k.d($),S&&S.d($)}}}function _R(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[hR],default:[fR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&1048639&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gR(n,e,t){let i,s,l,o,r,a;Ge(n,Tn,$=>t(10,a=$));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const _=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const h=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,s=d!=i),n.$$.dirty&1024&&t(4,l=!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.possibleProxyHeader)):u)},[f,c,r,o,l,s,m,_,d,i,a,g,h,k,S]}class bR extends ve{constructor(e){super(),ye(this,e,gR,_R,be,{formSettings:0,healthData:1})}}function z1(n,e,t){const i=n.slice();return i[5]=e[t],i}function U1(n){let e,t=(n[5].label||"")+"",i,s;return{c(){e=b("option"),i=W(t),e.__value=s=n[5].value,me(e,e.__value)},m(l,o){w(l,e,o),v(e,i)},p(l,o){o&2&&t!==(t=(l[5].label||"")+"")&&se(i,t),o&2&&s!==(s=l[5].value)&&(e.__value=s,me(e,e.__value))},d(l){l&&y(e)}}}function kR(n){let e,t,i,s,l,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,l=u.target.value)};return n.$$set=u=>{e=je(je({},e),Kt(u)),t(3,s=lt(e,i)),"value"in u&&t(0,l=u.value),"options"in u&&t(1,o=u.options)},[l,o,r,s,a]}class vR extends ve{constructor(e){super(),ye(this,e,yR,kR,be,{value:0,options:1})}}function V1(n,e,t){const i=n.slice();return i[22]=e[t],i}function B1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function wR(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(s,"for",r=n[28])},m(f,c){w(f,e,c),e.checked=n[0].rateLimits.enabled,w(f,i,c),w(f,s,c),v(s,l),v(s,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(s,"for",r)},d(f){f&&(y(e),y(i),y(s)),a=!1,u()}}}function W1(n){let e,t,i,s,l,o=ce(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML='Rate limit label Max requests
    (per IP) Interval
    (in seconds) Targeted users ',i=C(),s=b("tbody");for(let u=0;uge(e,"value",s)),{c(){H(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TR(n){let e,t,i;function s(){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(l,o){w(l,e,o),me(e,n[25].maxRequests),t||(i=Y(e,"input",s),t=!0)},p(l,o){n=l,o&1&&mt(e.value)!==n[25].maxRequests&&me(e,n[25].maxRequests)},d(l){l&&y(e),t=!1,i()}}}function $R(n){let e,t,i;function s(){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(l,o){w(l,e,o),me(e,n[25].duration),t||(i=Y(e,"input",s),t=!0)},p(l,o){n=l,o&1&&mt(e.value)!==n[25].duration&&me(e,n[25].duration)},d(l){l&&y(e),t=!1,i()}}}function CR(n){let e,t,i;function s(r){n[13](r,n[25])}function l(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new $n({props:o}),ne.push(()=>ge(e,"keyOfSelected",s)),e.$on("change",l),{c(){H(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,$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function Y1(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[SR]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[TR]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[$R]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[CR]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),H(i.$$.fragment),s=C(),l=b("td"),H(o.$$.fragment),r=C(),a=b("td"),H(u.$$.fragment),f=C(),c=b("td"),H(d.$$.fragment),m=C(),_=b("td"),g=b("button"),g.innerHTML='',h=C(),p(t,"class","col-label"),p(l,"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(_,"class","col-action"),p(e,"class","rate-limit-row")},m(O,E){w(O,e,E),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),q(d,c,null),v(e,m),v(e,_),v(_,g),v(e,h),k=!0,S||($=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){k||(M(i.$$.fragment,O),M(o.$$.fragment,O),M(u.$$.fragment,O),M(d.$$.fragment,O),k=!0)},o(O){D(i.$$.fragment,O),D(o.$$.fragment,O),D(u.$$.fragment,O),D(d.$$.fragment,O),k=!1},d(O){O&&y(e),j(i),j(o),j(u),j(d),S=!1,$()}}}function OR(n){let e,t,i=!U.isEmpty(n[0].rateLimits.rules),s,l,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[wR,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&W1(n);return{c(){var m,_,g;H(e.$$.fragment),t=C(),d&&d.c(),s=C(),l=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("button"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),x(o,"btn-danger",(g=(_=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:_.rules)==null?void 0:g.message),p(a,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(l,"class","flex m-t-sm")},m(m,_){q(e,m,_),w(m,t,_),d&&d.m(m,_),w(m,s,_),w(m,l,_),v(l,o),v(l,r),v(l,a),u=!0,f||(c=[Y(o,"click",n[16]),Y(a,"click",n[17])],f=!0)},p(m,_){var h,k,S;const g={};_&805306369&&(g.$$scope={dirty:_,ctx:m}),e.$set(g),_&1&&(i=!U.isEmpty(m[0].rateLimits.rules)),i?d?(d.p(m,_),_&1&&M(d,1)):(d=W1(m),d.c(),M(d,1),d.m(s.parentNode,s)):d&&(oe(),D(d,1,1,()=>{d=null}),re()),(!u||_&2)&&x(o,"btn-danger",(S=(k=(h=m[1])==null?void 0:h.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(y(t),y(s),y(l)),j(e,m),d&&d.d(m),f=!1,Ee(c)}}}function K1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function MR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function ER(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function DR(n){let e,t,i,s,l,o,r=n[4]&&K1();function a(c,d){return c[0].rateLimits.enabled?ER:MR}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),s=C(),r&&r.c(),l=C(),f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),r&&r.m(c,d),w(c,l,d),f.m(c,d),w(c,o,d)},p(c,d){c[4]?r?d&16&&M(r,1):(r=K1(),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),r&&r.d(c),f.d(c)}}}function IR(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function J1(n){let e,t=n[22].value.replace("*:",":")+"",i,s,l,o=n[22].description&&IR(n);return{c(){e=b("li"),i=W(t),s=C(),o&&o.c(),l=C(),p(e,"class","m-0")},m(r,a){w(r,e,a),v(e,i),v(e,s),o&&o.m(e,null),v(e,l)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&y(e),o&&o.d()}}}function LR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J=ce(n[6]),V=[];for(let Z=0;Zexact tag (e.g. users:create)
  • wildcard tag (e.g. *:create)
  • METHOD + exact path (e.g. POST /a/b)
  • METHOD + prefix path (e.g. POST /a/b/)
  • exact path (e.g. /a/b)
  • prefix path (e.g. /a/b/)
  • ",s=C(),l=b("p"),l.textContent=`In case of multiple rules with the same label but different target user audience (e.g. "guest" vs + extract the user IP.

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

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

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

    `,E=C(),L=b("div"),I=b("div"),H(A.$$.fragment),P=C(),N=b("div"),H(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){w(J,e,V),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(i,u),v(i,f),v(t,c),v(t,d),v(t,m),v(t,h),v(h,g),v(h,_),v(h,k),v(k,$),w(J,T,V),w(J,O,V),w(J,E,V),w(J,L,V),v(L,I),q(A,I,null),v(L,P),v(L,N),q(R,N,null),z=!0,F||(B=Oe(Re.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")+"")&&se(a,r),(!z||V&2)&&S!==(S=(J[1].possibleProxyHeader||"N/A")+"")&&se($,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&&(y(e),y(T),y(O),y(E),y(L)),j(A),j(R),F=!1,B()}}}function dR(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,"The configured proxy header doesn't match with the detected one.")),t=!0)},d(s){s&&y(e),t=!1,i()}}}function pR(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-alert-line txt-sm txt-warning")},m(s,l){w(s,e,l),t||(i=Oe(Re.call(null,e,`Detected proxy header. +It is recommend to list it as trusted.`)),t=!0)},d(s){s&&y(e),t=!1,i()}}}function mR(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function hR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function z1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function _R(n){let e,t,i,s,l,o,r,a,u,f,c;function d($,T){if(T&43&&(o=null),!$[3]&&$[1].possibleProxyHeader)return pR;if(o==null&&(o=!!($[3]&&!$[5]&&!$[0].trustedProxy.headers.includes($[1].possibleProxyHeader))),o)return dR}let m=d(n,-1),h=m&&m(n);function g($,T){return $[3]?hR:mR}let _=g(n),k=_(n),S=n[4]&&z1();return{c(){e=b("div"),t=b("i"),i=C(),s=b("span"),s.textContent="User IP proxy headers",l=C(),h&&h.c(),r=C(),a=b("div"),u=C(),k.c(),f=C(),S&&S.c(),c=ke(),p(t,"class","ri-route-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(a,"class","flex-fill")},m($,T){w($,e,T),v(e,t),v(e,i),v(e,s),v(e,l),h&&h.m(e,null),w($,r,T),w($,a,T),w($,u,T),k.m($,T),w($,f,T),S&&S.m($,T),w($,c,T)},p($,T){m!==(m=d($,T))&&(h&&h.d(1),h=m&&m($),h&&(h.c(),h.m(e,null))),_!==(_=g($))&&(k.d(1),k=_($),k&&(k.c(),k.m(f.parentNode,f))),$[4]?S?T&16&&M(S,1):(S=z1(),S.c(),M(S,1),S.m(c.parentNode,c)):S&&(oe(),D(S,1,1,()=>{S=null}),re())},d($){$&&(y(e),y(r),y(a),y(u),y(f),y(c)),h&&h.d(),k.d($),S&&S.d($)}}}function gR(n){let e,t;return e=new Ui({props:{single:!0,$$slots:{header:[_R],default:[cR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&1048639&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bR(n,e,t){let i,s,l,o,r,a;Ge(n,Tn,$=>t(10,a=$));const u=["X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP"];let{formSettings:f}=e,{healthData:c}=e,d="";function m($){t(0,f.trustedProxy.headers=[$],f)}const h=[{label:"Use leftmost IP",value:!0},{label:"Use rightmost IP",value:!1}];function g($){n.$$.not_equal(f.trustedProxy.headers,$)&&(f.trustedProxy.headers=$,t(0,f))}const _=()=>t(0,f.trustedProxy.headers=[],f),k=$=>m($);function S($){n.$$.not_equal(f.trustedProxy.useLeftmostIP,$)&&(f.trustedProxy.useLeftmostIP=$,t(0,f))}return n.$$set=$=>{"formSettings"in $&&t(0,f=$.formSettings),"healthData"in $&&t(1,c=$.healthData)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=JSON.stringify(f)),n.$$.dirty&768&&d!=i&&t(8,d=i),n.$$.dirty&768&&t(5,s=d!=i),n.$$.dirty&1024&&t(4,l=!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.possibleProxyHeader)):u)},[f,c,r,o,l,s,m,h,d,i,a,g,_,k,S]}class kR extends ve{constructor(e){super(),ye(this,e,bR,gR,be,{formSettings:0,healthData:1})}}function U1(n,e,t){const i=n.slice();return i[5]=e[t],i}function V1(n){let e,t=(n[5].label||"")+"",i,s;return{c(){e=b("option"),i=W(t),e.__value=s=n[5].value,me(e,e.__value)},m(l,o){w(l,e,o),v(e,i)},p(l,o){o&2&&t!==(t=(l[5].label||"")+"")&&se(i,t),o&2&&s!==(s=l[5].value)&&(e.__value=s,me(e,e.__value))},d(l){l&&y(e)}}}function yR(n){let e,t,i,s,l,o,r=[{type:t=n[3].type||"text"},{list:n[2]},{value:n[0]},n[3]],a={};for(let c=0;c{t(0,l=u.target.value)};return n.$$set=u=>{e=je(je({},e),Kt(u)),t(3,s=lt(e,i)),"value"in u&&t(0,l=u.value),"options"in u&&t(1,o=u.options)},[l,o,r,s,a]}class wR extends ve{constructor(e){super(),ye(this,e,vR,yR,be,{value:0,options:1})}}function B1(n,e,t){const i=n.slice();return i[22]=e[t],i}function W1(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function SR(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable "),o=b("small"),o.textContent="(experimental)",p(e,"type","checkbox"),p(e,"id",t=n[28]),p(o,"class","txt-hint"),p(s,"for",r=n[28])},m(f,c){w(f,e,c),e.checked=n[0].rateLimits.enabled,w(f,i,c),w(f,s,c),v(s,l),v(s,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(s,"for",r)},d(f){f&&(y(e),y(i),y(s)),a=!1,u()}}}function Y1(n){let e,t,i,s,l,o=ce(n[0].rateLimits.rules||[]),r=[];for(let u=0;uD(r[u],1,1,()=>{r[u]=null});return{c(){e=b("table"),t=b("thead"),t.innerHTML='Rate limit label Max requests
    (per IP) Interval
    (in seconds) Targeted users ',i=C(),s=b("tbody");for(let u=0;uge(e,"value",s)),{c(){H(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,$e(()=>t=!1)),e.$set(a)},i(o){i||(M(e.$$.fragment,o),i=!0)},o(o){D(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $R(n){let e,t,i;function s(){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(l,o){w(l,e,o),me(e,n[25].maxRequests),t||(i=Y(e,"input",s),t=!0)},p(l,o){n=l,o&1&&mt(e.value)!==n[25].maxRequests&&me(e,n[25].maxRequests)},d(l){l&&y(e),t=!1,i()}}}function CR(n){let e,t,i;function s(){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(l,o){w(l,e,o),me(e,n[25].duration),t||(i=Y(e,"input",s),t=!0)},p(l,o){n=l,o&1&&mt(e.value)!==n[25].duration&&me(e,n[25].duration)},d(l){l&&y(e),t=!1,i()}}}function OR(n){let e,t,i;function s(r){n[13](r,n[25])}function l(){return n[14](n[27])}let o={items:n[5]};return n[25].audience!==void 0&&(o.keyOfSelected=n[25].audience),e=new $n({props:o}),ne.push(()=>ge(e,"keyOfSelected",s)),e.$on("change",l),{c(){H(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,$e(()=>t=!1)),e.$set(u)},i(r){i||(M(e.$$.fragment,r),i=!0)},o(r){D(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function K1(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$;i=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".label",inlineError:!0,$$slots:{default:[TR]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".maxRequests",inlineError:!0,$$slots:{default:[$R]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".duration",inlineError:!0,$$slots:{default:[CR]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field",name:"rateLimits.rules."+n[27]+".audience",inlineError:!0,$$slots:{default:[OR]},$$scope:{ctx:n}}});function T(){return n[15](n[27])}return{c(){e=b("tr"),t=b("td"),H(i.$$.fragment),s=C(),l=b("td"),H(o.$$.fragment),r=C(),a=b("td"),H(u.$$.fragment),f=C(),c=b("td"),H(d.$$.fragment),m=C(),h=b("td"),g=b("button"),g.innerHTML='',_=C(),p(t,"class","col-label"),p(l,"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){w(O,e,E),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),q(d,c,null),v(e,m),v(e,h),v(h,g),v(e,_),k=!0,S||($=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){k||(M(i.$$.fragment,O),M(o.$$.fragment,O),M(u.$$.fragment,O),M(d.$$.fragment,O),k=!0)},o(O){D(i.$$.fragment,O),D(o.$$.fragment,O),D(u.$$.fragment,O),D(d.$$.fragment,O),k=!1},d(O){O&&y(e),j(i),j(o),j(u),j(d),S=!1,$()}}}function MR(n){let e,t,i=!U.isEmpty(n[0].rateLimits.rules),s,l,o,r,a,u,f,c;e=new fe({props:{class:"form-field form-field-toggle m-b-xs",name:"rateLimits.enabled",$$slots:{default:[SR,({uniqueId:m})=>({28:m}),({uniqueId:m})=>m?268435456:0]},$$scope:{ctx:n}}});let d=i&&Y1(n);return{c(){var m,h,g;H(e.$$.fragment),t=C(),d&&d.c(),s=C(),l=b("div"),o=b("button"),o.innerHTML=' Add rate limit rule',r=C(),a=b("button"),a.innerHTML="Learn more about the rate limit rules",p(o,"type","button"),p(o,"class","btn btn-sm btn-secondary m-r-auto"),x(o,"btn-danger",(g=(h=(m=n[1])==null?void 0:m.rateLimits)==null?void 0:h.rules)==null?void 0:g.message),p(a,"type","button"),p(a,"class","txt-nowrap txt-sm link-hint"),p(l,"class","flex m-t-sm")},m(m,h){q(e,m,h),w(m,t,h),d&&d.m(m,h),w(m,s,h),w(m,l,h),v(l,o),v(l,r),v(l,a),u=!0,f||(c=[Y(o,"click",n[16]),Y(a,"click",n[17])],f=!0)},p(m,h){var _,k,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=Y1(m),d.c(),M(d,1),d.m(s.parentNode,s)):d&&(oe(),D(d,1,1,()=>{d=null}),re()),(!u||h&2)&&x(o,"btn-danger",(S=(k=(_=m[1])==null?void 0:_.rateLimits)==null?void 0:k.rules)==null?void 0:S.message)},i(m){u||(M(e.$$.fragment,m),M(d),u=!0)},o(m){D(e.$$.fragment,m),D(d),u=!1},d(m){m&&(y(t),y(s),y(l)),j(e,m),d&&d.d(m),f=!1,Ee(c)}}}function J1(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Oe(Re.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&tt(()=>{i&&(t||(t=qe(e,Ct,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Ct,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&y(e),o&&t&&t.end(),s=!1,l()}}}function ER(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function DR(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function IR(n){let e,t,i,s,l,o,r=n[4]&&J1();function a(c,d){return c[0].rateLimits.enabled?DR:ER}let u=a(n),f=u(n);return{c(){e=b("div"),e.innerHTML=' Rate limiting',t=C(),i=b("div"),s=C(),r&&r.c(),l=C(),f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),r&&r.m(c,d),w(c,l,d),f.m(c,d),w(c,o,d)},p(c,d){c[4]?r?d&16&&M(r,1):(r=J1(),r.c(),M(r,1),r.m(l.parentNode,l)):r&&(oe(),D(r,1,1,()=>{r=null}),re()),u!==(u=a(c))&&(f.d(1),f=u(c),f&&(f.c(),f.m(o.parentNode,o)))},d(c){c&&(y(e),y(t),y(i),y(s),y(l),y(o)),r&&r.d(c),f.d(c)}}}function LR(n){let e;return{c(){e=b("em"),e.textContent=`(${n[22].description})`,p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Z1(n){let e,t=n[22].value.replace("*:",":")+"",i,s,l,o=n[22].description&&LR(n);return{c(){e=b("li"),i=W(t),s=C(),o&&o.c(),l=C(),p(e,"class","m-0")},m(r,a){w(r,e,a),v(e,i),v(e,s),o&&o.m(e,null),v(e,l)},p(r,a){r[22].description&&o.p(r,a)},d(r){r&&y(e),o&&o.d()}}}function AR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B,J=ce(n[6]),V=[];for(let Z=0;Zexact tag (e.g. users:create)
  • wildcard tag (e.g. *:create)
  • METHOD + exact path (e.g. POST /a/b)
  • METHOD + prefix path (e.g. POST /a/b/)
  • exact path (e.g. /a/b)
  • prefix path (e.g. /a/b/)
  • ",s=C(),l=b("p"),l.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=C(),r=b("hr"),a=C(),u=b("p"),u.textContent="The rate limit label could be in one of the following formats:",f=C(),c=b("ul"),d=b("li"),d.innerHTML=`[METHOD ]/my/path - full exact route match ( must be without trailing slash ; "METHOD" is optional).
    For example: -
    • /hello - matches GET /hello, POST /hello, etc.
    • POST /hello - matches only POST /hello
    `,m=C(),_=b("li"),_.innerHTML=`[METHOD ]/my/prefix/ - path prefix ( +
    • /hello - matches GET /hello, POST /hello, etc.
    • POST /hello - matches only POST /hello
    `,m=C(),h=b("li"),h.innerHTML=`[METHOD ]/my/prefix/ - path prefix ( must end with trailing slash; "METHOD" is optional). For example:
    • /hello/ - matches GET /hello, POST /hello/a/b/c, etc.
    • POST /hello/ - matches POST /hello, - POST /hello/a/b/c, etc.
    `,g=C(),h=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To + POST /hello/a/b/c, etc.`,g=C(),_=b("li"),k=b("code"),k.textContent="collectionName:predefinedTag",S=W(` - targets a specific action of a single collection. To apply the rule for all collections you can use the `),$=b("code"),$.textContent="*",T=W(` wildcard. For example: `),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;Zt(20,s=A)),Ge(n,Tn,A=>t(1,l=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 ju(),t(2,u=[]);for(let A of s)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(){Jt({}),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){Jt({}),o.rateLimits.rules.splice(A,1),t(0,o),o.rateLimits.rules.length||t(0,o.rateLimits.enabled=!1,o)}function _(){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 h(A,P){A[P].maxRequests=mt(this.value),t(0,o)}function k(A,P){A[P].duration=mt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const $=A=>{Wn("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){ne[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(l==null?void 0:l.rateLimits))},[o,l,u,f,i,r,a,d,m,_,g,h,k,S,$,T,O,E,L,I]}class FR extends ve{constructor(e){super(),ye(this,e,RR,NR,be,{formSettings:0})}}function qR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[HR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[zR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});function J(Ce){n[11](Ce)}let V={healthData:n[3]};n[0]!==void 0&&(V.formSettings=n[0]),f=new bR({props:V}),ne.push(()=>ge(f,"formSettings",J));function Z(Ce){n[12](Ce)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new FR({props:G}),ne.push(()=>ge(m,"formSettings",Z));function de(Ce){n[13](Ce)}let pe={};n[0]!==void 0&&(pe.formSettings=n[0]),h=new rR({props:pe}),ne.push(()=>ge(h,"formSettings",de)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[UR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});let ae=n[4]&&Z1(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),u=b("div"),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),H(h.$$.fragment),S=C(),$=b("div"),H(T.$$.fragment),O=C(),E=b("div"),L=b("div"),I=C(),ae&&ae.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],x(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Ce,Ye){w(Ce,e,Ye),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),v(a,u),q(f,u,null),v(u,d),q(m,u,null),v(u,g),q(h,u,null),v(e,S),v(e,$),q(T,$,null),w(Ce,O,Ye),w(Ce,E,Ye),v(E,L),v(E,I),ae&&ae.m(E,null),v(E,A),v(E,P),v(P,N),z=!0,F||(B=Y(P,"click",n[16]),F=!0)},p(Ce,Ye){const Ke={};Ye&25165825&&(Ke.$$scope={dirty:Ye,ctx:Ce}),i.$set(Ke);const ct={};Ye&25165825&&(ct.$$scope={dirty:Ye,ctx:Ce}),o.$set(ct);const et={};Ye&8&&(et.healthData=Ce[3]),!c&&Ye&1&&(c=!0,et.formSettings=Ce[0],$e(()=>c=!1)),f.$set(et);const xe={};!_&&Ye&1&&(_=!0,xe.formSettings=Ce[0],$e(()=>_=!1)),m.$set(xe);const Be={};!k&&Ye&1&&(k=!0,Be.formSettings=Ce[0],$e(()=>k=!1)),h.$set(Be);const ut={};Ye&25165825&&(ut.$$scope={dirty:Ye,ctx:Ce}),T.$set(ut),Ce[4]?ae?ae.p(Ce,Ye):(ae=Z1(Ce),ae.c(),ae.m(E,A)):ae&&(ae.d(1),ae=null),(!z||Ye&20&&R!==(R=!Ce[4]||Ce[2]))&&(P.disabled=R),(!z||Ye&4)&&x(P,"btn-loading",Ce[2])},i(Ce){z||(M(i.$$.fragment,Ce),M(o.$$.fragment,Ce),M(f.$$.fragment,Ce),M(m.$$.fragment,Ce),M(h.$$.fragment,Ce),M(T.$$.fragment,Ce),z=!0)},o(Ce){D(i.$$.fragment,Ce),D(o.$$.fragment,Ce),D(f.$$.fragment,Ce),D(m.$$.fragment,Ce),D(h.$$.fragment,Ce),D(T.$$.fragment,Ce),z=!1},d(Ce){Ce&&(y(e),y(O),y(E)),j(i),j(o),j(f),j(m),j(h),j(T),ae&&ae.d(),F=!1,B()}}}function jR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function HR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Application name"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.appName),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].meta.appName&&me(l,u[0].meta.appName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function zR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Application URL"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.appURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].meta.appURL&&me(l,u[0].meta.appURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function UR(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[23])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[14]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function Z1(n){let e,t,i,s;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(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&y(e),i=!1,s()}}}function VR(n){let e,t,i,s,l,o,r,a,u;const f=[jR,qR],c=[];function d(m,_){return m[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=b("header"),e.innerHTML='',t=C(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),v(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",it(n[5])),a=!0)},p(m,_){let g=l;l=d(m),l===g?c[l].p(m,_):(oe(),D(c[g],1,1,()=>{c[g]=null}),re(),o=c[l],o?o.p(m,_):(o=c[l]=f[l](m),o.c()),M(o,1),o.m(s,null))},i(m){r||(M(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(y(e),y(t),y(i)),c[l].d(),a=!1,u()}}}function BR(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[VR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function G1(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 s of e)s.priority=0,s.isTag?(s.priority+=1e3,s.isExactTag?s.priority+=10:s.priority+=5):(s.hasMethod&&(s.priority+=10),s.isPrefix||(s.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].lengthe[1].priority?-1:e[0].priorityt(17,s=P)),Ge(n,pr,P=>t(18,l=P)),Ge(n,an,P=>t(19,o=P)),En(an,o="Application settings",o);let r={},a={},u=!1,f=!1,c="",d={};_();async function m(){var P;try{t(3,d=((P=await he.health.check()||{})==null?void 0:P.data)||{})}catch(N){console.warn("Health check failed:",N)}}async function _(){t(1,u=!0);try{const P=await he.settings.getAll()||{};h(P),await m()}catch(P){he.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=G1(a.rateLimits.rules),a);try{const P=await he.settings.update(U.filterRedactedProps(a));h(P),await m(),Jt({}),nn("Successfully saved application settings.")}catch(P){he.error(P)}t(2,f=!1)}}function h(P={}){var N,R;En(pr,l=(N=P==null?void 0:P.meta)==null?void 0:N.appName,l),En(Il,s=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),s),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),G1(a.rateLimits.rules),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function L(){a.meta.hideControls=this.checked,t(0,a)}const I=()=>k(),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,k,r,c,S,$,T,O,E,L,I,A]}class YR extends ve{constructor(e){super(),ye(this,e,WR,BR,be,{})}}function KR(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Backup name"),s=C(),l=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&me(l,c[2])},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function JR(n){let e,t,i,s,l,o,r;return s=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[KR,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + `),B=b("ul");for(let Z=0;Zt(20,s=A)),Ge(n,Tn,A=>t(1,l=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 ju(),t(2,u=[]);for(let A of s)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(){Jt({}),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){Jt({}),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=mt(this.value),t(0,o)}function k(A,P){A[P].duration=mt(this.value),t(0,o)}function S(A,P){n.$$.not_equal(P.audience,A)&&(P.audience=A,t(0,o))}const $=A=>{Wn("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){ne[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(l==null?void 0:l.rateLimits))},[o,l,u,f,i,r,a,d,m,h,g,_,k,S,$,T,O,E,L,I]}class qR extends ve{constructor(e){super(),ye(this,e,FR,RR,be,{formSettings:0})}}function jR(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z,F,B;i=new fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[zR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.appURL",$$slots:{default:[UR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});function J(Ce){n[11](Ce)}let V={healthData:n[3]};n[0]!==void 0&&(V.formSettings=n[0]),f=new kR({props:V}),ne.push(()=>ge(f,"formSettings",J));function Z(Ce){n[12](Ce)}let G={};n[0]!==void 0&&(G.formSettings=n[0]),m=new qR({props:G}),ne.push(()=>ge(m,"formSettings",Z));function de(Ce){n[13](Ce)}let pe={};n[0]!==void 0&&(pe.formSettings=n[0]),_=new aR({props:pe}),ne.push(()=>ge(_,"formSettings",de)),T=new fe({props:{class:"form-field form-field-toggle m-0",name:"meta.hideControls",$$slots:{default:[VR,({uniqueId:Ce})=>({23:Ce}),({uniqueId:Ce})=>Ce?8388608:0]},$$scope:{ctx:n}}});let ae=n[4]&&G1(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),u=b("div"),H(f.$$.fragment),d=C(),H(m.$$.fragment),g=C(),H(_.$$.fragment),S=C(),$=b("div"),H(T.$$.fragment),O=C(),E=b("div"),L=b("div"),I=C(),ae&&ae.c(),A=C(),P=b("button"),N=b("span"),N.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(u,"class","accordions"),p(a,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid"),p(L,"class","flex-fill"),p(N,"class","txt"),p(P,"type","submit"),p(P,"class","btn btn-expanded"),P.disabled=R=!n[4]||n[2],x(P,"btn-loading",n[2]),p(E,"class","flex m-t-base")},m(Ce,Ye){w(Ce,e,Ye),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),v(a,u),q(f,u,null),v(u,d),q(m,u,null),v(u,g),q(_,u,null),v(e,S),v(e,$),q(T,$,null),w(Ce,O,Ye),w(Ce,E,Ye),v(E,L),v(E,I),ae&&ae.m(E,null),v(E,A),v(E,P),v(P,N),z=!0,F||(B=Y(P,"click",n[16]),F=!0)},p(Ce,Ye){const Ke={};Ye&25165825&&(Ke.$$scope={dirty:Ye,ctx:Ce}),i.$set(Ke);const ct={};Ye&25165825&&(ct.$$scope={dirty:Ye,ctx:Ce}),o.$set(ct);const et={};Ye&8&&(et.healthData=Ce[3]),!c&&Ye&1&&(c=!0,et.formSettings=Ce[0],$e(()=>c=!1)),f.$set(et);const xe={};!h&&Ye&1&&(h=!0,xe.formSettings=Ce[0],$e(()=>h=!1)),m.$set(xe);const Be={};!k&&Ye&1&&(k=!0,Be.formSettings=Ce[0],$e(()=>k=!1)),_.$set(Be);const ut={};Ye&25165825&&(ut.$$scope={dirty:Ye,ctx:Ce}),T.$set(ut),Ce[4]?ae?ae.p(Ce,Ye):(ae=G1(Ce),ae.c(),ae.m(E,A)):ae&&(ae.d(1),ae=null),(!z||Ye&20&&R!==(R=!Ce[4]||Ce[2]))&&(P.disabled=R),(!z||Ye&4)&&x(P,"btn-loading",Ce[2])},i(Ce){z||(M(i.$$.fragment,Ce),M(o.$$.fragment,Ce),M(f.$$.fragment,Ce),M(m.$$.fragment,Ce),M(_.$$.fragment,Ce),M(T.$$.fragment,Ce),z=!0)},o(Ce){D(i.$$.fragment,Ce),D(o.$$.fragment,Ce),D(f.$$.fragment,Ce),D(m.$$.fragment,Ce),D(_.$$.fragment,Ce),D(T.$$.fragment,Ce),z=!1},d(Ce){Ce&&(y(e),y(O),y(E)),j(i),j(o),j(f),j(m),j(_),j(T),ae&&ae.d(),F=!1,B()}}}function HR(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function zR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Application name"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.appName),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].meta.appName&&me(l,u[0].meta.appName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function UR(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Application URL"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.appURL),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].meta.appURL&&me(l,u[0].meta.appURL)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function VR(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Hide collection create and edit controls",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[23])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[14]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function G1(n){let e,t,i,s;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(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&y(e),i=!1,s()}}}function BR(n){let e,t,i,s,l,o,r,a,u;const f=[HR,jR],c=[];function d(m,h){return m[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=b("header"),e.innerHTML='

    ',t=C(),i=b("div"),s=b("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),v(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",it(n[5])),a=!0)},p(m,h){let g=l;l=d(m),l===g?c[l].p(m,h):(oe(),D(c[g],1,1,()=>{c[g]=null}),re(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),M(o,1),o.m(s,null))},i(m){r||(M(o),r=!0)},o(m){D(o),r=!1},d(m){m&&(y(e),y(t),y(i)),c[l].d(),a=!1,u()}}}function WR(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[BR]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function X1(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 s of e)s.priority=0,s.isTag?(s.priority+=1e3,s.isExactTag?s.priority+=10:s.priority+=5):(s.hasMethod&&(s.priority+=10),s.isPrefix||(s.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].lengthe[1].priority?-1:e[0].priorityt(17,s=P)),Ge(n,pr,P=>t(18,l=P)),Ge(n,an,P=>t(19,o=P)),En(an,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 he.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 he.settings.getAll()||{};_(P),await m()}catch(P){he.error(P)}t(1,u=!1)}async function g(){if(!(f||!i)){t(2,f=!0),t(0,a.rateLimits.rules=X1(a.rateLimits.rules),a);try{const P=await he.settings.update(U.filterRedactedProps(a));_(P),await m(),Jt({}),nn("Successfully saved application settings.")}catch(P){he.error(P)}t(2,f=!1)}}function _(P={}){var N,R;En(pr,l=(N=P==null?void 0:P.meta)==null?void 0:N.appName,l),En(Il,s=!!((R=P==null?void 0:P.meta)!=null&&R.hideControls),s),t(0,a={meta:(P==null?void 0:P.meta)||{},batch:P.batch||{},trustedProxy:P.trustedProxy||{headers:[]},rateLimits:P.rateLimits||{rules:[]}}),X1(a.rateLimits.rules),t(7,r=JSON.parse(JSON.stringify(a)))}function k(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function S(){a.meta.appName=this.value,t(0,a)}function $(){a.meta.appURL=this.value,t(0,a)}function T(P){a=P,t(0,a)}function O(P){a=P,t(0,a)}function E(P){a=P,t(0,a)}function L(){a.meta.hideControls=this.checked,t(0,a)}const I=()=>k(),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,k,r,c,S,$,T,O,E,L,I,A]}class KR extends ve{constructor(e){super(),ye(this,e,YR,WR,be,{})}}function JR(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=W("Backup name"),s=C(),l=b("input"),r=C(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),v(e,t),w(c,s,d),w(c,l,d),me(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&me(l,c[2])},d(c){c&&(y(e),y(s),y(l),y(r),y(a)),u=!1,f()}}}function ZR(n){let e,t,i,s,l,o,r;return s=new fe({props:{class:"form-field m-0",name:"name",$$slots:{default:[JR,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

    `,t=C(),i=b("form"),H(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),q(s,i,null),l=!0,o||(r=Y(i,"submit",it(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(M(s.$$.fragment,a),l=!0)},o(a){D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(t),y(i)),j(s),o=!1,r()}}}function ZR(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function GR(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],x(s,"btn-loading",n[3])},m(a,u){w(a,e,u),v(e,t),w(a,i,u),w(a,s,u),v(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&x(s,"btn-loading",a[3])},d(a){a&&(y(e),y(i),y(s)),o=!1,r()}}}function XR(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[GR],header:[ZR],default:[JR]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function QR(n,e,t){const i=wt(),s="backup_create_"+U.randomString(5);let l,o="",r=!1,a;function u(S){Jt({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await he.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),nn("Successfully generated new backup.")}catch(S){S.isAbort||he.error(S)}clearTimeout(a),t(3,r=!1)}}ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Js("A backup has already been started, please wait."),!1):!0,_=()=>(r&&Js("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ne[S?"unshift":"push"](()=>{l=S,t(1,l)})}function h(S){Le.call(this,n,S)}function k(S){Le.call(this,n,S)}return[f,l,o,r,s,c,u,d,m,_,g,h,k]}class xR extends ve{constructor(e){super(),ye(this,e,QR,XR,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function eF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Backup name"),s=C(),l=b("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),r||(a=Y(l,"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(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function tF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;return u=new Oi({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[eF,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

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

    `,t=C(),i=b("form"),H(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),q(s,i,null),l=!0,o||(r=Y(i,"submit",it(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(M(s.$$.fragment,a),l=!0)},o(a){D(s.$$.fragment,a),l=!1},d(a){a&&(y(e),y(t),y(i)),j(s),o=!1,r()}}}function GR(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function XR(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],x(s,"btn-loading",n[3])},m(a,u){w(a,e,u),v(e,t),w(a,i,u),w(a,s,u),v(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&x(s,"btn-loading",a[3])},d(a){a&&(y(e),y(i),y(s)),o=!1,r()}}}function QR(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[XR],header:[GR],default:[ZR]},$$scope:{ctx:n}};return e=new ln({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function xR(n,e,t){const i=wt(),s="backup_create_"+U.randomString(5);let l,o="",r=!1,a;function u(S){Jt({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await he.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),nn("Successfully generated new backup.")}catch(S){S.isAbort||he.error(S)}clearTimeout(a),t(3,r=!1)}}ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(Js("A backup has already been started, please wait."),!1):!0,h=()=>(r&&Js("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){ne[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Le.call(this,n,S)}function k(S){Le.call(this,n,S)}return[f,l,o,r,s,c,u,d,m,h,g,_,k]}class eF extends ve{constructor(e){super(),ye(this,e,xR,QR,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function tF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Backup name"),s=C(),l=b("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[2]),r||(a=Y(l,"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(l,"id",o),f&4&&l.value!==u[2]&&me(l,u[2])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function nF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;return u=new Oi({props:{value:n[1]}}),m=new fe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[tF,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

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

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

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

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

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

    `,t=C(),i=b("div"),s=W(`Type the backup name `),l=b("div"),o=b("span"),r=W(n[1]),a=C(),H(u.$$.fragment),f=W(` - to confirm:`),c=C(),d=b("form"),H(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),v(i,s),v(i,l),v(l,o),v(o,r),v(l,a),q(u,l,null),v(i,f),w(k,c,S),w(k,d,S),q(m,d,null),_=!0,g||(h=Y(d,"submit",it(n[7])),g=!0)},p(k,S){(!_||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){_||(M(u.$$.fragment,k),M(m.$$.fragment,k),_=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),_=!1},d(k){k&&(y(e),y(t),y(i),y(c),y(d)),j(u),j(m),g=!1,h()}}}function nF(n){let e,t,i,s;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),s=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),v(e,t),v(e,i),v(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&y(e)}}}function iF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=C(),s=b("button"),l=b("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function lF(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[iF],header:[nF],default:[tF]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function sF(n,e,t){let i;const s="backup_restore_"+U.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await he.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Mi(((S=$.response)==null?void 0:S.message)||$.message))}}}ro(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const _=()=>!a;function g(S){ne[S?"unshift":"push"](()=>{l=S,t(3,l)})}function h(S){Le.call(this,n,S)}function k(S){Le.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,m,_,g,h,k]}class oF extends ve{constructor(e){super(),ye(this,e,sF,lF,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function X1(n,e,t){const i=n.slice();return i[22]=e[t],i}function Q1(n,e,t){const i=n.slice();return i[19]=e[t],i}function rF(n){let e=[],t=new Map,i,s,l=ce(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function eb(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,m=U.formattedFileSize(e[22].size)+"",_,g,h,k,S,$,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"),s=C(),l=b("div"),o=b("span"),a=W(r),f=C(),c=b("span"),d=W("("),_=W(m),g=W(")"),h=C(),k=b("div"),S=b("button"),$=b("i"),O=C(),E=b("button"),L=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(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"),x(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(pe,ae){w(pe,t,ae),v(t,i),v(t,s),v(t,l),v(l,o),v(o,a),v(l,f),v(l,c),v(c,d),v(c,_),v(c,g),v(t,h),v(t,k),v(k,S),v(S,$),v(k,O),v(k,E),v(E,L),v(k,A),v(k,P),v(P,N),v(t,z),B=!0,J||(V=[Oe(Re.call(null,S,"Download")),Y(S,"click",it(Z)),Oe(Re.call(null,E,"Restore")),Y(E,"click",it(G)),Oe(Re.call(null,P,"Delete")),Y(P,"click",it(de))],J=!0)},p(pe,ae){e=pe,(!B||ae&8)&&r!==(r=e[22].key+"")&&se(a,r),(!B||ae&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ae&8)&&m!==(m=U.formattedFileSize(e[22].size)+"")&&se(_,m),(!B||ae&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ae&40)&&x(S,"btn-loading",e[5][e[22].key]),(!B||ae&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!B||ae&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!B||ae&72)&&x(P,"btn-loading",e[6][e[22].key])},i(pe){B||(pe&&tt(()=>{B&&(F||(F=qe(t,ht,{duration:150},!0)),F.run(1))}),B=!0)},o(pe){pe&&(F||(F=qe(t,ht,{duration:150},!1)),F.run(0)),B=!1},d(pe){pe&&y(t),pe&&F&&F.end(),J=!1,Ee(V)}}}function tb(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function uF(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function fF(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function cF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g;const h=[aF,rF],k=[];function S(I,A){return I[4]?0:1}i=S(n),s=k[i]=h[i](n);function $(I,A){return I[7]?fF:uF}let T=$(n),O=T(n),E={};f=new xR({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new oF({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),s.c(),l=C(),o=b("div"),r=b("button"),O.c(),u=C(),H(f.$$.fragment),c=C(),H(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){w(I,e,A),v(e,t),k[i].m(t,null),v(e,l),v(e,o),v(o,r),O.m(r,null),w(I,u,A),q(f,I,A),w(I,c,A),q(d,I,A),m=!0,_||(g=Y(r,"click",n[13]),_=!0)},p(I,[A]){let P=i;i=S(I),i===P?k[i].p(I,A):(oe(),D(k[P],1,1,()=>{k[P]=null}),re(),s=k[i],s?s.p(I,A):(s=k[i]=h[i](I),s.c()),M(s,1),s.m(t,null)),T!==(T=$(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(M(s),M(f.$$.fragment,I),M(d.$$.fragment,I),m=!0)},o(I){D(s),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(y(e),y(u),y(c)),k[i].d(),O.d(),n[14](null),j(f,I),n[16](null),j(d,I),_=!1,g()}}}function dF(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),_();async function f(){t(4,o=!0);try{t(3,l=await he.backups.getFullList()),l.sort((E,L)=>E.modifiedL.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(he.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await he.getSuperuserFileToken();U.download(he.backups.getDownloadURL(L,E))}catch(L){L.isAbort||he.error(L)}delete r[E],t(5,r)}}function d(E){yn(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await he.backups.delete(E),U.removeByKey(l,"name",E),f(),nn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||he.error(L)}delete a[E],t(6,a)}}async function _(){var E;try{const L=await he.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{}}un(()=>{let E=setInterval(()=>{_()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),h=E=>s.show(E.key),k=E=>d(E.key),S=()=>i==null?void 0:i.show();function $(E){ne[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ne[E?"unshift":"push"](()=>{s=E,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,g,h,k,S,$,T,O]}class pF extends ve{constructor(e){super(),ye(this,e,dF,cF,be,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const mF=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),nb=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function hF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),v(s,l),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&&se(l,u[4]),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function ib(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[_F,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[gF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[bF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[kF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[yF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[vF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),m=C(),_=b("div"),H(g.$$.fragment),h=C(),k=b("div"),H(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(_,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){w(L,e,I),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),q(d,c,null),v(e,m),v(e,_),q(g,_,null),v(e,h),v(e,k),q(S,k,null),v(e,$),v(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=qe(e,ht,{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=qe(e,ht,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&y(e),j(i),j(o),j(u),j(d),j(g),j(S),L&&O&&O.end()}}}function _F(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].endpoint),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].endpoint&&me(l,u[0].endpoint)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function gF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Bucket"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].bucket),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].bucket&&me(l,u[0].bucket)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function bF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Region"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].region),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].region&&me(l,u[0].region)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function kF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Access key"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].accessKey),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&me(l,u[0].accessKey)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function yF(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Secret"),s=C(),H(l.$$.fragment),p(e,"for",i=n[23])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const _={};m&8388608&&(_.id=d[23]),!o&&m&32&&(o=!0,_.mask=d[5],$e(()=>o=!1)),!r&&m&1&&(r=!0,_.value=d[0].secret,$e(()=>r=!1)),l.$set(_)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function vF(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[23])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[16]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function wF(n){let e,t,i,s,l;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[hF,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Nt(o,n,n[17],nb);let a=n[0].enabled&&ib(n);return{c(){H(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),s=ke()},m(u,f){q(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&131079)&&Ft(r,o,u,u[17],l?Rt(o,u[17],f,mF):qt(u[17]),nb),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=ib(u),a.c(),M(a,1),a.m(s.parentNode,s)):a&&(oe(),D(a,1,1,()=>{a=null}),re())},i(u){l||(M(e.$$.fragment,u),M(r,u),M(a),l=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),l=!1},d(u){u&&(y(t),y(i),y(s)),j(e,u),r&&r.d(u),a&&a.d(u)}}}const Fa="s3_test_request";function SF(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,_=!1;function g(){t(5,_=!!(l!=null&&l.accessKey))}function h(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;he.cancelRequest(Fa),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(Fa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await he.settings.testS3(u,{$cancelKey:Fa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}un(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function L(P){_=P,t(5,_)}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,l=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,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&l!=null&&l.enabled&&(g(),h(100)),n.$$.dirty&9&&(o.enabled||Wn(r))},[o,f,c,r,a,_,l,u,i,S,$,T,O,E,L,I,A,s]}class Gy extends ve{constructor(e){super(),ye(this,e,SF,wF,be,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function TF(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("i"),s=C(),l=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),v(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Oe(Re.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(l,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(y(e),y(s),y(l)),n[5](null),o=!1,Ee(r)}}}const lb="upload_backup";function $F(n,e,t){const i=wt();let{class:s=""}=e,l,o=!1;function r(){l&&t(1,l.value="",l)}function a(m){m&&yn(`Note that we don't perform validations for the uploaded backup files. Proceed with caution and only if you trust the source. + to confirm:`),c=C(),d=b("form"),H(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),v(i,s),v(i,l),v(l,o),v(o,r),v(l,a),q(u,l,null),v(i,f),w(k,c,S),w(k,d,S),q(m,d,null),h=!0,g||(_=Y(d,"submit",it(n[7])),g=!0)},p(k,S){(!h||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){h||(M(u.$$.fragment,k),M(m.$$.fragment,k),h=!0)},o(k){D(u.$$.fragment,k),D(m.$$.fragment,k),h=!1},d(k){k&&(y(e),y(t),y(i),y(c),y(d)),j(u),j(m),g=!1,_()}}}function iF(n){let e,t,i,s;return{c(){e=b("h4"),t=W("Restore "),i=b("strong"),s=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),v(e,t),v(e,i),v(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&y(e)}}}function lF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=W("Cancel"),i=C(),s=b("button"),l=b("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function sF(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[lF],header:[iF],default:[nF]},$$scope:{ctx:n}};return e=new ln({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(M(e.$$.fragment,s),t=!0)},o(s){D(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function oF(n,e,t){let i;const s="backup_restore_"+U.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){Jt({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await he.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),Mi(((S=$.response)==null?void 0:S.message)||$.message))}}}ro(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function g(S){ne[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Le.call(this,n,S)}function k(S){Le.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,m,h,g,_,k]}class rF extends ve{constructor(e){super(),ye(this,e,oF,sF,be,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Q1(n,e,t){const i=n.slice();return i[22]=e[t],i}function x1(n,e,t){const i=n.slice();return i[19]=e[t],i}function aF(n){let e=[],t=new Map,i,s,l=ce(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function tb(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,m=U.formattedFileSize(e[22].size)+"",h,g,_,k,S,$,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"),s=C(),l=b("div"),o=b("span"),a=W(r),f=C(),c=b("span"),d=W("("),h=W(m),g=W(")"),_=C(),k=b("div"),S=b("button"),$=b("i"),O=C(),E=b("button"),L=b("i"),A=C(),P=b("button"),N=b("i"),z=C(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(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"),x(P,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(pe,ae){w(pe,t,ae),v(t,i),v(t,s),v(t,l),v(l,o),v(o,a),v(l,f),v(l,c),v(c,d),v(c,h),v(c,g),v(t,_),v(t,k),v(k,S),v(S,$),v(k,O),v(k,E),v(E,L),v(k,A),v(k,P),v(P,N),v(t,z),B=!0,J||(V=[Oe(Re.call(null,S,"Download")),Y(S,"click",it(Z)),Oe(Re.call(null,E,"Restore")),Y(E,"click",it(G)),Oe(Re.call(null,P,"Delete")),Y(P,"click",it(de))],J=!0)},p(pe,ae){e=pe,(!B||ae&8)&&r!==(r=e[22].key+"")&&se(a,r),(!B||ae&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||ae&8)&&m!==(m=U.formattedFileSize(e[22].size)+"")&&se(h,m),(!B||ae&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||ae&40)&&x(S,"btn-loading",e[5][e[22].key]),(!B||ae&72&&I!==(I=e[6][e[22].key]))&&(E.disabled=I),(!B||ae&72&&R!==(R=e[6][e[22].key]))&&(P.disabled=R),(!B||ae&72)&&x(P,"btn-loading",e[6][e[22].key])},i(pe){B||(pe&&tt(()=>{B&&(F||(F=qe(t,ht,{duration:150},!0)),F.run(1))}),B=!0)},o(pe){pe&&(F||(F=qe(t,ht,{duration:150},!1)),F.run(0)),B=!1},d(pe){pe&&y(t),pe&&F&&F.end(),J=!1,Ee(V)}}}function nb(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function fF(n){let e,t,i;return{c(){e=b("span"),t=C(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function cF(n){let e,t,i;return{c(){e=b("i"),t=C(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function dF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;const _=[uF,aF],k=[];function S(I,A){return I[4]?0:1}i=S(n),s=k[i]=_[i](n);function $(I,A){return I[7]?cF:fF}let T=$(n),O=T(n),E={};f=new eF({props:E}),n[14](f),f.$on("submit",n[15]);let L={};return d=new rF({props:L}),n[16](d),{c(){e=b("div"),t=b("div"),s.c(),l=C(),o=b("div"),r=b("button"),O.c(),u=C(),H(f.$$.fragment),c=C(),H(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,A){w(I,e,A),v(e,t),k[i].m(t,null),v(e,l),v(e,o),v(o,r),O.m(r,null),w(I,u,A),q(f,I,A),w(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?k[i].p(I,A):(oe(),D(k[P],1,1,()=>{k[P]=null}),re(),s=k[i],s?s.p(I,A):(s=k[i]=_[i](I),s.c()),M(s,1),s.m(t,null)),T!==(T=$(I))&&(O.d(1),O=T(I),O&&(O.c(),O.m(r,null))),(!m||A&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const N={};f.$set(N);const R={};d.$set(R)},i(I){m||(M(s),M(f.$$.fragment,I),M(d.$$.fragment,I),m=!0)},o(I){D(s),D(f.$$.fragment,I),D(d.$$.fragment,I),m=!1},d(I){I&&(y(e),y(u),y(c)),k[i].d(),O.d(),n[14](null),j(f,I),n[16](null),j(d,I),h=!1,g()}}}function pF(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,l=await he.backups.getFullList()),l.sort((E,L)=>E.modifiedL.modified?-1:0),t(4,o=!1)}catch(E){E.isAbort||(he.error(E),t(4,o=!1))}}async function c(E){if(!r[E]){t(5,r[E]=!0,r);try{const L=await he.getSuperuserFileToken();U.download(he.backups.getDownloadURL(L,E))}catch(L){L.isAbort||he.error(L)}delete r[E],t(5,r)}}function d(E){yn(`Do you really want to delete ${E}?`,()=>m(E))}async function m(E){if(!a[E]){t(6,a[E]=!0,a);try{await he.backups.delete(E),U.removeByKey(l,"name",E),f(),nn(`Successfully deleted ${E}.`)}catch(L){L.isAbort||he.error(L)}delete a[E],t(6,a)}}async function h(){var E;try{const L=await he.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{}}un(()=>{let E=setInterval(()=>{h()},3e3);return()=>{clearInterval(E)}});const g=E=>c(E.key),_=E=>s.show(E.key),k=E=>d(E.key),S=()=>i==null?void 0:i.show();function $(E){ne[E?"unshift":"push"](()=>{i=E,t(1,i)})}const T=()=>{f()};function O(E){ne[E?"unshift":"push"](()=>{s=E,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,g,_,k,S,$,T,O]}class mF extends ve{constructor(e){super(),ye(this,e,pF,dF,be,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}const hF=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),ib=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function _F(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),v(s,l),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&&se(l,u[4]),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function lb(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E;return i=new fe({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[gF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[bF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[kF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),d=new fe({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[yF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),g=new fe({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[vF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),S=new fe({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[wF,({uniqueId:L})=>({23:L}),({uniqueId:L})=>L?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),H(d.$$.fragment),m=C(),h=b("div"),H(g.$$.fragment),_=C(),k=b("div"),H(S.$$.fragment),$=C(),T=b("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(L,I){w(L,e,I),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),q(d,c,null),v(e,m),v(e,h),q(g,h,null),v(e,_),v(e,k),q(S,k,null),v(e,$),v(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=qe(e,ht,{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=qe(e,ht,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&y(e),j(i),j(o),j(u),j(d),j(g),j(S),L&&O&&O.end()}}}function gF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Endpoint"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].endpoint),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].endpoint&&me(l,u[0].endpoint)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function bF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Bucket"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].bucket),r||(a=Y(l,"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(l,"id",o),f&1&&l.value!==u[0].bucket&&me(l,u[0].bucket)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function kF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Region"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].region),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].region&&me(l,u[0].region)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function yF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Access key"),s=C(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].accessKey),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&me(l,u[0].accessKey)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function vF(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Secret"),s=C(),H(l.$$.fragment),p(e,"for",i=n[23])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m&8388608&&i!==(i=d[23]))&&p(e,"for",i);const h={};m&8388608&&(h.id=d[23]),!o&&m&32&&(o=!0,h.mask=d[5],$e(()=>o=!1)),!r&&m&1&&(r=!0,h.value=d[0].secret,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function wF(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.textContent="Force path-style addressing",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[23])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[16]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function SF(n){let e,t,i,s,l;e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[_F,({uniqueId:u})=>({23:u}),({uniqueId:u})=>u?8388608:0]},$$scope:{ctx:n}}});const o=n[8].default,r=Nt(o,n,n[17],ib);let a=n[0].enabled&&lb(n);return{c(){H(e.$$.fragment),t=C(),r&&r.c(),i=C(),a&&a.c(),s=ke()},m(u,f){q(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&8519697&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&131079)&&Ft(r,o,u,u[17],l?Rt(o,u[17],f,hF):qt(u[17]),ib),u[0].enabled?a?(a.p(u,f),f&1&&M(a,1)):(a=lb(u),a.c(),M(a,1),a.m(s.parentNode,s)):a&&(oe(),D(a,1,1,()=>{a=null}),re())},i(u){l||(M(e.$$.fragment,u),M(r,u),M(a),l=!0)},o(u){D(e.$$.fragment,u),D(r,u),D(a),l=!1},d(u){u&&(y(t),y(i),y(s)),j(e,u),r&&r.d(u),a&&a.d(u)}}}const Fa="s3_test_request";function TF(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null,h=!1;function g(){t(5,h=!!(l!=null&&l.accessKey))}function _(P){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{k()},P)}async function k(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;he.cancelRequest(Fa),clearTimeout(d),d=setTimeout(()=>{he.cancelRequest(Fa),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let P;try{await he.settings.testS3(u,{$cancelKey:Fa})}catch(N){P=N}return P!=null&&P.isAbort||(t(1,f=P),t(2,c=!1),clearTimeout(d)),f}un(()=>()=>{clearTimeout(d),clearTimeout(m)});function S(){o.enabled=this.checked,t(0,o)}function $(){o.endpoint=this.value,t(0,o)}function T(){o.bucket=this.value,t(0,o)}function O(){o.region=this.value,t(0,o)}function E(){o.accessKey=this.value,t(0,o)}function 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,l=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,s=P.$$scope)},n.$$.update=()=>{n.$$.dirty&64&&l!=null&&l.enabled&&(g(),_(100)),n.$$.dirty&9&&(o.enabled||Wn(r))},[o,f,c,r,a,h,l,u,i,S,$,T,O,E,L,I,A,s]}class Xy extends ve{constructor(e){super(),ye(this,e,TF,SF,be,{originalConfig:6,config:0,configKey:3,toggleLabel:4,testFilesystem:7,testError:1,isTesting:2})}}function $F(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("i"),s=C(),l=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),v(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Oe(Re.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(l,"change",n[6])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:te,o:te,d(a){a&&(y(e),y(s),y(l)),n[5](null),o=!1,Ee(r)}}}const sb="upload_backup";function CF(n,e,t){const i=wt();let{class:s=""}=e,l,o=!1;function r(){l&&t(1,l.value="",l)}function a(m){m&&yn(`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,h,k;if(o||!m)return;t(2,o=!0);const _=new FormData;_.set("file",m);try{await he.backups.upload(_,{requestKey:lb}),t(2,o=!1),i("success"),nn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(h=(g=S.response)==null?void 0:g.data)==null?void 0:h.file)!=null&&k.message?Mi(S.response.data.file.message):he.error(S))}r()}ro(()=>{he.cancelRequest(lb)});const f=()=>l==null?void 0:l.click();function c(m){ne[m?"unshift":"push"](()=>{l=m,t(1,l)})}const d=m=>{var _,g;a((g=(_=m==null?void 0:m.target)==null?void 0:_.files)==null?void 0:g[0])};return n.$$set=m=>{"class"in m&&t(0,s=m.class)},[s,l,o,a,f,c,d]}class CF extends ve{constructor(e){super(),ye(this,e,$F,TF,be,{class:0})}}function OF(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function MF(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function sb(n){var B,J,V;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[EF,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&ob(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 Gy({props:R}),ne.push(()=>ge(r,"config",A)),ne.push(()=>ge(r,"isTesting",P)),ne.push(()=>ge(r,"testError",N));let z=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&rb(n),F=n[9]&&ab(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),I&&I.c(),s=C(),l=b("div"),o=C(),H(r.$$.fragment),c=C(),d=b("div"),m=b("div"),_=C(),z&&z.c(),g=C(),F&&F.c(),h=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){w(Z,e,G),q(t,e,null),v(e,i),I&&I.m(e,null),v(e,s),v(e,l),v(e,o),q(r,e,null),v(e,c),v(e,d),v(d,m),v(d,_),z&&z.m(d,null),v(d,g),F&&F.m(d,null),v(d,h),v(d,k),v(k,S),O=!0,E||(L=[Y(k,"click",n[28]),Y(e,"submit",it(n[11]))],E=!0)},p(Z,G){var ae,Ce,Ye;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=ob(Z),I.c(),M(I,1),I.m(e,s)):I&&(oe(),D(I,1,1,()=>{I=null}),re());const pe={};G[0]&1&&(pe.originalConfig=(ae=Z[0].backups)==null?void 0:ae.s3),!a&&G[0]&2&&(a=!0,pe.config=Z[1].backups.s3,$e(()=>a=!1)),!u&&G[0]&128&&(u=!0,pe.isTesting=Z[7],$e(()=>u=!1)),!f&&G[0]&256&&(f=!0,pe.testError=Z[8],$e(()=>f=!1)),r.$set(pe),(Ye=(Ce=Z[1].backups)==null?void 0:Ce.s3)!=null&&Ye.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=rb(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=ab(Z),F.c(),F.m(d,h)):F&&(F.d(1),F=null),(!O||G[0]&544&&$!==($=!Z[9]||Z[5]))&&(k.disabled=$),(!O||G[0]&32)&&x(k,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=qe(e,ht,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=qe(e,ht,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&y(e),j(t),I&&I.d(),j(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ee(L)}}}function EF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function ob(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[IF,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[LF,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),v(e,t),v(t,i),q(s,i,null),v(t,l),v(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}),s.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(s.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(s.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),j(s),j(r),f&&a&&a.end()}}}function DF(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',s=C(),l=b("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(l,"click",n[21]),Y(r,"click",n[22])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r)),a=!1,Ee(u)}}}function IF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P;return g=new Dn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[DF]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=W("Cron expression"),s=C(),l=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),_=C(),H(g.$$.fragment),h=C(),k=b("div"),S=b("p"),$=W(`Supports numeric list, steps, ranges or +Do you really want to upload "${m.name}"?`,()=>{u(m)},()=>{r()})}async function u(m){var g,_,k;if(o||!m)return;t(2,o=!0);const h=new FormData;h.set("file",m);try{await he.backups.upload(h,{requestKey:sb}),t(2,o=!1),i("success"),nn("Successfully uploaded a new backup.")}catch(S){S.isAbort||(t(2,o=!1),(k=(_=(g=S.response)==null?void 0:g.data)==null?void 0:_.file)!=null&&k.message?Mi(S.response.data.file.message):he.error(S))}r()}ro(()=>{he.cancelRequest(sb)});const f=()=>l==null?void 0:l.click();function c(m){ne[m?"unshift":"push"](()=>{l=m,t(1,l)})}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,s=m.class)},[s,l,o,a,f,c,d]}class OF extends ve{constructor(e){super(),ye(this,e,CF,$F,be,{class:0})}}function MF(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function EF(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function ob(n){var B,J,V;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L;t=new fe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[DF,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&rb(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 Xy({props:R}),ne.push(()=>ge(r,"config",A)),ne.push(()=>ge(r,"isTesting",P)),ne.push(()=>ge(r,"testError",N));let z=((V=(J=n[1].backups)==null?void 0:J.s3)==null?void 0:V.enabled)&&!n[9]&&!n[5]&&ab(n),F=n[9]&&ub(n);return{c(){e=b("form"),H(t.$$.fragment),i=C(),I&&I.c(),s=C(),l=b("div"),o=C(),H(r.$$.fragment),c=C(),d=b("div"),m=b("div"),h=C(),z&&z.c(),g=C(),F&&F.c(),_=C(),k=b("button"),S=b("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(Z,G){w(Z,e,G),q(t,e,null),v(e,i),I&&I.m(e,null),v(e,s),v(e,l),v(e,o),q(r,e,null),v(e,c),v(e,d),v(d,m),v(d,h),z&&z.m(d,null),v(d,g),F&&F.m(d,null),v(d,_),v(d,k),v(k,S),O=!0,E||(L=[Y(k,"click",n[28]),Y(e,"submit",it(n[11]))],E=!0)},p(Z,G){var ae,Ce,Ye;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=rb(Z),I.c(),M(I,1),I.m(e,s)):I&&(oe(),D(I,1,1,()=>{I=null}),re());const pe={};G[0]&1&&(pe.originalConfig=(ae=Z[0].backups)==null?void 0:ae.s3),!a&&G[0]&2&&(a=!0,pe.config=Z[1].backups.s3,$e(()=>a=!1)),!u&&G[0]&128&&(u=!0,pe.isTesting=Z[7],$e(()=>u=!1)),!f&&G[0]&256&&(f=!0,pe.testError=Z[8],$e(()=>f=!1)),r.$set(pe),(Ye=(Ce=Z[1].backups)==null?void 0:Ce.s3)!=null&&Ye.enabled&&!Z[9]&&!Z[5]?z?z.p(Z,G):(z=ab(Z),z.c(),z.m(d,g)):z&&(z.d(1),z=null),Z[9]?F?F.p(Z,G):(F=ub(Z),F.c(),F.m(d,_)):F&&(F.d(1),F=null),(!O||G[0]&544&&$!==($=!Z[9]||Z[5]))&&(k.disabled=$),(!O||G[0]&32)&&x(k,"btn-loading",Z[5])},i(Z){O||(M(t.$$.fragment,Z),M(I),M(r.$$.fragment,Z),Z&&tt(()=>{O&&(T||(T=qe(e,ht,{duration:150},!0)),T.run(1))}),O=!0)},o(Z){D(t.$$.fragment,Z),D(I),D(r.$$.fragment,Z),Z&&(T||(T=qe(e,ht,{duration:150},!1)),T.run(0)),O=!1},d(Z){Z&&y(e),j(t),I&&I.d(),j(r),z&&z.d(),F&&F.d(),Z&&T&&T.end(),E=!1,Ee(L)}}}function DF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=C(),s=b("label"),l=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),v(s,l),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(s,"for",o)},d(u){u&&(y(e),y(i),y(s)),r=!1,a()}}}function rb(n){let e,t,i,s,l,o,r,a,u;return s=new fe({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[LF,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[AF,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),v(e,t),v(t,i),q(s,i,null),v(t,l),v(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}),s.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(M(s.$$.fragment,f),M(r.$$.fragment,f),f&&tt(()=>{u&&(a||(a=qe(e,ht,{duration:150},!0)),a.run(1))}),u=!0)},o(f){D(s.$$.fragment,f),D(r.$$.fragment,f),f&&(a||(a=qe(e,ht,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&y(e),j(s),j(r),f&&a&&a.end()}}}function IF(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=C(),i=b("button"),i.innerHTML='Every sunday at 00:00h',s=C(),l=b("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=C(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(l,"click",n[21]),Y(r,"click",n[22])],a=!0)},p:te,d(f){f&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r)),a=!1,Ee(u)}}}function LF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P;return g=new Dn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[IF]},$$scope:{ctx:n}}}),{c(){var N,R;e=b("label"),t=W("Cron expression"),s=C(),l=b("input"),a=C(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=C(),m=b("i"),h=C(),H(g.$$.fragment),_=C(),k=b("div"),S=b("p"),$=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]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;w(N,e,R),v(e,t),w(N,s,R),w(N,l,R),me(l,n[1].backups.cron),w(N,a,R),w(N,u,R),v(u,f),v(f,c),v(f,d),v(f,m),v(f,_),q(g,f,null),w(N,h,R),w(N,k,R),v(k,S),v(S,$),v(S,T),v(S,O),v(S,E),v(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||l.focus(),A||(P=[Y(l,"input",n[18]),Oe(Re.call(null,T,`@yearly + The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((R=(N=n[0])==null?void 0:N.backups)!=null&&R.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(N,R){var z,F;w(N,e,R),v(e,t),w(N,s,R),w(N,l,R),me(l,n[1].backups.cron),w(N,a,R),w(N,u,R),v(u,f),v(f,c),v(f,d),v(f,m),v(f,h),q(g,f,null),w(N,_,R),w(N,k,R),v(k,S),v(S,$),v(S,T),v(S,O),v(S,E),v(S,L),I=!0,(F=(z=n[0])==null?void 0:z.backups)!=null&&F.cron||l.focus(),A||(P=[Y(l,"input",n[18]),Oe(Re.call(null,T,`@yearly @annually @monthly @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(l,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=N[0])==null?void 0:F.backups)!=null&&B.cron)))&&(l.autofocus=r),R[0]&2&&l.value!==N[1].backups.cron&&me(l,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&&(y(e),y(s),y(l),y(a),y(u),y(h),y(k)),j(g),A=!1,Ee(P)}}}function LF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),s=C(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"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(l,"id",o),f[0]&2&&mt(l.value)!==u[1].backups.cronMaxKeep&&me(l,u[1].backups.cronMaxKeep)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function rb(n){let e;function t(l,o){return l[7]?NF:l[8]?PF:AF}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function AF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function PF(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Oe(t=Re.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Lt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&y(e),i=!1,s()}}}function NF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ab(n){let e,t,i,s,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-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),v(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&y(e),s=!1,l()}}}function RF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N;m=new Fr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new CF({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new pF({props:R}),n[15](k);function z(V,Z){return V[6]?MF:OF}let F=z(n),B=F(n),J=n[6]&&!n[4]&&sb(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),H(m.$$.fragment),_=C(),H(g.$$.fragment),h=C(),H(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),E=b("span"),E.textContent="Backups options",L=C(),B.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],x(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){w(V,e,Z),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(V,r,Z),w(V,a,Z),v(a,u),v(u,f),v(f,c),v(f,d),q(m,f,null),v(f,_),q(g,f,null),v(u,h),q(k,u,null),v(u,S),v(u,$),v(u,T),v(u,O),v(O,E),v(O,L),B.m(O,null),v(u,I),J&&J.m(u,null),A=!0,P||(N=[Y(O,"click",n[16]),Y(u,"submit",it(n[11]))],P=!0)},p(V,Z){(!A||Z[0]&1024)&&se(o,V[10]);const G={};k.$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)&&x(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=sb(V),J.c(),M(J,1),J.m(u,null)):J&&(oe(),D(J,1,1,()=>{J=null}),re())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(k.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),D(k.$$.fragment,V),D(J),A=!1},d(V){V&&(y(e),y(r),y(a)),j(m),j(g),n[15](null),j(k),B.d(),J&&J.d(),P=!1,Ee(N)}}}function FF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[RF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function qF(n,e,t){let i,s;Ge(n,an,Z=>t(10,s=Z)),En(an,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,_=null;g();async function g(){t(4,a=!0);try{const Z=await he.settings.getAll()||{};k(Z)}catch(Z){he.error(Z)}t(4,a=!1)}async function h(){if(!(u||!i)){t(5,u=!0);try{const Z=await he.settings.update(U.filterRedactedProps(r));Jt({}),await $(),k(Z),nn("Successfully saved application settings.")}catch(Z){he.error(Z)}t(5,u=!1)}}function k(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 $(){return l==null?void 0:l.loadBackups()}function T(Z){ne[Z?"unshift":"push"](()=>{l=Z,t(3,l)})}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=mt(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){_=Z,t(8,_)}const J=()=>S(),V=()=>h();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&&(Wn("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,m,_,i,s,h,S,$,f,T,O,E,L,I,A,P,N,R,z,F,B,J,V]}class jF extends ve{constructor(e){super(),ye(this,e,qF,FF,be,{},null,[-1,-1])}}function ub(n,e,t){const i=n.slice();return i[7]=e[t],i}function HF(n){let e=[],t=new Map,i,s=ce(n[0]);const l=r=>r[7].id;for(let r=0;r',t=C(),i=b("div"),i.innerHTML='',s=C(),l=b("div"),l.innerHTML='',o=C(),r=b("div"),r.innerHTML='',p(e,"class","list-item list-item-loader"),p(i,"class","list-item list-item-loader"),p(l,"class","list-item list-item-loader"),p(r,"class","list-item list-item-loader")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r))}}}function fb(n){let e;return{c(){e=b("div"),e.innerHTML='No app crons found. ',p(e,"class","list-item list-item-placeholder")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function cb(n,e){let t,i,s,l=e[7].id+"",o,r,a,u=e[7].expression+"",f,c,d,m,_,g,h,k,S;function $(){return e[6](e[7])}return{key:n,first:null,c(){t=b("div"),i=b("div"),s=b("span"),o=W(l),r=C(),a=b("span"),f=W(u),c=C(),d=b("div"),m=b("button"),_=b("i"),h=C(),p(s,"class","txt"),p(i,"class","content"),p(a,"class","txt-hint txt-nowrap txt-mono cron-expr m-r-xs"),p(_,"class","ri-play-large-line"),p(m,"type","button"),p(m,"class","btn btn-sm btn-circle btn-hint btn-transparent"),m.disabled=g=e[2][e[7].id],p(m,"aria-label","Run"),x(m,"btn-loading",e[2][e[7].id]),p(d,"class","actions"),p(t,"class","list-item"),this.first=t},m(T,O){w(T,t,O),v(t,i),v(i,s),v(s,o),v(t,r),v(t,a),v(a,f),v(t,c),v(t,d),v(d,m),v(m,_),v(t,h),k||(S=[Oe(Re.call(null,m,"Run")),Y(m,"click",it($))],k=!0)},p(T,O){e=T,O&1&&l!==(l=e[7].id+"")&&se(o,l),O&1&&u!==(u=e[7].expression+"")&&se(f,u),O&5&&g!==(g=e[2][e[7].id])&&(m.disabled=g),O&5&&x(m,"btn-loading",e[2][e[7].id])},d(T){T&&y(t),k=!1,Ee(S)}}}function UF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$;m=new Fr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[4]);function T(L,I){return L[1]?zF:HF}let O=T(n),E=O(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[3]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Registered app cron jobs",d=C(),H(m.$$.fragment),_=C(),g=b("div"),h=b("div"),E.c(),k=C(),S=b("p"),S.innerHTML=`App cron jobs can be registered only programmatically with +@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(l,"id",o),(!I||R[0]&1&&r!==(r=!((B=(F=N[0])==null?void 0:F.backups)!=null&&B.cron)))&&(l.autofocus=r),R[0]&2&&l.value!==N[1].backups.cron&&me(l,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&&(y(e),y(s),y(l),y(a),y(u),y(_),y(k)),j(g),A=!1,Ee(P)}}}function AF(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Max @auto backups to keep"),s=C(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"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(l,"id",o),f[0]&2&&mt(l.value)!==u[1].backups.cronMaxKeep&&me(l,u[1].backups.cronMaxKeep)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function ab(n){let e;function t(l,o){return l[7]?RF:l[8]?NF:PF}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function PF(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function NF(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Oe(t=Re.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Lt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&y(e),i=!1,s()}}}function RF(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function ub(n){let e,t,i,s,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-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),v(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&y(e),s=!1,l()}}}function FF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N;m=new Fr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),g=new OF({props:{class:"btn-sm"}}),g.$on("success",n[13]);let R={};k=new mF({props:R}),n[15](k);function z(V,Z){return V[6]?EF:MF}let F=z(n),B=F(n),J=n[6]&&!n[4]&&ob(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[10]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=C(),H(m.$$.fragment),h=C(),H(g.$$.fragment),_=C(),H(k.$$.fragment),S=C(),$=b("hr"),T=C(),O=b("button"),E=b("span"),E.textContent="Backups options",L=C(),B.c(),I=C(),J&&J.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(E,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],x(O,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(V,Z){w(V,e,Z),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(V,r,Z),w(V,a,Z),v(a,u),v(u,f),v(f,c),v(f,d),q(m,f,null),v(f,h),q(g,f,null),v(u,_),q(k,u,null),v(u,S),v(u,$),v(u,T),v(u,O),v(O,E),v(O,L),B.m(O,null),v(u,I),J&&J.m(u,null),A=!0,P||(N=[Y(O,"click",n[16]),Y(u,"submit",it(n[11]))],P=!0)},p(V,Z){(!A||Z[0]&1024)&&se(o,V[10]);const G={};k.$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)&&x(O,"btn-loading",V[4]),V[6]&&!V[4]?J?(J.p(V,Z),Z[0]&80&&M(J,1)):(J=ob(V),J.c(),M(J,1),J.m(u,null)):J&&(oe(),D(J,1,1,()=>{J=null}),re())},i(V){A||(M(m.$$.fragment,V),M(g.$$.fragment,V),M(k.$$.fragment,V),M(J),A=!0)},o(V){D(m.$$.fragment,V),D(g.$$.fragment,V),D(k.$$.fragment,V),D(J),A=!1},d(V){V&&(y(e),y(r),y(a)),j(m),j(g),n[15](null),j(k),B.d(),J&&J.d(),P=!1,Ee(N)}}}function qF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[FF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function jF(n,e,t){let i,s;Ge(n,an,Z=>t(10,s=Z)),En(an,s="Backups",s);let l,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 he.settings.getAll()||{};k(Z)}catch(Z){he.error(Z)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const Z=await he.settings.update(U.filterRedactedProps(r));Jt({}),await $(),k(Z),nn("Successfully saved application settings.")}catch(Z){he.error(Z)}t(5,u=!1)}}function k(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 $(){return l==null?void 0:l.loadBackups()}function T(Z){ne[Z?"unshift":"push"](()=>{l=Z,t(3,l)})}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=mt(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&&(Wn("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,m,h,i,s,_,S,$,f,T,O,E,L,I,A,P,N,R,z,F,B,J,V]}class HF extends ve{constructor(e){super(),ye(this,e,jF,qF,be,{},null,[-1,-1])}}function fb(n,e,t){const i=n.slice();return i[7]=e[t],i}function zF(n){let e=[],t=new Map,i,s=ce(n[0]);const l=r=>r[7].id;for(let r=0;r',t=C(),i=b("div"),i.innerHTML='',s=C(),l=b("div"),l.innerHTML='',o=C(),r=b("div"),r.innerHTML='',p(e,"class","list-item list-item-loader"),p(i,"class","list-item list-item-loader"),p(l,"class","list-item list-item-loader"),p(r,"class","list-item list-item-loader")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),w(a,o,u),w(a,r,u)},p:te,d(a){a&&(y(e),y(t),y(i),y(s),y(l),y(o),y(r))}}}function cb(n){let e;return{c(){e=b("div"),e.innerHTML='No app crons found. ',p(e,"class","list-item list-item-placeholder")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function db(n,e){let t,i,s,l=e[7].id+"",o,r,a,u=e[7].expression+"",f,c,d,m,h,g,_,k,S;function $(){return e[6](e[7])}return{key:n,first:null,c(){t=b("div"),i=b("div"),s=b("span"),o=W(l),r=C(),a=b("span"),f=W(u),c=C(),d=b("div"),m=b("button"),h=b("i"),_=C(),p(s,"class","txt"),p(i,"class","content"),p(a,"class","txt-hint txt-nowrap txt-mono cron-expr m-r-xs"),p(h,"class","ri-play-large-line"),p(m,"type","button"),p(m,"class","btn btn-sm btn-circle btn-hint btn-transparent"),m.disabled=g=e[2][e[7].id],p(m,"aria-label","Run"),x(m,"btn-loading",e[2][e[7].id]),p(d,"class","actions"),p(t,"class","list-item"),this.first=t},m(T,O){w(T,t,O),v(t,i),v(i,s),v(s,o),v(t,r),v(t,a),v(a,f),v(t,c),v(t,d),v(d,m),v(m,h),v(t,_),k||(S=[Oe(Re.call(null,m,"Run")),Y(m,"click",it($))],k=!0)},p(T,O){e=T,O&1&&l!==(l=e[7].id+"")&&se(o,l),O&1&&u!==(u=e[7].expression+"")&&se(f,u),O&5&&g!==(g=e[2][e[7].id])&&(m.disabled=g),O&5&&x(m,"btn-loading",e[2][e[7].id])},d(T){T&&y(t),k=!1,Ee(S)}}}function VF(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$;m=new Fr({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[4]);function T(L,I){return L[1]?UF:zF}let O=T(n),E=O(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[3]),r=C(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Registered app cron jobs",d=C(),H(m.$$.fragment),h=C(),g=b("div"),_=b("div"),E.c(),k=C(),S=b("p"),S.innerHTML=`App cron jobs can be registered only programmatically with Go or JavaScript - .`,p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(h,"class","list-content"),p(g,"class","list list-compact"),p(S,"class","txt-hint m-t-xs"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(L,I){w(L,e,I),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(L,r,I),w(L,a,I),v(a,u),v(u,f),v(f,c),v(f,d),q(m,f,null),v(u,_),v(u,g),v(g,h),E.m(h,null),v(u,k),v(u,S),$=!0},p(L,I){(!$||I&8)&&se(o,L[3]),O===(O=T(L))&&E?E.p(L,I):(E.d(1),E=O(L),E&&(E.c(),E.m(h,null)))},i(L){$||(M(m.$$.fragment,L),$=!0)},o(L){D(m.$$.fragment,L),$=!1},d(L){L&&(y(e),y(r),y(a)),j(m),E.d()}}}function VF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[UF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1039&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function BF(n,e,t){let i;Ge(n,an,f=>t(3,i=f)),En(an,i="Crons",i);let s=[],l=!1,o={};r();async function r(){t(1,l=!0);try{t(0,s=await he.crons.getFullList()),t(1,l=!1)}catch(f){f.isAbort||(he.error(f),t(1,l=!1))}}async function a(f){t(2,o[f]=!0,o);try{await he.crons.run(f),nn(`Successfully triggered ${f}.`),t(2,o[f]=!1,o)}catch(c){c.isAbort||(he.error(c),t(2,o[f]=!1,o))}}return[s,l,o,i,r,a,f=>a(f.id)]}class WF extends ve{constructor(e){super(),ye(this,e,BF,VF,be,{})}}function db(n,e,t){const i=n.slice();return i[22]=e[t],i}function YF(n){let e,t,i,s,l,o,r,a=[],u=new Map,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[JF,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=ce(n[0]);const B=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=C(),i=b("div"),s=b("div"),l=b("div"),H(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),s=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),q(i,t,null),v(t,s),l=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){l||(M(i.$$.fragment,o),l=!0)},o(o){D(i.$$.fragment,o),l=!1},d(o){o&&y(t),j(i)}}}function GF(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[KF,YF],_=[];function g(h,k){return h[4]?0:1}return f=g(n),c=_[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(h,k){w(h,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(h,r,k),w(h,a,k),v(a,u),_[f].m(u,null),d=!0},p(h,k){(!d||k&128)&&se(o,h[7]);let S=f;f=g(h),f===S?_[f].p(h,k):(oe(),D(_[S],1,1,()=>{_[S]=null}),re(),c=_[f],c?c.p(h,k):(c=_[f]=m[f](h),c.c()),M(c,1),c.m(u,null))},i(h){d||(M(c),d=!0)},o(h){D(c),d=!1},d(h){h&&(y(e),y(r),y(a)),_[f].d()}}}function XF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[GF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function QF(n,e,t){let i,s,l,o;Ge(n,an,A=>t(7,o=A)),En(an,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 he.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;k()}catch(P){he.error(P)}t(4,c=!1)}function m(){U.downloadJson(Object.values(f),"pb_schema")}function _(){U.copyToClipboard(i),Js("The configuration was copied to your clipboard!",3e3)}function g(){l?h():k()}function h(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>g(),T=A=>S(A),O=()=>_();function E(A){ne[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,s=Object.keys(f).length),n.$$.dirty&5&&t(5,l=u.length&&s===u.length)},[u,f,s,a,c,l,i,o,m,_,g,S,r,$,T,O,E,L,I]}class xF extends ve{constructor(e){super(),ye(this,e,QF,XF,be,{})}}function mb(n,e,t){const i=n.slice();return i[14]=e[t],i}function hb(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function _b(n,e,t){const i=n.slice();return i[14]=e[t],i}function gb(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function bb(n,e,t){const i=n.slice();return i[14]=e[t],i}function kb(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function yb(n,e,t){const i=n.slice();return i[30]=e[t],i}function eq(n){let e,t,i,s,l=n[1].name+"",o,r=n[10]&&vb(),a=n[0].name!==n[1].name&&wb(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),s=b("strong"),o=W(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[10]?r||(r=vb(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=wb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&y(e),r&&r.d(),a&&a.d()}}}function tq(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),l=W(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(y(e),y(t),y(i))}}}function nq(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),l=W(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),v(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(y(e),y(t),y(i))}}}function vb(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function wb(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=W(t),s=C(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),v(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(y(e),y(s),y(l))}}}function Sb(n){var h,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((h=n[0])==null?void 0:h[n[30]])+"",f,c,d,m,_=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var S,$,T,O,E,L;e=b("tr"),t=b("td"),i=b("span"),l=W(s),o=C(),r=b("td"),a=b("pre"),f=W(u),c=C(),d=b("td"),m=b("pre"),g=W(_),p(t,"class","min-width svelte-qs0w8h"),p(a,"class","txt diff-value svelte-qs0w8h"),p(r,"class","svelte-qs0w8h"),x(r,"changed-old-col",!n[11]&&Rn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),x(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),x(d,"changed-new-col",!n[5]&&Rn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",Rn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,$){w(S,e,$),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,c),v(e,d),v(d,m),v(m,g)},p(S,$){var T,O,E,L,I,A,P,N;$[0]&512&&s!==(s=S[30]+"")&&se(l,s),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&se(f,u),$[0]&2563&&x(r,"changed-old-col",!S[11]&&Rn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),$[0]&2048&&x(r,"changed-none-col",S[11]),$[0]&514&&_!==(_=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&se(g,_),$[0]&547&&x(d,"changed-new-col",!S[5]&&Rn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&x(d,"changed-none-col",S[5]),$[0]&515&&x(e,"txt-primary",Rn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&y(e)}}}function Tb(n){let e,t=ce(n[6]),i=[];for(let s=0;sProps Old New',l=C(),o=b("tbody");for(let T=0;T<_.length;T+=1)_[T].c();r=C(),g&&g.c(),a=C();for(let T=0;T!c.find(S=>k.id==S.id))))}function h(k){return typeof k>"u"?"":U.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,s=!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(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,_=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,l=U.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=U.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,_,o,l,s,h]}class sq extends ve{constructor(e){super(),ye(this,e,lq,iq,be,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Lb(n,e,t){const i=n.slice();return i[17]=e[t],i}function Ab(n){let e,t;return e=new sq({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function oq(n){let e,t,i=ce(n[2]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o.`,p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(_,"class","list-content"),p(g,"class","list list-compact"),p(S,"class","txt-hint m-t-xs"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(L,I){w(L,e,I),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(L,r,I),w(L,a,I),v(a,u),v(u,f),v(f,c),v(f,d),q(m,f,null),v(u,h),v(u,g),v(g,_),E.m(_,null),v(u,k),v(u,S),$=!0},p(L,I){(!$||I&8)&&se(o,L[3]),O===(O=T(L))&&E?E.p(L,I):(E.d(1),E=O(L),E&&(E.c(),E.m(_,null)))},i(L){$||(M(m.$$.fragment,L),$=!0)},o(L){D(m.$$.fragment,L),$=!1},d(L){L&&(y(e),y(r),y(a)),j(m),E.d()}}}function BF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[VF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1039&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function WF(n,e,t){let i;Ge(n,an,f=>t(3,i=f)),En(an,i="Crons",i);let s=[],l=!1,o={};r();async function r(){t(1,l=!0);try{t(0,s=await he.crons.getFullList()),t(1,l=!1)}catch(f){f.isAbort||(he.error(f),t(1,l=!1))}}async function a(f){t(2,o[f]=!0,o);try{await he.crons.run(f),nn(`Successfully triggered ${f}.`),t(2,o[f]=!1,o)}catch(c){c.isAbort||(he.error(c),t(2,o[f]=!1,o))}}return[s,l,o,i,r,a,f=>a(f.id)]}class YF extends ve{constructor(e){super(),ye(this,e,WF,BF,be,{})}}function pb(n,e,t){const i=n.slice();return i[22]=e[t],i}function KF(n){let e,t,i,s,l,o,r,a=[],u=new Map,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I,A,P,N,R,z;o=new fe({props:{class:"form-field",$$slots:{default:[ZF,({uniqueId:J})=>({12:J}),({uniqueId:J})=>J?4096:0]},$$scope:{ctx:n}}});let F=ce(n[0]);const B=J=>J[22].id;for(let J=0;JBelow you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=C(),i=b("div"),s=b("div"),l=b("div"),H(o.$$.fragment),r=C();for(let J=0;J({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),H(i.$$.fragment),s=C(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),q(i,t,null),v(t,s),l=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){l||(M(i.$$.fragment,o),l=!0)},o(o){D(i.$$.fragment,o),l=!1},d(o){o&&y(t),j(i)}}}function XF(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[JF,KF],h=[];function g(_,k){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",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(_,r,k),w(_,a,k),v(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k&128)&&se(o,_[7]);let S=f;f=g(_),f===S?h[f].p(_,k):(oe(),D(h[S],1,1,()=>{h[S]=null}),re(),c=h[f],c?c.p(_,k):(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(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function QF(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[XF]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}function xF(n,e,t){let i,s,l,o;Ge(n,an,A=>t(7,o=A)),En(an,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 he.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;k()}catch(P){he.error(P)}t(4,c=!1)}function m(){U.downloadJson(Object.values(f),"pb_schema")}function h(){U.copyToClipboard(i),Js("The configuration was copied to your clipboard!",3e3)}function g(){l?_():k()}function _(){t(1,f={})}function k(){t(1,f={});for(const A of u)t(1,f[A.id]=A,f)}function S(A){f[A.id]?delete f[A.id]:t(1,f[A.id]=A,f),t(1,f)}const $=()=>g(),T=A=>S(A),O=()=>h();function E(A){ne[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,s=Object.keys(f).length),n.$$.dirty&5&&t(5,l=u.length&&s===u.length)},[u,f,s,a,c,l,i,o,m,h,g,S,r,$,T,O,E,L,I]}class eq extends ve{constructor(e){super(),ye(this,e,xF,QF,be,{})}}function hb(n,e,t){const i=n.slice();return i[14]=e[t],i}function _b(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function gb(n,e,t){const i=n.slice();return i[14]=e[t],i}function bb(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function kb(n,e,t){const i=n.slice();return i[14]=e[t],i}function yb(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function vb(n,e,t){const i=n.slice();return i[30]=e[t],i}function tq(n){let e,t,i,s,l=n[1].name+"",o,r=n[10]&&wb(),a=n[0].name!==n[1].name&&Sb(n);return{c(){e=b("div"),r&&r.c(),t=C(),a&&a.c(),i=C(),s=b("strong"),o=W(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[10]?r||(r=wb(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Sb(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&y(e),r&&r.d(),a&&a.d()}}}function nq(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Deleted",t=C(),i=b("strong"),l=W(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(y(e),y(t),y(i))}}}function iq(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=b("span"),e.textContent="Added",t=C(),i=b("strong"),l=W(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),v(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&se(l,s)},d(r){r&&(y(e),y(t),y(i))}}}function wb(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Sb(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=W(t),s=C(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),v(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(y(e),y(s),y(l))}}}function Tb(n){var _,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var S,$,T,O,E,L;e=b("tr"),t=b("td"),i=b("span"),l=W(s),o=C(),r=b("td"),a=b("pre"),f=W(u),c=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"),x(r,"changed-old-col",!n[11]&&Rn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),x(r,"changed-none-col",n[11]),p(m,"class","txt diff-value svelte-qs0w8h"),p(d,"class","svelte-qs0w8h"),x(d,"changed-new-col",!n[5]&&Rn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),x(d,"changed-none-col",n[5]),p(e,"class","svelte-qs0w8h"),x(e,"txt-primary",Rn((E=n[0])==null?void 0:E[n[30]],(L=n[1])==null?void 0:L[n[30]]))},m(S,$){w(S,e,$),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,c),v(e,d),v(d,m),v(m,g)},p(S,$){var T,O,E,L,I,A,P,N;$[0]&512&&s!==(s=S[30]+"")&&se(l,s),$[0]&513&&u!==(u=S[12]((T=S[0])==null?void 0:T[S[30]])+"")&&se(f,u),$[0]&2563&&x(r,"changed-old-col",!S[11]&&Rn((O=S[0])==null?void 0:O[S[30]],(E=S[1])==null?void 0:E[S[30]])),$[0]&2048&&x(r,"changed-none-col",S[11]),$[0]&514&&h!==(h=S[12]((L=S[1])==null?void 0:L[S[30]])+"")&&se(g,h),$[0]&547&&x(d,"changed-new-col",!S[5]&&Rn((I=S[0])==null?void 0:I[S[30]],(A=S[1])==null?void 0:A[S[30]])),$[0]&32&&x(d,"changed-none-col",S[5]),$[0]&515&&x(e,"txt-primary",Rn((P=S[0])==null?void 0:P[S[30]],(N=S[1])==null?void 0:N[S[30]]))},d(S){S&&y(e)}}}function $b(n){let e,t=ce(n[6]),i=[];for(let s=0;sProps Old New',l=C(),o=b("tbody");for(let T=0;T!c.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":U.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,r=k.collectionA),"collectionB"in k&&t(1,a=k.collectionB),"deleteMissing"in k&&t(2,u=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)&&!(a!=null&&a.name)),n.$$.dirty[0]&33&&t(11,s=!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(k=>!c.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,m=c.filter(k=>f.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,h=c.filter(k=>!f.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(10,l=U.hasCollectionChanges(r,a,u)),n.$$.dirty[0]&3&&t(9,o=U.mergeUnique(Object.keys(r||{}),Object.keys(a||{})).filter(k=>!["fields","created","updated"].includes(k)))},[r,a,u,f,c,i,d,m,h,o,l,s,_]}class oq extends ve{constructor(e){super(),ye(this,e,sq,lq,be,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Ab(n,e,t){const i=n.slice();return i[17]=e[t],i}function Pb(n){let e,t;return e=new oq({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function rq(n){let e,t,i=ce(n[2]),s=[];for(let o=0;oD(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),nn("Successfully imported collections configuration."),i("submit")}catch(T){he.error(T)}t(4,u=!1),c()}}const g=()=>m(),h=()=>!u;function k(T){ne[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,g,h,k,S,$]}class cq extends ve{constructor(e){super(),ye(this,e,fq,uq,be,{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 Nb(n,e,t){const i=n.slice();return i[37]=e[t],i}function Rb(n,e,t){const i=n.slice();return i[34]=e[t],i}function dq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T,O,E,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[mq,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&qb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&jb(),R=n[6]&&n[1].length&&n[7]&&Hb(n),z=n[13].length&&Xb(n),F=!!n[0]&&Qb(n);return{c(){e=b("input"),t=C(),i=b("div"),s=b("p"),l=W(`Paste below the collections configuration you want to import or - `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),H(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),_=C(),g=b("div"),F&&F.c(),h=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){w(B,e,J),n[22](e),w(B,t,J),w(B,i,J),v(i,s),v(s,l),v(s,o),w(B,r,J),q(a,B,J),w(B,u,J),A&&A.m(B,J),w(B,f,J),w(B,c,J),N&&N.m(B,J),w(B,d,J),R&&R.m(B,J),w(B,m,J),z&&z.m(B,J),w(B,_,J),w(B,g,J),F&&F.m(g,null),v(g,h),v(g,k),v(g,S),v(g,$),v($,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y($,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&x(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=qb(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(oe(),D(A,1,1,()=>{A=null}),re()),B[6]&&B[1].length&&!B[7]?N||(N=jb(),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=Hb(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?z?z.p(B,J):(z=Xb(B),z.c(),z.m(_.parentNode,_)):z&&(z.d(1),z=null),B[0]?F?F.p(B,J):(F=Qb(B),F.c(),F.m(g,h)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&($.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&&(y(e),y(t),y(i),y(r),y(u),y(f),y(c),y(d),y(m),y(_),y(g)),n[22](null),j(a,B),A&&A.d(B),N&&N.d(B),R&&R.d(B),z&&z.d(B),F&&F.d(),L=!1,Ee(I)}}}function pq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Fb(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function mq(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Fb();return{c(){e=b("label"),t=W("Collections"),s=C(),l=b("textarea"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(l,"id",o=n[42]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"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(l,"id",o),m[0]&1&&me(l,d[0]),d[0]&&!d[6]?c||(c=Fb(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function qb(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[hq,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&96|s[1]&6144&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hq(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),s=C(),l=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(l,"for",r=n[42])},m(f,c){w(f,e,c),e.checked=n[5],w(f,s,c),w(f,l,c),v(l,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(l,"for",r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function jb(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function Hb(n){let e,t,i,s,l,o=n[9].length&&zb(n),r=n[3].length&&Bb(n),a=n[8].length&&Jb(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),s=C(),r&&r.c(),l=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=zb(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Bb(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Jb(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(y(e),y(t),y(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function zb(n){let e=[],t=new Map,i,s=ce(n[9]);const l=o=>o[34].id;for(let o=0;oo[37].old.id+o[37].new.id;for(let o=0;oo[34].id;for(let o=0;o',i=C(),s=b("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are +- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await he.collections.import(o,a),nn("Successfully imported collections configuration."),i("submit")}catch(T){he.error(T)}t(4,u=!1),c()}}const g=()=>m(),_=()=>!u;function k(T){ne[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Le.call(this,n,T)}function $(T){Le.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,g,_,k,S,$]}class dq extends ve{constructor(e){super(),ye(this,e,cq,fq,be,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Nb(n,e,t){const i=n.slice();return i[34]=e[t],i}function Rb(n,e,t){const i=n.slice();return i[37]=e[t],i}function Fb(n,e,t){const i=n.slice();return i[34]=e[t],i}function pq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T,O,E,L,I;a=new fe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[hq,({uniqueId:B})=>({42:B}),({uniqueId:B})=>[0,B?2048:0]]},$$scope:{ctx:n}}});let A=n[1].length&&jb(n),P=!1,N=n[6]&&n[1].length&&!n[7]&&Hb(),R=n[6]&&n[1].length&&n[7]&&zb(n),z=n[13].length&&Qb(n),F=!!n[0]&&xb(n);return{c(){e=b("input"),t=C(),i=b("div"),s=b("p"),l=W(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=C(),H(a.$$.fragment),u=C(),A&&A.c(),f=C(),c=C(),N&&N.c(),d=C(),R&&R.c(),m=C(),z&&z.c(),h=C(),g=b("div"),F&&F.c(),_=C(),k=b("div"),S=C(),$=b("button"),T=b("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(k,"class","flex-fill"),p(T,"class","txt"),p($,"type","button"),p($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=O=!n[14],p(g,"class","flex m-t-base")},m(B,J){w(B,e,J),n[22](e),w(B,t,J),w(B,i,J),v(i,s),v(s,l),v(s,o),w(B,r,J),q(a,B,J),w(B,u,J),A&&A.m(B,J),w(B,f,J),w(B,c,J),N&&N.m(B,J),w(B,d,J),R&&R.m(B,J),w(B,m,J),z&&z.m(B,J),w(B,h,J),w(B,g,J),F&&F.m(g,null),v(g,_),v(g,k),v(g,S),v(g,$),v($,T),E=!0,L||(I=[Y(e,"change",n[23]),Y(o,"click",n[24]),Y($,"click",n[20])],L=!0)},p(B,J){(!E||J[0]&4096)&&x(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=jb(B),A.c(),M(A,1),A.m(f.parentNode,f)):A&&(oe(),D(A,1,1,()=>{A=null}),re()),B[6]&&B[1].length&&!B[7]?N||(N=Hb(),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=zb(B),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),B[13].length?z?z.p(B,J):(z=Qb(B),z.c(),z.m(h.parentNode,h)):z&&(z.d(1),z=null),B[0]?F?F.p(B,J):(F=xb(B),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!E||J[0]&16384&&O!==(O=!B[14]))&&($.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&&(y(e),y(t),y(i),y(r),y(u),y(f),y(c),y(d),y(m),y(h),y(g)),n[22](null),j(a,B),A&&A.d(B),N&&N.d(B),R&&R.d(B),z&&z.d(B),F&&F.d(),L=!1,Ee(I)}}}function mq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function qb(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function hq(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&qb();return{c(){e=b("label"),t=W("Collections"),s=C(),l=b("textarea"),r=C(),c&&c.c(),a=ke(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(l,"id",o=n[42]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"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(l,"id",o),m[0]&1&&me(l,d[0]),d[0]&&!d[6]?c||(c=qb(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),c&&c.d(d),u=!1,f()}}}function jb(n){let e,t;return e=new fe({props:{class:"form-field form-field-toggle",$$slots:{default:[_q,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&96|s[1]&6144&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _q(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("input"),s=C(),l=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(l,"for",r=n[42])},m(f,c){w(f,e,c),e.checked=n[5],w(f,s,c),w(f,l,c),v(l,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(l,"for",r)},d(f){f&&(y(e),y(s),y(l)),a=!1,u()}}}function Hb(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&y(e)}}}function zb(n){let e,t,i,s,l,o=n[9].length&&Ub(n),r=n[3].length&&Wb(n),a=n[8].length&&Zb(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=C(),i=b("div"),o&&o.c(),s=C(),r&&r.c(),l=C(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Ub(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Wb(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Zb(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(y(e),y(t),y(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Ub(n){let e=[],t=new Map,i,s=ce(n[9]);const l=o=>o[34].id;for(let o=0;oo[37].old.id+o[37].new.id;for(let o=0;oo[34].id;for(let o=0;o',i=C(),s=b("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are imported with different IDs. You can replace them in the import if you want - to.`,l=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&y(e),r=!1,a()}}}function Qb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[29]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function _q(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[pq,dq],_=[];function g(h,k){return h[4]?0:1}return f=g(n),c=_[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(h,k){w(h,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(h,r,k),w(h,a,k),v(a,u),_[f].m(u,null),d=!0},p(h,k){(!d||k[0]&32768)&&se(o,h[15]);let S=f;f=g(h),f===S?_[f].p(h,k):(oe(),D(_[S],1,1,()=>{_[S]=null}),re(),c=_[f],c?c.p(h,k):(c=_[f]=m[f](h),c.c()),M(c,1),c.m(u,null))},i(h){d||(M(c),d=!0)},o(h){D(c),d=!1},d(h){h&&(y(e),y(r),y(a)),_[f].d()}}}function gq(n){let e,t,i,s,l,o;e=new Fl({}),i=new si({props:{$$slots:{default:[_q]},$$scope:{ctx:n}}});let r={};return l=new cq({props:r}),n[30](l),l.$on("submit",n[31]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),q(l,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={};l.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(l.$$.fragment,a),o=!1},d(a){a&&(y(t),y(s)),j(e,a),j(i,a),n[30](null),j(l,a)}}}function bq(n,e,t){let i,s,l,o,r,a,u;Ge(n,an,pe=>t(15,u=pe)),En(an,u="Import collections",u);let f,c,d="",m=!1,_=[],g=[],h=!0,k=[],S=!1,$=!1;T();async function T(){var pe;t(4,S=!0);try{t(21,g=await he.collections.getFullList(200));for(let ae of g)delete ae.created,delete ae.updated,(pe=ae.oauth2)==null||delete pe.providers}catch(ae){he.error(ae)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let pe of _){const ae=U.findByKey(g,"id",pe.id);!(ae!=null&&ae.id)||!U.hasCollectionChanges(ae,pe,h)||k.push({new:pe,old:ae})}}function E(){t(1,_=[]);try{t(1,_=JSON.parse(d))}catch{}Array.isArray(_)?t(1,_=U.filterDuplicatesByKey(_)):t(1,_=[]);for(let pe of _)delete pe.created,delete pe.updated,pe.fields=U.filterDuplicatesByKey(pe.fields)}function L(){var pe;for(let ae of _){const Ce=U.findByKey(g,"name",ae.name)||U.findByKey(g,"id",ae.id);if(!Ce)continue;const Ye=ae.id,Ke=Ce.id;ae.id=Ke;const ct=Array.isArray(Ce.fields)?Ce.fields:[],et=Array.isArray(ae.fields)?ae.fields:[];for(const xe of et){const Be=U.findByKey(ct,"name",xe.name);Be&&Be.id&&(xe.id=Be.id)}for(let xe of _)if(Array.isArray(xe.fields))for(let Be of xe.fields)Be.collectionId&&Be.collectionId===Ye&&(Be.collectionId=Ke);for(let xe=0;xe<((pe=ae.indexes)==null?void 0:pe.length);xe++)ae.indexes[xe]=ae.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,Be=>Be.replace(Ye,Ke))}t(0,d=JSON.stringify(_,null,4))}function I(pe){t(12,m=!0);const ae=new FileReader;ae.onload=async Ce=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Ce.target.result),await _n(),_.length||(Mi("Invalid collections configuration."),A())},ae.onerror=Ce=>{console.warn(Ce),Mi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ae.readAsText(pe)}function A(){t(0,d=""),t(10,f.value="",f),Jt({})}function P(){const pe=$?U.filterDuplicatesByKey(g.concat(_)):_;c==null||c.show(g,pe,h)}function N(pe){ne[pe?"unshift":"push"](()=>{f=pe,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(){$=this.checked,t(5,$)}function J(){h=this.checked,t(2,h)}const V=()=>L(),Z=()=>A();function G(pe){ne[pe?"unshift":"push"](()=>{c=pe,t(11,c)})}const de=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&_.length&&_.length===_.filter(pe=>!!pe.id&&!!pe.name).length),n.$$.dirty[0]&2097254&&t(9,s=g.filter(pe=>i&&!$&&h&&!U.findByKey(_,"id",pe.id))),n.$$.dirty[0]&2097218&&t(8,l=_.filter(pe=>i&&!U.findByKey(g,"id",pe.id))),n.$$.dirty[0]&6&&(typeof _<"u"||typeof h<"u")&&O(),n.$$.dirty[0]&777&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=_.filter(pe=>{let ae=U.findByKey(g,"name",pe.name)||U.findByKey(g,"id",pe.id);if(!ae)return!1;if(ae.id!=pe.id)return!0;const Ce=Array.isArray(ae.fields)?ae.fields:[],Ye=Array.isArray(pe.fields)?pe.fields:[];for(const Ke of Ye){if(U.findByKey(Ce,"id",Ke.id))continue;const et=U.findByKey(Ce,"name",Ke.name);if(et&&Ke.id!=et.id)return!0}return!1}))},[d,_,h,k,S,$,i,o,l,s,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,B,J,V,Z,G,de]}class kq extends ve{constructor(e){super(),ye(this,e,bq,gq,be,{},null,[-1,-1])}}function yq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[wq,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[Sq,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[Tq,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&xb(n);function h($,T){return $[6]?Nq:Pq}let k=h(n),S=k(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),g&&g.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){w($,e,T),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),w($,r,T),q(a,$,T),w($,u,T),g&&g.m($,T),w($,f,T),w($,c,T),v(c,d),v(c,m),S.m(c,null),_=!0},p($,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:$}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:$}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:$}),a.$set(L),$[0].smtp.enabled?g?(g.p($,T),T[0]&1&&M(g,1)):(g=xb($),g.c(),M(g,1),g.m(f.parentNode,f)):g&&(oe(),D(g,1,1,()=>{g=null}),re()),k===(k=h($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){_||(M(i.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(g),_=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(g),_=!1},d($){$&&(y(e),y(r),y(u),y(f),y(c)),j(i),j(o),j(a,$),g&&g.d($),S.d()}}}function vq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function wq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Sender name"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.senderName),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&me(l,u[0].meta.senderName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Sq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Sender address"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","email"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.senderAddress),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&me(l,u[0].meta.senderAddress)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Tq(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[33])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[16]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function xb(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h,k,S,$,T;s=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[$q,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[Cq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[Oq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[Mq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?Dq:Eq}let E=O(n),L=E(n),I=n[5]&&e0(n);return{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),_=C(),g=b("button"),L.c(),h=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){w(A,e,P),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),v(e,_),v(e,g),L.m(g,null),v(e,h),I&&I.m(e,null),S=!0,$||(T=Y(g,"click",it(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),s.$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=e0(A),I.c(),M(I,1),I.m(e,null)):I&&(oe(),D(I,1,1,()=>{I=null}),re())},i(A){S||(M(s.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(I),A&&tt(()=>{S&&(k||(k=qe(e,ht,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(s.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(I),A&&(k||(k=qe(e,ht,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&y(e),j(s),j(r),j(f),j(m),L.d(),I&&I.d(),A&&k&&k.end(),$=!1,T()}}}function $q(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.host),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&me(l,u[0].smtp.host)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Cq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Port"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","number"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.port),r||(a=Y(l,"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(l,"id",o),f[0]&1&&mt(l.value)!==u[0].smtp.port&&me(l,u[0].smtp.port)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Oq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Username"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.username),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&me(l,u[0].smtp.username)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Mq(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Password"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const _={};m[1]&4&&(_.id=d[33]),!o&&m[0]&16&&(o=!0,_.mask=d[4],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,_.value=d[0].smtp.password,$e(()=>r=!1)),l.$set(_)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function Eq(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function Dq(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function e0(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[Iq,({uniqueId:_})=>({33:_}),({uniqueId:_})=>[0,_?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[Lq,({uniqueId:_})=>({33:_}),({uniqueId:_})=>[0,_?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[Aq,({uniqueId:_})=>({33:_}),({uniqueId:_})=>[0,_?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(_,g){w(_,e,g),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),m=!0},p(_,g){const h={};g[0]&1|g[1]&12&&(h.$$scope={dirty:g,ctx:_}),i.$set(h);const k={};g[0]&1|g[1]&12&&(k.$$scope={dirty:g,ctx:_}),o.$set(k);const S={};g[0]&1|g[1]&12&&(S.$$scope={dirty:g,ctx:_}),u.$set(S)},i(_){m||(M(i.$$.fragment,_),M(o.$$.fragment,_),M(u.$$.fragment,_),_&&tt(()=>{m&&(d||(d=qe(e,ht,{duration:150},!0)),d.run(1))}),m=!0)},o(_){D(i.$$.fragment,_),D(o.$$.fragment,_),D(u.$$.fragment,_),_&&(d||(d=qe(e,ht,{duration:150},!1)),d.run(0)),m=!1},d(_){_&&y(e),j(i),j(o),j(u),_&&d&&d.end()}}}function Iq(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function Lq(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function Aq(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].smtp.localName),u||(f=[Oe(Re.call(null,s,{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&&l!==(l=c[33])&&p(e,"for",l),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&me(r,c[0].smtp.localName)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function Pq(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[28]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Nq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[6]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),r||(a=[Y(e,"click",n[26]),Y(s,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(s)),r=!1,Ee(a)}}}function Rq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;const k=[vq,yq],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),_=!0,g||(h=Y(u,"submit",it(n[29])),g=!0)},p(T,O){(!_||O[0]&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){_||(M(m),_=!0)},o(T){D(m),_=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,h()}}}function Fq(n){let e,t,i,s,l,o;e=new Fl({}),i=new si({props:{$$slots:{default:[Rq]},$$scope:{ctx:n}}});let r={};return l=new zy({props:r}),n[30](l),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),q(l,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={};l.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(l.$$.fragment,a),o=!1},d(a){a&&(y(t),y(s)),j(e,a),j(i,a),n[30](null),j(l,a)}}}function qq(n,e,t){let i,s,l;Ge(n,an,de=>t(7,l=de));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];En(an,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,m=!1,_=!1;g();async function g(){t(2,c=!0);try{const de=await he.settings.getAll()||{};k(de)}catch(de){he.error(de)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const de=await he.settings.update(U.filterRedactedProps(f));k(de),Jt({}),nn("Successfully saved mail settings.")}catch(de){he.error(de)}t(3,d=!1)}}function k(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 $(){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=mt(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,_=!_)};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=()=>h(),V=()=>a==null?void 0:a.show(),Z=()=>h();function G(de){ne[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,s=i!=JSON.stringify(f))},[f,a,c,d,m,_,s,l,o,r,h,S,u,i,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V,Z,G]}class jq extends ve{constructor(e){super(),ye(this,e,qq,Fq,be,{},null,[-1,-1])}}function Hq(n){var L;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[Uq]},$$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 Gy({props:T}),ne.push(()=>ge(e,"config",k)),ne.push(()=>ge(e,"isTesting",S)),ne.push(()=>ge(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&n0(n),E=n[6]&&i0(n);return{c(){H(e.$$.fragment),l=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),w(I,l,A),w(I,o,A),v(o,r),v(o,a),O&&O.m(o,null),v(o,u),E&&E.m(o,null),v(o,f),v(o,c),v(c,d),_=!0,g||(h=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,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!s&&A&32&&(s=!0,P.testError=I[5],$e(()=>s=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=n0(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=i0(I),E.c(),E.m(o,f)):E&&(E.d(1),E=null),(!_||A&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!_||A&8)&&x(c,"btn-loading",I[3])},i(I){_||(M(e.$$.fragment,I),_=!0)},o(I){D(e.$$.fragment,I),_=!1},d(I){I&&(y(l),y(o)),j(e,I),O&&O.d(),E&&E.d(),g=!1,h()}}}function zq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function t0(n){var A;let e,t,i,s,l,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,_,g,h,k,S,$,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=C(),l=b("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually + to.
    `,l=C(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=Y(o,"click",n[28]),r=!0)},p:te,d(u){u&&y(e),r=!1,a()}}}function xb(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[29]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function gq(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[mq,pq],h=[];function g(_,k){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",s=C(),l=b("div"),o=W(n[15]),r=C(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(_,r,k),w(_,a,k),v(a,u),h[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&se(o,_[15]);let S=f;f=g(_),f===S?h[f].p(_,k):(oe(),D(h[S],1,1,()=>{h[S]=null}),re(),c=h[f],c?c.p(_,k):(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(_){_&&(y(e),y(r),y(a)),h[f].d()}}}function bq(n){let e,t,i,s,l,o;e=new Fl({}),i=new si({props:{$$slots:{default:[gq]},$$scope:{ctx:n}}});let r={};return l=new dq({props:r}),n[30](l),l.$on("submit",n[31]),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),q(l,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={};l.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(l.$$.fragment,a),o=!1},d(a){a&&(y(t),y(s)),j(e,a),j(i,a),n[30](null),j(l,a)}}}function kq(n,e,t){let i,s,l,o,r,a,u;Ge(n,an,pe=>t(15,u=pe)),En(an,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],_=!0,k=[],S=!1,$=!1;T();async function T(){var pe;t(4,S=!0);try{t(21,g=await he.collections.getFullList(200));for(let ae of g)delete ae.created,delete ae.updated,(pe=ae.oauth2)==null||delete pe.providers}catch(ae){he.error(ae)}t(4,S=!1)}function O(){if(t(3,k=[]),!!i)for(let pe of h){const ae=U.findByKey(g,"id",pe.id);!(ae!=null&&ae.id)||!U.hasCollectionChanges(ae,pe,_)||k.push({new:pe,old:ae})}}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 pe of h)delete pe.created,delete pe.updated,pe.fields=U.filterDuplicatesByKey(pe.fields)}function L(){var pe;for(let ae of h){const Ce=U.findByKey(g,"name",ae.name)||U.findByKey(g,"id",ae.id);if(!Ce)continue;const Ye=ae.id,Ke=Ce.id;ae.id=Ke;const ct=Array.isArray(Ce.fields)?Ce.fields:[],et=Array.isArray(ae.fields)?ae.fields:[];for(const xe of et){const Be=U.findByKey(ct,"name",xe.name);Be&&Be.id&&(xe.id=Be.id)}for(let xe of h)if(Array.isArray(xe.fields))for(let Be of xe.fields)Be.collectionId&&Be.collectionId===Ye&&(Be.collectionId=Ke);for(let xe=0;xe<((pe=ae.indexes)==null?void 0:pe.length);xe++)ae.indexes[xe]=ae.indexes[xe].replace(/create\s+(?:unique\s+)?\s*index\s*(?:if\s+not\s+exists\s+)?(\S*)\s+on/gim,Be=>Be.replace(Ye,Ke))}t(0,d=JSON.stringify(h,null,4))}function I(pe){t(12,m=!0);const ae=new FileReader;ae.onload=async Ce=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Ce.target.result),await _n(),h.length||(Mi("Invalid collections configuration."),A())},ae.onerror=Ce=>{console.warn(Ce),Mi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ae.readAsText(pe)}function A(){t(0,d=""),t(10,f.value="",f),Jt({})}function P(){const pe=$?U.filterDuplicatesByKey(g.concat(h)):h;c==null||c.show(g,pe,_)}function N(pe){ne[pe?"unshift":"push"](()=>{f=pe,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(){$=this.checked,t(5,$)}function J(){_=this.checked,t(2,_)}const V=()=>L(),Z=()=>A();function G(pe){ne[pe?"unshift":"push"](()=>{c=pe,t(11,c)})}const de=()=>{A(),T()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&$!==null&&E(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(pe=>!!pe.id&&!!pe.name).length),n.$$.dirty[0]&2097254&&t(9,s=g.filter(pe=>i&&!$&&_&&!U.findByKey(h,"id",pe.id))),n.$$.dirty[0]&2097218&&t(8,l=h.filter(pe=>i&&!U.findByKey(g,"id",pe.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof _<"u")&&O(),n.$$.dirty[0]&777&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=h.filter(pe=>{let ae=U.findByKey(g,"name",pe.name)||U.findByKey(g,"id",pe.id);if(!ae)return!1;if(ae.id!=pe.id)return!0;const Ce=Array.isArray(ae.fields)?ae.fields:[],Ye=Array.isArray(pe.fields)?pe.fields:[];for(const Ke of Ye){if(U.findByKey(Ce,"id",Ke.id))continue;const et=U.findByKey(Ce,"name",Ke.name);if(et&&Ke.id!=et.id)return!0}return!1}))},[d,h,_,k,S,$,i,o,l,s,f,c,m,a,r,u,T,L,I,A,P,g,N,R,z,F,B,J,V,Z,G,de]}class yq extends ve{constructor(e){super(),ye(this,e,kq,bq,be,{},null,[-1,-1])}}function vq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;i=new fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[Sq,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[Tq,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}}),a=new fe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[$q,({uniqueId:$})=>({33:$}),({uniqueId:$})=>[0,$?4:0]]},$$scope:{ctx:n}}});let g=n[0].smtp.enabled&&e0(n);function _($,T){return $[6]?Rq:Nq}let k=_(n),S=k(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),H(a.$$.fragment),u=C(),g&&g.c(),f=C(),c=b("div"),d=b("div"),m=C(),S.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(d,"class","flex-fill"),p(c,"class","flex")},m($,T){w($,e,T),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),w($,r,T),q(a,$,T),w($,u,T),g&&g.m($,T),w($,f,T),w($,c,T),v(c,d),v(c,m),S.m(c,null),h=!0},p($,T){const O={};T[0]&1|T[1]&12&&(O.$$scope={dirty:T,ctx:$}),i.$set(O);const E={};T[0]&1|T[1]&12&&(E.$$scope={dirty:T,ctx:$}),o.$set(E);const L={};T[0]&1|T[1]&12&&(L.$$scope={dirty:T,ctx:$}),a.$set(L),$[0].smtp.enabled?g?(g.p($,T),T[0]&1&&M(g,1)):(g=e0($),g.c(),M(g,1),g.m(f.parentNode,f)):g&&(oe(),D(g,1,1,()=>{g=null}),re()),k===(k=_($))&&S?S.p($,T):(S.d(1),S=k($),S&&(S.c(),S.m(c,null)))},i($){h||(M(i.$$.fragment,$),M(o.$$.fragment,$),M(a.$$.fragment,$),M(g),h=!0)},o($){D(i.$$.fragment,$),D(o.$$.fragment,$),D(a.$$.fragment,$),D(g),h=!1},d($){$&&(y(e),y(r),y(u),y(f),y(c)),j(i),j(o),j(a,$),g&&g.d($),S.d()}}}function wq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function Sq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Sender name"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.senderName),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&me(l,u[0].meta.senderName)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Tq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Sender address"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","email"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].meta.senderAddress),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&me(l,u[0].meta.senderAddress)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function $q(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=C(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server (recommended)",o=C(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[33]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[33])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),v(s,l),v(s,o),v(s,r),u||(f=[Y(e,"change",n[16]),Oe(Re.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(s,"for",a)},d(c){c&&(y(e),y(i),y(s)),u=!1,Ee(f)}}}function e0(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_,k,S,$,T;s=new fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[Cq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),r=new fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[Oq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),f=new fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[Mq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}}),m=new fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[Eq,({uniqueId:A})=>({33:A}),({uniqueId:A})=>[0,A?4:0]]},$$scope:{ctx:n}}});function O(A,P){return A[5]?Iq:Dq}let E=O(n),L=E(n),I=n[5]&&t0(n);return{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=C(),o=b("div"),H(r.$$.fragment),a=C(),u=b("div"),H(f.$$.fragment),c=C(),d=b("div"),H(m.$$.fragment),h=C(),g=b("button"),L.c(),_=C(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(A,P){w(A,e,P),v(e,t),v(t,i),q(s,i,null),v(t,l),v(t,o),q(r,o,null),v(t,a),v(t,u),q(f,u,null),v(t,c),v(t,d),q(m,d,null),v(e,h),v(e,g),L.m(g,null),v(e,_),I&&I.m(e,null),S=!0,$||(T=Y(g,"click",it(n[22])),$=!0)},p(A,P){const N={};P[0]&1|P[1]&12&&(N.$$scope={dirty:P,ctx:A}),s.$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=t0(A),I.c(),M(I,1),I.m(e,null)):I&&(oe(),D(I,1,1,()=>{I=null}),re())},i(A){S||(M(s.$$.fragment,A),M(r.$$.fragment,A),M(f.$$.fragment,A),M(m.$$.fragment,A),M(I),A&&tt(()=>{S&&(k||(k=qe(e,ht,{duration:150},!0)),k.run(1))}),S=!0)},o(A){D(s.$$.fragment,A),D(r.$$.fragment,A),D(f.$$.fragment,A),D(m.$$.fragment,A),D(I),A&&(k||(k=qe(e,ht,{duration:150},!1)),k.run(0)),S=!1},d(A){A&&y(e),j(s),j(r),j(f),j(m),L.d(),I&&I.d(),A&&k&&k.end(),$=!1,T()}}}function Cq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("SMTP server host"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.host),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&me(l,u[0].smtp.host)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Oq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Port"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","number"),p(l,"id",o=n[33]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.port),r||(a=Y(l,"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(l,"id",o),f[0]&1&&mt(l.value)!==u[0].smtp.port&&me(l,u[0].smtp.port)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Mq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Username"),s=C(),l=b("input"),p(e,"for",i=n[33]),p(l,"type","text"),p(l,"id",o=n[33])},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[0].smtp.username),r||(a=Y(l,"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(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&me(l,u[0].smtp.username)},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function Eq(n){let e,t,i,s,l,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),l=new rf({props:c}),ne.push(()=>ge(l,"mask",u)),ne.push(()=>ge(l,"value",f)),{c(){e=b("label"),t=W("Password"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(d,m){w(d,e,m),v(e,t),w(d,s,m),q(l,d,m),a=!0},p(d,m){(!a||m[1]&4&&i!==(i=d[33]))&&p(e,"for",i);const h={};m[1]&4&&(h.id=d[33]),!o&&m[0]&16&&(o=!0,h.mask=d[4],$e(()=>o=!1)),!r&&m[0]&1&&(r=!0,h.value=d[0].smtp.password,$e(()=>r=!1)),l.$set(h)},i(d){a||(M(l.$$.fragment,d),a=!0)},o(d){D(l.$$.fragment,d),a=!1},d(d){d&&(y(e),y(s)),j(l,d)}}}function Dq(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function Iq(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=C(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function t0(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new fe({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[Lq,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),o=new fe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[Aq,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),u=new fe({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[Pq,({uniqueId:h})=>({33:h}),({uniqueId:h})=>[0,h?4:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=C(),l=b("div"),H(o.$$.fragment),r=C(),a=b("div"),H(u.$$.fragment),f=C(),c=b("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,g){w(h,e,g),v(e,t),q(i,t,null),v(e,s),v(e,l),q(o,l,null),v(e,r),v(e,a),q(u,a,null),v(e,f),v(e,c),m=!0},p(h,g){const _={};g[0]&1|g[1]&12&&(_.$$scope={dirty:g,ctx:h}),i.$set(_);const k={};g[0]&1|g[1]&12&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);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=qe(e,ht,{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=qe(e,ht,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&y(e),j(i),j(o),j(u),h&&d&&d.end()}}}function Lq(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("TLS encryption"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function Aq(n){let e,t,i,s,l,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),l=new $n({props:u}),ne.push(()=>ge(l,"keyOfSelected",a)),{c(){e=b("label"),t=W("AUTH method"),s=C(),H(l.$$.fragment),p(e,"for",i=n[33])},m(f,c){w(f,e,c),v(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4&&i!==(i=f[33]))&&p(e,"for",i);const d={};c[1]&4&&(d.id=f[33]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,$e(()=>o=!1)),l.$set(d)},i(f){r||(M(l.$$.fragment,f),r=!0)},o(f){D(l.$$.fragment,f),r=!1},d(f){f&&(y(e),y(s)),j(l,f)}}}function Pq(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=C(),s=b("i"),o=C(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[33]),p(r,"type","text"),p(r,"id",a=n[33]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),v(e,t),v(e,i),v(e,s),w(c,o,d),w(c,r,d),me(r,n[0].smtp.localName),u||(f=[Oe(Re.call(null,s,{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&&l!==(l=c[33])&&p(e,"for",l),d[1]&4&&a!==(a=c[33])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&me(r,c[0].smtp.localName)},d(c){c&&(y(e),y(o),y(r)),u=!1,Ee(f)}}}function Nq(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[28]),t=!0)},p:te,d(s){s&&y(e),t=!1,i()}}}function Rq(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=C(),s=b("button"),l=b("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[6]||n[3],x(s,"btn-loading",n[3])},m(u,f){w(u,e,f),v(e,t),w(u,i,f),w(u,s,f),v(s,l),r||(a=[Y(e,"click",n[26]),Y(s,"click",n[27])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&72&&o!==(o=!u[6]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&(y(e),y(i),y(s)),r=!1,Ee(a)}}}function Fq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;const k=[wq,vq],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[29])),g=!0)},p(T,O){(!h||O[0]&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function qq(n){let e,t,i,s,l,o;e=new Fl({}),i=new si({props:{$$slots:{default:[Fq]},$$scope:{ctx:n}}});let r={};return l=new Uy({props:r}),n[30](l),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment),s=C(),H(l.$$.fragment)},m(a,u){q(e,a,u),w(a,t,u),q(i,a,u),w(a,s,u),q(l,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={};l.$set(c)},i(a){o||(M(e.$$.fragment,a),M(i.$$.fragment,a),M(l.$$.fragment,a),o=!0)},o(a){D(e.$$.fragment,a),D(i.$$.fragment,a),D(l.$$.fragment,a),o=!1},d(a){a&&(y(t),y(s)),j(e,a),j(i,a),n[30](null),j(l,a)}}}function jq(n,e,t){let i,s,l;Ge(n,an,de=>t(7,l=de));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];En(an,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,m=!1,h=!1;g();async function g(){t(2,c=!0);try{const de=await he.settings.getAll()||{};k(de)}catch(de){he.error(de)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const de=await he.settings.update(U.filterRedactedProps(f));k(de),Jt({}),nn("Successfully saved mail settings.")}catch(de){he.error(de)}t(3,d=!1)}}function k(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 $(){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=mt(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){ne[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,s=i!=JSON.stringify(f))},[f,a,c,d,m,h,s,l,o,r,_,S,u,i,$,T,O,E,L,I,A,P,N,R,z,F,B,J,V,Z,G]}class Hq extends ve{constructor(e){super(),ye(this,e,jq,qq,be,{},null,[-1,-1])}}function zq(n){var L;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;function k(I){n[11](I)}function S(I){n[12](I)}function $(I){n[13](I)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[Vq]},$$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 Xy({props:T}),ne.push(()=>ge(e,"config",k)),ne.push(()=>ge(e,"isTesting",S)),ne.push(()=>ge(e,"testError",$));let O=((L=n[1].s3)==null?void 0:L.enabled)&&!n[6]&&!n[3]&&i0(n),E=n[6]&&l0(n);return{c(){H(e.$$.fragment),l=C(),o=b("div"),r=b("div"),a=C(),O&&O.c(),u=C(),E&&E.c(),f=C(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,A){q(e,I,A),w(I,l,A),w(I,o,A),v(o,r),v(o,a),O&&O.m(o,null),v(o,u),E&&E.m(o,null),v(o,f),v(o,c),v(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,$e(()=>t=!1)),!i&&A&16&&(i=!0,P.isTesting=I[4],$e(()=>i=!1)),!s&&A&32&&(s=!0,P.testError=I[5],$e(()=>s=!1)),e.$set(P),(N=I[1].s3)!=null&&N.enabled&&!I[6]&&!I[3]?O?O.p(I,A):(O=i0(I),O.c(),O.m(o,u)):O&&(O.d(1),O=null),I[6]?E?E.p(I,A):(E=l0(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)&&x(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&&(y(l),y(o)),j(e,I),O&&O.d(),E&&E.d(),g=!1,_()}}}function Uq(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function n0(n){var A;let e,t,i,s,l,o,r,a=(A=n[0].s3)!=null&&A.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,g,_,k,S,$,T,O,E,L,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',s=C(),l=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 - `),c=b("strong"),m=W(d),_=W(`. - `),g=b("br"),h=W(` + `),c=b("strong"),m=W(d),h=W(`. + `),g=b("br"),_=W(` There are numerous command line tools that can help you, such as: `),k=b("a"),k.textContent=`rclone `,S=W(`, `),$=b("a"),$.textContent=`s5cmd - `,T=W(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){w(P,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,c),v(c,m),v(l,_),v(l,g),v(l,h),v(l,k),v(l,S),v(l,$),v(l,T),v(e,O),v(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")&&se(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function Uq(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&t0(n);return{c(){t&&t.c(),e=ke()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&M(t,1)):(t=t0(s),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(oe(),D(t,1,1,()=>{t=null}),re())},d(s){s&&y(e),t&&t.d(s)}}}function n0(n){let e;function t(l,o){return l[4]?Wq:l[5]?Bq:Vq}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function Vq(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Bq(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Oe(t=Re.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Lt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&y(e),i=!1,s()}}}function Wq(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function i0(n){let e,t,i,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-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&y(e),i=!1,s()}}}function Yq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g,h;const k=[zq,Hq],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

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

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

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),_=!0,g||(h=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!_||O&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){_||(M(m),_=!0)},o(T){D(m),_=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,h()}}}function Kq(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[Yq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}const Jq="s3_test_request";function Zq(n,e,t){let i,s,l;Ge(n,an,E=>t(7,l=E)),En(an,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await he.settings.getAll()||{};_(E)}catch(E){he.error(E)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(Jq);const E=await he.settings.update(U.filterRedactedProps(r));Jt({}),await _(E),As(),nn("Successfully saved storage settings.")}catch(E){he.error(E)}t(3,u=!1)}}async function _(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 h(E){n.$$.not_equal(r.s3,E)&&(r.s3=E,t(1,r))}function k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,m,g,i,h,k,S,$,T,O]}class Gq extends ve{constructor(e){super(),ye(this,e,Zq,Kq,be,{})}}function l0(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function Xq(n){let e,t,i,s=!n[0]&&l0();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=l0(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ft(o,l,r,r[2],i?Rt(l,r[2],a,null):qt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),s&&s.d(),o&&o.d(r)}}}function Qq(n){let e,t;return e=new si({props:{class:"full-page",center:!0,$$slots:{default:[Xq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function xq(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class e9 extends ve{constructor(e){super(),ye(this,e,xq,Qq,be,{nobranding:0})}}function s0(n){let e,t,i,s,l;return{c(){e=W("("),t=W(n[1]),i=W("/"),s=W(n[2]),l=W(")")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p(o,r){r&2&&se(t,o[1]),r&4&&se(s,o[2])},d(o){o&&(y(e),y(t),y(i),y(s),y(l))}}}function t9(n){let e,t,i,s;const l=[s9,l9],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function n9(n){let e,t,i,s,l,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,_;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[u9,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[f9,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),o=b("button"),r=b("span"),u=W(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),x(o,"btn-disabled",n[7]),x(o,"btn-loading",n[7]),p(e,"class","block")},m(g,h){w(g,e,h),q(t,e,null),v(e,i),q(s,e,null),v(e,l),v(e,o),v(o,r),v(r,u),v(o,f),v(o,c),d=!0,m||(_=Y(e,"submit",it(n[14])),m=!0)},p(g,h){const k={};h&201326625&&(k.$$scope={dirty:h,ctx:g}),t.$set(k);const S={};h&201326656&&(S.$$scope={dirty:h,ctx:g}),s.$set(S),(!d||h&4)&&a!==(a=g[2]>1?"Next":"Login")&&se(u,a),(!d||h&128)&&x(o,"btn-disabled",g[7]),(!d||h&128)&&x(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(s.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(s.$$.fragment,g),d=!1},d(g){g&&y(e),j(t),j(s),m=!1,_()}}}function i9(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function l9(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,g=n[12]&&o0(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[o9,({uniqueId:h})=>({26:h}),({uniqueId:h})=>h?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[r9,({uniqueId:h})=>({26:h}),({uniqueId:h})=>h?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),H(i.$$.fragment),s=C(),H(l.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),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"),x(r,"btn-disabled",n[9]),x(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(h,k){g&&g.m(h,k),w(h,e,k),w(h,t,k),q(i,t,null),v(t,s),q(l,t,null),v(t,o),v(t,r),w(h,a,k),w(h,u,k),v(u,f),v(f,c),d=!0,m||(_=[Y(t,"submit",it(n[16])),Y(f,"click",n[22])],m=!0)},p(h,k){h[12]?g?g.p(h,k):(g=o0(h),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:h}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:h}),l.$set($),(!d||k&512)&&x(r,"btn-disabled",h[9]),(!d||k&512)&&x(r,"btn-loading",h[9]),(!d||k&512)&&(f.disabled=h[9])},i(h){d||(M(i.$$.fragment,h),M(l.$$.fragment,h),d=!0)},o(h){D(i.$$.fragment,h),D(l.$$.fragment,h),d=!1},d(h){h&&(y(e),y(t),y(a),y(u)),g&&g.d(h),j(i),j(l),m=!1,Ee(_)}}}function s9(n){let e,t,i,s,l,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[a9,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),s=b("button"),s.innerHTML=' Send OTP',p(s,"type","submit"),p(s,"class","btn btn-lg btn-block btn-next"),x(s,"btn-disabled",n[8]),x(s,"btn-loading",n[8]),p(e,"class","block")},m(a,u){w(a,e,u),q(t,e,null),v(e,i),v(e,s),l=!0,o||(r=Y(e,"submit",it(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!l||u&256)&&x(s,"btn-disabled",a[8]),(!l||u&256)&&x(s,"btn-loading",a[8])},i(a){l||(M(t.$$.fragment,a),l=!0)},o(a){D(t.$$.fragment,a),l=!1},d(a){a&&y(e),j(t),o=!1,r()}}}function o0(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("p"),i=W("Check your "),s=b("strong"),l=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){w(r,e,a),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o)},p(r,a){a&4096&&se(l,r[12])},d(r){r&&y(e)}}}function o9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Id"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","text"),p(l,"id",o=n[26]),l.value=n[4],p(l,"placeholder",n[11]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),r||(a=Y(l,"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(l,"id",o),f&16&&l.value!==u[4]&&(l.value=u[4]),f&2048&&p(l,"placeholder",u[11])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function r9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("One-time password"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","password"),p(l,"id",o=n[26]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[13]),l.focus(),r||(a=Y(l,"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(l,"id",o),f&8192&&l.value!==u[13]&&me(l,u[13])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function a9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Email"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[12]),r||(a=Y(l,"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(l,"id",o),f&4096&&l.value!==u[12]&&me(l,u[12])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function u9(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,s,l,o,r,a,u,f;return{c(){e=b("label"),i=W(t),l=C(),o=b("input"),p(e,"for",s=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){w(c,e,d),v(e,i),w(c,l,d),w(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)+"")&&se(i,t),d&67108864&&s!==(s=c[26])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function f9(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),s=C(),l=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(l,"type","password"),p(l,"id",o=n[26]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[6]),w(d,r,m),w(d,a,m),v(a,u),f||(c=[Y(l,"input",n[18]),Oe(Fn.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(l,"id",o),m&64&&l.value!==d[6]&&me(l,d[6])},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),f=!1,Ee(c)}}}function c9(n){let e,t,i,s,l,o,r,a,u=n[2]>1&&s0(n);const f=[i9,n9,t9],c=[];function d(m,_){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(l=d(n))&&(o=c[l]=f[l](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login - `),u&&u.c(),s=C(),o&&o.c(),r=ke(),p(e,"class","content txt-center m-b-base")},m(m,_){w(m,e,_),v(e,t),v(t,i),u&&u.m(t,null),w(m,s,_),~l&&c[l].m(m,_),w(m,r,_),a=!0},p(m,_){m[2]>1?u?u.p(m,_):(u=s0(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=l;l=d(m),l===g?~l&&c[l].p(m,_):(o&&(oe(),D(c[g],1,1,()=>{c[g]=null}),re()),~l?(o=c[l],o?o.p(m,_):(o=c[l]=f[l](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&&(y(e),y(s),y(r)),u&&u.d(),~l&&c[l].d(m)}}}function d9(n){let e,t;return e=new e9({props:{$$slots:{default:[c9]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&134234111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function p9(n,e,t){let i;Ge(n,zu,z=>t(23,i=z));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,_="",g="",h="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await he.collection("_superusers").listAuthMethods())}catch(z){he.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await he.collection("_superusers").authWithPassword(l,o),As(),Jt({}),ls("/")}catch(B){B.status==401?(t(3,_=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,k=l),await O()):/^[^@\s]+@[^@\s]+$/.test(l)&&t(12,k=l)):B.status!=400?he.error(B):Mi("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await he.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,h=g),As(),Jt({})}catch(z){z.status==429&&t(4,g=h),he.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await he.collection("_superusers").authWithOTP(g||h,S,{mfaId:_}),As(),Jt({}),ls("/")}catch(z){he.error(z)}t(9,d=!1)}}const L=z=>{t(5,l=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}const P=z=>{t(4,g=z.target.value||h),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),_!=""&&t(1,a++,a),g!=""&&t(1,a++,a))},[r,a,u,_,g,l,o,f,c,d,m,h,k,S,T,O,E,L,I,A,P,N,R]}class m9 extends ve{constructor(e){super(),ye(this,e,p9,d9,be,{})}}function Xt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t$t(()=>import("./PageInstaller-DfKhEmI8.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Ar(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Xt({component:m9,conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Xt({asyncComponent:()=>$t(()=>import("./PageSuperuserRequestPasswordReset-ZJjtPYiP.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageSuperuserConfirmPasswordReset-1IyKQ6zI.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Xt({component:KN,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Xt({component:nC,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Xt({component:YR,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Xt({component:jq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Xt({component:Gq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Xt({component:xF,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Xt({component:kq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Xt({component:jF,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/crons":Xt({component:WF,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmPasswordReset-BdDq85c3.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmPasswordReset-BdDq85c3.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmVerification-DP-zC8Bz.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmVerification-DP-zC8Bz.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmEmailChange-CS--tlmU.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmEmailChange-CS--tlmU.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Xt({asyncComponent:()=>$t(()=>import("./PageOAuth2RedirectSuccess-C9LrAm5x.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Xt({asyncComponent:()=>$t(()=>import("./PageOAuth2RedirectFailure-z3pLbqpQ.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Xt({component:D3,userData:{showAppSidebar:!1}})};function _9(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){w(t,e,i)},d(t){t&&y(e)}}}function r0(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=U.getInitials(n[0].email)+"",_,g,h,k,S,$,T;return h=new Dn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[g9]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),s=b("nav"),l=b("a"),l.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),_=W(m),g=C(),H(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){w(O,e,E),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,c),v(c,d),v(d,_),v(c,g),q(h,c,null),S=!0,$||(T=[Oe(Fn.call(null,t)),Oe(Fn.call(null,l)),Oe(Si.call(null,l,{path:"/collections/?.*",className:"current-route"})),Oe(Re.call(null,l,{text:"Collections",position:"right"})),Oe(Fn.call(null,r)),Oe(Si.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(Re.call(null,r,{text:"Logs",position:"right"})),Oe(Fn.call(null,u)),Oe(Si.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(Re.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=U.getInitials(O[0].email)+"")&&se(_,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),h.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(h.$$.fragment,O),S=!0)},o(O){D(h.$$.fragment,O),S=!1},d(O){O&&y(e),j(h),$=!1,Ee(T)}}}function g9(n){let e,t=n[0].email+"",i,s,l,o,r,a,u,f,c,d;return{c(){e=b("div"),i=W(t),l=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",s=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,_){w(m,e,_),v(e,i),w(m,l,_),w(m,o,_),w(m,r,_),w(m,a,_),w(m,u,_),w(m,f,_),c||(d=[Oe(Fn.call(null,a)),Y(f,"click",n[7])],c=!0)},p(m,_){_&1&&t!==(t=m[0].email+"")&&se(i,t),_&1&&s!==(s=m[0].email)&&p(e,"title",s)},d(m){m&&(y(e),y(l),y(o),y(r),y(a),y(u),y(f)),c=!1,Ee(d)}}}function a0(n){let e,t,i;return t=new Pu({props:{conf:U.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p:te,i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function b9(n){var S;let e,t,i,s,l,o,r,a,u,f,c,d,m,_;document.title=e=U.joinNonEmpty([n[4],n[3],"PocketBase"]," - ",!1);let g=window.location.protocol=="https:"&&_9(),h=((S=n[0])==null?void 0:S.id)&&n[1]&&r0(n);r=new $3({props:{routes:h9}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Zw({}),c=new Nw({});let k=n[1]&&!n[2]&&a0(n);return{c(){g&&g.c(),t=ke(),i=C(),s=b("div"),h&&h.c(),l=C(),o=b("div"),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),d=C(),k&&k.c(),m=ke(),p(o,"class","app-body"),p(s,"class","app-layout")},m($,T){g&&g.m(document.head,null),v(document.head,t),w($,i,T),w($,s,T),h&&h.m(s,null),v(s,l),v(s,o),q(r,o,null),v(o,a),q(u,o,null),w($,f,T),q(c,$,T),w($,d,T),k&&k.m($,T),w($,m,T),_=!0},p($,[T]){var O;(!_||T&24)&&e!==(e=U.joinNonEmpty([$[4],$[3],"PocketBase"]," - ",!1))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?h?(h.p($,T),T&3&&M(h,1)):(h=r0($),h.c(),M(h,1),h.m(s,l)):h&&(oe(),D(h,1,1,()=>{h=null}),re()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=a0($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(oe(),D(k,1,1,()=>{k=null}),re())},i($){_||(M(h),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),_=!0)},o($){D(h),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),_=!1},d($){$&&(y(i),y(s),y(f),y(d),y(m)),g&&g.d($),y(t),h&&h.d(),j(r),j(u),j(c,$),k&&k.d($)}}}function k9(n,e,t){let i,s,l,o;Ge(n,Il,g=>t(10,i=g)),Ge(n,pr,g=>t(3,s=g)),Ge(n,Lr,g=>t(0,l=g)),Ge(n,an,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var h,k,S,$;((h=g==null?void 0:g.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,En(an,o="",o),Jt({}),Ok())}function c(){ls("/")}async function d(){var g,h;if(l!=null&&l.id)try{const k=await he.settings.getAll({$cancelKey:"initialAppSettings"});En(pr,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),En(Il,i=!!((h=k==null?void 0:k.meta)!=null&&h.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){he.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,m,_]}class y9 extends ve{constructor(e){super(),ye(this,e,k9,b9,be,{})}}new y9({target:document.getElementById("app")});export{Yt as $,W as A,Js as B,oe as C,re as D,Oe as E,e9 as F,Fn as G,te as H,se as I,U as J,nn as K,ke as L,po as M,Ar as N,Ge as O,En as P,un as Q,an as R,ve as S,In as T,wt as U,N7 as V,of as W,ce as X,dt as Y,kt as Z,li as _,M as a,Ht as a0,h0 as a1,S6 as a2,w9 as a3,Re as a4,Mi as b,H as c,j as d,_n as e,fe as f,es as g,y as h,ye as i,Ee as j,x as k,w as l,q as m,v as n,Y as o,he as p,it as q,ls as r,be as s,D as t,b as u,C as v,p as w,yn as x,ne as y,me as z}; + `,T=W(", etc."),O=C(),E=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(E,"class","clearfix m-t-base")},m(P,N){w(P,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,c),v(c,m),v(l,h),v(l,g),v(l,_),v(l,k),v(l,S),v(l,$),v(l,T),v(e,O),v(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")&&se(u,a),(!I||N&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){I||(P&&tt(()=>{I&&(L||(L=qe(e,ht,{duration:150},!0)),L.run(1))}),I=!0)},o(P){P&&(L||(L=qe(e,ht,{duration:150},!1)),L.run(0)),I=!1},d(P){P&&y(e),P&&L&&L.end()}}}function Vq(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&n0(n);return{c(){t&&t.c(),e=ke()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&M(t,1)):(t=n0(s),t.c(),M(t,1),t.m(e.parentNode,e)):t&&(oe(),D(t,1,1,()=>{t=null}),re())},d(s){s&&y(e),t&&t.d(s)}}}function i0(n){let e;function t(l,o){return l[4]?Yq:l[5]?Wq:Bq}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&y(e),s.d(l)}}}function Bq(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function Wq(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Oe(t=Re.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Lt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&y(e),i=!1,s()}}}function Yq(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:te,d(t){t&&y(e)}}}function l0(n){let e,t,i,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-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),v(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&y(e),i=!1,s()}}}function Kq(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,_;const k=[Uq,zq],S=[];function $(T,O){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=C(),l=b("div"),o=W(n[7]),r=C(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

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

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

    ",c=C(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){w(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),w(T,r,O),w(T,a,O),v(a,u),v(u,f),v(u,c),S[d].m(u,null),h=!0,g||(_=Y(u,"submit",it(n[16])),g=!0)},p(T,O){(!h||O&128)&&se(o,T[7]);let E=d;d=$(T),d===E?S[d].p(T,O):(oe(),D(S[E],1,1,()=>{S[E]=null}),re(),m=S[d],m?m.p(T,O):(m=S[d]=k[d](T),m.c()),M(m,1),m.m(u,null))},i(T){h||(M(m),h=!0)},o(T){D(m),h=!1},d(T){T&&(y(e),y(r),y(a)),S[d].d(),g=!1,_()}}}function Jq(n){let e,t,i,s;return e=new Fl({}),i=new si({props:{$$slots:{default:[Kq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=C(),H(i.$$.fragment)},m(l,o){q(e,l,o),w(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(M(e.$$.fragment,l),M(i.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),D(i.$$.fragment,l),s=!1},d(l){l&&y(t),j(e,l),j(i,l)}}}const Zq="s3_test_request";function Gq(n,e,t){let i,s,l;Ge(n,an,E=>t(7,l=E)),En(an,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const E=await he.settings.getAll()||{};h(E)}catch(E){he.error(E)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{he.cancelRequest(Zq);const E=await he.settings.update(U.filterRedactedProps(r));Jt({}),await h(E),As(),nn("Successfully saved storage settings.")}catch(E){he.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 k(E){f=E,t(4,f)}function S(E){c=E,t(5,c)}const $=()=>g(),T=()=>m(),O=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,m,g,i,_,k,S,$,T,O]}class Xq extends ve{constructor(e){super(),ye(this,e,Gq,Jq,be,{})}}function s0(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=C(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(y(e),y(t),y(i))}}}function Qq(n){let e,t,i,s=!n[0]&&s0();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=C(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=s0(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ft(o,l,r,r[2],i?Rt(l,r[2],a,null):qt(r[2]),null)},i(r){i||(M(o,r),i=!0)},o(r){D(o,r),i=!1},d(r){r&&y(e),s&&s.d(),o&&o.d(r)}}}function xq(n){let e,t;return e=new si({props:{class:"full-page",center:!0,$$slots:{default:[Qq]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function e9(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class t9 extends ve{constructor(e){super(),ye(this,e,e9,xq,be,{nobranding:0})}}function o0(n){let e,t,i,s,l;return{c(){e=W("("),t=W(n[1]),i=W("/"),s=W(n[2]),l=W(")")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p(o,r){r&2&&se(t,o[1]),r&4&&se(s,o[2])},d(o){o&&(y(e),y(t),y(i),y(s),y(l))}}}function n9(n){let e,t,i,s;const l=[o9,s9],o=[];function r(a,u){return a[4]?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(oe(),D(o[f],1,1,()=>{o[f]=null}),re(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){s||(M(t),s=!0)},o(a){D(t),s=!1},d(a){a&&y(i),o[e].d(a)}}}function i9(n){let e,t,i,s,l,o,r,a=n[2]>1?"Next":"Login",u,f,c,d,m,h;return t=new fe({props:{class:"form-field required",name:"identity",$$slots:{default:[f9,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),s=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[c9,({uniqueId:g})=>({26:g}),({uniqueId:g})=>g?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),H(s.$$.fragment),l=C(),o=b("button"),r=b("span"),u=W(a),f=C(),c=b("i"),p(r,"class","txt"),p(c,"class","ri-arrow-right-line"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block btn-next"),x(o,"btn-disabled",n[7]),x(o,"btn-loading",n[7]),p(e,"class","block")},m(g,_){w(g,e,_),q(t,e,null),v(e,i),q(s,e,null),v(e,l),v(e,o),v(o,r),v(r,u),v(o,f),v(o,c),d=!0,m||(h=Y(e,"submit",it(n[14])),m=!0)},p(g,_){const k={};_&201326625&&(k.$$scope={dirty:_,ctx:g}),t.$set(k);const S={};_&201326656&&(S.$$scope={dirty:_,ctx:g}),s.$set(S),(!d||_&4)&&a!==(a=g[2]>1?"Next":"Login")&&se(u,a),(!d||_&128)&&x(o,"btn-disabled",g[7]),(!d||_&128)&&x(o,"btn-loading",g[7])},i(g){d||(M(t.$$.fragment,g),M(s.$$.fragment,g),d=!0)},o(g){D(t.$$.fragment,g),D(s.$$.fragment,g),d=!1},d(g){g&&y(e),j(t),j(s),m=!1,h()}}}function l9(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:te,i:te,o:te,d(t){t&&y(e)}}}function s9(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g=n[12]&&r0(n);return i=new fe({props:{class:"form-field required",name:"otpId",$$slots:{default:[r9,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),l=new fe({props:{class:"form-field required",name:"password",$$slots:{default:[a9,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),{c(){g&&g.c(),e=C(),t=b("form"),H(i.$$.fragment),s=C(),H(l.$$.fragment),o=C(),r=b("button"),r.innerHTML='Login ',a=C(),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"),x(r,"btn-disabled",n[9]),x(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(_,k){g&&g.m(_,k),w(_,e,k),w(_,t,k),q(i,t,null),v(t,s),q(l,t,null),v(t,o),v(t,r),w(_,a,k),w(_,u,k),v(u,f),v(f,c),d=!0,m||(h=[Y(t,"submit",it(n[16])),Y(f,"click",n[22])],m=!0)},p(_,k){_[12]?g?g.p(_,k):(g=r0(_),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null);const S={};k&201328656&&(S.$$scope={dirty:k,ctx:_}),i.$set(S);const $={};k&201334784&&($.$$scope={dirty:k,ctx:_}),l.$set($),(!d||k&512)&&x(r,"btn-disabled",_[9]),(!d||k&512)&&x(r,"btn-loading",_[9]),(!d||k&512)&&(f.disabled=_[9])},i(_){d||(M(i.$$.fragment,_),M(l.$$.fragment,_),d=!0)},o(_){D(i.$$.fragment,_),D(l.$$.fragment,_),d=!1},d(_){_&&(y(e),y(t),y(a),y(u)),g&&g.d(_),j(i),j(l),m=!1,Ee(h)}}}function o9(n){let e,t,i,s,l,o,r;return t=new fe({props:{class:"form-field required",name:"email",$$slots:{default:[u9,({uniqueId:a})=>({26:a}),({uniqueId:a})=>a?67108864:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=C(),s=b("button"),s.innerHTML=' Send OTP',p(s,"type","submit"),p(s,"class","btn btn-lg btn-block btn-next"),x(s,"btn-disabled",n[8]),x(s,"btn-loading",n[8]),p(e,"class","block")},m(a,u){w(a,e,u),q(t,e,null),v(e,i),v(e,s),l=!0,o||(r=Y(e,"submit",it(n[15])),o=!0)},p(a,u){const f={};u&201330688&&(f.$$scope={dirty:u,ctx:a}),t.$set(f),(!l||u&256)&&x(s,"btn-disabled",a[8]),(!l||u&256)&&x(s,"btn-loading",a[8])},i(a){l||(M(t.$$.fragment,a),l=!0)},o(a){D(t.$$.fragment,a),l=!1},d(a){a&&y(e),j(t),o=!1,r()}}}function r0(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("p"),i=W("Check your "),s=b("strong"),l=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){w(r,e,a),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o)},p(r,a){a&4096&&se(l,r[12])},d(r){r&&y(e)}}}function r9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Id"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","text"),p(l,"id",o=n[26]),l.value=n[4],p(l,"placeholder",n[11]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),r||(a=Y(l,"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(l,"id",o),f&16&&l.value!==u[4]&&(l.value=u[4]),f&2048&&p(l,"placeholder",u[11])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function a9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("One-time password"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","password"),p(l,"id",o=n[26]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[13]),l.focus(),r||(a=Y(l,"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(l,"id",o),f&8192&&l.value!==u[13]&&me(l,u[13])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function u9(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=W("Email"),s=C(),l=b("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),v(e,t),w(u,s,f),w(u,l,f),me(l,n[12]),r||(a=Y(l,"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(l,"id",o),f&4096&&l.value!==u[12]&&me(l,u[12])},d(u){u&&(y(e),y(s),y(l)),r=!1,a()}}}function f9(n){let e,t=U.sentenize(n[0].password.identityFields.join(" or "),!1)+"",i,s,l,o,r,a,u,f;return{c(){e=b("label"),i=W(t),l=C(),o=b("input"),p(e,"for",s=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){w(c,e,d),v(e,i),w(c,l,d),w(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)+"")&&se(i,t),d&67108864&&s!==(s=c[26])&&p(e,"for",s),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&&(y(e),y(l),y(o)),u=!1,f()}}}function c9(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=W("Password"),s=C(),l=b("input"),r=C(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[26]),p(l,"type","password"),p(l,"id",o=n[26]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),v(e,t),w(d,s,m),w(d,l,m),me(l,n[6]),w(d,r,m),w(d,a,m),v(a,u),f||(c=[Y(l,"input",n[18]),Oe(Fn.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(l,"id",o),m&64&&l.value!==d[6]&&me(l,d[6])},d(d){d&&(y(e),y(s),y(l),y(r),y(a)),f=!1,Ee(c)}}}function d9(n){let e,t,i,s,l,o,r,a,u=n[2]>1&&o0(n);const f=[l9,i9,n9],c=[];function d(m,h){return m[10]?0:m[0].password.enabled&&!m[3]?1:m[0].otp.enabled?2:-1}return~(l=d(n))&&(o=c[l]=f[l](n)),{c(){e=b("div"),t=b("h4"),i=W(`Superuser login + `),u&&u.c(),s=C(),o&&o.c(),r=ke(),p(e,"class","content txt-center m-b-base")},m(m,h){w(m,e,h),v(e,t),v(t,i),u&&u.m(t,null),w(m,s,h),~l&&c[l].m(m,h),w(m,r,h),a=!0},p(m,h){m[2]>1?u?u.p(m,h):(u=o0(m),u.c(),u.m(t,null)):u&&(u.d(1),u=null);let g=l;l=d(m),l===g?~l&&c[l].p(m,h):(o&&(oe(),D(c[g],1,1,()=>{c[g]=null}),re()),~l?(o=c[l],o?o.p(m,h):(o=c[l]=f[l](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&&(y(e),y(s),y(r)),u&&u.d(),~l&&c[l].d(m)}}}function p9(n){let e,t;return e=new t9({props:{$$slots:{default:[d9]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&134234111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){D(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function m9(n,e,t){let i;Ge(n,zu,z=>t(23,i=z));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r={},a=1,u=1,f=!1,c=!1,d=!1,m=!1,h="",g="",_="",k="",S="";$();async function $(){if(!m){t(10,m=!0);try{t(0,r=await he.collection("_superusers").listAuthMethods())}catch(z){he.error(z)}t(10,m=!1)}}async function T(){var z,F;if(!f){t(7,f=!0);try{await he.collection("_superusers").authWithPassword(l,o),As(),Jt({}),ls("/")}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,k=l),await O()):/^[^@\s]+@[^@\s]+$/.test(l)&&t(12,k=l)):B.status!=400?he.error(B):Mi("Invalid login credentials.")}t(7,f=!1)}}async function O(){if(!c){t(8,c=!0);try{const z=await he.collection("_superusers").requestOTP(k);t(4,g=z.otpId),t(11,_=g),As(),Jt({})}catch(z){z.status==429&&t(4,g=_),he.error(z)}t(8,c=!1)}}async function E(){if(!d){t(9,d=!0);try{await he.collection("_superusers").authWithOTP(g||_,S,{mfaId:h}),As(),Jt({}),ls("/")}catch(z){he.error(z)}t(9,d=!1)}}const L=z=>{t(5,l=z.target.value)};function I(){o=this.value,t(6,o)}function A(){k=this.value,t(12,k)}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,l,o,f,c,d,m,_,k,S,T,O,E,L,I,A,P,N,R]}class h9 extends ve{constructor(e){super(),ye(this,e,m9,p9,be,{})}}function Xt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t$t(()=>import("./PageInstaller-BfzyXDSy.js"),[],import.meta.url),conditions:[n=>n.params.token&&!Ar(n.params.token)],userData:{showAppSidebar:!1}}),"/login":Xt({component:h9,conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/request-password-reset":Xt({asyncComponent:()=>$t(()=>import("./PageSuperuserRequestPasswordReset-uFdlcqFn.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageSuperuserConfirmPasswordReset-BUk9QWNe.js"),[],import.meta.url),conditions:[n=>!he.authStore.isValid],userData:{showAppSidebar:!1}}),"/collections":Xt({component:JN,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/logs":Xt({component:iC,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings":Xt({component:KR,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/mail":Xt({component:Hq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/storage":Xt({component:Xq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/export-collections":Xt({component:eq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/import-collections":Xt({component:yq,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/backups":Xt({component:HF,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/settings/crons":Xt({component:YF,conditions:[n=>he.authStore.isValid],userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmPasswordReset-Dn-6dV59.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmPasswordReset-Dn-6dV59.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmVerification-ByYtK2uy.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmVerification-ByYtK2uy.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmEmailChange-eIqoWA8x.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Xt({asyncComponent:()=>$t(()=>import("./PageRecordConfirmEmailChange-eIqoWA8x.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Xt({asyncComponent:()=>$t(()=>import("./PageOAuth2RedirectSuccess-CTZBGWQn.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Xt({asyncComponent:()=>$t(()=>import("./PageOAuth2RedirectFailure-BNMes8rk.js"),[],import.meta.url),userData:{showAppSidebar:!1}}),"*":Xt({component:I3,userData:{showAppSidebar:!1}})};function g9(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){w(t,e,i)},d(t){t&&y(e)}}}function a0(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=U.getInitials(n[0].email)+"",h,g,_,k,S,$,T;return _=new Dn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[b9]},$$scope:{ctx:n}}}),{c(){e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=C(),s=b("nav"),l=b("a"),l.innerHTML='',o=C(),r=b("a"),r.innerHTML='',a=C(),u=b("a"),u.innerHTML='',f=C(),c=b("div"),d=b("span"),h=W(m),g=C(),H(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),p(d,"class","initials"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged superuser menu"),p(c,"class","thumb thumb-circle link-hint"),p(c,"title",k=n[0].email),p(e,"class","app-sidebar")},m(O,E){w(O,e,E),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,c),v(c,d),v(d,h),v(c,g),q(_,c,null),S=!0,$||(T=[Oe(Fn.call(null,t)),Oe(Fn.call(null,l)),Oe(Si.call(null,l,{path:"/collections/?.*",className:"current-route"})),Oe(Re.call(null,l,{text:"Collections",position:"right"})),Oe(Fn.call(null,r)),Oe(Si.call(null,r,{path:"/logs/?.*",className:"current-route"})),Oe(Re.call(null,r,{text:"Logs",position:"right"})),Oe(Fn.call(null,u)),Oe(Si.call(null,u,{path:"/settings/?.*",className:"current-route"})),Oe(Re.call(null,u,{text:"Settings",position:"right"}))],$=!0)},p(O,E){(!S||E&1)&&m!==(m=U.getInitials(O[0].email)+"")&&se(h,m);const L={};E&4097&&(L.$$scope={dirty:E,ctx:O}),_.$set(L),(!S||E&1&&k!==(k=O[0].email))&&p(c,"title",k)},i(O){S||(M(_.$$.fragment,O),S=!0)},o(O){D(_.$$.fragment,O),S=!1},d(O){O&&y(e),j(_),$=!1,Ee(T)}}}function b9(n){let e,t=n[0].email+"",i,s,l,o,r,a,u,f,c,d;return{c(){e=b("div"),i=W(t),l=C(),o=b("hr"),r=C(),a=b("a"),a.innerHTML=' Manage superusers',u=C(),f=b("button"),f.innerHTML=' Logout',p(e,"class","txt-ellipsis current-superuser svelte-1ahgi3o"),p(e,"title",s=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){w(m,e,h),v(e,i),w(m,l,h),w(m,o,h),w(m,r,h),w(m,a,h),w(m,u,h),w(m,f,h),c||(d=[Oe(Fn.call(null,a)),Y(f,"click",n[7])],c=!0)},p(m,h){h&1&&t!==(t=m[0].email+"")&&se(i,t),h&1&&s!==(s=m[0].email)&&p(e,"title",s)},d(m){m&&(y(e),y(l),y(o),y(r),y(a),y(u),y(f)),c=!1,Ee(d)}}}function u0(n){let e,t,i;return t=new Pu({props:{conf:U.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),q(t,e,null),i=!0},p:te,i(s){i||(M(t.$$.fragment,s),i=!0)},o(s){D(t.$$.fragment,s),i=!1},d(s){s&&y(e),j(t)}}}function k9(n){var S;let e,t,i,s,l,o,r,a,u,f,c,d,m,h;document.title=e=U.joinNonEmpty([n[4],n[3],"PocketBase"]," - ",!1);let g=window.location.protocol=="https:"&&g9(),_=((S=n[0])==null?void 0:S.id)&&n[1]&&a0(n);r=new C3({props:{routes:_9}}),r.$on("routeLoading",n[5]),r.$on("conditionsFailed",n[6]),u=new Gw({}),c=new Rw({});let k=n[1]&&!n[2]&&u0(n);return{c(){g&&g.c(),t=ke(),i=C(),s=b("div"),_&&_.c(),l=C(),o=b("div"),H(r.$$.fragment),a=C(),H(u.$$.fragment),f=C(),H(c.$$.fragment),d=C(),k&&k.c(),m=ke(),p(o,"class","app-body"),p(s,"class","app-layout")},m($,T){g&&g.m(document.head,null),v(document.head,t),w($,i,T),w($,s,T),_&&_.m(s,null),v(s,l),v(s,o),q(r,o,null),v(o,a),q(u,o,null),w($,f,T),q(c,$,T),w($,d,T),k&&k.m($,T),w($,m,T),h=!0},p($,[T]){var O;(!h||T&24)&&e!==(e=U.joinNonEmpty([$[4],$[3],"PocketBase"]," - ",!1))&&(document.title=e),(O=$[0])!=null&&O.id&&$[1]?_?(_.p($,T),T&3&&M(_,1)):(_=a0($),_.c(),M(_,1),_.m(s,l)):_&&(oe(),D(_,1,1,()=>{_=null}),re()),$[1]&&!$[2]?k?(k.p($,T),T&6&&M(k,1)):(k=u0($),k.c(),M(k,1),k.m(m.parentNode,m)):k&&(oe(),D(k,1,1,()=>{k=null}),re())},i($){h||(M(_),M(r.$$.fragment,$),M(u.$$.fragment,$),M(c.$$.fragment,$),M(k),h=!0)},o($){D(_),D(r.$$.fragment,$),D(u.$$.fragment,$),D(c.$$.fragment,$),D(k),h=!1},d($){$&&(y(i),y(s),y(f),y(d),y(m)),g&&g.d($),y(t),_&&_.d(),j(r),j(u),j(c,$),k&&k.d($)}}}function y9(n,e,t){let i,s,l,o;Ge(n,Il,g=>t(10,i=g)),Ge(n,pr,g=>t(3,s=g)),Ge(n,Lr,g=>t(0,l=g)),Ge(n,an,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,k,S,$;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=g==null?void 0:g.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=g==null?void 0:g.detail)==null?void 0:$.location,En(an,o="",o),Jt({}),Mk())}function c(){ls("/")}async function d(){var g,_;if(l!=null&&l.id)try{const k=await he.settings.getAll({$cancelKey:"initialAppSettings"});En(pr,s=((g=k==null?void 0:k.meta)==null?void 0:g.appName)||"",s),En(Il,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){he.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,m,h]}class v9 extends ve{constructor(e){super(),ye(this,e,y9,k9,be,{})}}new v9({target:document.getElementById("app")});export{Yt as $,W as A,Js as B,oe as C,re as D,Oe as E,t9 as F,Fn as G,te as H,se as I,U as J,nn as K,ke as L,po as M,Ar as N,Ge as O,En as P,un as Q,an as R,ve as S,In as T,wt as U,R7 as V,of as W,ce as X,dt as Y,kt as Z,li as _,M as a,Ht as a0,_0 as a1,T6 as a2,S9 as a3,Re as a4,Mi as b,H as c,j as d,_n as e,fe as f,es as g,y as h,ye as i,Ee as j,x as k,w as l,q as m,v as n,Y as o,he as p,it as q,ls as r,be as s,D as t,b as u,C as v,p as w,yn as x,ne as y,me as z}; diff --git a/ui/dist/index.html b/ui/dist/index.html index 9a8ee845..32a1433b 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -37,7 +37,7 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - + diff --git a/ui/src/components/records/RecordInfoContent.svelte b/ui/src/components/records/RecordInfoContent.svelte index 8beb7575..7736b945 100644 --- a/ui/src/components/records/RecordInfoContent.svelte +++ b/ui/src/components/records/RecordInfoContent.svelte @@ -55,12 +55,16 @@ {/if} {#if field.type == "relation" && record.expand?.[field.name]} {@const isMultiple = Array.isArray(record.expand?.[field.name])} - {@const expands = CommonHelper.toArray(record.expand?.[field.name])} + {@const expanded = CommonHelper.toArray(record.expand?.[field.name])} {#if isMultiple}{"["}{/if} - {#each expands as expandRecord, j} + {#each expanded.slice(0, 2) as expandRecord, j} {#if j > 0}|{/if} {/each} + {#if expanded.length > 2} + | + ({expanded.length - 2} more) + {/if} {#if isMultiple}{"]"}{/if} {:else if field.type == "geoPoint"}