pocketbase/ui/dist/assets/index-9473b958.js

206 lines
891 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(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 G(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function Kb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function a_(n){return n()}function ru(){return Object.create(null)}function Pe(n){n.forEach(a_)}function Bt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function zn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Jb(n){return Object.keys(n).length===0}function u_(n,...e){if(n==null)return G;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(u_(e,t))}function Nt(n,e,t,i){if(n){const s=f_(n,e,t,i);return n[0](s)}}function f_(n,e,t,i){return n[1]&&i?Je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ft(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;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Rt(n,e,t,i,s,l){if(s){const o=f_(e,t,i,l);n.p(o,s)}}function qt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Qn(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Et(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Si(n){return n??""}function Kt(n,e,t){return n.set(t),e}function Ie(n){return n&&Bt(n.destroy)?n.destroy:G}const c_=typeof window<"u";let Fo=c_?()=>window.performance.now():()=>Date.now(),da=c_?n=>requestAnimationFrame(n):G;const bs=new Set;function d_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&da(d_)}function Ro(n){let e;return bs.size===0&&da(d_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function p_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Zb(n){const e=b("style");return Gb(p_(n),e),e.sheet}function Gb(n,e){return g(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function V(n){return document.createTextNode(n)}function D(){return V(" ")}function Me(){return V("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function kn(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)}function Xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function pt(n){return n===""?null:+n}function Xb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Lr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function m_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Ht(n,e){return new n(e)}const mo=new Map;let ho=0;function Qb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function xb(n,e){const t={stylesheet:Zb(e),rules:{}};return mo.set(n,t),t}function al(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${Qb(f)}_${r}`,d=p_(n),{stylesheet:m,rules:h}=mo.get(d)||xb(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function ul(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||e1())}function e1(){da(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function t1(n,e,t,i){if(!e)return G;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return G;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=G,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function _(){c&&(h=al(n,0,1,o,l,r,c)),l||(m=!0)}function v(){c&&ul(n,h),d=!1}return Ro(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),v()),!d)return!1;if(m){const y=k-a,$=0+1*r(y/o);f($,1-$)}return!0}),_(),f(0,1),v}function n1(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,h_(n,s)}}function h_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fl;function oi(n){fl=n}function wl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Zt(n){wl().$$.on_mount.push(n)}function i1(n){wl().$$.after_update.push(n)}function __(n){wl().$$.on_destroy.push(n)}function Tt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=m_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Ve(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _s=[],se=[],oo=[],Nr=[],g_=Promise.resolve();let Fr=!1;function b_(){Fr||(Fr=!0,g_.then(pa))}function sn(){return b_(),g_}function xe(n){oo.push(n)}function ke(n){Nr.push(n)}const er=new Set;let fs=0;function pa(){if(fs!==0)return;const n=fl;do{try{for(;fs<_s.length;){const e=_s[fs];fs++,oi(e),s1(e.$$)}}catch(e){throw _s.length=0,fs=0,e}for(oi(null),_s.length=0,fs=0;se.length;)se.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];er.has(t)||(er.add(t),t())}oo.length=0}while(_s.length);for(;Nr.length;)Nr.pop()();Fr=!1,er.clear(),oi(n)}function s1(n){if(n.fragment!==null){n.update(),Pe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(xe)}}let qs;function ma(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Ki(n,e,t){n.dispatchEvent(m_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Jn;function ae(){Jn={r:0,c:[],p:Jn}}function ue(){Jn.r||Pe(Jn.c),Jn=Jn.p}function E(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Jn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ha={duration:0};function v_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:_=G,css:v}=s||ha;v&&(o=al(n,0,1,m,d,h,v,a++)),_(0,1);const k=Fo()+d,y=k+m;r&&r.abort(),l=!0,xe(()=>Ki(n,!0,"start")),r=Ro($=>{if(l){if($>=y)return _(1,0),Ki(n,!0,"end"),u(),l=!1;if($>=k){const T=h(($-k)/m);_(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),Bt(s)?(s=s(i),ma().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function y_(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Jn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=kl,tick:d=G,css:m}=s||ha;m&&(o=al(n,1,0,f,u,c,m));const h=Fo()+u,_=h+f;xe(()=>Ki(n,!1,"start")),Ro(v=>{if(l){if(v>=_)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(v>=h){const k=c((v-h)/f);d(1-k,k)}}return l})}return Bt(s)?ma().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&ul(n,o),l=!1)}}}function je(n,e,t,i){const s={direction:"both"};let l=e(n,t,s),o=i?0:1,r=null,a=null,u=null;function f(){u&&ul(n,u)}function c(m,h){const _=m.b-o;return h*=Math.abs(_),{a:o,b:m.b,d:_,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:_=300,easing:v=kl,tick:k=G,css:y}=l||ha,$={start:Fo()+h,b:m};m||($.group=Jn,Jn.r+=1),r||a?a=$:(y&&(f(),u=al(n,o,m,_,h,v,y)),m&&k(0,1),r=c($,_),xe(()=>Ki(n,m,"start")),Ro(T=>{if(a&&T>a.start&&(r=c(a,_),a=null,Ki(n,r.b,"start"),y&&(f(),u=al(n,o,r.b,r.duration,0,v,l.css))),r){if(T>=r.end)k(o=r.b,1-o),Ki(n,r.b,"end"),a||(r.b?f():--r.group.r||Pe(r.group.c)),r=null;else if(T>=r.start){const M=T-r.start;o=r.a+r.d*v(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?ma().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function au(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(ae(),P(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ue())}):e.block.d(1),u.c(),E(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&pa()}if(Kb(n)){const s=wl();if(n.then(l=>{oi(s),i(e.then,1,e.value,l),oi(null)},l=>{if(oi(s),i(e.catch,2,e.error,l),oi(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 l1(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 es(n,e){n.d(1),e.delete(n.key)}function ln(n,e){P(n,1,1,()=>{e.delete(n.key)})}function o1(n,e){n.f(),ln(n,e)}function wt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,m=l.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const v=[],k=new Map,y=new Map;for(h=m;h--;){const C=c(s,l,h),O=t(C);let A=o.get(O);A?i&&A.p(C,e):(A=u(O,C),A.c()),k.set(O,v[h]=A),O in _&&y.set(O,Math.abs(h-_[O]))}const $=new Set,T=new Set;function M(C){E(C,1),C.m(r,f),o.set(C.key,C),f=C.first,m--}for(;d&&m;){const C=v[m-1],O=n[d-1],A=C.key,I=O.key;C===O?(f=C.first,d--,m--):k.has(I)?!o.has(A)||$.has(A)?M(C):T.has(I)?d--:y.get(A)>y.get(I)?(T.add(A),M(C)):($.add(I),d--):(a(O,o),d--)}for(;d--;){const C=n[d];k.has(C.key)||a(C,o)}for(;m;)M(v[m-1]);return v}function on(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 xn(n){return typeof n=="object"&&n!==null?n:{}}function _e(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,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||xe(()=>{const o=n.$$.on_mount.map(a_).filter(Bt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Pe(o),n.$$.on_mount=[]}),l.forEach(xe)}function j(n,e){const t=n.$$;t.fragment!==null&&(Pe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function r1(n,e){n.$$.dirty[0]===-1&&(_s.push(n),b_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function ge(n,e,t,i,s,l,o,r=[-1]){const a=fl;oi(n);const u=n.$$={fragment:null,ctx:[],props:l,update:G,not_equal:s,bound:ru(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:ru(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...m)=>{const h=m.length?m[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&r1(n,c)),d}):[],u.update(),f=!0,Pe(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=Xb(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),pa()}oi(a)}class be{$destroy(){j(this,1),this.$destroy=G}$on(e,t){if(!Bt(t))return G;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&&!Jb(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Mt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}const cs=[];function k_(n,e){return{subscribe:Fn(n,e).subscribe}}function Fn(n,e=G){let t;const i=new Set;function s(r){if(he(n,r)&&(n=r,t)){const a=!cs.length;for(const u of i)u[1](),cs.push(u,n);if(a){for(let u=0;u<cs.length;u+=2)cs[u][0](cs[u+1]);cs.length=0}}}function l(r){s(r(n))}function o(r,a=G){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||G),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function w_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return k_(t,o=>{let r=!1;const a=[];let u=0,f=G;const c=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Bt(m)?m:G},d=s.map((m,h)=>u_(m,_=>{a[h]=_,u&=~(1<<h),r&&c()},()=>{u|=1<<h}));return r=!0,c(),function(){Pe(d),f()}})}function S_(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,s,l,o=[],r="",a=n.split("/");for(a[0]||a.shift();s=a.shift();)t=s[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=s.indexOf("?",1),l=s.indexOf(".",1),o.push(s.substring(1,~i?i:~l?l:s.length)),r+=~i&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(r+=(~i?"?":"")+"\\"+s.substring(l))):r+="/"+s;return{keys:o,pattern:new RegExp("^"+r+(e?"(?=$|/)":"/?$"),"i")}}function a1(n){let e,t,i;const s=[n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Je(a,s[u]);return{props:a}}return l&&(e=Ht(l,o()),e.$on("routeEvent",n[7])),{c(){e&&H(e.$$.fragment),t=Me()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&4?on(s,[xn(r[2])]):{};if(l!==(l=r[0])){if(e){ae();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=Ht(l,o()),e.$on("routeEvent",r[7]),H(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function u1(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Je(a,s[u]);return{props:a}}return l&&(e=Ht(l,o()),e.$on("routeEvent",n[6])),{c(){e&&H(e.$$.fragment),t=Me()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&6?on(s,[a&2&&{params:r[1]},a&4&&xn(r[2])]):{};if(l!==(l=r[0])){if(e){ae();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=Ht(l,o()),e.$on("routeEvent",r[6]),H(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function f1(n){let e,t,i,s;const l=[u1,a1],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Me()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function uu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qo=k_(null,function(e){e(uu());const t=()=>{e(uu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});w_(qo,n=>n.location);const _a=w_(qo,n=>n.querystring),fu=Fn(void 0);async function Di(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await sn();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 xt(n,e){if(e=du(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return cu(n,e),{update(t){t=du(t),cu(n,t)}}}function c1(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function cu(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||d1(i.currentTarget.getAttribute("href"))})}function du(n){return n&&typeof n=="string"?{href:n}:n||{}}function d1(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function p1(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,C){if(!C||typeof C!="function"&&(typeof C!="object"||C._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:A}=S_(M);this.path=M,typeof C=="object"&&C._sveltesparouter===!0?(this.component=C.component,this.conditions=C.conditions||[],this.userData=C.userData,this.props=C.props||{}):(this.component=()=>Promise.resolve(C),this.conditions=[],this.props={}),this._pattern=O,this._keys=A}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=M.match(s);if(I&&I[0])M=M.substr(I[0].length)||"/";else return null}}const C=this._pattern.exec(M);if(C===null)return null;if(this._keys===!1)return C;const O={};let A=0;for(;A<this._keys.length;){try{O[this._keys[A]]=decodeURIComponent(C[A+1]||"")||null}catch{O[this._keys[A]]=null}A++}return O}async checkConditions(M){for(let C=0;C<this.conditions.length;C++)if(!await this.conditions[C](M))return!1;return!0}}const r=[];i instanceof Map?i.forEach((T,M)=>{r.push(new o(M,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=Tt();async function d(T,M){await sn(),c(T,M)}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),i1(()=>{c1(m)}));let _=null,v=null;const k=qo.subscribe(async T=>{_=T;let M=0;for(;M<r.length;){const C=r[M].match(T.location);if(!C){M++;continue}const O={route:r[M].path,location:T.location,querystring:T.querystring,userData:r[M].userData,params:C&&typeof C=="object"&&Object.keys(C).length?C:null};if(!await r[M].checkConditions(O)){t(0,a=null),v=null,d("conditionsFailed",O);return}d("routeLoading",Object.assign({},O));const A=r[M].component;if(v!=A){A.loading?(t(0,a=A.loading),v=A,t(1,u=A.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u}))):(t(0,a=null),v=null);const I=await A();if(T!=_)return;t(0,a=I&&I.default||I),v=A}C&&typeof C=="object"&&Object.keys(C).length?t(1,u=C):t(1,u=null),t(2,f=r[M].props),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u})).then(()=>{fu.set(u)});return}t(0,a=null),v=null,fu.set(void 0)});__(()=>{k(),h&&window.removeEventListener("popstate",h)});function y(T){Ve.call(this,n,T)}function $(T){Ve.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,y,$]}class m1 extends be{constructor(e){super(),ge(this,e,p1,f1,he,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let $_;function T_(n){const e=n.pattern.test($_);pu(n,n.className,e),pu(n,n.inactiveClassName,!e)}function pu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{$_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(T_)});function jn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?S_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),T_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const h1="modulepreload",_1=function(n,e){return new URL(n,e).href},mu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=_1(l,i),l in mu)return;mu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":h1,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Rr=function(n,e){return Rr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Rr(n,e)};function Jt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=n}Rr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qr=function(){return qr=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e},qr.apply(this,arguments)};function en(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}function tn(n,e){var t,i,s,l,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(a){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&c[0]?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){o.label=c[1];break}if(c[0]===6&&o.label<s[1]){o.label=s[1],s=c;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(c);break}s[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(n,o)}catch(d){c=[6,d],i=0}finally{t=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([a,u])}}}var C_,cl=function(n){function e(t){var i,s,l,o,r=this;return(r=n.call(this,"ClientResponseError")||this).url="",r.status=0,r.data={},r.isAbort=!1,r.originalError=null,Object.setPrototypeOf(r,e.prototype),t instanceof e||(r.originalError=t),t!==null&&typeof t=="object"&&(r.url=typeof t.url=="string"?t.url:"",r.status=typeof t.status=="number"?t.status:0,r.data=t.data!==null&&typeof t.data=="object"?t.data:{}),typeof DOMException<"u"&&t instanceof DOMException&&(r.isAbort=!0),r.name="ClientResponseError "+r.status,r.message=(i=r.data)===null||i===void 0?void 0:i.message,r.message||(r.isAbort?r.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((o=(l=(s=r.originalError)===null||s===void 0?void 0:s.cause)===null||l===void 0?void 0:l.message)===null||o===void 0)&&o.includes("ECONNREFUSED ::1")?r.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).":r.message="Something went wrong while processing your request."),r}return Jt(e,n),e.prototype.toJSON=function(){return qr({},this)},e}(Error),ql=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function hu(n,e,t){var i=Object.assign({},t||{}),s=i.encode||b1;if(!ql.test(n))throw new TypeError("argument name is invalid");var l=s(e);if(l&&!ql.test(l))throw new TypeError("argument val is invalid");var o=n+"="+l;if(i.maxAge!=null){var r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!ql.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!ql.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(u){return Object.prototype.toString.call(u)==="[object Date]"||u instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function g1(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function b1(n){return encodeURIComponent(n)}function _u(n){if(n)try{var e=decodeURIComponent(C_(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}C_=typeof atob=="function"?atob:function(n){var e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};var Sl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){for(var t=0,i=Object.entries(e);t<i.length;t++){var s=i[t],l=s[0],o=s[1];this[l]=o}this.id=e.id!==void 0?e.id:"",this.created=e.created!==void 0?e.created:"",this.updated=e.updated!==void 0?e.updated:""},Object.defineProperty(n.prototype,"isNew",{get:function(){return!this.id},enumerable:!1,configurable:!0}),n.prototype.clone=function(){var e=typeof structuredClone=="function"?structuredClone(this):JSON.parse(JSON.stringify(this));return new this.constructor(e)},n.prototype.export=function(){return Object.assign({},this)},n}(),$i=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.collectionName=typeof t.collectionName=="string"?t.collectionName:"",this.loadExpand(t.expand)},e.prototype.loadExpand=function(t){for(var i in t=t||{},this.expand={},t)Array.isArray(t[i])?this.expand[i]=t[i].map(function(s){return new e(s||{})}):this.expand[i]=new e(t[i]||{})},e}(Sl),Xi=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.avatar=typeof t.avatar=="number"?t.avatar:0,this.email=typeof t.email=="string"?t.email:""},e}(Sl),v1=function(){function n(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!function(t,i){i===void 0&&(i=0);var s=_u(t);return!(Object.keys(s).length>0&&(!s.exp||s.exp-i>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?t.collectionId!==void 0?new $i(t):new Xi(t):null,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},n.prototype.loadFromCookie=function(e,t){t===void 0&&(t="pb_auth");var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||g1,f=0;f<o.length;){var c=o.indexOf("=",f);if(c===-1)break;var d=o.indexOf(";",f);if(d===-1)d=o.length;else if(d<c){f=o.lastIndexOf(";",c-1)+1;continue}var m=o.slice(f,c).trim();if(a[m]===void 0){var h=o.slice(c+1,d).trim();h.charCodeAt(0)===34&&(h=h.slice(1,-1));try{a[m]=u(h)}catch{a[m]=h}}f=d+1}return a}(e||"")[t]||"",s={};try{(typeof(s=JSON.parse(i))===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)},n.prototype.exportToCookie=function(e,t){var i,s,l;t===void 0&&(t="pb_auth");var o={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},r=_u(this.token);r!=null&&r.exp?o.expires=new Date(1e3*r.exp):o.expires=new Date("1970-01-01"),e=Object.assign({},o,e);var a={token:this.token,model:((i=this.model)===null||i===void 0?void 0:i.export())||null},u=hu(t,JSON.stringify(a),e),f=typeof Blob<"u"?new Blob([u]).size:u.length;return a.model&&f>4096&&(a.model={id:(s=a==null?void 0:a.model)===null||s===void 0?void 0:s.id,email:(l=a==null?void 0:a.model)===null||l===void 0?void 0:l.email},this.model instanceof $i&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=hu(t,JSON.stringify(a),e)),u},n.prototype.onChange=function(e,t){var i=this;return t===void 0&&(t=!1),this._onChangeCallbacks.push(e),t&&e(this.token,this.model),function(){for(var s=i._onChangeCallbacks.length-1;s>=0;s--)if(i._onChangeCallbacks[s]==e)return delete i._onChangeCallbacks[s],void i._onChangeCallbacks.splice(s,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e<t.length;e++){var i=t[e];i&&i(this.token,this.model)}},n}(),M_=function(n){function e(t){t===void 0&&(t="pocketbase_auth");var i=n.call(this)||this;return i.storageFallback={},i.storageKey=t,i}return Jt(e,n),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,i=this._storageGet(this.storageKey)||{};return i===null||typeof i!="object"||i.model===null||typeof i.model!="object"?null:((t=i.model)===null||t===void 0?void 0:t.collectionId)===void 0?new Xi(i.model):new $i(i.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(t,i){this._storageSet(this.storageKey,{token:t,model:i}),n.prototype.save.call(this,t,i)},e.prototype.clear=function(){this._storageRemove(this.storageKey),n.prototype.clear.call(this)},e.prototype._storageGet=function(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){var i=window.localStorage.getItem(t)||"";try{return JSON.parse(i)}catch{return i}}return this.storageFallback[t]},e.prototype._storageSet=function(t,i){if(typeof window<"u"&&(window!=null&&window.localStorage)){var s=i;typeof i!="string"&&(s=JSON.stringify(i)),window.localStorage.setItem(t,s)}else this.storageFallback[t]=i},e.prototype._storageRemove=function(t){var i;typeof window<"u"&&(window!=null&&window.localStorage)&&((i=window.localStorage)===null||i===void 0||i.removeItem(t)),delete this.storageFallback[t]},e}(v1),$l=function(e){this.client=e},y1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then(function(i){return i||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send("/api/settings",{method:"PATCH",params:i,body:t}).then(function(s){return s||{}})},e.prototype.testS3=function(t){return t===void 0&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then(function(){return!0})},e.prototype.testEmail=function(t,i,s){s===void 0&&(s={});var l={email:t,template:i};return this.client.send("/api/settings/test/email",{method:"POST",params:s,body:l}).then(function(){return!0})},e}($l),D_=function(e,t,i,s,l){this.page=e>0?e:1,this.perPage=t>=0?t:0,this.totalItems=i>=0?i:0,this.totalPages=s>=0?s:0,this.items=l||[]},ga=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=200),i===void 0&&(i={}),this._getFullList(this.baseCrudPath,t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),this._getFirstListItem(this.baseCrudPath,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),this._getOne(this.baseCrudPath,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this._create(this.baseCrudPath,t,i)},e.prototype.update=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._update(this.baseCrudPath,t,i,s)},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this._delete(this.baseCrudPath,t,i)},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return en(l,void 0,void 0,function(){return tn(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,m=c.totalItems;return o=o.concat(d),d.length&&m>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u<f.length;u++){var c=f[u];a.push(o.decode(c))}}return new D_((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||0,(r==null?void 0:r.totalPages)||0,a)})},e.prototype._getOne=function(t,i,s){var l=this;return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"GET",params:s}).then(function(o){return l.decode(o)})},e.prototype._getFirstListItem=function(t,i,s){return s===void 0&&(s={}),s=Object.assign({filter:i,$cancelKey:"one_by_filter_"+t+"_"+i},s),this._getList(t,1,1,s).then(function(l){var o;if(!(!((o=l==null?void 0:l.items)===null||o===void 0)&&o.length))throw new cl({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return l.items[0]})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s){return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}($l)),k1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.decode=function(t){return new Xi(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/admins"},enumerable:!1,configurable:!0}),e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a;return l.client.authStore.model&&((r=l.client.authStore.model)===null||r===void 0?void 0:r.collectionId)===void 0&&((a=l.client.authStore.model)===null||a===void 0?void 0:a.id)===(o==null?void 0:o.id)&&l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r;return l&&s.client.authStore.model&&((o=s.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&((r=s.client.authStore.model)===null||r===void 0?void 0:r.id)===t&&s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return t!=null&&t.token&&(t!=null&&t.admin)&&this.client.authStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authWithPassword=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCrudPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},e.prototype.authRefresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(this.authResponse.bind(this))},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCrudPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCrudPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e}(ga),w1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.recordId=typeof t.recordId=="string"?t.recordId:"",this.collectionId=typeof t.collectionId=="string"?t.collectionId:"",this.provider=typeof t.provider=="string"?t.provider:"",this.providerId=typeof t.providerId=="string"?t.providerId:""},e}(Sl),S1=function(n){function e(t,i){var s=n.call(this,t)||this;return s.collectionIdOrName=i,s}return Jt(e,n),e.prototype.decode=function(t){return new $i(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return this.baseCollectionPath+"/records"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseCollectionPath",{get:function(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)},enumerable:!1,configurable:!0}),e.prototype.subscribeOne=function(t,i){return en(this,void 0,void 0,function(){return tn(this,function(s){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,i)]})})},e.prototype.subscribe=function(t,i){return en(this,void 0,void 0,function(){var s;return tn(this,function(l){if(typeof t=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),[2,this.client.realtime.subscribe(this.collectionIdOrName,t)];if(!i)throw new Error("Missing subscription callback.");if(t==="")throw new Error("Missing topic.");return s=this.collectionIdOrName,t!=="*"&&(s+="/"+t),[2,this.client.realtime.subscribe(s,i)]})})},e.prototype.unsubscribe=function(t){return en(this,void 0,void 0,function(){return tn(this,function(i){return t==="*"?[2,this.client.realtime.unsubscribe(this.collectionIdOrName)]:t?[2,this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t)]:[2,this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)]})})},e.prototype.getFullList=function(t,i){return t===void 0&&(t=200),i===void 0&&(i={}),n.prototype.getFullList.call(this,t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),n.prototype.getList.call(this,t,i,s)},e.prototype.getFirstListItem=function(t,i){return i===void 0&&(i={}),n.prototype.getFirstListItem.call(this,t,i)},e.prototype.getOne=function(t,i){return i===void 0&&(i={}),n.prototype.getOne.call(this,t,i)},e.prototype.create=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),n.prototype.create.call(this,t,i)},e.prototype.update=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),n.prototype.update.call(this,t,i,s).then(function(o){var r,a,u;return((r=l.client.authStore.model)===null||r===void 0?void 0:r.id)!==(o==null?void 0:o.id)||((a=l.client.authStore.model)===null||a===void 0?void 0:a.collectionId)!==l.collectionIdOrName&&((u=l.client.authStore.model)===null||u===void 0?void 0:u.collectionName)!==l.collectionIdOrName||l.client.authStore.save(l.client.authStore.token,o),o})},e.prototype.delete=function(t,i){var s=this;return i===void 0&&(i={}),n.prototype.delete.call(this,t,i).then(function(l){var o,r,a;return!l||((o=s.client.authStore.model)===null||o===void 0?void 0:o.id)!==t||((r=s.client.authStore.model)===null||r===void 0?void 0:r.collectionId)!==s.collectionIdOrName&&((a=s.client.authStore.model)===null||a===void 0?void 0:a.collectionName)!==s.collectionIdOrName||s.client.authStore.clear(),l})},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCollectionPath+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{usernamePassword:!!(i!=null&&i.usernamePassword),emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authWithPassword=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({identity:t,password:i},s),this.client.send(this.baseCollectionPath+"/auth-with-password",{method:"POST",params:l,body:s}).then(function(r){return o.authResponse(r)})},e.prototype.authWithOAuth2=function(t,i,s,l,o,r,a){var u=this;return o===void 0&&(o={}),r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l,createData:o},r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",{method:"POST",params:a,body:r}).then(function(f){return u.authResponse(f)})},e.prototype.authRefresh=function(t,i){var s=this;return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCollectionPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(function(l){return s.authResponse(l)})},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCollectionPath+"/confirm-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCollectionPath+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCollectionPath+"/confirm-email-change",{method:"POST",params:l,body:s}).then(function(){return!0})},e.prototype.listExternalAuths=function(t,i){return i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:i}).then(function(s){var l=[];if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];l.push(new w1(a))}return l})},e.prototype.unlinkExternalAuth=function(t,i,s){return s===void 0&&(s={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}(ga),mn=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.unique=!!e.unique,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},n}(),pn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.system=!!t.system,this.name=typeof t.name=="string"?t.name:"",this.type=typeof t.type=="string"?t.type:"base",this.options=t.options!==void 0?t.options:{},this.listRule=typeof t.listRule=="string"?t.listRule:null,this.viewRule=typeof t.viewRule=="string"?t.viewRule:null,this.createRule=typeof t.createRule=="string"?t.createRule:null,this.updateRule=typeof t.updateRule=="string"?t.updateRule:null,this.deleteRule=typeof t.deleteRule=="string"?t.deleteRule:null,t.schema=Array.isArray(t.schema)?t.schema:[],this.schema=[];for(var i=0,s=t.schema;i<s.length;i++){var l=s[i];this.schema.push(new mn(l))}},Object.defineProperty(e.prototype,"isBase",{get:function(){return this.type==="base"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAuth",{get:function(){return this.type==="auth"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isView",{get:function(){return this.type==="view"},enumerable:!1,configurable:!0}),e}(Sl),$1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.decode=function(t){return new pn(t)},Object.defineProperty(e.prototype,"baseCrudPath",{get:function(){return"/api/collections"},enumerable:!1,configurable:!0}),e.prototype.import=function(t,i,s){return i===void 0&&(i=!1),s===void 0&&(s={}),en(this,void 0,void 0,function(){return tn(this,function(l){return[2,this.client.send(this.baseCrudPath+"/import",{method:"PUT",params:s,body:{collections:t,deleteMissing:i}}).then(function(){return!0})]})})},e}(ga),jr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),t.remoteIp=t.remoteIp||t.ip,this.url=typeof t.url=="string"?t.url:"",this.method=typeof t.method=="string"?t.method:"GET",this.status=typeof t.status=="number"?t.status:200,this.auth=typeof t.auth=="string"?t.auth:"guest",this.remoteIp=typeof t.remoteIp=="string"?t.remoteIp:"",this.userIp=typeof t.userIp=="string"?t.userIp:"",this.referer=typeof t.referer=="string"?t.referer:"",this.userAgent=typeof t.userAgent=="string"?t.userAgent:"",this.meta=typeof t.meta=="object"&&t.meta!==null?t.meta:{}},e}(Sl),T1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.getRequestsList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),s=Object.assign({page:t,perPage:i},s),this.client.send("/api/logs/requests",{method:"GET",params:s}).then(function(l){var o=[];if(l!=null&&l.items){l.items=(l==null?void 0:l.items)||[];for(var r=0,a=l.items;r<a.length;r++){var u=a[r];o.push(new jr(u))}}return new D_((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||0,(l==null?void 0:l.totalPages)||0,o)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:i}).then(function(s){return new jr(s)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then(function(i){return i})},e}($l),C1=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t.lastSentTopics=[],t.maxConnectTimeout=15e3,t.reconnectAttempts=0,t.maxReconnectAttempts=1/0,t.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],t.pendingConnects=[],t}return Jt(e,n),Object.defineProperty(e.prototype,"isConnected",{get:function(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(t,i){var s;return en(this,void 0,void 0,function(){var l,o=this;return tn(this,function(r){switch(r.label){case 0:if(!t)throw new Error("topic must be set.");return l=function(a){var u,f=a;try{u=JSON.parse(f==null?void 0:f.data)}catch{}i(u||{})},this.subscriptions[t]||(this.subscriptions[t]=[]),this.subscriptions[t].push(l),this.isConnected?[3,2]:[4,this.connect()];case 1:return r.sent(),[3,5];case 2:return this.subscriptions[t].length!==1?[3,4]:[4,this.submitSubscriptions()];case 3:return r.sent(),[3,5];case 4:(s=this.eventSource)===null||s===void 0||s.addEventListener(t,l),r.label=5;case 5:return[2,function(){return en(o,void 0,void 0,function(){return tn(this,function(a){return[2,this.unsubscribeByTopicAndListener(t,l)]})})}]}})})},e.prototype.unsubscribe=function(t){var i;return en(this,void 0,void 0,function(){var s,l,o;return tn(this,function(r){switch(r.label){case 0:if(!this.hasSubscriptionListeners(t))return[2];if(t){for(s=0,l=this.subscriptions[t];s<l.length;s++)o=l[s],(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,o);delete this.subscriptions[t]}else this.subscriptions={};return this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3]);case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByPrefix=function(t){var i;return en(this,void 0,void 0,function(){var s,l,o,r,a;return tn(this,function(u){switch(u.label){case 0:for(l in s=!1,this.subscriptions)if(l.startsWith(t)){for(s=!0,o=0,r=this.subscriptions[l];o<r.length;o++)a=r[o],(i=this.eventSource)===null||i===void 0||i.removeEventListener(l,a);delete this.subscriptions[l]}return s?this.hasSubscriptionListeners()?[4,this.submitSubscriptions()]:[3,2]:[2];case 1:return u.sent(),[3,3];case 2:this.disconnect(),u.label=3;case 3:return[2]}})})},e.prototype.unsubscribeByTopicAndListener=function(t,i){var s;return en(this,void 0,void 0,function(){var l,o;return tn(this,function(r){switch(r.label){case 0:if(!Array.isArray(this.subscriptions[t])||!this.subscriptions[t].length)return[2];for(l=!1,o=this.subscriptions[t].length-1;o>=0;o--)this.subscriptions[t][o]===i&&(l=!0,delete this.subscriptions[t][o],this.subscriptions[t].splice(o,1),(s=this.eventSource)===null||s===void 0||s.removeEventListener(t,i));return l?(this.subscriptions[t].length||delete this.subscriptions[t],this.hasSubscriptionListeners()?[3,1]:(this.disconnect(),[3,3])):[2];case 1:return this.hasSubscriptionListeners(t)?[3,3]:[4,this.submitSubscriptions()];case 2:r.sent(),r.label=3;case 3:return[2]}})})},e.prototype.hasSubscriptionListeners=function(t){var i,s;if(this.subscriptions=this.subscriptions||{},t)return!!(!((i=this.subscriptions[t])===null||i===void 0)&&i.length);for(var l in this.subscriptions)if(!((s=this.subscriptions[l])===null||s===void 0)&&s.length)return!0;return!1},e.prototype.submitSubscriptions=function(){return en(this,void 0,void 0,function(){return tn(this,function(t){return this.clientId?(this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},params:{$cancelKey:"realtime_"+this.clientId}}).catch(function(i){if(!(i!=null&&i.isAbort))throw i})]):[2]})})},e.prototype.getNonEmptySubscriptionTopics=function(){var t=[];for(var i in this.subscriptions)this.subscriptions[i].length&&t.push(i);return t},e.prototype.addAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeAllSubscriptionListeners(),this.subscriptions)for(var i=0,s=this.subscriptions[t];i<s.length;i++){var l=s[i];this.eventSource.addEventListener(t,l)}},e.prototype.removeAllSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)for(var i=0,s=this.subscriptions[t];i<s.length;i++){var l=s[i];this.eventSource.removeEventListener(t,l)}},e.prototype.connect=function(){return en(this,void 0,void 0,function(){var t=this;return tn(this,function(i){return this.reconnectAttempts>0?[2]:[2,new Promise(function(s,l){t.pendingConnects.push({resolve:s,reject:l}),t.pendingConnects.length>1||t.initConnect()})]})})},e.prototype.initConnect=function(){var t=this;this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(function(){t.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=function(i){t.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",function(i){var s=i;t.clientId=s==null?void 0:s.lastEventId,t.submitSubscriptions().then(function(){return en(t,void 0,void 0,function(){var l;return tn(this,function(o){switch(o.label){case 0:l=3,o.label=1;case 1:return this.hasUnsentSubscriptions()&&l>0?(l--,[4,this.submitSubscriptions()]):[3,3];case 2:return o.sent(),[3,1];case 3:return[2]}})})}).then(function(){for(var l=0,o=t.pendingConnects;l<o.length;l++)o[l].resolve();t.pendingConnects=[],t.reconnectAttempts=0,clearTimeout(t.reconnectTimeoutId),clearTimeout(t.connectTimeoutId)}).catch(function(l){t.clientId="",t.connectErrorHandler(l)})})},e.prototype.hasUnsentSubscriptions=function(){var t=this.getNonEmptySubscriptionTopics();if(t.length!=this.lastSentTopics.length)return!0;for(var i=0,s=t;i<s.length;i++){var l=s[i];if(!this.lastSentTopics.includes(l))return!0}return!1},e.prototype.connectErrorHandler=function(t){var i=this;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(var s=0,l=this.pendingConnects;s<l.length;s++)l[s].reject(new cl(t));this.disconnect()}else{this.disconnect(!0);var o=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(function(){i.initConnect()},o)}},e.prototype.disconnect=function(t){var i;if(t===void 0&&(t=!1),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(var s=new cl(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}($l),M1=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Jt(e,n),e.prototype.check=function(t){return t===void 0&&(t={}),this.client.send("/api/health",{method:"GET",params:t})},e}($l),ba=function(){function n(e,t,i){e===void 0&&(e="/"),i===void 0&&(i="en-US"),this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new M_,this.admins=new k1(this),this.collections=new $1(this),this.logs=new T1(this),this.settings=new y1(this),this.realtime=new C1(this),this.health=new M1(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new S1(this,e)),this.recordServices[e]},n.prototype.autoCancellation=function(e){return this.enableAutoCancellation=!!e,this},n.prototype.cancelRequest=function(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this},n.prototype.cancelAllRequests=function(){for(var e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this},n.prototype.send=function(e,t){var i,s,l,o,r,a,u,f;return en(this,void 0,void 0,function(){var c,d,m,h,_,v=this;return tn(this,function(k){return(c=Object.assign({method:"GET"},t)).body&&c.body.constructor.name!=="FormData"&&(typeof c.body!="string"&&(c.body=JSON.stringify(c.body)),((i=c==null?void 0:c.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(c.headers=Object.assign({},c.headers,{"Content-Type":"application/json"}))),((s=c==null?void 0:c.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(c.headers=Object.assign({},c.headers,{"Accept-Language":this.lang})),!((l=this.authStore)===null||l===void 0)&&l.token&&((o=c==null?void 0:c.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(c.headers=Object.assign({},c.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&((r=c.params)===null||r===void 0?void 0:r.$autoCancel)!==!1&&(d=((a=c.params)===null||a===void 0?void 0:a.$cancelKey)||(c.method||"GET")+e,this.cancelRequest(d),m=new AbortController,this.cancelControllers[d]=m,c.signal=m.signal),(u=c.params)===null||u===void 0||delete u.$autoCancel,(f=c.params)===null||f===void 0||delete f.$cancelKey,h=this.buildUrl(e),c.params!==void 0&&((_=this.serializeQueryParams(c.params))&&(h+=(h.includes("?")?"&":"?")+_),delete c.params),this.beforeSend&&(c=Object.assign({},this.beforeSend(h,c))),[2,fetch(h,c).then(function(y){return en(v,void 0,void 0,function(){var $;return tn(this,function(T){switch(T.label){case 0:$={},T.label=1;case 1:return T.trys.push([1,3,,4]),[4,y.json()];case 2:return $=T.sent(),[3,4];case 3:return T.sent(),[3,4];case 4:if(this.afterSend&&($=this.afterSend(y,$)),y.status>=400)throw new cl({url:y.url,status:y.status,data:$});return[2,$]}})})}).catch(function(y){throw new cl(y)})]})})},n.prototype.getFileUrl=function(e,t,i){i===void 0&&(i={});var s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));var l=this.buildUrl(s.join("/"));if(Object.keys(i).length){var o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];t.push(l+"="+encodeURIComponent(a))}else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")},n}();class ts extends Error{}class D1 extends ts{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class O1 extends ts{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class E1 extends ts{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gs extends ts{}class O_ extends ts{constructor(e){super(`Invalid unit ${e}`)}}class On extends ts{}class mi extends ts{constructor(){super("Zone is an abstract class")}}const De="numeric",Bn="short",yn="long",Hr={year:De,month:De,day:De},E_={year:De,month:Bn,day:De},A1={year:De,month:Bn,day:De,weekday:Bn},A_={year:De,month:yn,day:De},I_={year:De,month:yn,day:De,weekday:yn},P_={hour:De,minute:De},L_={hour:De,minute:De,second:De},N_={hour:De,minute:De,second:De,timeZoneName:Bn},F_={hour:De,minute:De,second:De,timeZoneName:yn},R_={hour:De,minute:De,hourCycle:"h23"},q_={hour:De,minute:De,second:De,hourCycle:"h23"},j_={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Bn},H_={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:yn},V_={year:De,month:De,day:De,hour:De,minute:De},z_={year:De,month:De,day:De,hour:De,minute:De,second:De},B_={year:De,month:Bn,day:De,hour:De,minute:De},U_={year:De,month:Bn,day:De,hour:De,minute:De,second:De},I1={year:De,month:Bn,day:De,weekday:Bn,hour:De,minute:De},W_={year:De,month:yn,day:De,hour:De,minute:De,timeZoneName:Bn},Y_={year:De,month:yn,day:De,hour:De,minute:De,second:De,timeZoneName:Bn},K_={year:De,month:yn,day:De,weekday:yn,hour:De,minute:De,timeZoneName:yn},J_={year:De,month:yn,day:De,weekday:yn,hour:De,minute:De,second:De,timeZoneName:yn};function Ge(n){return typeof n>"u"}function Ji(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function P1(n){return typeof n=="string"}function L1(n){return Object.prototype.toString.call(n)==="[object Date]"}function Z_(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function N1(n){return Array.isArray(n)?n:[n]}function gu(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 F1(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ts(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ri(n,e,t){return jo(n)&&n>=e&&n<=t}function R1(n,e){return n-e*Math.floor(n/e)}function Dt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function _i(n){if(!(Ge(n)||n===null||n===""))return parseInt(n,10)}function Fi(n){if(!(Ge(n)||n===null||n===""))return parseFloat(n)}function va(n){if(!(Ge(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ya(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Tl(n){return n%4===0&&(n%100!==0||n%400===0)}function el(n){return Tl(n)?366:365}function _o(n,e){const t=R1(e-1,12)+1,i=n+(e-t)/12;return t===2?Tl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ka(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function go(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Vr(n){return n>99?n:n>60?1900+n:2e3+n}function G_(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 Ho(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 X_(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new On(`Invalid unit value ${n}`);return e}function bo(n,e){const t={};for(const i in n)if(Ts(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=X_(s)}return t}function tl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Dt(t,2)}:${Dt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Dt(t,2)}${Dt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return F1(n,["hour","minute","second","millisecond"])}const Q_=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,q1=["January","February","March","April","May","June","July","August","September","October","November","December"],x_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],j1=["J","F","M","A","M","J","J","A","S","O","N","D"];function eg(n){switch(n){case"narrow":return[...j1];case"short":return[...x_];case"long":return[...q1];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 tg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ng=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],H1=["M","T","W","T","F","S","S"];function ig(n){switch(n){case"narrow":return[...H1];case"short":return[...ng];case"long":return[...tg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const sg=["AM","PM"],V1=["Before Christ","Anno Domini"],z1=["BC","AD"],B1=["B","A"];function lg(n){switch(n){case"narrow":return[...B1];case"short":return[...z1];case"long":return[...V1];default:return null}}function U1(n){return sg[n.hour<12?0:1]}function W1(n,e){return ig(e)[n.weekday-1]}function Y1(n,e){return eg(e)[n.month-1]}function K1(n,e){return lg(e)[n.year<0?0:1]}function J1(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 bu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Z1={D:Hr,DD:E_,DDD:A_,DDDD:I_,t:P_,tt:L_,ttt:N_,tttt:F_,T:R_,TT:q_,TTT:j_,TTTT:H_,f:V_,ff:B_,fff:W_,ffff:K_,F:z_,FF:U_,FFF:Y_,FFFF:J_};class dn{static create(e,t={}){return new dn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?(i.length>0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return Z1[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Dt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(m,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?U1(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Y1(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?W1(e,m):l(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=dn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?K1(e,m):l({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return bu(dn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=dn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return bu(l,s(r))}}class Hn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cl{get type(){throw new mi}get name(){throw new mi}get ianaName(){return this.name}get isUniversal(){throw new mi}offsetName(e,t){throw new mi}formatOffset(e,t){throw new mi}offset(e){throw new mi}equals(e){throw new mi}get isValid(){throw new mi}}let tr=null;class wa extends Cl{static get instance(){return tr===null&&(tr=new wa),tr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return G_(e,t,i)}formatOffset(e,t){return tl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function G1(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const X1={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Q1(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 x1(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=X1[l];l==="era"?i[r]=o:Ge(r)||(i[r]=parseInt(o,10))}return i}let jl={};class ai extends Cl{static create(e){return jl[e]||(jl[e]=new ai(e)),jl[e]}static resetCache(){jl={},uo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=ai.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return G_(e,t,i,this.name)}formatOffset(e,t){return tl(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=G1(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?x1(i,t):Q1(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=ka({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let m=+t;const h=m%1e3;return m-=h>=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let nr=null;class nn extends Cl{static get utcInstance(){return nr===null&&(nr=new nn(0)),nr}static instance(e){return e===0?nn.utcInstance:new nn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new nn(Ho(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${tl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${tl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return tl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class e0 extends Cl{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function gi(n,e){if(Ge(n)||n===null)return e;if(n instanceof Cl)return n;if(P1(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?nn.utcInstance:nn.parseSpecifier(t)||ai.create(n)}else return Ji(n)?nn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new e0(n)}let vu=()=>Date.now(),yu="system",ku=null,wu=null,Su=null,$u;class Lt{static get now(){return vu}static set now(e){vu=e}static set defaultZone(e){yu=e}static get defaultZone(){return gi(yu,wa.instance)}static get defaultLocale(){return ku}static set defaultLocale(e){ku=e}static get defaultNumberingSystem(){return wu}static set defaultNumberingSystem(e){wu=e}static get defaultOutputCalendar(){return Su}static set defaultOutputCalendar(e){Su=e}static get throwOnInvalid(){return $u}static set throwOnInvalid(e){$u=e}static resetCaches(){gt.resetCache(),ai.resetCache()}}let Tu={};function t0(n,e={}){const t=JSON.stringify([n,e]);let i=Tu[t];return i||(i=new Intl.ListFormat(n,e),Tu[t]=i),i}let zr={};function Br(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.DateTimeFormat(n,e),zr[t]=i),i}let Ur={};function n0(n,e={}){const t=JSON.stringify([n,e]);let i=Ur[t];return i||(i=new Intl.NumberFormat(n,e),Ur[t]=i),i}let Wr={};function i0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Wr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Wr[s]=l),l}let Xs=null;function s0(){return Xs||(Xs=new Intl.DateTimeFormat().resolvedOptions().locale,Xs)}function l0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Br(n).resolvedOptions()}catch{t=Br(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function o0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function r0(n){const e=[];for(let t=1;t<=12;t++){const i=qe.utc(2016,t,1);e.push(n(i))}return e}function a0(n){const e=[];for(let t=1;t<=7;t++){const i=qe.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function u0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class f0{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=n0(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):ya(e,3);return Dt(t,this.padTo)}}}class c0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&ai.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Br(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class d0{constructor(e,t,i){this.opts={style:"long",...i},!t&&Z_()&&(this.rtf=i0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):J1(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class gt{static fromOpts(e){return gt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Lt.defaultLocale,o=l||(s?"en-US":s0()),r=t||Lt.defaultNumberingSystem,a=i||Lt.defaultOutputCalendar;return new gt(o,r,a,l)}static resetCache(){Xs=null,zr={},Ur={},Wr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return gt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=l0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=o0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u0(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:gt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Hl(this,e,i,eg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=r0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,ig,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=a0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>sg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[qe.utc(2016,11,13,9),qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,lg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[qe.utc(-40,1,1),qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new f0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new c0(e,this.intl,t)}relFormatter(e={}){return new d0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return t0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Is(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ps(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ls(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function og(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=_i(e[t+s]);return[i,null,t+s]}}const rg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,p0=`(?:${rg.source}?(?:\\[(${Q_.source})\\])?)?`,Sa=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ag=RegExp(`${Sa.source}${p0}`),$a=RegExp(`(?:T${ag.source})?`),m0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,h0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,_0=/(\d{4})-?(\d{3})/,g0=og("weekYear","weekNumber","weekDay"),b0=og("year","ordinal"),v0=/(\d{4})-(\d\d)-(\d\d)/,ug=RegExp(`${Sa.source} ?(?:${rg.source}|(${Q_.source}))?`),y0=RegExp(`(?: ${ug.source})?`);function vs(n,e,t){const i=n[e];return Ge(i)?t:_i(i)}function k0(n,e){return[{year:vs(n,e),month:vs(n,e+1,1),day:vs(n,e+2,1)},null,e+3]}function Ns(n,e){return[{hours:vs(n,e,0),minutes:vs(n,e+1,0),seconds:vs(n,e+2,0),milliseconds:va(n[e+3])},null,e+4]}function Ml(n,e){const t=!n[e]&&!n[e+1],i=Ho(n[e+1],n[e+2]),s=t?null:nn.instance(i);return[{},s,e+3]}function Dl(n,e){const t=n[e]?ai.create(n[e]):null;return[{},t,e+1]}const w0=RegExp(`^T?${Sa.source}$`),S0=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function $0(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(m,h=!1)=>m!==void 0&&(h||m&&f)?-m:m;return[{years:d(Fi(t)),months:d(Fi(i)),weeks:d(Fi(s)),days:d(Fi(l)),hours:d(Fi(o)),minutes:d(Fi(r)),seconds:d(Fi(a),a==="-0"),milliseconds:d(va(u),c)}]}const T0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ta(n,e,t,i,s,l,o){const r={year:e.length===2?Vr(_i(e)):_i(e),month:x_.indexOf(t)+1,day:_i(i),hour:_i(s),minute:_i(l)};return o&&(r.second=_i(o)),n&&(r.weekday=n.length>3?tg.indexOf(n)+1:ng.indexOf(n)+1),r}const C0=/^(?:(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 M0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ta(e,s,i,t,l,o,r);let m;return a?m=T0[a]:u?m=0:m=Ho(f,c),[d,new nn(m)]}function D0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const O0=/^(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$/,E0=/^(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$/,A0=/^(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 Cu(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,s,i,t,l,o,r),nn.utcInstance]}function I0(n){const[,e,t,i,s,l,o,r]=n;return[Ta(e,r,t,i,s,l,o),nn.utcInstance]}const P0=Is(m0,$a),L0=Is(h0,$a),N0=Is(_0,$a),F0=Is(ag),fg=Ps(k0,Ns,Ml,Dl),R0=Ps(g0,Ns,Ml,Dl),q0=Ps(b0,Ns,Ml,Dl),j0=Ps(Ns,Ml,Dl);function H0(n){return Ls(n,[P0,fg],[L0,R0],[N0,q0],[F0,j0])}function V0(n){return Ls(D0(n),[C0,M0])}function z0(n){return Ls(n,[O0,Cu],[E0,Cu],[A0,I0])}function B0(n){return Ls(n,[S0,$0])}const U0=Ps(Ns);function W0(n){return Ls(n,[w0,U0])}const Y0=Is(v0,y0),K0=Is(ug),J0=Ps(Ns,Ml,Dl);function Z0(n){return Ls(n,[Y0,fg],[K0,J0])}const G0="Invalid Duration",cg={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}},X0={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},...cg},$n=146097/400,ds=146097/4800,Q0={years:{quarters:4,months:12,weeks:$n/7,days:$n,hours:$n*24,minutes:$n*24*60,seconds:$n*24*60*60,milliseconds:$n*24*60*60*1e3},quarters:{months:3,weeks:$n/28,days:$n/4,hours:$n*24/4,minutes:$n*24*60/4,seconds:$n*24*60*60/4,milliseconds:$n*24*60*60*1e3/4},months:{weeks:ds/7,days:ds,hours:ds*24,minutes:ds*24*60,seconds:ds*24*60*60,milliseconds:ds*24*60*60*1e3},...cg},zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],x0=zi.slice(0).reverse();function Ri(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new tt(i)}function ev(n){return n<0?Math.floor(n):Math.ceil(n)}function dg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?ev(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function tv(n,e){x0.reduce((t,i)=>Ge(e[i])?t:(t&&dg(n,e,t,e,i),i),null)}class tt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||gt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Q0:X0,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 On(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tt({values:bo(e,tt.normalizeUnit),loc:gt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Ji(e))return tt.fromMillis(e);if(tt.isDuration(e))return e;if(typeof e=="object")return tt.fromObject(e);throw new On(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=B0(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]=W0(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 On("need to specify a reason the Duration is invalid");const i=e instanceof Hn?e:new Hn(e,t);if(Lt.throwOnInvalid)throw new E1(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 O_(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?dn.create(this.loc,i).formatDurationFromString(this,e):G0}toHuman(e={}){const t=zi.map(i=>{const s=this.values[i];return Ge(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=ya(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e),i={};for(const s of zi)(Ts(t.values,s)||Ts(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ri(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]=X_(e(this.values[i],i));return Ri(this,{values:t},!0)}get(e){return this[tt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...bo(e,tt.normalizeUnit)};return Ri(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Ri(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return tv(this.matrix,e),Ri(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 zi)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;Ji(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)zi.indexOf(u)>zi.indexOf(o)&&dg(this.matrix,s,u,t,o)}else Ji(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 Ri(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ri(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 zi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const js="Invalid Interval";function nv(n,e){return!n||!n.isValid?vt.invalid("missing or invalid start"):!e||!e.isValid?vt.invalid("missing or invalid end"):e<n?vt.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class vt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the Interval is invalid");const i=e instanceof Hn?e:new Hn(e,t);if(Lt.throwOnInvalid)throw new O1(i);return new vt({invalid:i})}static fromDateTimes(e,t){const i=zs(e),s=zs(t),l=nv(i,s);return l??new vt({start:i,end:s})}static after(e,t){const i=tt.fromDurationLike(t),s=zs(e);return vt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=tt.fromDurationLike(t),s=zs(e);return vt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=qe.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=qe.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return vt.fromDateTimes(l,r);if(o){const u=tt.fromISO(s,t);if(u.isValid)return vt.after(l,u)}else if(a){const u=tt.fromISO(i,t);if(u.isValid)return vt.before(r,u)}}return vt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),i=this.end.startOf(e);return Math.floor(i.diff(t,e).get(e))+1}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?vt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(zs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s<this.e;){const o=t[l]||this.e,r=+o>+this.e?this.e:o;i.push(vt.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(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*s));l=+r>+this.e?this.e:r,o.push(vt.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}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return t>=i?null:vt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return vt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((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(vt.fromDateTimes(t,a.time)),t=null);return vt.merge(s)}difference(...e){return vt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:js}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:js}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:js}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:js}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:js}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):tt.invalid(this.invalidReason)}mapEndpoints(e){return vt.fromDateTimes(e(this.s),e(this.e))}}class Vl{static hasDST(e=Lt.defaultZone){const t=qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ai.isValidZone(e)}static normalizeZone(e){return gi(e,Lt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||gt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||gt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return gt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return gt.create(t,null,"gregory").eras(e)}static features(){return{relative:Z_()}}}function Mu(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 iv(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Mu(r,a);return(u-u%7)/7}],["days",Mu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function sv(n,e,t,i){let[s,l,o,r]=iv(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=tt.fromObject(l,i);return u.length>0?tt.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ca={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Du={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]},lv=Ca.hanidec.replace(/[\[|\]]/g,"").split("");function ov(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(Ca.hanidec)!==-1)e+=lv.indexOf(n[t]);else for(const s in Du){const[l,o]=Du[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Rn({numberingSystem:n},e=""){return new RegExp(`${Ca[n||"latn"]}${e}`)}const rv="missing Intl.DateTimeFormat.formatToParts support";function it(n,e=t=>t){return{regex:n,deser:([t])=>e(ov(t))}}const av=String.fromCharCode(160),pg=`[ ${av}]`,mg=new RegExp(pg,"g");function uv(n){return n.replace(/\./g,"\\.?").replace(mg,pg)}function Ou(n){return n.replace(/\./g,"").replace(mg," ").toLowerCase()}function qn(n,e){return n===null?null:{regex:RegExp(n.map(uv).join("|")),deser:([t])=>n.findIndex(i=>Ou(t)===Ou(i))+e}}function Eu(n,e){return{regex:n,deser:([,t,i])=>Ho(t,i),groups:e}}function ir(n){return{regex:n,deser:([e])=>e}}function fv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function cv(n,e){const t=Rn(e),i=Rn(e,"{2}"),s=Rn(e,"{3}"),l=Rn(e,"{4}"),o=Rn(e,"{6}"),r=Rn(e,"{1,2}"),a=Rn(e,"{1,3}"),u=Rn(e,"{1,6}"),f=Rn(e,"{1,9}"),c=Rn(e,"{2,4}"),d=Rn(e,"{4,6}"),m=v=>({regex:RegExp(fv(v.val)),deser:([k])=>k,literal:!0}),_=(v=>{if(n.literal)return m(v);switch(v.val){case"G":return qn(e.eras("short",!1),0);case"GG":return qn(e.eras("long",!1),0);case"y":return it(u);case"yy":return it(c,Vr);case"yyyy":return it(l);case"yyyyy":return it(d);case"yyyyyy":return it(o);case"M":return it(r);case"MM":return it(i);case"MMM":return qn(e.months("short",!0,!1),1);case"MMMM":return qn(e.months("long",!0,!1),1);case"L":return it(r);case"LL":return it(i);case"LLL":return qn(e.months("short",!1,!1),1);case"LLLL":return qn(e.months("long",!1,!1),1);case"d":return it(r);case"dd":return it(i);case"o":return it(a);case"ooo":return it(s);case"HH":return it(i);case"H":return it(r);case"hh":return it(i);case"h":return it(r);case"mm":return it(i);case"m":return it(r);case"q":return it(r);case"qq":return it(i);case"s":return it(r);case"ss":return it(i);case"S":return it(a);case"SSS":return it(s);case"u":return ir(f);case"uu":return ir(r);case"uuu":return it(t);case"a":return qn(e.meridiems(),0);case"kkkk":return it(l);case"kk":return it(c,Vr);case"W":return it(r);case"WW":return it(i);case"E":case"c":return it(t);case"EEE":return qn(e.weekdays("short",!1,!1),1);case"EEEE":return qn(e.weekdays("long",!1,!1),1);case"ccc":return qn(e.weekdays("short",!0,!1),1);case"cccc":return qn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Eu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Eu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ir(/[a-z_+-/]{1,256}?/i);default:return m(v)}})(n)||{invalidReason:rv};return _.token=n,_}const dv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function pv(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=dv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function mv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function hv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ts(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 _v(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 Ge(n.z)||(t=ai.create(n.z)),Ge(n.Z)||(t||(t=new nn(n.Z)),i=n.Z),Ge(n.q)||(n.M=(n.q-1)*3+1),Ge(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),Ge(n.u)||(n.S=va(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let sr=null;function gv(){return sr||(sr=qe.fromMillis(1555555555555)),sr}function bv(n,e){if(n.literal)return n;const t=dn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=dn.create(e,t).formatDateTimeParts(gv()).map(o=>pv(o,e,t));return l.includes(void 0)?n:l}function vv(n,e){return Array.prototype.concat(...n.map(t=>bv(t,e)))}function hg(n,e,t){const i=vv(dn.parseFormat(t),n),s=i.map(o=>cv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=mv(s),a=RegExp(o,"i"),[u,f]=hv(e,a,r),[c,d,m]=f?_v(f):[null,null,void 0];if(Ts(f,"a")&&Ts(f,"H"))throw new Gs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:m}}}function yv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=hg(n,e,t);return[i,s,l,o]}const _g=[0,31,59,90,120,151,181,212,243,273,304,334],gg=[0,31,60,91,121,152,182,213,244,274,305,335];function An(n,e){return new Hn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function bg(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 vg(n,e,t){return t+(Tl(n)?gg:_g)[e-1]}function yg(n,e){const t=Tl(n)?gg:_g,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Yr(n){const{year:e,month:t,day:i}=n,s=vg(e,t,i),l=bg(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=go(r)):o>go(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function Au(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=bg(e,1,4),l=el(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=el(r)):o>l?(r=e+1,o-=el(e)):r=e;const{month:a,day:u}=yg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function lr(n){const{year:e,month:t,day:i}=n,s=vg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function Iu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=yg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function kv(n){const e=jo(n.weekYear),t=ri(n.weekNumber,1,go(n.weekYear)),i=ri(n.weekday,1,7);return e?t?i?!1:An("weekday",n.weekday):An("week",n.week):An("weekYear",n.weekYear)}function wv(n){const e=jo(n.year),t=ri(n.ordinal,1,el(n.year));return e?t?!1:An("ordinal",n.ordinal):An("year",n.year)}function kg(n){const e=jo(n.year),t=ri(n.month,1,12),i=ri(n.day,1,_o(n.year,n.month));return e?t?i?!1:An("day",n.day):An("month",n.month):An("year",n.year)}function wg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ri(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ri(t,0,59),r=ri(i,0,59),a=ri(s,0,999);return l?o?r?a?!1:An("millisecond",s):An("second",i):An("minute",t):An("hour",e)}const or="Invalid DateTime",Pu=864e13;function zl(n){return new Hn("unsupported zone",`the zone "${n.name}" is not supported`)}function rr(n){return n.weekData===null&&(n.weekData=Yr(n.c)),n.weekData}function Hs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new qe({...t,...e,old:t})}function Sg(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 Lu(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 fo(n,e,t){return Sg(ka(n),e,t)}function Nu(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,_o(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=ka(l);let[a,u]=Sg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return qe.invalid(new Hn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?dn.create(gt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ar(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Dt(n.c.year,t?6:4),e?(i+="-",i+=Dt(n.c.month),i+="-",i+=Dt(n.c.day)):(i+=Dt(n.c.month),i+=Dt(n.c.day)),i}function Fu(n,e,t,i,s,l){let o=Dt(n.c.hour);return e?(o+=":",o+=Dt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Dt(n.c.minute),(n.c.second!==0||!t)&&(o+=Dt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Dt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Dt(Math.trunc(-n.o/60)),o+=":",o+=Dt(Math.trunc(-n.o%60))):(o+="+",o+=Dt(Math.trunc(n.o/60)),o+=":",o+=Dt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const $g={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Sv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},$v={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Tg=["year","month","day","hour","minute","second","millisecond"],Tv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cv=["year","ordinal","hour","minute","second","millisecond"];function Ru(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 O_(n);return e}function qu(n,e){const t=gi(e.zone,Lt.defaultZone),i=gt.fromObject(e),s=Lt.now();let l,o;if(Ge(n.year))l=s;else{for(const u of Tg)Ge(n[u])&&(n[u]=$g[u]);const r=kg(n)||wg(n);if(r)return qe.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new qe({ts:l,zone:t,loc:i,o})}function ju(n,e,t){const i=Ge(t.round)?!0:t.round,s=(o,r)=>(o=ya(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Hu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class qe{constructor(e){const t=e.zone||Lt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Hn("invalid input"):null)||(t.isValid?null:zl(t));this.ts=Ge(e.ts)?Lt.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Lu(this.ts,r),i=Number.isNaN(s.year)?new Hn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||gt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new qe({})}static local(){const[e,t]=Hu(arguments),[i,s,l,o,r,a,u]=t;return qu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Hu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=nn.utcInstance,qu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=L1(e)?e.valueOf():NaN;if(Number.isNaN(i))return qe.invalid("invalid input");const s=gi(t.zone,Lt.defaultZone);return s.isValid?new qe({ts:i,zone:s,loc:gt.fromObject(t)}):qe.invalid(zl(s))}static fromMillis(e,t={}){if(Ji(e))return e<-Pu||e>Pu?qe.invalid("Timestamp out of range"):new qe({ts:e,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Ji(e))return new qe({ts:e*1e3,zone:gi(t.zone,Lt.defaultZone),loc:gt.fromObject(t)});throw new On("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=gi(t.zone,Lt.defaultZone);if(!i.isValid)return qe.invalid(zl(i));const s=Lt.now(),l=Ge(t.specificOffset)?i.offset(s):t.specificOffset,o=bo(e,Ru),r=!Ge(o.ordinal),a=!Ge(o.year),u=!Ge(o.month)||!Ge(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=gt.fromObject(t);if((f||r)&&c)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Gs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let h,_,v=Lu(s,l);m?(h=Tv,_=Sv,v=Yr(v)):r?(h=Cv,_=$v,v=lr(v)):(h=Tg,_=$g);let k=!1;for(const A of h){const I=o[A];Ge(I)?k?o[A]=_[A]:o[A]=v[A]:k=!0}const y=m?kv(o):r?wv(o):kg(o),$=y||wg(o);if($)return qe.invalid($);const T=m?Au(o):r?Iu(o):o,[M,C]=fo(T,l,i),O=new qe({ts:M,zone:i,o:C,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=H0(e);return Vs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=V0(e);return Vs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=z0(e);return Vs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ge(e)||Ge(t))throw new On("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=yv(o,e,t);return f?qe.invalid(f):Vs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Z0(e);return Vs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new On("need to specify a reason the DateTime is invalid");const i=e instanceof Hn?e:new Hn(e,t);if(Lt.throwOnInvalid)throw new D1(i);return new qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?rr(this).weekYear:NaN}get weekNumber(){return this.isValid?rr(this).weekNumber:NaN}get weekday(){return this.isValid?rr(this).weekday:NaN}get ordinal(){return this.isValid?lr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Vl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Vl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Vl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Vl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Tl(this.year)}get daysInMonth(){return _o(this.year,this.month)}get daysInYear(){return this.isValid?el(this.year):NaN}get weeksInWeekYear(){return this.isValid?go(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=dn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(nn.instance(e),t)}toLocal(){return this.setZone(Lt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=gi(e,Lt.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]=fo(o,l,e)}return Hs(this,{ts:s,zone:e})}else return qe.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Hs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=bo(e,Ru),i=!Ge(t.weekYear)||!Ge(t.weekNumber)||!Ge(t.weekday),s=!Ge(t.ordinal),l=!Ge(t.year),o=!Ge(t.month)||!Ge(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Gs("Can't mix ordinal dates with month/day");let u;i?u=Au({...Yr(this.c),...t}):Ge(t.ordinal)?(u={...this.toObject(),...t},Ge(t.day)&&(u.day=Math.min(_o(u.year,u.month),u.day))):u=Iu({...lr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return Hs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return Hs(this,Nu(this,t))}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e).negate();return Hs(this,Nu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=tt.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?dn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):or}toLocaleString(e=Hr,t={}){return this.isValid?dn.create(this.loc.clone(t),e).formatDateTime(this):or}toLocaleParts(e={}){return this.isValid?dn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=ar(this,o);return r+="T",r+=Fu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?ar(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Fu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ar(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():or}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return tt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=N1(t).map(tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=sv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(qe.now(),e,t)}until(e){return this.isValid?vt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||qe.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],l=e.unit;return Array.isArray(e.unit)&&(s=e.unit,l=void 0),ju(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?ju(e.base||qe.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(qe.isDateTime))throw new On("min requires all arguments be DateTimes");return gu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(qe.isDateTime))throw new On("max requires all arguments be DateTimes");return gu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=gt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return hg(o,e,t)}static fromStringExplain(e,t,i={}){return qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Hr}static get DATE_MED(){return E_}static get DATE_MED_WITH_WEEKDAY(){return A1}static get DATE_FULL(){return A_}static get DATE_HUGE(){return I_}static get TIME_SIMPLE(){return P_}static get TIME_WITH_SECONDS(){return L_}static get TIME_WITH_SHORT_OFFSET(){return N_}static get TIME_WITH_LONG_OFFSET(){return F_}static get TIME_24_SIMPLE(){return R_}static get TIME_24_WITH_SECONDS(){return q_}static get TIME_24_WITH_SHORT_OFFSET(){return j_}static get TIME_24_WITH_LONG_OFFSET(){return H_}static get DATETIME_SHORT(){return V_}static get DATETIME_SHORT_WITH_SECONDS(){return z_}static get DATETIME_MED(){return B_}static get DATETIME_MED_WITH_SECONDS(){return U_}static get DATETIME_MED_WITH_WEEKDAY(){return I1}static get DATETIME_FULL(){return W_}static get DATETIME_FULL_WITH_SECONDS(){return Y_}static get DATETIME_HUGE(){return K_}static get DATETIME_HUGE_WITH_SECONDS(){return J_}}function zs(n){if(qe.isDateTime(n))return n;if(n&&n.valueOf&&Ji(n.valueOf()))return qe.fromJSDate(n);if(n&&typeof n=="object")return qe.fromObject(n);throw new On(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Mv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Dv=[".mp4",".avi",".mov",".3gp",".wmv"],Ov=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Ev=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class z{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||z.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return z.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!z.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!z.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){z.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=z.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!z.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!z.isObject(l)&&!Array.isArray(l)||!z.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!z.isObject(s)&&!Array.isArray(s)||!z.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):z.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||z.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||z.isObject(e)&&Object.keys(e).length>0)&&z.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=e||"",e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let s=e[i];typeof s=="string"&&(s=z.truncate(s,150,!0)),t[i]=s}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const s={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let o in s)e=e.replace(s[o],o);const l=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return l.charAt(0).toLowerCase()+l.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),z.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",z.isEmpty(s)||i.push(s);return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static 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:ssZ",24:"yyyy-MM-dd HH:mm:ss.SSSZ"},i=t[e.length]||t[19];return qe.fromFormat(e,i,{zone:"UTC"})}return qe.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return z.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}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!!Mv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Dv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Ov.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Ev.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return z.hasImageExtension(e)?"image":z.hasDocumentExtension(e)?"document":z.hasVideoExtension(e)?"video":z.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(z.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)z.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):z.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,c,d;const t=(e==null?void 0:e.schema)||[],i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!(e!=null&&e.isView)||z.extractColumnsFromQuery((o=e==null?void 0:e.options)==null?void 0:o.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!(e!=null&&e.isView)||z.extractColumnsFromQuery((r=e==null?void 0:e.options)==null?void 0:r.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const m of t){let h=null;m.type==="number"?h=123:m.type==="date"?h="2022-01-01 10:00:00.123Z":m.type==="bool"?h=!0:m.type==="email"?h="test@example.com":m.type==="url"?h="https://example.com":m.type==="json"?h="JSON":m.type==="file"?(h="filename.jpg",((a=m.options)==null?void 0:a.maxSelect)!==1&&(h=[h])):m.type==="select"?(h=(f=(u=m.options)==null?void 0:u.values)==null?void 0:f[0],((c=m.options)==null?void 0:c.maxSelect)!==1&&(h=[h])):m.type==="relation"?(h="RELATION_RECORD_ID",((d=m.options)==null?void 0:d.maxSelect)!==1&&(h=[h])):h="test",i[m.name]=h}return i}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!z.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=z.isObject(u)&&z.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const l of e)l.type==="auth"?t.push(l):l.type==="base"?i.push(l):s.push(l);return[].concat(t,i,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,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample"],toolbar:"undo redo | styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample | code fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),u=tinymce.activeEditor.editorUpload.blobCache,f=r.result.split(",")[1],c=u.create(a,o,f);u.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()}}}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"||(z.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?z.plainText(r):r,s.push(z.truncate(r))):s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","email","username","heading","label","key","id"];for(const o of l)if(!z.isEmpty(e[o]))return e[o];return i}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.isView)for(let l of z.extractColumnsFromQuery(e.options.query))z.pushUnique(i,t+l);else e.isAuth?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)z.pushUnique(i,t+l.name);return i}}const zo=Fn([]);function Cg(n,e=4e3){return Bo(n,"info",e)}function jt(n,e=3e3){return Bo(n,"success",e)}function dl(n,e=4500){return Bo(n,"error",e)}function Av(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Mg(i)},t)};zo.update(s=>(Da(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function Mg(n){zo.update(e=>(Da(e,n),e))}function Ma(){zo.update(n=>{for(let e of n)Da(n,e);return[]})}function Da(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const fi=Fn({});function In(n){fi.set(n||{})}function Qi(n){fi.update(e=>(z.deleteByPath(e,n),e))}const Oa=Fn({});function Kr(n){Oa.set(n||{})}ba.prototype.logout=function(n=!0){this.authStore.clear(),n&&Di("/login")};ba.prototype.errorResponseHandler=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)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&dl(l)}if(z.isEmpty(s.data)||In(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Di("/")};class Iv extends M_{save(e,t){super.save(e,t),t instanceof Xi&&Kr(t)}clear(){super.clear(),Kr(null)}}const me=new ba("../",new Iv("pb_admin_auth"));me.authStore.model instanceof Xi&&Kr(me.authStore.model);function Pv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,h=Nt(m,n,n[2],null);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=D(),s=b("footer"),l=b("a"),l.innerHTML='<span class="txt">Docs</span>',o=D(),r=b("span"),r.textContent="|",a=D(),u=b("a"),f=b("span"),f.textContent="PocketBase v0.13.0",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(_,v){S(_,e,v),g(e,t),h&&h.m(t,null),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(u,f),d=!0},p(_,[v]){h&&h.p&&(!d||v&4)&&Rt(h,m,_,_[2],d?Ft(m,_[2],v,null):qt(_[2]),null),(!d||v&2&&c!==(c="page-wrapper "+_[1]))&&p(e,"class",c),(!d||v&3)&&Q(e,"center-content",_[0])},i(_){d||(E(h,_),d=!0)},o(_){P(h,_),d=!1},d(_){_&&w(e),h&&h.d(_)}}}function Lv(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class wn extends be{constructor(e){super(),ge(this,e,Lv,Pv,he,{center:0,class:1})}}function Vu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Nv(n){let e,t,i,s=!n[0]&&Vu();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=b("div"),s&&s.c(),t=D(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Vu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Rt(o,l,r,r[2],i?Ft(l,r[2],a,null):qt(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Fv(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Nv]},$$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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Rv(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 Dg extends be{constructor(e){super(),ge(this,e,Rv,Fv,he,{nobranding:0})}}function zu(n,e,t){const i=n.slice();return i[11]=e[t],i}const qv=n=>({}),Bu=n=>({uniqueId:n[3]});function jv(n){let e=(n[11]||vo)+"",t;return{c(){t=V(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||vo)+"")&&le(t,e)},d(i){i&&w(t)}}}function Hv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||vo)+"",i;return{c(){e=b("pre"),i=V(t)},m(o,r){S(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||vo)+"")&&le(i,t)},d(o){o&&w(e)}}}function Uu(n){let e,t;function i(o,r){return typeof o[11]=="object"?Hv:jv}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=D(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function Vv(n){let e,t,i,s,l;const o=n[8].default,r=Nt(o,n,n[7],Bu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Uu(zu(n,a,f));return{c(){e=b("div"),r&&r.c(),t=D();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),Q(e,"error",n[2].length)},m(f,c){S(f,e,c),r&&r.m(e,null),g(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[10](e),i=!0,s||(l=Y(e,"click",n[9]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&128)&&Rt(r,o,f,f[7],i?Ft(o,f[7],c,qv):qt(f[7]),Bu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const m=zu(f,a,d);u[d]?u[d].p(m,c):(u[d]=Uu(m),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),(!i||c&5)&&Q(e,"error",f[2].length)},i(f){i||(E(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),ht(u,f),n[10](null),s=!1,l()}}}const vo="Invalid value";function zv(n,e,t){let i;Ye(n,fi,h=>t(6,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Qi(r)}Zt(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(h){Ve.call(this,n,h)}function m(h){se[h?"unshift":"push"](()=>{u=h,t(1,u)})}return n.$$set=h=>{"name"in h&&t(4,r=h.name),"class"in h&&t(0,a=h.class),"$$scope"in h&&t(7,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&80&&t(2,f=z.toArray(z.getNestedVal(i,r)))},[a,u,f,o,r,c,i,l,s,d,m]}class pe extends be{constructor(e){super(),ge(this,e,zv,Vv,he,{name:4,class:0,changed:5})}get changed(){return this.$$.ctx[5]}}function Bv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Email"),s=D(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Uv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=V("Password"),s=D(),l=b("input"),r=D(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[1]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Wv(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Password confirm"),s=D(),l=b("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Yv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Bv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Uv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Wv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),f=b("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){S(h,e,_),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),q(a,e,null),g(e,u),g(e,f),c=!0,d||(m=Y(e,"submit",ft(n[4])),d=!0)},p(h,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:h}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&1540&&(y.$$scope={dirty:_,ctx:h}),a.$set(y),(!c||_&8)&&Q(f,"btn-disabled",h[3]),(!c||_&8)&&Q(f,"btn-loading",h[3])},i(h){c||(E(s.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){P(s.$$.fragment,h),P(o.$$.fragment,h),P(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function Kv(n,e,t){const i=Tt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class Jv extends be{constructor(e){super(),ge(this,e,Kv,Yv,he,{})}}function Wu(n){let e,t;return e=new Dg({props:{$$slots:{default:[Zv]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Zv(n){let e,t;return e=new Jv({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:G,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Gv(n){let e,t,i=n[0]&&Wu(n);return{c(){i&&i.c(),e=Me()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Wu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Xv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Di("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class Qv extends be{constructor(e){super(),ge(this,e,Xv,Gv,he,{})}}const St=Fn(""),yo=Fn(""),Cs=Fn(!1);function Uo(n){const e=n-1;return e*e*e+1}function ko(n,{delay:e=0,duration:t=400,easing:i=kl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Pn(n,{delay:e=0,duration:t=400,easing:i=Uo,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);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function At(n,{delay:e=0,duration:t=400,easing:i=Uo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function It(n,{delay:e=0,duration:t=400,easing:i=Uo,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}
`}}function xv(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){S(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:G,o:G,d(l){l&&w(e),n[13](null),i=!1,s()}}}function ey(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Yu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ku();return{c(){r&&r.c(),e=D(),t=b("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),s=!0,l||(o=Y(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Ku(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(ae(),P(r,1,1,()=>{r=null}),ue())},i(a){s||(E(r),a&&xe(()=>{i||(i=je(t,Pn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=je(t,Pn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&i&&i.end(),l=!1,o()}}}function Ku(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,Pn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,Pn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ty(n){let e,t,i,s,l,o,r,a,u,f;const c=[ey,xv],d=[];function m(_,v){return _[4]&&!_[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Yu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),s=D(),o.c(),r=D(),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(_,v){S(_,e,v),g(e,t),g(t,i),g(e,s),d[l].m(e,null),g(e,r),h&&h.m(e,null),a=!0,u||(f=[Y(e,"click",kn(n[11])),Y(e,"submit",ft(n[10]))],u=!0)},p(_,[v]){let k=l;l=m(_),l===k?d[l].p(_,v):(ae(),P(d[k],1,1,()=>{d[k]=null}),ue(),o=d[l],o?o.p(_,v):(o=d[l]=c[l](_),o.c()),E(o,1),o.m(e,r)),_[0].length||_[7].length?h?(h.p(_,v),v&129&&E(h,1)):(h=Yu(_),h.c(),E(h,1),h.m(e,null)):h&&(ae(),P(h,1,1,()=>{h=null}),ue())},i(_){a||(E(o),E(h),a=!0)},o(_){P(o),P(h),a=!1},d(_){_&&w(e),d[l].d(),h&&h.d(),u=!1,Pe(f)}}}function ny(n,e,t){const i=Tt(),s="search_"+z.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new pn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function _(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-17b33459.js"),["./FilterAutocompleteInput-17b33459.js","./index-a6ccb683.js"],import.meta.url)).default),t(5,f=!1))}Zt(()=>{_()});function v(M){Ve.call(this,n,M)}function k(M){d=M,t(7,d),t(0,l)}function y(M){se[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const T=()=>{m(!1),h()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,m,h,v,k,y,$,T]}class Wo extends be{constructor(e){super(),ge(this,e,ny,ty,he,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Jr,qi;const Zr="app-tooltip";function Ju(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function ki(){return qi=qi||document.querySelector("."+Zr),qi||(qi=document.createElement("div"),qi.classList.add(Zr),document.body.appendChild(qi)),qi}function Og(n,e){let t=ki();if(!t.classList.contains("active")||!(e!=null&&e.text)){Gr();return}t.textContent=e.text,t.className=Zr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Gr(){clearTimeout(Jr),ki().classList.remove("active"),ki().activeNode=void 0}function iy(n,e){ki().activeNode=n,clearTimeout(Jr),Jr=setTimeout(()=>{ki().classList.add("active"),Og(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Ju(e);function i(){iy(n,t)}function s(){Gr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",s),ki(),{update(l){var o,r;t=Ju(l),(r=(o=ki())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Og(n,t)},destroy(){var l,o;(o=(l=ki())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Gr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function sy(n){let e,t,i,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-refresh-line svelte-1bvelc2"></i>',p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),Q(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[Ie(t=Be.call(null,e,n[0])),Y(e,"click",n[2])],i=!0)},p(l,[o]){t&&Bt(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&Q(e,"refreshing",l[1])},i:G,o:G,d(l){l&&w(e),i=!1,Pe(s)}}}function ly(n,e,t){const i=Tt();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},150))}return Zt(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Ea extends be{constructor(e){super(),ge(this,e,ly,sy,he,{tooltip:0})}}function oy(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]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(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)&&Rt(r,o,a,a[5],i?Ft(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)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,Pe(l)}}}function ry(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 Wt extends be{constructor(e){super(),ge(this,e,ry,oy,he,{class:1,name:2,sort:0,disable:3})}}function ay(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function uy(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("div"),i=V(n[2]),s=D(),l=b("div"),o=V(n[1]),r=V(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(e,s),g(e,l),g(l,o),g(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function fy(n){let e;function t(l,o){return l[0]?uy:ay}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(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:G,o:G,d(l){s.d(l),l&&w(e)}}}function cy(n,e,t){let i,s,{date:l=""}=e;return n.$$set=o=>{"date"in o&&t(0,l=o.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i]}class ui extends be{constructor(e){super(),ge(this,e,cy,fy,he,{date:0})}}const dy=n=>({}),Zu=n=>({}),py=n=>({}),Gu=n=>({});function my(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Nt(u,n,n[4],Gu),c=n[5].default,d=Nt(c,n,n[4],null),m=n[5].after,h=Nt(m,n,n[4],Zu);return{c(){e=b("div"),f&&f.c(),t=D(),i=b("div"),d&&d.c(),l=D(),h&&h.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(_,v){S(_,e,v),f&&f.m(e,null),g(e,t),g(e,i),d&&d.m(i,null),n[6](i),g(e,l),h&&h.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(_,[v]){f&&f.p&&(!o||v&16)&&Rt(f,u,_,_[4],o?Ft(u,_[4],v,py):qt(_[4]),Gu),d&&d.p&&(!o||v&16)&&Rt(d,c,_,_[4],o?Ft(c,_[4],v,null):qt(_[4]),null),(!o||v&9&&s!==(s="horizontal-scroller "+_[0]+" "+_[3]+" svelte-wc2j9h"))&&p(i,"class",s),h&&h.p&&(!o||v&16)&&Rt(h,m,_,_[4],o?Ft(m,_[4],v,dy):qt(_[4]),Zu)},i(_){o||(E(f,_),E(d,_),E(h,_),o=!0)},o(_){P(f,_),P(d,_),P(h,_),o=!1},d(_){_&&w(e),f&&f.d(_),d&&d.d(_),n[6](null),h&&h.d(_),r=!1,Pe(a)}}}function hy(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,m=o.scrollWidth;m-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==m&&t(3,r+=" scroll-end")):t(3,r="")},100))}Zt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function c(d){se[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,f,o,r,s,i,c]}class Aa extends be{constructor(e){super(),ge(this,e,hy,my,he,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function Xu(n,e,t){const i=n.slice();return i[23]=e[t],i}function _y(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="ri-global-line"></i>
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function gy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="url",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function by(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="referer",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function vy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="User IP",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function yy(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="status",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function ky(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Qu(n){let e;function t(l,o){return l[6]?Sy:wy}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function wy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&xu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=xu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Sy(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function xu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function ef(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tf(n,e){var Se,We,lt;let t,i,s,l=((Se=e[23].method)==null?void 0:Se.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,h,_,v,k,y=(e[23].referer||"N/A")+"",$,T,M,C,O,A=(e[23].userIp||"N/A")+"",I,L,N,F,R,K=e[23].status+"",x,U,X,ne,J,fe,Z,de,ve,Te,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&ef();ne=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function ye(...ce){return e[18](e[23],...ce)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("span"),o=V(l),a=D(),u=b("td"),f=b("span"),d=V(c),h=D(),Ne&&Ne.c(),_=D(),v=b("td"),k=b("span"),$=V(y),M=D(),C=b("td"),O=b("span"),I=V(A),N=D(),F=b("td"),R=b("span"),x=V(K),U=D(),X=b("td"),H(ne.$$.fragment),J=D(),fe=b("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(k,"class","txt txt-ellipsis"),p(k,"title",T=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(v,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p(C,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(fe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ce,ze){S(ce,t,ze),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,h),Ne&&Ne.m(u,null),g(t,_),g(t,v),g(v,k),g(k,$),g(t,M),g(t,C),g(C,O),g(O,I),g(t,N),g(t,F),g(F,R),g(R,x),g(t,U),g(t,X),q(ne,X,null),g(t,J),g(t,fe),g(t,Z),de=!0,ve||(Te=[Y(t,"click",Re),Y(t,"keydown",ye)],ve=!0)},p(ce,ze){var Fe,ot,Vt;e=ce,(!de||ze&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||ze&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||ze&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||ze&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Vt=e[23].meta)!=null&&Vt.errorData?Ne||(Ne=ef(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||ze&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le($,y),(!de||ze&8&&T!==(T=e[23].referer))&&p(k,"title",T),(!de||ze&8)&&Q(k,"txt-hint",!e[23].referer),(!de||ze&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(I,A),(!de||ze&8&&L!==(L=e[23].userIp))&&p(O,"title",L),(!de||ze&8)&&Q(O,"txt-hint",!e[23].userIp),(!de||ze&8)&&K!==(K=e[23].status+"")&&le(x,K),(!de||ze&8)&&Q(R,"label-danger",e[23].status>=400);const te={};ze&8&&(te.date=e[23].created),ne.$set(te)},i(ce){de||(E(ne.$$.fragment,ce),de=!0)},o(ce){P(ne.$$.fragment,ce),de=!1},d(ce){ce&&w(t),Ne&&Ne.d(),j(ne),ve=!1,Pe(Te)}}}function $y(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O,A,I=[],L=new Map,N;function F(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[_y]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),se.push(()=>_e(s,"sort",F));function K(ye){n[12](ye)}let x={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[gy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),r=new Wt({props:x}),se.push(()=>_e(r,"sort",K));function U(ye){n[13](ye)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[by]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new Wt({props:X}),se.push(()=>_e(f,"sort",U));function ne(ye){n[14](ye)}let J={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[vy]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),m=new Wt({props:J}),se.push(()=>_e(m,"sort",ne));function fe(ye){n[15](ye)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[yy]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),v=new Wt({props:Z}),se.push(()=>_e(v,"sort",fe));function de(ye){n[16](ye)}let ve={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[ky]},$$scope:{ctx:n}};n[1]!==void 0&&(ve.sort=n[1]),$=new Wt({props:ve}),se.push(()=>_e($,"sort",de));let Te=n[3];const Ne=ye=>ye[23].id;for(let ye=0;ye<Te.length;ye+=1){let Se=Xu(n,Te,ye),We=Ne(Se);L.set(We,I[ye]=tf(We,Se))}let Re=null;return Te.length||(Re=Qu(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),H(s.$$.fragment),o=D(),H(r.$$.fragment),u=D(),H(f.$$.fragment),d=D(),H(m.$$.fragment),_=D(),H(v.$$.fragment),y=D(),H($.$$.fragment),M=D(),C=b("th"),O=D(),A=b("tbody");for(let ye=0;ye<I.length;ye+=1)I[ye].c();Re&&Re.c(),p(C,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[6])},m(ye,Se){S(ye,e,Se),g(e,t),g(t,i),q(s,i,null),g(i,o),q(r,i,null),g(i,u),q(f,i,null),g(i,d),q(m,i,null),g(i,_),q(v,i,null),g(i,y),q($,i,null),g(i,M),g(i,C),g(e,O),g(e,A);for(let We=0;We<I.length;We+=1)I[We].m(A,null);Re&&Re.m(A,null),N=!0},p(ye,Se){const We={};Se&67108864&&(We.$$scope={dirty:Se,ctx:ye}),!l&&Se&2&&(l=!0,We.sort=ye[1],ke(()=>l=!1)),s.$set(We);const lt={};Se&67108864&&(lt.$$scope={dirty:Se,ctx:ye}),!a&&Se&2&&(a=!0,lt.sort=ye[1],ke(()=>a=!1)),r.$set(lt);const ce={};Se&67108864&&(ce.$$scope={dirty:Se,ctx:ye}),!c&&Se&2&&(c=!0,ce.sort=ye[1],ke(()=>c=!1)),f.$set(ce);const ze={};Se&67108864&&(ze.$$scope={dirty:Se,ctx:ye}),!h&&Se&2&&(h=!0,ze.sort=ye[1],ke(()=>h=!1)),m.$set(ze);const te={};Se&67108864&&(te.$$scope={dirty:Se,ctx:ye}),!k&&Se&2&&(k=!0,te.sort=ye[1],ke(()=>k=!1)),v.$set(te);const Fe={};Se&67108864&&(Fe.$$scope={dirty:Se,ctx:ye}),!T&&Se&2&&(T=!0,Fe.sort=ye[1],ke(()=>T=!1)),$.$set(Fe),Se&841&&(Te=ye[3],ae(),I=wt(I,Se,Ne,1,ye,Te,L,A,ln,tf,null,Xu),ue(),!Te.length&&Re?Re.p(ye,Se):Te.length?Re&&(Re.d(1),Re=null):(Re=Qu(ye),Re.c(),Re.m(A,null))),(!N||Se&64)&&Q(e,"table-loading",ye[6])},i(ye){if(!N){E(s.$$.fragment,ye),E(r.$$.fragment,ye),E(f.$$.fragment,ye),E(m.$$.fragment,ye),E(v.$$.fragment,ye),E($.$$.fragment,ye);for(let Se=0;Se<Te.length;Se+=1)E(I[Se]);N=!0}},o(ye){P(s.$$.fragment,ye),P(r.$$.fragment,ye),P(f.$$.fragment,ye),P(m.$$.fragment,ye),P(v.$$.fragment,ye),P($.$$.fragment,ye);for(let Se=0;Se<I.length;Se+=1)P(I[Se]);N=!1},d(ye){ye&&w(e),j(s),j(r),j(f),j(m),j(v),j($);for(let Se=0;Se<I.length;Se+=1)I[Se].d();Re&&Re.d()}}}function nf(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=b("small"),t=V("Showing "),s=V(i),l=V(" of "),o=V(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&le(s,i),a&16&&le(o,r[4])},d(r){r&&w(e)}}}function sf(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=V("Load more ("),o=V(l),r=V(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[6]),Q(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=Y(t,"click",n[20]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&le(o,l),c&64&&Q(t,"btn-loading",f[6]),c&64&&Q(t,"btn-disabled",f[6])},d(f){f&&w(e),a=!1,u()}}}function Ty(n){let e,t,i,s,l;e=new Aa({props:{class:"table-wrapper",$$slots:{default:[$y]},$$scope:{ctx:n}}});let o=n[3].length&&nf(n),r=n[3].length&&n[7]&&sf(n);return{c(){H(e.$$.fragment),t=D(),o&&o.c(),i=D(),r&&r.c(),s=Me()},m(a,u){q(e,a,u),S(a,t,u),o&&o.m(a,u),S(a,i,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,[u]){const f={};u&67108939&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length?o?o.p(a,u):(o=nf(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[3].length&&a[7]?r?r.p(a,u):(r=sf(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(E(e.$$.fragment,a),l=!0)},o(a){P(e.$$.fragment,a),l=!1},d(a){j(e,a),a&&w(t),o&&o.d(a),a&&w(i),r&&r.d(a),a&&w(s)}}}function Cy(n,e,t){let i;const s=Tt(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,c=0,d=!1,m=0;async function h(L=1,N=!0){return t(6,d=!0),me.logs.getRequestsList(L,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async F=>{if(L<=1&&_(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),N){const R=++m;for(;F.items.length&&m==R;)t(3,u=u.concat(F.items.splice(0,10))),await z.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),_(),me.errorResponseHandler(F,!1))})}function _(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(L){a=L,t(1,a)}function k(L){a=L,t(1,a)}function y(L){a=L,t(1,a)}function $(L){a=L,t(1,a)}function T(L){a=L,t(1,a)}function M(L){a=L,t(1,a)}const C=L=>s("select",L),O=(L,N)=>{N.code==="Enter"&&(N.preventDefault(),s("select",L))},A=()=>t(0,o=""),I=()=>h(f+1);return n.$$set=L=>{"filter"in L&&t(0,o=L.filter),"presets"in L&&t(10,r=L.presets),"sort"in L&&t(1,a=L.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(_(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,k,y,$,T,M,C,O,A,I]}class My extends be{constructor(e){super(),ge(this,e,Cy,Ty,he,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function ni(){}const Dy=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function _t(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 Ke(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Ct=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Cn(n,e){return Ct(n)?n:e}function Xe(n,e){return typeof n>"u"?e:n}const Oy=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Eg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function yt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ut(n,e,t,i){let s,l,o;if(_t(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ke(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(_t(n))return n.map(So);if(Ke(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Ag(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ey(n,e,t,i){if(!Ag(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=_t(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||Ey;for(let o=0;o<s;++o){if(e=i[o],!Ke(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return pl(n,e,{merger:Ay})}function Ay(n,e,t){if(!Ag(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const lf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ti(n,e){return(lf[e]||(lf[e]=Iy(e)))(n)}function Iy(n){const e=Py(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Py(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ia(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ln=n=>typeof n<"u",Ci=n=>typeof n=="function",of=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Ly(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const $t=Math.PI,dt=2*$t,Ny=dt+$t,$o=Number.POSITIVE_INFINITY,Fy=$t/180,kt=$t/2,Bs=$t/4,rf=$t*2/3,En=Math.log10,Gn=Math.sign;function af(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(En(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Ry(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function qy(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Ig(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Vn(n){return n*($t/180)}function Pa(n){return n*(180/$t)}function uf(n){if(!Ct(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Pg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*$t&&(l+=dt),{angle:l,distance:s}}function Xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function jy(n,e){return(n-e+Ny)%dt-$t}function bn(n){return(n%dt+dt)%dt}function ml(n,e,t,i){const s=bn(n),l=bn(e),o=bn(t),r=bn(l-s),a=bn(o-s),u=bn(s-l),f=bn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Yt(n,e,t){return Math.max(e,Math.min(t,n))}function Hy(n){return Yt(n,-32768,32767)}function hl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function La(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Yi=(n,e,t,i)=>La(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Vy=(n,e,t)=>La(n,t,i=>n[i][e]>=t);function zy(n,e,t){let i=0,s=n.length;for(;i<s&&n[i]<e;)i++;for(;s>i&&n[s-1]>t;)s--;return i>0||s<n.length?n.slice(i,s):n}const Lg=["push","pop","shift","splice","unshift"];function By(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Lg.forEach(t=>{const i="_onData"+Ia(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function ff(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)&&(Lg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Ng(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const Fg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Rg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Fg.call(window,()=>{s=!1,n.apply(e,l)}))}}function Uy(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Wy=n=>n==="start"?"left":n==="end"?"right":"center",cf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function qg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=Yt(Math.min(Yi(r,o.axis,u).lo,t?i:Yi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=Yt(Math.max(Yi(r,o.axis,f,!0).hi+1,t?0:Yi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function jg(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 Ul=n=>n===0||n===1,df=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*dt/t)),pf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*dt/t)+1,sl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*kt)+1,easeOutSine:n=>Math.sin(n*kt),easeInOutSine:n=>-.5*(Math.cos($t*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=>Ul(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=>Ul(n)?n:df(n,.075,.3),easeOutElastic:n=>Ul(n)?n:pf(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*df(n*2,.1125,.45):.5+.5*pf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-sl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?sl.easeInBounce(n*2)*.5:sl.easeOutBounce(n*2-1)*.5+.5};/*!
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Ol(n){return n+.5|0}const bi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return bi(Ol(n*2.55),0,255)}function wi(n){return bi(Ol(n*255),0,255)}function li(n){return bi(Ol(n/2.55)/100,0,1)}function mf(n){return bi(Ol(n*100),0,100)}const Tn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Qr=[..."0123456789ABCDEF"],Yy=n=>Qr[n&15],Ky=n=>Qr[(n&240)>>4]+Qr[n&15],Wl=n=>(n&240)>>4===(n&15),Jy=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Zy(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Tn[n[1]]*17,g:255&Tn[n[2]]*17,b:255&Tn[n[3]]*17,a:e===5?Tn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Tn[n[1]]<<4|Tn[n[2]],g:Tn[n[3]]<<4|Tn[n[4]],b:Tn[n[5]]<<4|Tn[n[6]],a:e===9?Tn[n[7]]<<4|Tn[n[8]]:255})),t}const Gy=(n,e)=>n<255?e(n):"";function Xy(n){var e=Jy(n)?Yy:Ky;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Gy(n.a,e):void 0}const Qy=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Hg(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 xy(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 e2(n,e,t){const i=Hg(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 t2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Na(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=t2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function Ra(n,e,t){return Fa(Hg,n,e,t)}function n2(n,e,t){return Fa(e2,n,e,t)}function i2(n,e,t){return Fa(xy,n,e,t)}function Vg(n){return(n%360+360)%360}function s2(n){const e=Qy.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):wi(+e[5]));const s=Vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=n2(s,l,o):e[1]==="hsv"?i=i2(s,l,o):i=Ra(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function l2(n,e){var t=Na(n);t[0]=Vg(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function o2(n){if(!n)return;const e=Na(n),t=e[0],i=mf(e[1]),s=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const hf={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"},_f={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 r2(){const n={},e=Object.keys(_f),t=Object.keys(hf);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s],r=r.replace(l,hf[l]);l=parseInt(_f[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Yl;function a2(n){Yl||(Yl=r2(),Yl.transparent=[0,0,0,0]);const e=Yl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const u2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function f2(n){const e=u2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Qs(o):bi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Qs(i):bi(i,0,255)),s=255&(e[4]?Qs(s):bi(s,0,255)),l=255&(e[6]?Qs(l):bi(l,0,255)),{r:i,g:s,b:l,a:t}}}function c2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${li(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ur=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ps=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function d2(n,e,t){const i=ps(li(n.r)),s=ps(li(n.g)),l=ps(li(n.b));return{r:wi(ur(i+t*(ps(li(e.r))-i))),g:wi(ur(s+t*(ps(li(e.g))-s))),b:wi(ur(l+t*(ps(li(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=Na(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ra(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function zg(n,e){return n&&Object.assign(e||{},n)}function gf(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=wi(n[3]))):(e=zg(n,{r:0,g:0,b:0,a:1}),e.a=wi(e.a)),e}function p2(n){return n.charAt(0)==="r"?f2(n):s2(n)}class To{constructor(e){if(e instanceof To)return e;const t=typeof e;let i;t==="object"?i=gf(e):t==="string"&&(i=Zy(e)||a2(e)||p2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=zg(this._rgb);return e&&(e.a=li(e.a)),e}set rgb(e){this._rgb=gf(e)}rgbString(){return this._valid?c2(this._rgb):void 0}hexString(){return this._valid?Xy(this._rgb):void 0}hslString(){return this._valid?o2(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=d2(this._rgb,e._rgb,t)),this}clone(){return new To(this.rgb)}alpha(e){return this._rgb.a=wi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ol(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 Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return l2(this._rgb,e),this}}function Bg(n){return new To(n)}function Ug(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function bf(n){return Ug(n)?n:Bg(n)}function fr(n){return Ug(n)?n:Bg(n).saturate(.5).darken(.1).hexString()}const xi=Object.create(null),xr=Object.create(null);function ll(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function cr(n,e,t){return typeof e=="string"?pl(ll(n,e),t):pl(ll(n,""),e)}class m2{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>fr(i.backgroundColor),this.hoverBorderColor=(t,i)=>fr(i.borderColor),this.hoverColor=(t,i)=>fr(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return cr(this,e,t)}get(e){return ll(this,e)}describe(e,t){return cr(xr,e,t)}override(e,t){return cr(xi,e,t)}route(e,t,i,s){const l=ll(this,e),o=ll(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return Ke(a)?Object.assign({},u,a):Xe(a,u)},set(a){this[r]=a}}})}}var Qe=new m2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function h2(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Co(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function _2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;a<r;a++)if(c=t[a],c!=null&&_t(c)!==!0)o=Co(n,s,l,o,c);else if(_t(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!_t(d)&&(o=Co(n,s,l,o,d));n.restore();const m=l.length/2;if(m>t.length){for(a=0;a<m;a++)delete s[l[a]];l.splice(0,m)}return o}function ji(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 vf(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function ea(n,e,t,i){g2(n,e,t,i,null)}function g2(n,e,t,i,s){let l,o,r,a,u,f;const c=e.pointStyle,d=e.rotation,m=e.radius;let h=(d||0)*Fy;if(c&&typeof c=="object"&&(l=c.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(h),n.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),c){default:s?n.ellipse(t,i,s/2,m,0,0,dt):n.arc(t,i,m,0,dt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(h)*m,i-Math.cos(h)*m),h+=rf,n.lineTo(t+Math.sin(h)*m,i-Math.cos(h)*m),h+=rf,n.lineTo(t+Math.sin(h)*m,i-Math.cos(h)*m),n.closePath();break;case"rectRounded":u=m*.516,a=m-u,o=Math.cos(h+Bs)*a,r=Math.sin(h+Bs)*a,n.arc(t-o,i-r,u,h-$t,h-kt),n.arc(t+r,i-o,u,h-kt,h),n.arc(t+o,i+r,u,h,h+kt),n.arc(t-r,i+o,u,h+kt,h+$t),n.closePath();break;case"rect":if(!d){a=Math.SQRT1_2*m,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}h+=Bs;case"rectRot":o=Math.cos(h)*m,r=Math.sin(h)*m,n.moveTo(t-o,i-r),n.lineTo(t+r,i-o),n.lineTo(t+o,i+r),n.lineTo(t-r,i+o),n.closePath();break;case"crossRot":h+=Bs;case"cross":o=Math.cos(h)*m,r=Math.sin(h)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"star":o=Math.cos(h)*m,r=Math.sin(h)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),h+=Bs,o=Math.cos(h)*m,r=Math.sin(h)*m,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"line":o=s?s/2:Math.cos(h)*m,r=Math.sin(h)*m,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)*m,i+Math.sin(h)*m);break}n.fill(),e.borderWidth>0&&n.stroke()}}function _l(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function qa(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function ja(n){n.restore()}function b2(n,e,t,i,s){if(!e)return n.lineTo(t.x,t.y);if(s==="middle"){const l=(e.x+t.x)/2;n.lineTo(l,e.y),n.lineTo(l,t.y)}else s==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function v2(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function Mo(n,e,t,i,s,l={}){const o=_t(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,y2(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),at(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),k2(n,t,i,u,l),i+=s.lineHeight;n.restore()}function y2(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),at(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function k2(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Do(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-kt,$t,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,$t,kt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,kt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-kt,!0),n.lineTo(t+o.topLeft,i)}const w2=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),S2=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function $2(n,e){const t=(""+n).match(w2);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const T2=n=>+n||0;function Ha(n,e){const t={},i=Ke(e),s=i?Object.keys(e):e,l=Ke(n)?i?o=>Xe(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=T2(l(o));return t}function Wg(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Nn(n){const e=Wg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function vn(n,e){n=n||{},e=e||Qe.font;let t=Xe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Xe(n.style,e.style);i&&!(""+i).match(S2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:Xe(n.family,e.family),lineHeight:$2(Xe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Xe(n.weight,e.weight),string:""};return s.string=h2(s),s}function Jl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;l<o;++l)if(r=n[l],r!==void 0&&(e!==void 0&&typeof r=="function"&&(r=r(e),s=!1),t!==void 0&&_t(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function C2(n,e,t){const{min:i,max:s}=n,l=Eg(e,(s-i)/2),o=(r,a)=>t&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Oi(n,e){return Object.assign(Object.create(n),e)}function Va(n,e=[""],t=n,i,s=()=>n[0]){Ln(i)||(i=Zg("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Va([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return Kg(o,r,()=>L2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return kf(o).includes(r)},ownKeys(o){return kf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ds(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Yg(n,i),setContext:l=>Ds(n,l,t,i),override:l=>Ds(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 Kg(l,o,()=>D2(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 Yg(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:Ci(t)?t:()=>t,isIndexable:Ci(i)?i:()=>i}}const M2=(n,e)=>n?n+Ia(e):e,za=(n,e)=>Ke(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Kg(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function D2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ci(r)&&o.isScriptable(e)&&(r=O2(e,r,n,t)),_t(r)&&r.length&&(r=E2(e,r,n,o.isIndexable)),za(e,r)&&(r=Ds(r,s,l&&l[e],o)),r}function O2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),za(n,e)&&(e=Ba(s._scopes,s,n,e)),e}function E2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Ln(l.index)&&i(n))e=e[l.index%e.length];else if(Ke(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ba(u,s,n,f);e.push(Ds(c,l,o&&o[n],r))}}return e}function Jg(n,e,t){return Ci(n)?n(e,t):n}const A2=(n,e)=>n===!0?e:typeof n=="string"?Ti(e,n):void 0;function I2(n,e,t,i,s){for(const l of e){const o=A2(t,l);if(o){n.add(o);const r=Jg(o._fallback,t,s);if(Ln(r)&&r!==t&&r!==i)return r}else if(o===!1&&Ln(i)&&t!==i)return null}return!1}function Ba(n,e,t,i){const s=e._rootScopes,l=Jg(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=yf(r,o,t,l||t,i);return a===null||Ln(l)&&l!==t&&(a=yf(r,o,l,a,i),a===null)?!1:Va(Array.from(r),[""],s,l,()=>P2(e,t,i))}function yf(n,e,t,i,s){for(;t;)t=I2(n,e,t,i,s);return t}function P2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return _t(s)&&Ke(t)?t:s}function L2(n,e,t,i){let s;for(const l of e)if(s=Zg(M2(l,n),t),Ln(s))return za(n,s)?Ba(t,i,n,s):s}function Zg(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Ln(i))return i}}function kf(n){let e=n._keys;return e||(e=n._keys=N2(n._scopes)),e}function N2(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function Gg(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;r<a;++r)u=r+t,f=e[u],o[r]={r:s.parse(Ti(f,l),u)};return o}const F2=Number.EPSILON||1e-14,Os=(n,e)=>e<n.length&&!n[e].skip&&n[e],Xg=n=>n==="x"?"y":"x";function R2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Xr(l,s),a=Xr(o,l);let 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 q2(n,e,t){const i=n.length;let s,l,o,r,a,u=Os(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Os(n,f+1),!(!a||!u)){if(il(e[f],0,F2)){t[f]=t[f+1]=0;continue}s=t[f]/e[f],l=t[f+1]/e[f],r=Math.pow(s,2)+Math.pow(l,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=s*o*e[f],t[f+1]=l*o*e[f])}}function j2(n,e,t="x"){const i=Xg(t),s=n.length;let l,o,r,a=Os(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Os(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=c-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=c+l*e[u])}}function H2(n,e="x"){const t=Xg(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Os(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Os(n,o+1),!!a){if(u){const f=u[e]-a[e];s[o]=f!==0?(u[t]-a[t])/f:0}l[o]=r?u?Gn(s[o-1])!==Gn(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}q2(n,s,l),j2(n,l,e)}function Zl(n,e,t){return Math.max(Math.min(n,t),e)}function V2(n,e){let t,i,s,l,o,r=_l(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&_l(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Zl(s.cp1x,e.left,e.right),s.cp1y=Zl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Zl(s.cp2x,e.left,e.right),s.cp2y=Zl(s.cp2y,e.top,e.bottom)))}function z2(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")H2(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;l<o;++l)r=n[l],a=R2(u,r,n[Math.min(l+1,o-(i?0:1))%o],e.tension),r.cp1x=a.previous.x,r.cp1y=a.previous.y,r.cp2x=a.next.x,r.cp2y=a.next.y,u=r}e.capBezierPoints&&V2(n,t)}function Qg(){return typeof window<"u"&&typeof document<"u"}function Ua(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Oo(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Yo=n=>window.getComputedStyle(n,null);function B2(n,e){return Yo(n).getPropertyValue(e)}const U2=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=U2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const W2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Y2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(W2(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 Bi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Yo(t),l=s.boxSizing==="border-box",o=Zi(s,"padding"),r=Zi(s,"border","width"),{x:a,y:u,box:f}=Y2(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 K2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ua(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Yo(l),a=Zi(r,"border","width"),u=Zi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Oo(r.maxWidth,l,"clientWidth"),s=Oo(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||$o,maxHeight:s||$o}}const dr=n=>Math.round(n*10)/10;function J2(n,e,t,i){const s=Yo(n),l=Zi(s,"margin"),o=Oo(s.maxWidth,n,"clientWidth")||$o,r=Oo(s.maxHeight,n,"clientHeight")||$o,a=K2(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=Zi(s,"border","width"),d=Zi(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=dr(Math.min(u,o,a.maxWidth)),f=dr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=dr(u/2)),{width:u,height:f}}function wf(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Z2=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Sf(n,e){const t=B2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ui(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function G2(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 X2(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Ui(n,s,t),r=Ui(s,l,t),a=Ui(l,e,t),u=Ui(o,r,t),f=Ui(r,a,t);return Ui(u,f,t)}const $f=new Map;function Q2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=$f.get(t);return i||(i=new Intl.NumberFormat(n,e),$f.set(t,i)),i}function El(n,e,t){return Q2(e,t).format(n)}const x2=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}}},ek=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function pr(n,e,t){return n?x2(e,t):ek()}function tk(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 nk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function xg(n){return n==="angle"?{between:ml,compare:jy,normalize:bn}:{between:hl,compare:(e,t)=>e-t,normalize:e=>e}}function Tf({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 ik(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=xg(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;d<m&&o(r(e[u%a][i]),s,l);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function eb(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=xg(i),{start:f,end:c,loop:d,style:m}=ik(n,e,t),h=[];let _=!1,v=null,k,y,$;const T=()=>a(s,$,k)&&r(s,$)!==0,M=()=>r(l,k)===0||a(l,$,k),C=()=>_||T(),O=()=>!_||M();for(let A=f,I=f;A<=c;++A)y=e[A%o],!y.skip&&(k=u(y[i]),k!==$&&(_=a(k,s,l),v===null&&C()&&(v=r(k,s)===0?A:I),v!==null&&O()&&(h.push(Tf({start:v,end:A,loop:d,count:o,style:m})),v=null),I=A,$=k));return v!==null&&h.push(Tf({start:v,end:c,loop:d,count:o,style:m})),h}function tb(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=eb(i[s],n.points,e);l.length&&t.push(...l)}return t}function sk(n,e,t,i){let s=0,l=e-1;if(t&&!i)for(;s<e&&!n[s].skip;)s++;for(;s<e&&n[s].skip;)s++;for(s%=e,t&&(l+=s);l>s&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function lk(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 ok(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=sk(t,s,l,i);if(i===!0)return Cf(n,[{start:o,end:r,loop:l}],t,e);const a=r<o?r+s:r,u=!!n._fullLoop&&o===0&&r===s-1;return Cf(n,lk(t,o,a,u),t,e)}function Cf(n,e,t,i){return!i||!i.setContext||!t?e:rk(n,e,t,i)}function rk(n,e,t,i){const s=n._chart.getContext(),l=Mf(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function m(h,_,v,k){const y=r?-1:1;if(h!==_){for(h+=a;t[h%a].skip;)h-=y;for(;t[_%a].skip;)_+=y;h%a!==_%a&&(u.push({start:h%a,end:_%a,loop:v,style:k}),f=k,c=_%a)}}for(const h of e){c=r?c:h.start;let _=t[c%a],v;for(d=c+1;d<=h.end;d++){const k=t[d%a];v=Mf(i.setContext(Oi(s,{type:"segment",p0:_,p1:k,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),ak(v,f)&&m(c,d-1,h.loop,f),_=k,f=v}c<d-1&&m(c,d-1,h.loop,f)}return u}function Mf(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function ak(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class uk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Fg.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 ii=new uk;const Df="transparent",fk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=bf(n||Df),s=i.valid&&bf(e||Df);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class ck{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||fk[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([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||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?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<i.length;s++)i[s][t]()}}const dk=["x","y","borderWidth","radius","tension"],pk=["color","borderColor","backgroundColor"];Qe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const mk=Object.keys(Qe.animation);Qe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});Qe.set("animations",{colors:{type:"color",properties:pk},numbers:{type:"number",properties:dk}});Qe.describe("animations",{_fallback:"animation"});Qe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class nb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ke(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ke(s))return;const l={};for(const o of mk)l[o]=s[o];(_t(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=_k(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&hk(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 ck(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 ii.add(this._chart,i),!0}}function hk(n,e){const t=[],i=Object.keys(e);for(let s=0;s<i.length;s++){const l=n[i[s]];l&&l.active()&&t.push(l.wait())}return Promise.all(t)}function _k(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Of(n,e){const t=n&&n.options||{},i=t.reverse,s=t.min===void 0?e:0,l=t.max===void 0?e:0;return{start:i?l:s,end:i?s:l}}function gk(n,e,t){if(t===!1)return!1;const i=Of(n,t),s=Of(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function bk(n){let e,t,i,s;return Ke(n)?(e=n.top,t=n.right,i=n.bottom,s=n.left):e=t=i=s=n,{top:e,right:t,bottom:i,left:s,disabled:n===!1}}function ib(n,e){const t=[],i=n._getSortedDatasetMetas(e);let s,l;for(s=0,l=i.length;s<l;++s)t.push(i[s].index);return t}function Ef(n,e,t,i={}){const s=n.keys,l=i.mode==="single";let o,r,a,u;if(e!==null){for(o=0,r=s.length;o<r;++o){if(a=+s[o],a===t){if(i.all)continue;break}u=n.values[a],Ct(u)&&(l||e===0||Gn(e)===Gn(u))&&(e+=u)}return e}}function vk(n){const e=Object.keys(n),t=new Array(e.length);let i,s,l;for(i=0,s=e.length;i<s;++i)l=e[i],t[i]={x:l,y:n[l]};return t}function Af(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function yk(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function kk(n){const{min:e,max:t,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY}}function wk(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function If(n,e,t,i){for(const s of e.getMatchingVisibleMetas(i).reverse()){const l=n[s.index];if(t&&l>0||!t&&l<0)return s.index}return null}function Pf(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=yk(l,o,i),c=e.length;let d;for(let m=0;m<c;++m){const h=e[m],{[a]:_,[u]:v}=h,k=h._stacks||(h._stacks={});d=k[u]=wk(s,f,_),d[r]=v,d._top=If(d,o,!0,i.type),d._bottom=If(d,o,!1,i.type)}}function mr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Sk(n,e){return Oi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function $k(n,e,t){return Oi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Us(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const hr=n=>n==="reset"||n==="none",Lf=(n,e)=>e?n:Object.assign({},n),Tk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:ib(t,!0),values:null};class Un{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Af(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Us(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,l=t.xAxisID=Xe(i.xAxisID,mr(e,"x")),o=t.yAxisID=Xe(i.yAxisID,mr(e,"y")),r=t.rAxisID=Xe(i.rAxisID,mr(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&&ff(this._data,this),e._stacked&&Us(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Ke(t))this._data=vk(t);else if(i!==t){if(i){ff(i,this);const s=this._cachedMeta;Us(s),s._parsed=[]}t&&Object.isExtensible(t)&&By(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=Af(t.vScale,t),t.stack!==i.stack&&(s=!0,Us(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Pf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{_t(s[e])?d=this.parseArrayData(i,s,e,t):Ke(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const m=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(m()&&(a=!1),u=c);i._sorted=a}o&&Pf(this,d)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,c=new Array(s);let d,m,h;for(d=0,m=s;d<m;++d)h=d+i,c[d]={[r]:f||l.parse(u[h],h),[a]:o.parse(t[h],h)};return c}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,c;for(a=0,u=s;a<u;++a)f=a+i,c=t[f],r[a]={x:l.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,s){const{xScale:l,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(s);let f,c,d,m;for(f=0,c=s;f<c;++f)d=f+i,m=t[d],u[f]={x:l.parse(Ti(m,r),d),y:o.parse(Ti(m,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,l=this._cachedMeta,o=t[e.axis],r={keys:ib(s,!0),values:t._stacks[e.axis]};return Ef(r,o,l.index,{mode:i})}updateRangeFromParsed(e,t,i,s){const l=i[t.axis];let o=l===null?NaN:l;const r=s&&i._stacks[t.axis];s&&r&&(s.values=r,o=Ef(s,l,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,s=i._parsed,l=i._sorted&&e===i.iScale,o=s.length,r=this._getOtherScale(e),a=Tk(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=kk(r);let d,m;function h(){m=s[d];const _=m[r.axis];return!Ct(m[e.axis])||f>_||c<_}for(d=0;d<o&&!(!h()&&(this.updateRangeFromParsed(u,e,m,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s<l;++s)o=t[s][e.axis],Ct(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,s=t.vScale,l=this.getParsed(e);return{label:i?""+i.getLabelForValue(l[i.axis]):"",value:s?""+s.getLabelForValue(l[s.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=bk(Xe(this.options.clip,gk(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],l=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,l,r,a),f=r;f<r+a;++f){const c=s[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,l))}for(f=0;f<o.length;++f)o[f].draw(e,l)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let l;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];l=o.$context||(o.$context=$k(this.getContext(),e,o)),l.parsed=this.getParsed(e),l.raw=s.data[e],l.index=l.dataIndex=e}else l=this.$context||(this.$context=Sk(this.chart.getContext(),this.index)),l.dataset=s,l.index=l.datasetIndex=this.index;return l.active=!!t,l.mode=i,l}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const s=t==="active",l=this._cachedDataOpts,o=e+"-"+t,r=l[o],a=this.enableOptionSharing&&Ln(i);if(r)return Lf(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),m=Object.keys(Qe.elements[e]),h=()=>this.getContext(i,s),_=u.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,l[o]=Object.freeze(Lf(_,a))),_}_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 nb(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||hr(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){hr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!hr(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<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Us(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Un.defaults={};Un.prototype.datasetElementType=null;Un.prototype.dataElementType=null;function Ck(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let i=[];for(let s=0,l=t.length;s<l;s++)i=i.concat(t[s].controller.getAllParsedValues(n));n._cache.$bar=Ng(i.sort((s,l)=>s-l))}return n._cache.$bar}function Mk(n){const e=n.iScale,t=Ck(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Ln(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s<l;++s)o=e.getPixelForValue(t[s]),a();for(r=void 0,s=0,l=e.ticks.length;s<l;++s)o=e.getPixelForTick(s),a();return i}function Dk(n,e,t,i){const s=t.barThickness;let l,o;return at(s)?(l=e.min*t.categoryPercentage,o=t.barPercentage):(l=s*i,o=1),{chunk:l/i,ratio:o,start:e.pixels[n]-l/2}}function Ok(n,e,t,i){const s=e.pixels,l=s[n];let o=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const a=t.categoryPercentage;o===null&&(o=l-(r===null?e.end-e.start:r-l)),r===null&&(r=l+l-o);const u=l-(l-Math.min(o,r))/2*a;return{chunk:Math.abs(r-o)/2*a/i,ratio:t.barPercentage,start:u}}function Ek(n,e,t,i){const s=t.parse(n[0],i),l=t.parse(n[1],i),o=Math.min(s,l),r=Math.max(s,l);let a=o,u=r;Math.abs(o)>Math.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function sb(n,e,t,i){return _t(n)?Ek(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Nf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(sb(d,c,l,u));return a}function _r(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ak(n,e,t){return n!==0?Gn(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Ik(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",l="start"):(s="start",l="end"),{start:t,end:i,reverse:e,top:s,bottom:l}}function Pk(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:r,reverse:a,top:u,bottom:f}=Ik(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Ff(f,o,r,a)]=!0,s=u)),l[Ff(s,o,r,a)]=!0,n.borderSkipped=l}function Ff(n,e,t,i){return i?(n=Lk(n,e,t),n=Rf(n,t,e)):n=Rf(n,e,t),n}function Lk(n,e,t){return n===e?t:n===t?e:n}function Rf(n,e,t){return n==="start"?e:n==="end"?t:n}function Nk(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Wa extends Un{parsePrimitiveData(e,t,i,s){return Nf(e,t,i,s)}parseArrayData(e,t,i,s){return Nf(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,c=[];let d,m,h,_;for(d=i,m=i+s;d<m;++d)_=t[d],h={},h[l.axis]=l.parse(Ti(_,u),d),c.push(sb(Ti(_,f),h,o,d));return c}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const l=i._custom;l&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,l.min),e.max=Math.max(e.max,l.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,l=this.getParsed(e),o=l._custom,r=_r(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s);for(let m=t;m<t+i;m++){const h=this.getParsed(m),_=l||at(h[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(m),v=this._calculateBarIndexPixels(m,f),k=(h._stacks||{})[r.axis],y={horizontal:u,base:_.base,enableBorderRadius:!k||_r(h._custom)||o===k._top||o===k._bottom,x:u?_.head:v.center,y:u?v.center:_.head,height:u?v.size:Math.abs(_.size),width:u?Math.abs(_.size):v.size};d&&(y.options=c||this.resolveDataElementOptions(m,e[m].active?"active":s));const $=y.options||e[m].options;Pk(y,$,k,o),Nk(y,$,f.ratio),this.updateElement(e[m],m,y,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(a=>a.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(at(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||Mk(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:l}}=this,o=s||0,r=this.getParsed(e),a=r._custom,u=_r(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,m,h;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&Gn(f)!==Gn(a.barEnd)&&(c=0),c+=f);const _=!at(s)&&!u?s:c;let v=t.getPixelForValue(_);if(this.chart.getDataVisibility(e)?m=t.getPixelForValue(c+d):m=v,h=m-v,Math.abs(h)<l){h=Ak(h,t,o)*l,f===o&&(v-=h/2);const k=t.getPixelForDecimal(0),y=t.getPixelForDecimal(1),$=Math.min(k,y),T=Math.max(k,y);v=Math.max(Math.min(v,T),$),m=v+h}if(v===t.getPixelForValue(o)){const k=Gn(h)*t.getLineWidthForValue(o)/2;v+=k,h-=k}return{size:h,base:v,head:m,center:m+h/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=Xe(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?Ok(e,t,s,u):Dk(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Wa.id="bar";Wa.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Wa.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ya extends Un{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,i,s){const l=super.parsePrimitiveData(e,t,i,s);for(let o=0;o<l.length;o++)l[o]._custom=this.resolveDataElementOptions(o+i).radius;return l}parseArrayData(e,t,i,s){const l=super.parseArrayData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=Xe(r[2],this.resolveDataElementOptions(o+i).radius)}return l}parseObjectData(e,t,i,s){const l=super.parseObjectData(e,t,i,s);for(let o=0;o<l.length;o++){const r=t[i+o];l[o]._custom=Xe(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;d<t+i;d++){const m=e[d],h=!l&&this.getParsed(d),_={},v=_[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(h[f]),k=_[c]=l?r.getBasePixel():r.getPixelForValue(h[c]);_.skip=isNaN(v)||isNaN(k),u&&(_.options=a||this.resolveDataElementOptions(d,m.active?"active":s),l&&(_.options.radius=0)),this.updateElement(m,d,_,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=Xe(i&&i._custom,l),s}}Ya.id="bubble";Ya.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ya.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Fk(n,e,t){let i=1,s=1,l=0,o=0;if(e<dt){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),m=($,T,M)=>ml($,r,a,!0)?1:Math.max(T,T*t,M,M*t),h=($,T,M)=>ml($,r,a,!0)?-1:Math.min(T,T*t,M,M*t),_=m(0,u,c),v=m(kt,f,d),k=h($t,u,c),y=h($t+kt,f,d);i=(_-k)/2,s=(v-y)/2,l=-(_+k)/2,o=-(v+y)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Al extends Un{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(Ke(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ti(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Vn(this.options.rotation-90)}_getCircumference(){return Vn(this.options.circumference)}_getRotationExtents(){let e=dt,t=-dt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,l=s._getRotation(),o=s._getCircumference();e=Math.min(e,l),t=Math.max(t,l+o)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,s=this._cachedMeta,l=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(l)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-o)/2,0),a=Math.min(Oy(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:m,offsetX:h,offsetY:_}=Fk(c,f,a),v=(i.width-o)/d,k=(i.height-o)/m,y=Math.max(Math.min(v,k)/2,0),$=Eg(this.options.radius,y),T=Math.max($*a,0),M=($-T)/this._getVisibleDatasetWeightTotal();this.offsetX=h*$,this.offsetY=_*$,s.total=this.calculateTotal(),this.outerRadius=$-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/dt)}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,r=o.chartArea,u=o.options.animation,f=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=l&&u.animateScale,m=d?0:this.innerRadius,h=d?0:this.outerRadius,{sharedOptions:_,includeOptions:v}=this._getSharedOptions(t,s);let k=this._getRotation(),y;for(y=0;y<t;++y)k+=this._circumference(y,l);for(y=t;y<t+i;++y){const $=this._circumference(y,l),T=e[y],M={x:f+this.offsetX,y:c+this.offsetY,startAngle:k,endAngle:k+$,circumference:$,outerRadius:h,innerRadius:m};v&&(M.options=_||this.resolveDataElementOptions(y,T.active?"active":s)),k+=$,this.updateElement(T,y,M,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?dt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;s<l;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),e=o.data,r=o.controller;break}}if(!e)return 0;for(s=0,l=e.length;s<l;++s)a=r.resolveDataElementOptions(s),a.borderAlign!=="inner"&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,s=e.length;i<s;++i){const l=this.resolveDataElementOptions(i);t=Math.max(t,l.offset||0,l.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(Xe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Al.id="doughnut";Al.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};Al.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Al.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return _t(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Ko extends Un{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=qg(t,s,o);this._drawStart=r,this._drawCount=a,jg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,m=r.axis,{spanGaps:h,segment:_}=this.options,v=Ms(h)?h:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let y=t>0&&this.getParsed(t-1);for(let $=t;$<t+i;++$){const T=e[$],M=this.getParsed($),C=k?T:{},O=at(M[m]),A=C[d]=o.getPixelForValue(M[d],$),I=C[m]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[m],$);C.skip=isNaN(A)||isNaN(I)||O,C.stop=$>0&&Math.abs(M[d]-y[d])>v,_&&(C.parsed=M,C.raw=u.data[$]),c&&(C.options=f||this.resolveDataElementOptions($,T.active?"active":s)),k||this.updateElement(T,$,C,s),y=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ko.id="line";Ko.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ko.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ka extends Un{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=El(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Gg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(l<t.min&&(t.min=l),l>t.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*$t;let m=d,h;const _=360/this.countVisibleElements();for(h=0;h<t;++h)m+=this._computeAngle(h,s,_);for(h=t;h<t+i;h++){const v=e[h];let k=m,y=m+this._computeAngle(h,s,_),$=o.getDataVisibility(h)?u.getDistanceFromCenterForValue(this.getParsed(h).r):0;m=y,l&&(a.animateScale&&($=0),a.animateRotate&&(k=y=d));const T={x:f,y:c,innerRadius:0,outerRadius:$,startAngle:k,endAngle:y,options:this.resolveDataElementOptions(h,v.active?"active":s)};this.updateElement(v,h,T,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Vn(this.resolveDataElementOptions(e,t).angle||i):0}}Ka.id="polarArea";Ka.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ka.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class lb extends Al{}lb.id="pie";lb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ja extends Un{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return Gg.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r<t+i;r++){const a=e[r],u=this.resolveDataElementOptions(r,a.active?"active":s),f=l.getPointPositionForValue(r,this.getParsed(r).r),c=o?l.xCenter:f.x,d=o?l.yCenter:f.y,m={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,m,s)}}}Ja.id="radar";Ja.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Ja.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};let ci=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Ms(this.x)&&Ms(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}};ci.defaults={};ci.defaultRoutes=void 0;const ob={values(n){return _t(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=Rk(n,t)}const o=En(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),El(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(En(n)));return i===1||i===2||i===5?ob.numeric.call(this,n,e,t):""}};function Rk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Jo={formatters:ob};Qe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Jo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});Qe.route("scale.ticks","color","","color");Qe.route("scale.grid","color","","borderColor");Qe.route("scale.grid","borderColor","","borderColor");Qe.route("scale.title","color","","color");Qe.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});Qe.describe("scales",{_fallback:"scale"});Qe.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function qk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||jk(n),s=t.major.enabled?Vk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return zk(e,a,s,l/i),a;const u=Hk(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Gl(e,a,u,at(d)?0:o-d,o),f=0,c=l-1;f<c;f++)Gl(e,a,u,s[f],s[f+1]);return Gl(e,a,u,r,at(d)?e.length:r+d),a}return Gl(e,a,u),a}function jk(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),s=n._maxLength/t;return Math.floor(Math.min(i,s))}function Hk(n,e,t){const i=Bk(n),s=e.length/t;if(!i)return Math.max(s,1);const l=Ry(i);for(let o=0,r=l.length-1;o<r;o++){const a=l[o];if(a>s)return a}return Math.max(s,1)}function Vk(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function zk(n,e,t,i){let s=0,l=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===l&&(e.push(n[o]),s++,l=t[s*i])}function Gl(n,e,t,i,s){const l=Xe(i,0),o=Math.min(Xe(s,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),s&&(a=s-i,t=a/Math.floor(a/t)),f=l;f<0;)r++,f=Math.round(l+r*t);for(u=Math.max(l,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(l+r*t))}function Bk(n){const e=n.length;let t,i;if(e<2)return!1;for(i=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==i)return!1;return i}const Uk=n=>n==="left"?"right":n==="right"?"left":n,qf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function jf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;l<s;l+=i)t.push(n[Math.floor(l)]);return t}function Wk(n,e,t){const i=n.ticks.length,s=Math.min(e,i-1),l=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(s),u;if(!(t&&(i===1?u=Math.max(a-l,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(s-1))/2,a+=s<e?u:-u,a<l-r||a>o+r)))return a}function Yk(n,e){ut(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;l<s;++l)delete t.data[i[l]];i.splice(0,s)}})}function Ws(n){return n.drawTicks?n.tickLength:0}function Hf(n,e){if(!n.display)return 0;const t=vn(n.font,e),i=Nn(n.padding);return(_t(n.text)?n.text.length:1)*t.lineHeight+i.height}function Kk(n,e){return Oi(n,{scale:e,type:"scale"})}function Jk(n,e,t){return Oi(n,{tick:t,index:e,type:"tick"})}function Zk(n,e,t){let i=Wy(n);return(t&&e!=="right"||!t&&e==="right")&&(i=Uk(i)),i}function Gk(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,m,h;const _=o-s,v=r-l;if(n.isHorizontal()){if(m=cf(i,l,r),Ke(t)){const k=Object.keys(t)[0],y=t[k];h=f[k].getPixelForValue(y)+_-e}else t==="center"?h=(u.bottom+u.top)/2+_-e:h=qf(n,t,e);d=r-l}else{if(Ke(t)){const k=Object.keys(t)[0],y=t[k];m=f[k].getPixelForValue(y)-v+e}else t==="center"?m=(u.left+u.right)/2-v+e:m=qf(n,t,e);h=cf(i,o,s),c=t==="left"?-kt:kt}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class ns extends ci{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Cn(e,Number.POSITIVE_INFINITY),t=Cn(t,Number.NEGATIVE_INFINITY),i=Cn(i,Number.POSITIVE_INFINITY),s=Cn(s,Number.NEGATIVE_INFINITY),{min:Cn(e,i),max:Cn(t,s),minDefined:Ct(e),maxDefined:Ct(t)}}getMinMax(e){let{min:t,max:i,minDefined:s,maxDefined:l}=this.getUserBounds(),o;if(s&&l)return{min:t,max:i};const r=this.getMatchingVisibleMetas();for(let a=0,u=r.length;a<u;++a)o=r[a].controller.getMinMax(this,e),s||(t=Math.min(t,o.min)),l||(i=Math.max(i,o.max));return t=l&&t>i?i:t,i=s&&t>i?t:i,{min:Cn(t,Cn(i,t)),max:Cn(i,Cn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){yt(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=C2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?jf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=qk(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){yt(this.options.afterUpdate,[this])}beforeSetDimensions(){yt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){yt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),yt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){yt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,s,l;for(i=0,s=e.length;i<s;i++)l=e[i],l.label=yt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){yt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){yt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,l=t.maxRotation;let o=s,r,a,u;if(!this._isVisible()||!t.display||s>=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Yt(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Ws(e.grid)-t.padding-Hf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Pa(Math.min(Math.asin(Yt((f.highest.height+6)/r,-1,1)),Math.asin(Yt(a/u,-1,1))-Math.asin(Yt(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){yt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){yt(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=Hf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ws(l)+a):(e.height=this.maxHeight,e.width=Ws(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Vn(this.labelRotation),_=Math.cos(h),v=Math.sin(h);if(r){const k=i.mirror?0:v*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:_*c.width+v*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,v,_)}}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(){yt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)at(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=jf(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:s}=this,l=[],o=[];let r=0,a=0,u,f,c,d,m,h,_,v,k,y,$;for(u=0;u<t;++u){if(d=e[u].label,m=this._resolveTickFontOptions(u),i.font=h=m.string,_=s[h]=s[h]||{data:{},gc:[]},v=m.lineHeight,k=y=0,!at(d)&&!_t(d))k=Co(i,_.data,_.gc,k,d),y=v;else if(_t(d))for(f=0,c=d.length;f<c;++f)$=d[f],!at($)&&!_t($)&&(k=Co(i,_.data,_.gc,k,$),y+=v);l.push(k),o.push(y),r=Math.max(k,r),a=Math.max(y,a)}Yk(s,t);const T=l.indexOf(r),M=o.indexOf(a),C=O=>({width:l[O]||0,height:o[O]||0});return{first:C(0),last:C(t-1),widest:C(T),highest:C(M),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Hy(this._alignToPixels?ji(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=Jk(this.getContext(),e,i))}return this.$context||(this.$context=Kk(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Vn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Ws(l),d=[],m=l.setContext(this.getContext()),h=m.drawBorder?m.borderWidth:0,_=h/2,v=function(x){return ji(i,x,h)};let k,y,$,T,M,C,O,A,I,L,N,F;if(o==="top")k=v(this.bottom),C=this.bottom-c,A=k-_,L=v(e.top)+_,F=e.bottom;else if(o==="bottom")k=v(this.top),L=e.top,F=v(e.bottom)-_,C=k+_,A=this.top+c;else if(o==="left")k=v(this.right),M=this.right-c,O=k-_,I=v(e.left)+_,N=e.right;else if(o==="right")k=v(this.left),I=e.left,N=v(e.right)-_,M=k+_,O=this.left+c;else if(t==="x"){if(o==="center")k=v((e.top+e.bottom)/2+.5);else if(Ke(o)){const x=Object.keys(o)[0],U=o[x];k=v(this.chart.scales[x].getPixelForValue(U))}L=e.top,F=e.bottom,C=k+_,A=C+c}else if(t==="y"){if(o==="center")k=v((e.left+e.right)/2);else if(Ke(o)){const x=Object.keys(o)[0],U=o[x];k=v(this.chart.scales[x].getPixelForValue(U))}M=k-_,O=M-c,I=e.left,N=e.right}const R=Xe(s.ticks.maxTicksLimit,f),K=Math.max(1,Math.ceil(f/R));for(y=0;y<f;y+=K){const x=l.setContext(this.getContext(y)),U=x.lineWidth,X=x.color,ne=x.borderDash||[],J=x.borderDashOffset,fe=x.tickWidth,Z=x.tickColor,de=x.tickBorderDash||[],ve=x.tickBorderDashOffset;$=Wk(this,y,r),$!==void 0&&(T=ji(i,$,U),a?M=O=I=N=T:C=A=L=F=T,d.push({tx1:M,ty1:C,tx2:O,ty2:A,x1:I,y1:L,x2:N,y2:F,width:U,color:X,borderDash:ne,borderDashOffset:J,tickWidth:fe,tickColor:Z,tickBorderDash:de,tickBorderDashOffset:ve}))}return this._ticksLength=f,this._borderValue=k,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:l}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=l,d=Ws(i.grid),m=d+f,h=c?-f:m,_=-Vn(this.labelRotation),v=[];let k,y,$,T,M,C,O,A,I,L,N,F,R="middle";if(s==="top")C=this.bottom-h,O=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+h,O=this._getXAxisLabelAlignment();else if(s==="left"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,M=x.x}else if(s==="right"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,M=x.x}else if(t==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(Ke(s)){const x=Object.keys(s)[0],U=s[x];C=this.chart.scales[x].getPixelForValue(U)+m}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-m;else if(Ke(s)){const x=Object.keys(s)[0],U=s[x];M=this.chart.scales[x].getPixelForValue(U)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?R="top":a==="end"&&(R="bottom"));const K=this._getLabelSizes();for(k=0,y=r.length;k<y;++k){$=r[k],T=$.label;const x=l.setContext(this.getContext(k));A=this.getPixelForTick(k)+l.labelOffset,I=this._resolveTickFontOptions(k),L=I.lineHeight,N=_t(T)?T.length:1;const U=N/2,X=x.color,ne=x.textStrokeColor,J=x.textStrokeWidth;let fe=O;o?(M=A,O==="inner"&&(k===y-1?fe=this.options.reverse?"left":"right":k===0?fe=this.options.reverse?"right":"left":fe="center"),s==="top"?u==="near"||_!==0?F=-N*L+L/2:u==="center"?F=-K.highest.height/2-U*L+L:F=-K.highest.height+L/2:u==="near"||_!==0?F=L/2:u==="center"?F=K.highest.height/2-U*L:F=K.highest.height-N*L,c&&(F*=-1)):(C=A,F=(1-N)*L/2);let Z;if(x.showLabelBackdrop){const de=Nn(x.backdropPadding),ve=K.heights[k],Te=K.widths[k];let Ne=C+F-de.top,Re=M-de.left;switch(R){case"middle":Ne-=ve/2;break;case"bottom":Ne-=ve;break}switch(O){case"center":Re-=Te/2;break;case"right":Re-=Te;break}Z={left:Re,top:Ne,width:Te+de.width,height:ve+de.height,color:x.backdropColor}}v.push({rotation:_,label:T,font:I,color:X,strokeColor:ne,strokeWidth:J,textOffset:F,textAlign:fe,textBaseline:R,translation:[M,C],backdrop:Z})}return v}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Vn(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<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,c;this.isHorizontal()?(a=ji(e,this.left,l)-l/2,u=ji(e,this.right,o)+o/2,f=c=r):(f=ji(e,this.top,l)-l/2,c=ji(e,this.bottom,o)+o/2,a=u=r),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(a,f),t.lineTo(u,c),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&qa(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;Mo(i,f,0,c,u,a)}s&&ja(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=vn(i.font),o=Nn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||Ke(t)?(a+=o.bottom,_t(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=Gk(this,a,t,r);Mo(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:Zk(r,t,s),textBaseline:"middle",translation:[u,f]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=Xe(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ns.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l<o;++l){const r=t[l];r[i]===this.id&&(!e||r.type===e)&&s.push(r)}return s}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return vn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Xl{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;xk(t)&&(i=this.register(t));const s=this.items,l=e.id,o=this.scope+"."+l;if(!l)throw new Error("class does not have id: "+e);return l in s||(s[l]=e,Xk(e,o,i),this.override&&Qe.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,s=this.scope;i in t&&delete t[i],s&&i in Qe[s]&&(delete Qe[s][i],this.override&&delete xi[i])}}function Xk(n,e,t){const i=pl(Object.create(null),[t?Qe.get(t):{},Qe.get(e),n.defaults]);Qe.set(e,i),n.defaultRoutes&&Qk(e,n.defaultRoutes),n.descriptors&&Qe.describe(e,n.descriptors)}function Qk(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Qe.route(l,s,a,r)})}function xk(n){return"id"in n&&"defaults"in n}class ew{constructor(){this.controllers=new Xl(Un,"datasets",!0),this.elements=new Xl(ci,"elements"),this.plugins=new Xl(Object,"plugins"),this.scales=new Xl(ns,"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):ut(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Ia(e);yt(i["before"+s],[],i),t[e](i),yt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const s=t.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return s}}var Zn=new ew;class Za extends Un{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=qg(t,i,s);if(this._drawStart=l,this._drawCount=o,jg(t)&&(l=0,o=i.length),this.options.showLine){const{dataset:r,_dataset:a}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},e)}this.updateElements(i,l,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Zn.getElement("line")),super.addElements()}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),m=o.axis,h=r.axis,{spanGaps:_,segment:v}=this.options,k=Ms(_)?_:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){const M=e[T],C=this.getParsed(T),O=y?M:{},A=at(C[h]),I=O[m]=o.getPixelForValue(C[m],T),L=O[h]=l||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,C,a):C[h],T);O.skip=isNaN(I)||isNaN(L)||A,O.stop=T>0&&Math.abs(C[m]-$[m])>k,v&&(O.parsed=C,O.raw=u.data[T]),d&&(O.options=c||this.resolveDataElementOptions(T,M.active?"active":s)),y||this.updateElement(M,T,O,s),$=C}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Za.id="scatter";Za.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Za.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Hi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ta{constructor(e){this.options=e||{}}init(e){}formats(){return Hi()}parse(e,t){return Hi()}format(e,t){return Hi()}add(e,t,i){return Hi()}diff(e,t,i){return Hi()}startOf(e,t,i){return Hi()}endOf(e,t){return Hi()}}ta.override=function(n){Object.assign(ta.prototype,n)};var rb={_date:ta};function tw(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?Vy:Yi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Il(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r<a;++r){const{index:u,data:f}=l[r],{lo:c,hi:d}=tw(l[r],e,o,s);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function nw(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const l=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(l,2)+Math.pow(o,2))}}function gr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Il(n,t,e,function(r,a,u){!s&&!_l(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function iw(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=Pg(o,{x:e.x,y:e.y});ml(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Il(n,t,e,l),s}function sw(n,e,t,i,s,l){let o=[];const r=nw(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const m=f.inRange(e.x,e.y,s);if(i&&!m)return;const h=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(h))&&!m)return;const v=r(e,h);v<a?(o=[{element:f,datasetIndex:c,index:d}],a=v):v===a&&o.push({element:f,datasetIndex:c,index:d})}return Il(n,t,e,u),o}function br(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?iw(n,e,t,s):sw(n,e,t,i,s,l)}function Vf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Il(n,t,e,(a,u,f)=>{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 lw={evaluateInteractionItems:Il,modes:{index(n,e,t,i){const s=Bi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,s,l,i,o):br(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=Bi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,s,l,i,o):br(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;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const s=Bi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return gr(n,s,l,i,o)},nearest(n,e,t,i){const s=Bi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return br(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Bi(e,n);return Vf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Bi(e,n);return Vf(n,s,"y",t.intersect,i)}}};const ab=["left","top","right","bottom"];function Ys(n,e){return n.filter(t=>t.pos===e)}function zf(n,e){return n.filter(t=>ab.indexOf(t.pos)===-1&&t.box.axis===e)}function Ks(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function ow(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:l,options:{stack:o,stackWeight:r=1}}=s,e.push({index:t,box:s,pos:l,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&l+o,stackWeight:r});return e}function rw(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!ab.includes(s))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=l}return e}function aw(n,e){const t=rw(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=e;let l,o,r;for(l=0,o=n.length;l<o;++l){r=n[l];const{fullSize:a}=r.box,u=t[r.stack],f=u&&r.stackWeight/u.weight;r.horizontal?(r.width=f?f*i:a&&e.availableWidth,r.height=s):(r.width=i,r.height=f?f*s:a&&e.availableHeight)}return t}function uw(n){const e=ow(n),t=Ks(e.filter(u=>u.box.fullSize),!0),i=Ks(Ys(e,"left"),!0),s=Ks(Ys(e,"right")),l=Ks(Ys(e,"top"),!0),o=Ks(Ys(e,"bottom")),r=zf(e,"x"),a=zf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ys(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Bf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function ub(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function fw(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!Ke(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&ub(o,l.getPadding());const r=Math.max(0,e.outerWidth-Bf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Bf(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 cw(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 dw(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function xs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,dw(r.horizontal,e));const{same:c,other:d}=fw(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&xs(s,e,t,i)||f}function Ql(n,e,t,i,s){n.top=t,n.left=e,n.right=e+i,n.bottom=t+s,n.width=i,n.height=s}function Uf(n,e,t,i){const s=t.padding;let{x:l,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;Ln(u.start)&&(o=u.start),a.fullSize?Ql(a,s.left,o,t.outerWidth-s.right-s.left,d):Ql(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;Ln(u.start)&&(l=u.start),a.fullSize?Ql(a,l,s.top,d,t.outerHeight-s.bottom-s.top):Ql(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}Qe.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var xl={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,i){if(!n)return;const s=Nn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=uw(n.boxes),a=r.vertical,u=r.horizontal;ut(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,v)=>v.box.options&&v.box.options.display===!1?_:_+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);ub(d,Nn(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=aw(a.concat(u),c);xs(r.fullSize,m,c,h),xs(a,m,c,h),xs(u,m,c,h)&&xs(a,m,c,h),cw(m),Uf(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Uf(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},ut(r.chartArea,_=>{const v=_.box;Object.assign(v,n.chartArea),v.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class fb{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 pw extends fb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",mw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Wf=n=>n===null||n==="";function hw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={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",Wf(s)){const l=Sf(n,"width");l!==void 0&&(n.width=l)}if(Wf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Sf(n,"height");l!==void 0&&(n.height=l)}return n}const cb=Z2?{passive:!0}:!1;function _w(n,e,t){n.addEventListener(e,t,cb)}function gw(n,e,t){n.canvas.removeEventListener(e,t,cb)}function bw(n,e){const t=mw[n.type]||n.type,{x:i,y:s}=Bi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Eo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function vw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.addedNodes,i),o=o&&!Eo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function yw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.removedNodes,i),o=o&&!Eo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const gl=new Map;let Yf=0;function db(){const n=window.devicePixelRatio;n!==Yf&&(Yf=n,gl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function kw(n,e){gl.size||window.addEventListener("resize",db),gl.set(n,e)}function ww(n){gl.delete(n),gl.size||window.removeEventListener("resize",db)}function Sw(n,e,t){const i=n.canvas,s=i&&Ua(i);if(!s)return;const l=Rg((r,a)=>{const u=s.clientWidth;t(r,a),u<s.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),kw(n,l),o}function vr(n,e,t){t&&t.disconnect(),e==="resize"&&ww(n)}function $w(n,e,t){const i=n.canvas,s=Rg(l=>{n.ctx!==null&&t(bw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return _w(i,e,s),s}class Tw extends fb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(hw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];at(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[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:vw,detach:yw,resize:Sw}[t]||$w;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:vr,detach:vr,resize:vr}[t]||gw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return J2(e,t,i,s)}isAttached(e){const t=Ua(e);return!!(t&&t.isConnected)}}function Cw(n){return!Qg()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?pw:Tw}class Mw{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(yt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){at(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=Xe(i.options&&i.options.plugins,{}),l=Dw(i);return s===!1&&!t?[]:Ew(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function Dw(n){const e={},t=[],i=Object.keys(Zn.plugins.items);for(let l=0;l<i.length;l++)t.push(Zn.getPlugin(i[l]));const s=n.plugins||[];for(let l=0;l<s.length;l++){const o=s[l];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function Ow(n,e){return!e&&n===!1?null:n===!0?{}:n}function Ew(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=Ow(i[a],s);u!==null&&l.push({plugin:r,options:Aw(n.config,{plugin:r,local:t[a]},u,o)})}return l}function Aw(n,{plugin:e,local:t},i,s){const l=n.pluginScopeKeys(e),o=n.getOptionScopes(i,l);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function na(n,e){const t=Qe.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Iw(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function Pw(n,e){return n===e?"_index_":"_value_"}function Lw(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ia(n,e){return n==="x"||n==="y"?n:e.axis||Lw(e.position)||n.charAt(0).toLowerCase()}function Nw(n,e){const t=xi[n.type]||{scales:{}},i=e.scales||{},s=na(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!Ke(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=ia(r,a),f=Pw(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=nl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||na(a,e),c=(xi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const m=Iw(d,u),h=r[m+"AxisID"]||l[m]||m;o[h]=o[h]||Object.create(null),nl(o[h],[{axis:m},i[h],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];nl(a,[Qe.scales[a.type],Qe.scale])}),o}function pb(n){const e=n.options||(n.options={});e.plugins=Xe(e.plugins,{}),e.scales=Nw(n,e)}function mb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Fw(n){return n=n||{},n.data=mb(n.data),pb(n),n}const Kf=new Map,hb=new Set;function eo(n,e){let t=Kf.get(n);return t||(t=e(),Kf.set(n,t),hb.add(t)),t}const Js=(n,e,t)=>{const i=Ti(e,t);i!==void 0&&n.add(i)};class Rw{constructor(e){this._config=Fw(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=mb(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(),pb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return eo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return eo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return eo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return eo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Js(a,e,c))),f.forEach(c=>Js(a,s,c)),f.forEach(c=>Js(a,xi[l]||{},c)),f.forEach(c=>Js(a,Qe,c)),f.forEach(c=>Js(a,xr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),hb.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,xi[t]||{},Qe.datasets[t]||{},{type:t},Qe,xr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Jf(this._resolverCache,e,s);let a=o;if(jw(o,t)){l.$shared=!1,i=Ci(i)?i():i;const u=this.createResolver(e,i,r);a=Ds(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Jf(this._resolverCache,e,i);return Ke(t)?Ds(l,t,void 0,s):l}}function Jf(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:Va(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const qw=n=>Ke(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ci(n[t]),!1);function jw(n,e){const{isScriptable:t,isIndexable:i}=Yg(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ci(r)||qw(r))||o&&_t(r))return!0}return!1}var Hw="3.9.1";const Vw=["top","bottom","left","right","chartArea"];function Zf(n,e){return n==="top"||n==="bottom"||Vw.indexOf(n)===-1&&e==="x"}function Gf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Xf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),yt(t&&t.onComplete,[n],e)}function zw(n){const e=n.chart,t=e.options.animation;yt(t&&t.onProgress,[n],e)}function _b(n){return Qg()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ao={},gb=n=>{const e=_b(n);return Object.values(Ao).filter(t=>t.canvas===e).pop()};function Bw(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 Uw(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Io{constructor(e,t){const i=this.config=new Rw(t),s=_b(e),l=gb(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||Cw(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=Dy(),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 Mw,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Uy(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Ao[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ii.listen(this,"complete",Xf),ii.listen(this,"progress",zw),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return at(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vf(this.canvas,this.ctx),this}stop(){return ii.stop(this),this}resize(e,t){ii.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,wf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),yt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ut(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=ia(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),ut(l,o=>{const r=o.options,a=r.id,u=ia(a,r),f=Xe(r.type,o.dtype);(r.position===void 0||Zf(r.position,u)!==Zf(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=Zn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ut(s,(o,r)=>{o||delete i[r]}),ut(i,o=>{xl.configure(this,o,o.options),xl.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;s<i;++s)this._destroyDatasetMeta(s);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(Gf("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.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<s;i++){const l=t[i];let o=this.getDatasetMeta(i);const r=l.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=l.indexAxis||na(r,this.options),o.order=l.order||0,o.index=i,o.label=""+l.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=Zn.getController(r),{datasetElementType:u,dataElementType:f}=Qe.datasets[r];Object.assign(a.prototype,{dataElementType:Zn.getElement(f),datasetElementType:u&&Zn.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ut(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),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<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!s&&l.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||ut(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Gf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ut(this.scales,e=>{xl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!of(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;Bw(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;l<t;l++)if(!of(s,i(l)))return;return Array.from(s).map(l=>l.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ut(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<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,Ci(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ii.has(this)?this.attached&&!ii.running(this)&&ii.start(this):(this.draw(),Xf({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&qa(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&ja(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return _l(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=lw.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=Oi(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);Ln(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(),ii.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),vf(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Ao[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(l,o)=>{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};ut(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(){ut(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ut(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<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:l,index:o})=>{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!wo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=Ly(e),u=Uw(e,this._lastEvent,i,a);i&&(this._lastEvent=null,yt(l.onHover,[e,r,this],this),a&&yt(l.onClick,[e,r,this],this));const f=!wo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const Qf=()=>ut(Io.instances,n=>n._plugins.invalidate()),hi=!0;Object.defineProperties(Io,{defaults:{enumerable:hi,value:Qe},instances:{enumerable:hi,value:Ao},overrides:{enumerable:hi,value:xi},registry:{enumerable:hi,value:Zn},version:{enumerable:hi,value:Hw},getChart:{enumerable:hi,value:gb},register:{enumerable:hi,value:(...n)=>{Zn.add(...n),Qf()}},unregister:{enumerable:hi,value:(...n)=>{Zn.remove(...n),Qf()}}});function bb(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+kt,i-kt),n.closePath(),n.clip()}function Ww(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Yw(n,e,t,i){const s=Ww(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return Yt(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Yt(s.innerStart,0,o),innerEnd:Yt(s.innerEnd,0,o)}}function ms(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function sa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let m=0;const h=s-a;if(i){const x=f>0?f-i:0,U=c>0?c-i:0,X=(x+U)/2,ne=X!==0?h*X/(X+i):h;m=(h-ne)/2}const _=Math.max(.001,h*c-t/$t)/c,v=(h-_)/2,k=a+v+m,y=s-v-m,{outerStart:$,outerEnd:T,innerStart:M,innerEnd:C}=Yw(e,d,c,y-k),O=c-$,A=c-T,I=k+$/O,L=y-T/A,N=d+M,F=d+C,R=k+M/N,K=y-C/F;if(n.beginPath(),l){if(n.arc(o,r,c,I,L),T>0){const X=ms(A,L,o,r);n.arc(X.x,X.y,T,L,y+kt)}const x=ms(F,y,o,r);if(n.lineTo(x.x,x.y),C>0){const X=ms(F,K,o,r);n.arc(X.x,X.y,C,y+kt,K+Math.PI)}if(n.arc(o,r,d,y-C/d,k+M/d,!0),M>0){const X=ms(N,R,o,r);n.arc(X.x,X.y,M,R+Math.PI,k-kt)}const U=ms(O,k,o,r);if(n.lineTo(U.x,U.y),$>0){const X=ms(O,I,o,r);n.arc(X.x,X.y,$,k-kt,I)}}else{n.moveTo(o,r);const x=Math.cos(I)*c+o,U=Math.sin(I)*c+r;n.lineTo(x,U);const X=Math.cos(L)*c+o,ne=Math.sin(L)*c+r;n.lineTo(X,ne)}n.closePath()}function Kw(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){sa(n,e,t,i,o+dt,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%dt,r%dt===0&&(a+=dt))}return sa(n,e,t,i,a,s),n.fill(),a}function Jw(n,e,t){const{x:i,y:s,startAngle:l,pixelMargin:o,fullCircles:r}=e,a=Math.max(e.outerRadius-o,0),u=e.innerRadius+o;let f;for(t&&bb(n,e,l+dt),n.beginPath(),n.arc(i,s,u,l+dt,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+dt),f=0;f<r;++f)n.stroke()}function Zw(n,e,t,i,s,l){const{options:o}=e,{borderWidth:r,borderJoinStyle:a}=o,u=o.borderAlign==="inner";r&&(u?(n.lineWidth=r*2,n.lineJoin=a||"round"):(n.lineWidth=r,n.lineJoin=a||"bevel"),e.fullCircles&&Jw(n,e,u),u&&bb(n,e,s),sa(n,e,t,i,s,l),n.stroke())}class Ga extends ci{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:l,distance:o}=Pg(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,h=Xe(c,a-r)>=dt||ml(l,r,a),_=hl(o,u+d,f+d);return h&&_}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>dt?Math.floor(i/dt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=$t&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=Kw(e,this,r,l,o);Zw(e,this,r,l,a,o),e.restore()}}Ga.id="arc";Ga.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ga.defaultRoutes={backgroundColor:"backgroundColor"};function vb(n,e,t=e){n.lineCap=Xe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Xe(t.borderDash,e.borderDash)),n.lineDashOffset=Xe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Xe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Xe(t.borderWidth,e.borderWidth),n.strokeStyle=Xe(t.borderColor,e.borderColor)}function Gw(n,e,t){n.lineTo(t.x,t.y)}function Xw(n){return n.stepped?b2:n.tension||n.cubicInterpolationMode==="monotone"?v2:Gw}function yb(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=s<o&&l<o||s>r&&l>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function Qw(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=yb(s,t,i),f=Xw(l);let{move:c=!0,reverse:d}=i||{},m,h,_;for(m=0;m<=u;++m)h=s[(r+(d?u-m:m))%o],!h.skip&&(c?(n.moveTo(h.x,h.y),c=!1):f(n,_,h,d,l.stepped),_=h);return a&&(h=s[(r+(d?u:0))%o],f(n,_,h,d,l.stepped)),!!a}function xw(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=yb(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,_,v,k;const y=T=>(o+(u?r-T:T))%l,$=()=>{_!==v&&(n.lineTo(f,v),n.lineTo(f,_),n.lineTo(f,k))};for(a&&(m=s[y(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=s[y(d)],m.skip)continue;const T=m.x,M=m.y,C=T|0;C===h?(M<_?_=M:M>v&&(v=M),f=(c*f+T)/++c):($(),n.lineTo(T,M),h=C,c=0,_=v=M),k=M}$()}function la(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?xw:Qw}function eS(n){return n.stepped?G2:n.tension||n.cubicInterpolationMode==="monotone"?X2:Ui}function tS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),vb(n,e.options),n.stroke(s)}function nS(n,e,t,i){const{segments:s,options:l}=e,o=la(e);for(const r of s)vb(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const iS=typeof Path2D=="function";function sS(n,e,t,i){iS&&!e.options.segment?tS(n,e,t,i):nS(n,e,t,i)}class Ei extends ci{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;z2(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=ok(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=tb(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=eS(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],m=l[c],h=l[d];if(m===h){r.push(m);continue}const _=Math.abs((s-m[t])/(h[t]-m[t])),v=a(m,h,_,i.stepped);v[t]=e[t],r.push(v)}return r.length===1?r[0]:r}pathSegment(e,t,i){return la(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=la(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of s)o&=l(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,s){const l=this.options||{};(this.points||[]).length&&l.borderWidth&&(e.save(),sS(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ei.id="line";Ei.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Ei.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Ei.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function xf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Zo extends ci{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:l,y:o}=this.getProps(["x","y"],i);return Math.pow(e-l,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return xf(this,e,"x",t)}inYRange(e,t){return xf(this,e,"y",t)}getCenterPoint(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}size(e){e=e||this.options||{};let t=e.radius||0;t=Math.max(t,t&&e.hoverRadius||0);const i=t&&e.borderWidth||0;return(t+i)*2}draw(e,t){const i=this.options;this.skip||i.radius<.1||!_l(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,ea(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Zo.id="point";Zo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Zo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function kb(n,e){const{x:t,y:i,base:s,width:l,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-c,f=i+c):(c=l/2,r=t-c,a=t+c,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function vi(n,e,t,i){return n?0:Yt(e,t,i)}function lS(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=Wg(i);return{t:vi(s.top,l.top,0,t),r:vi(s.right,l.right,0,e),b:vi(s.bottom,l.bottom,0,t),l:vi(s.left,l.left,0,e)}}function oS(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=ys(s),o=Math.min(e,t),r=n.borderSkipped,a=i||Ke(s);return{topLeft:vi(!a||r.top||r.left,l.topLeft,0,o),topRight:vi(!a||r.top||r.right,l.topRight,0,o),bottomLeft:vi(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:vi(!a||r.bottom||r.right,l.bottomRight,0,o)}}function rS(n){const e=kb(n),t=e.right-e.left,i=e.bottom-e.top,s=lS(n,t/2,i/2),l=oS(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:l},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,l.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,l.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,l.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,l.bottomRight-Math.max(s.b,s.r))}}}}function yr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&kb(n,i);return r&&(s||hl(e,r.left,r.right))&&(l||hl(t,r.top,r.bottom))}function aS(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function uS(n,e){n.rect(e.x,e.y,e.w,e.h)}function kr(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,l=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+l,h:n.h+o,radius:n.radius}}class Xa extends ci{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:l,outer:o}=rS(this),r=aS(o.radius)?Do:uS;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,kr(o,t,l)),e.clip(),r(e,kr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,kr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return yr(this,e,t,i)}inXRange(e,t){return yr(this,e,null,t)}inYRange(e,t){return yr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:l}=this.getProps(["x","y","base","horizontal"],e);return{x:l?(t+s)/2:t,y:l?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Xa.id="bar";Xa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Xa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function fS(n,e,t){const i=n.segments,s=n.points,l=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Qa(a,u,s);const f=oa(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const c=tb(e,f);for(const d of c){const m=oa(t,l[d.start],l[d.end],d.loop),h=eb(r,s,m);for(const _ of h)o.push({source:_,target:d,start:{[t]:ec(f,m,"start",Math.max)},end:{[t]:ec(f,m,"end",Math.min)}})}}return o}function oa(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=bn(s),l=bn(l)),{property:n,start:s,end:l}}function cS(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Qa(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 Qa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function ec(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function wb(n,e){let t=[],i=!1;return _t(n)?(i=!0,t=n):t=cS(n,e),t.length?new Ei({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function tc(n){return n&&n.fill!==!1}function dS(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(!Ct(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function pS(n,e,t){const i=gS(n);if(Ke(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Ct(s)&&Math.floor(s)===s?mS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function mS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function hS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:Ke(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function _S(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:Ke(n)?i=n.value:i=e.getBaseValue(),i}function gS(n){const e=n.options,t=e.fill;let i=Xe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function bS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=vS(e,t);r.push(wb({x:null,y:e.bottom},i));for(let a=0;a<l.length;a++){const u=l[a];for(let f=u.start;f<=u.end;f++)yS(s,o[f],r)}return new Ei({points:s,options:{}})}function vS(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const l=i[s];if(l.index===e)break;l.hidden||t.unshift(l.dataset)}return t}function yS(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=kS(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function kS(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],l=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<l.length;u++){const f=l[u],c=o[f.start][t],d=o[f.end][t];if(hl(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class Sb{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:s,y:l,radius:o}=this;return t=t||{start:0,end:dt},e.arc(s,l,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:s}=this,l=e.angle;return{x:t+Math.cos(l)*s,y:i+Math.sin(l)*s,angle:l}}}function wS(n){const{chart:e,fill:t,line:i}=n;if(Ct(t))return SS(e,t);if(t==="stack")return bS(n);if(t==="shape")return!0;const s=$S(n);return s instanceof Sb?s:wb(s,i)}function SS(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function $S(n){return(n.scale||{}).getPointPositionForValue?CS(n):TS(n)}function TS(n){const{scale:e={},fill:t}=n,i=hS(t,e);if(Ct(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function CS(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=_S(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new Sb({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<s;++a)r.push(e.getPointPositionForValue(a,o));return r}function wr(n,e,t){const i=wS(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&s.points.length&&(qa(n,t),MS(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),ja(n))}function MS(n,e){const{line:t,target:i,above:s,below:l,area:o,scale:r}=e,a=t._loop?"angle":e.axis;n.save(),a==="x"&&l!==s&&(nc(n,i,o.top),ic(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),nc(n,i,o.bottom)),ic(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function nc(n,e,t){const{segments:i,points:s}=e;let l=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=s[a],c=s[Qa(a,u,s)];l?(n.moveTo(f.x,f.y),l=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function ic(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=fS(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,m=i!==!0;n.save(),n.fillStyle=d,DS(n,o,m&&oa(s,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let _;if(m){h?n.closePath():sc(n,i,c,s);const v=!!i.pathSegment(n,u,{move:h,reverse:!0});_=h&&v,_||sc(n,i,f,s)}n.closePath(),n.fill(_?"evenodd":"nonzero"),n.restore()}}function DS(n,e,t){const{top:i,bottom:s}=e.chart.chartArea,{property:l,start:o,end:r}=t||{};l==="x"&&(n.beginPath(),n.rect(o,i,r-o,s-i),n.clip())}function sc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var OS={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,s=[];let l,o,r,a;for(o=0;o<i;++o)l=n.getDatasetMeta(o),r=l.dataset,a=null,r&&r.options&&r instanceof Ei&&(a={visible:n.isDatasetVisible(o),index:o,fill:pS(r,o,i),chart:n,axis:l.controller.options.indexAxis,scale:l.vScale,line:r}),l.$filler=a,s.push(a);for(o=0;o<i;++o)a=s[o],!(!a||a.fill===!1)&&(a.fill=dS(s,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),l=n.chartArea;for(let o=s.length-1;o>=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&wr(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;tc(l)&&wr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!tc(i)||t.drawTime!=="beforeDatasetDraw"||wr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ol={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e<t;++e){const o=n[e].element;if(o&&o.hasValue()){const r=o.tooltipPosition();i+=r.x,s+=r.y,++l}}return{x:i/l,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<o;++l){const a=n[l].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Xr(e,u);f<s&&(s=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function Kn(n,e){return e&&(_t(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function si(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function ES(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 lc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=vn(e.bodyFont),u=vn(e.titleFont),f=vn(e.footerFont),c=l.length,d=s.length,m=i.length,h=Nn(e.padding);let _=h.height,v=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const $=function(T){v=Math.max(v,t.measureText(T).width+y)};return t.save(),t.font=u.string,ut(n.title,$),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),$),y=e.displayColors?o+2+e.boxPadding:0,ut(i,T=>{ut(T.before,$),ut(T.lines,$),ut(T.after,$)}),y=0,t.font=f.string,ut(n.footer,$),t.restore(),v+=h.width,{width:v,height:_}}function AS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function IS(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 PS(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"),IS(u,n,e,t)&&(u="center"),u}function oc(n,e,t){const i=t.yAlign||e.yAlign||AS(n,t);return{xAlign:t.xAlign||e.xAlign||PS(n,e,t,i),yAlign:i}}function LS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function NS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function rc(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}=ys(o);let h=LS(e,r);const _=NS(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:Yt(h,0,i.width-e.width),y:Yt(_,0,i.height-e.height)}}function to(n,e,t){const i=Nn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return Kn([],si(n))}function FS(n,e,t){return Oi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function uc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ra extends ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new nb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=FS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(o)),r}getBeforeBody(e,t){return ac(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=uc(i,l);Kn(o.before,si(r.beforeLabel.call(this,l))),Kn(o.lines,r.label.call(this,l)),Kn(o.after,si(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return ac(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=Kn(r,si(s)),r=Kn(r,si(l)),r=Kn(r,si(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;a<u;++a)r.push(ES(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ut(r,f=>{const c=uc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ol[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=lc(this,i),u=Object.assign({},r,a),f=oc(this.chart,i,u),c=rc(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}=ys(r),{x:d,y:m}=e,{width:h,height:_}=t;let v,k,y,$,T,M;return l==="center"?(T=m+_/2,s==="left"?(v=d,k=v-o,$=T+o,M=T-o):(v=d+h,k=v+o,$=T-o,M=T+o),y=v):(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,v=k-o,y=k+o):($=m+_,T=$+o,v=k+o,y=k-o),M=$),{x1:v,x2:k,x3:y,y1:$,y2:T,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=pr(i.rtl,this.x,this.width);for(e.x=to(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=vn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<l;++a)t.fillText(s[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===l&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,s,l){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u,boxPadding:f}=l,c=vn(l.bodyFont),d=to(this,"left",l),m=s.x(d),h=a<c.lineHeight?(c.lineHeight-a)/2:0,_=t.y+h;if(l.usePointStyle){const v={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},k=s.leftForLtr(m,u)+u/2,y=_+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,ea(e,v,k,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,ea(e,v,k,y)}else{e.lineWidth=Ke(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const v=s.leftForLtr(m,u-f),k=s.leftForLtr(s.xPlus(m,1),u-f-2),y=ys(o.borderRadius);Object.values(y).some($=>$!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:v,y:_,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:k,y:_+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(v,_,u,a),e.strokeRect(v,_,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,_+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=vn(i.bodyFont);let d=c.lineHeight,m=0;const h=pr(i.rtl,this.x,this.width),_=function(A){t.fillText(A,h.x(e.x+m),e.y+d/2),e.y+=d+l},v=h.textAlign(o);let k,y,$,T,M,C,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,v,i),t.fillStyle=i.bodyColor,ut(this.beforeBody,_),m=r&&v!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,C=s.length;T<C;++T){for(k=s[T],y=this.labelTextColors[T],t.fillStyle=y,ut(k.before,_),$=k.lines,r&&$.length&&(this._drawColorBox(t,e,T,h,i),d=Math.max(c.lineHeight,a)),M=0,O=$.length;M<O;++M)_($[M]),d=c.lineHeight;ut(k.after,_)}m=0,d=c.lineHeight,ut(this.afterBody,_),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=pr(i.rtl,this.x,this.width);for(e.x=to(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=vn(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<l;++r)t.fillText(s[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:l,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:m,bottomRight:h}=ys(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-h),t.quadraticCurveTo(r+u,a+f,r+u-h,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+m,a+f),t.quadraticCurveTo(r,a+f,r,a+f-m),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ol[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=lc(this,e),a=Object.assign({},o,this._size),u=oc(t,e,a),f=rc(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=Nn(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),tk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),nk(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!wo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!wo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ol[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ra.positioners=ol;var RS={id:"tooltip",_element:ra,positioners:ol,afterInit(n,e,t){t&&(n.tooltip=new ra({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle: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<i)return t[e.dataIndex]}return""},afterTitle:ni,beforeBody:ni,beforeLabel:ni,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return at(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:ni,afterBody:ni,beforeFooter:ni,footer:ni,afterFooter:ni}},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"]};const qS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function jS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return qS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const HS=(n,e)=>n===null?null:Yt(Math.round(n),0,e);class aa extends ns{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(at(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:jS(i,e,Xe(t,e),this._addedLabels),HS(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}aa.id="category";aa.defaults={ticks:{callback:aa.prototype.getLabelForValue}};function VS(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:_,max:v}=e,k=!at(o),y=!at(r),$=!at(u),T=(v-_)/(c+1);let M=af((v-_)/h/m)*m,C,O,A,I;if(M<1e-14&&!k&&!y)return[{value:_},{value:v}];I=Math.ceil(v/M)-Math.floor(_/M),I>h&&(M=af(I*M/h/m)*m),at(a)||(C=Math.pow(10,a),M=Math.ceil(M*C)/C),s==="ticks"?(O=Math.floor(_/M)*M,A=Math.ceil(v/M)*M):(O=_,A=v),k&&y&&l&&qy((r-o)/l,M/1e3)?(I=Math.round(Math.min((r-o)/M,f)),M=(r-o)/I,O=o,A=r):$?(O=k?o:O,A=y?r:A,I=u-1,M=(A-O)/I):(I=(A-O)/M,il(I,Math.round(I),M/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(uf(M),uf(O));C=Math.pow(10,at(a)?L:a),O=Math.round(O*C)/C,A=Math.round(A*C)/C;let N=0;for(k&&(d&&O!==o?(t.push({value:o}),O<o&&N++,il(Math.round((O+N*M)*C)/C,o,fc(o,T,n))&&N++):O<o&&N++);N<I;++N)t.push({value:Math.round((O+N*M)*C)/C});return y&&d&&A!==r?t.length&&il(t[t.length-1].value,r,fc(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!y||A===r)&&t.push({value:A}),t}function fc(n,e,{horizontal:t,minRotation:i}){const s=Vn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Po extends ns{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 at(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=Gn(s),u=Gn(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=VS(s,l);return e.bounds==="ticks"&&Ig(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 El(e,this.chart.options.locale,this.options.ticks.format)}}class xa extends Po{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ct(e)?e:0,this.max=Ct(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Vn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}xa.id="linear";xa.defaults={ticks:{callback:Jo.formatters.numeric}};function cc(n){return n/Math.pow(10,Math.floor(En(n)))===1}function zS(n,e){const t=Math.floor(En(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Cn(n.min,Math.pow(10,Math.floor(En(e.min)))),o=Math.floor(En(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:cc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o<t||o===t&&r<i);const u=Cn(n.max,l);return s.push({value:u,major:cc(l)}),s}class $b extends ns{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Po.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Ct(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ct(e)?Math.max(0,e):null,this.max=Ct(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(En(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=zS(t,this);return e.bounds==="ticks"&&Ig(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":El(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=En(e),this._valueRange=En(this.max)-En(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(En(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}$b.id="logarithmic";$b.defaults={ticks:{callback:Jo.formatters.logarithmic,major:{enabled:!0}}};function ua(n){const e=n.ticks;if(e.display&&n.display){const t=Nn(e.backdropPadding);return Xe(e.font&&e.font.size,Qe.font.size)+t.height}return 0}function BS(n,e,t){return t=_t(t)?t:[t],{w:_2(n,e.string,t),h:t.length*e.lineHeight}}function dc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:n<i||n>s?{start:e-t,end:e}:{start:e,end:e+t}}function US(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?$t/l:0;for(let a=0;a<l;a++){const u=o.setContext(n.getPointLabelContext(a));s[a]=u.padding;const f=n.getPointPosition(a,n.drawingArea+s[a],r),c=vn(u.font),d=BS(n.ctx,c,n._pointLabels[a]);i[a]=d;const m=bn(n.getIndexAngle(a)+r),h=Math.round(Pa(m)),_=dc(h,f.x,d.w,0,180),v=dc(h,f.y,d.h,90,270);WS(t,e,m,_,v)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=YS(n,i,s)}function WS(n,e,t,i,s){const l=Math.abs(Math.sin(t)),o=Math.abs(Math.cos(t));let r=0,a=0;i.start<e.l?(r=(e.l-i.start)/l,n.l=Math.min(n.l,e.l-r)):i.end>e.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.start<e.t?(a=(e.t-s.start)/o,n.t=Math.min(n.t,e.t-a)):s.end>e.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function YS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ua(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?$t/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(Pa(bn(f.angle+kt))),d=e[u],m=ZS(f.y,d.h,c),h=KS(c),_=JS(f.x,d.w,h);i.push({x:f.x,y:m,textAlign:h,left:_,top:m,right:_+d.w,bottom:m+d.h})}return i}function KS(n){return n===0||n===180?"center":n<180?"left":"right"}function JS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function ZS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function GS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=vn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:m}=n._pointLabelItems[s],{backdropColor:h}=l;if(!at(h)){const _=ys(l.borderRadius),v=Nn(l.backdropPadding);t.fillStyle=h;const k=f-v.left,y=c-v.top,$=d-f+v.width,T=m-c+v.height;Object.values(_).some(M=>M!==0)?(t.beginPath(),Do(t,{x:k,y,w:$,h:T,radius:_}),t.fill()):t.fillRect(k,y,$,T)}Mo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function Tb(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,dt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o<i;o++)l=n.getPointPosition(o,e),s.lineTo(l.x,l.y)}}function XS(n,e,t,i){const s=n.ctx,l=e.circular,{color:o,lineWidth:r}=e;!l&&!i||!o||!r||t<0||(s.save(),s.strokeStyle=o,s.lineWidth=r,s.setLineDash(e.borderDash),s.lineDashOffset=e.borderDashOffset,s.beginPath(),Tb(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function QS(n,e,t){return Oi(n,{label:t,index:e,type:"pointLabel"})}class Go extends Po{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Nn(ua(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Ct(e)&&!isNaN(e)?e:0,this.max=Ct(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ua(this.options))}generateTickLabels(e){Po.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=yt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?US(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=dt/(this._pointLabels.length||1),i=this.options.startAngle||0;return bn(e*t+Vn(i))}getDistanceFromCenterForValue(e){if(at(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(at(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return QS(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-kt+i;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:s,bottom:l}=this._pointLabelItems[e];return{left:t,top:i,right:s,bottom:l}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),Tb(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:s}=t,l=this._pointLabels.length;let o,r,a;if(t.pointLabels.display&&GS(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));XS(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=vn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Nn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Mo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Go.id="radialLinear";Go.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Jo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Go.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Go.descriptors={angleLines:{_fallback:"grid"}};const Xo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},fn=Object.keys(Xo);function xS(n,e){return n-e}function pc(n,e){if(at(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)),Ct(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ms(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function mc(n,e,t,i){const s=fn.length;for(let l=fn.indexOf(n);l<s-1;++l){const o=Xo[fn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return fn[l]}return fn[s-1]}function e3(n,e,t,i,s){for(let l=fn.length-1;l>=fn.indexOf(t);l--){const o=fn[l];if(Xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return fn[t?fn.indexOf(t):0]}function t3(n){for(let e=fn.indexOf(n)+1,t=fn.length;e<t;++e)if(Xo[fn[e]].common)return fn[e]}function hc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=La(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function n3(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 _c(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o<l;++o)r=e[o],s[r]=o,i.push({value:r,major:!1});return l===0||!t?i:n3(n,i,s,t)}class Pl extends ns{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){const i=e.time||(e.time={}),s=this._adapter=new rb._date(e.adapters.date);s.init(t),nl(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:pc(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:s,max:l,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(s=Math.min(s,u.min)),!r&&!isNaN(u.max)&&(l=Math.max(l,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),s=Ct(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Ct(l)&&!isNaN(l)?l:+t.endOf(Date.now(),i)+1,this.min=Math.min(s,l-1),this.max=Math.max(s+1,l)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const l=this.min,o=this.max,r=zy(s,l,o);return this._unit=t.unit||(i.autoSkip?mc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):e3(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:t3(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),_c(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+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=Yt(t,0,o),i=Yt(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||mc(l.minUnit,t,i,this._getLabelCapacity(t)),r=Xe(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ms(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<i;d=+e.add(d,r,o),m++)hc(f,d,h);return(d===i||s.bounds==="ticks"||m===1)&&hc(f,d,h),Object.keys(f).sort((_,v)=>_-v).map(_=>+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,m=this._adapter.format(e,s||(d?f:u)),h=l.ticks.callback;return h?yt(h,[m,t,i],this):m}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=Vn(this.isHorizontal()?t.maxRotation:t.minRotation),l=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*l+r*o,h:i*o+r*l}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,l=this._tickFormatFunction(e,0,_c(this,[e],this._majorUnit),s),o=this._getLabelSize(l),r=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return r>0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t<i;++t)e=e.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const s=this.getLabels();for(t=0,i=s.length;t<i;++t)e.push(pc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Ng(e.sort(xS))}}Pl.id="time";Pl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function no(n,e,t){let i=0,s=n.length-1,l,o,r,a;t?(e>=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=Yi(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}=Yi(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 Cb extends Pl{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=no(t,this.min),this._tableRange=no(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<r;++o)u=e[o],u>=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o<r;++o)f=s[o+1],a=s[o-1],u=s[o],Math.round((f+a)/2)!==u&&l.push({time:u,pos:o/(r-1)});return 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(no(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return no(this._table,i*this._tableRange+this._minPos,!0)}}Cb.id="timeseries";Cb.defaults=Pl.defaults;/*!
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const i3={datetime:qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:qe.TIME_WITH_SECONDS,minute:qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};rb._date.override({_id:"luxon",_create:function(n){return qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return i3},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=qe.fromFormat(n,e,t):n=qe.fromISO(n,t):n instanceof Date?n=qe.fromJSDate(n,t):i==="object"&&!(n instanceof qe)&&(n=qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function gc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,It,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,It,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function s3(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=V(n[1]),t=D(),s=V(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function l3(n){let e;return{c(){e=V("Loading...")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function o3(n){let e,t,i,s,l,o=n[2]&&gc();function r(f,c){return f[2]?l3:s3}let a=r(n),u=a(n);return{c(){e=b("div"),o&&o.c(),t=D(),i=b("canvas"),s=D(),l=b("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Lr(i,"height","250px"),Lr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=gc(),o.c(),E(o,1),o.m(e,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function r3(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let h of m)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Io.register(Ei,Zo,Ko,xa,Pl,OS,RS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){se[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class a3 extends be{constructor(e){super(),ge(this,e,r3,o3,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fa={},u3={get exports(){return fa},set exports(n){fa=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function y($){return $ instanceof a?new a($.type,y($.content),$.alias):Array.isArray($)?$.map(y):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++l}),y.__id},clone:function y($,T){T=T||{};var M,C;switch(r.util.type($)){case"Object":if(C=r.util.objId($),T[C])return T[C];M={},T[C]=M;for(var O in $)$.hasOwnProperty(O)&&(M[O]=y($[O],T));return M;case"Array":return C=r.util.objId($),T[C]?T[C]:(M=[],T[C]=M,$.forEach(function(A,I){M[I]=y(A,T)}),M);default:return $}},getLanguage:function(y){for(;y;){var $=s.exec(y.className);if($)return $[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,$){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(y){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==y)return $[T]}return null}},isActive:function(y,$,T){for(var M="no-"+$;y;){var C=y.classList;if(C.contains($))return!0;if(C.contains(M))return!1;y=y.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,$){var T=r.util.clone(r.languages[y]);for(var M in $)T[M]=$[M];return T},insertBefore:function(y,$,T,M){M=M||r.languages;var C=M[y],O={};for(var A in C)if(C.hasOwnProperty(A)){if(A==$)for(var I in T)T.hasOwnProperty(I)&&(O[I]=T[I]);T.hasOwnProperty(A)||(O[A]=C[A])}var L=M[y];return M[y]=O,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=O)}),O},DFS:function y($,T,M,C){C=C||{};var O=r.util.objId;for(var A in $)if($.hasOwnProperty(A)){T.call($,A,$[A],M||A);var I=$[A],L=r.util.type(I);L==="Object"&&!C[O(I)]?(C[O(I)]=!0,y(I,T,null,C)):L==="Array"&&!C[O(I)]&&(C[O(I)]=!0,y(I,T,A,C))}}},plugins:{},highlightAll:function(y,$){r.highlightAllUnder(document,y,$)},highlightAllUnder:function(y,$,T){var M={callback:T,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,O;O=M.elements[C++];)r.highlightElement(O,$===!0,M.callback)},highlightElement:function(y,$,T){var M=r.util.getLanguage(y),C=r.languages[M];r.util.setLanguage(y,M);var O=y.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var A=y.textContent,I={element:y,language:M,grammar:C,code:A};function L(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if($&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(y,$,T){var M={code:y,grammar:$,language:T};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(y,$){var T=$.rest;if(T){for(var M in T)$[M]=T[M];delete $.rest}var C=new c;return d(C,C.head,y),f(y,C,$,C.head,0),h(C)},hooks:{all:{},add:function(y,$){var T=r.hooks.all;T[y]=T[y]||[],T[y].push($)},run:function(y,$){var T=r.hooks.all[y];if(!(!T||!T.length))for(var M=0,C;C=T[M++];)C($)}},Token:a};i.Prism=r;function a(y,$,T,M){this.type=y,this.content=$,this.alias=T,this.length=(M||"").length|0}a.stringify=function y($,T){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(L){M+=y(L,T)}),M}var C={type:$.type,content:y($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},O=$.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(C.classes,O):C.classes.push(O)),r.hooks.run("wrap",C);var A="";for(var I in C.attributes)A+=" "+I+'="'+(C.attributes[I]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+A+">"+C.content+"</"+C.tag+">"};function u(y,$,T,M){y.lastIndex=$;var C=y.exec(T);if(C&&M&&C[1]){var O=C[1].length;C.index+=O,C[0]=C[0].slice(O)}return C}function f(y,$,T,M,C,O){for(var A in T)if(!(!T.hasOwnProperty(A)||!T[A])){var I=T[A];I=Array.isArray(I)?I:[I];for(var L=0;L<I.length;++L){if(O&&O.cause==A+","+L)return;var N=I[L],F=N.inside,R=!!N.lookbehind,K=!!N.greedy,x=N.alias;if(K&&!N.pattern.global){var U=N.pattern.toString().match(/[imsuy]*$/)[0];N.pattern=RegExp(N.pattern.source,U+"g")}for(var X=N.pattern||N,ne=M.next,J=C;ne!==$.tail&&!(O&&J>=O.reach);J+=ne.value.length,ne=ne.next){var fe=ne.value;if($.length>y.length)return;if(!(fe instanceof a)){var Z=1,de;if(K){if(de=u(X,J,y,R),!de||de.index>=y.length)break;var Re=de.index,ve=de.index+de[0].length,Te=J;for(Te+=ne.value.length;Re>=Te;)ne=ne.next,Te+=ne.value.length;if(Te-=ne.value.length,J=Te,ne.value instanceof a)continue;for(var Ne=ne;Ne!==$.tail&&(Te<ve||typeof Ne.value=="string");Ne=Ne.next)Z++,Te+=Ne.value.length;Z--,fe=y.slice(J,Te),de.index-=J}else if(de=u(X,0,fe,R),!de)continue;var Re=de.index,ye=de[0],Se=fe.slice(0,Re),We=fe.slice(Re+ye.length),lt=J+fe.length;O&&lt>O.reach&&(O.reach=lt);var ce=ne.prev;Se&&(ce=d($,ce,Se),J+=Se.length),m($,ce,Z);var ze=new a(A,F?r.tokenize(ye,F):ye,x,ye);if(ne=d($,ce,ze),We&&d($,ne,We),Z>1){var te={cause:A+","+L,reach:lt};f(y,$,T,ne.prev,J,te),O&&te.reach>O.reach&&(O.reach=te.reach)}}}}}}function c(){var y={value:null,prev:null,next:null},$={value:null,prev:y,next:null};y.next=$,this.head=y,this.tail=$,this.length=0}function d(y,$,T){var M=$.next,C={value:T,prev:$,next:M};return $.next=C,M.prev=C,y.length++,C}function m(y,$,T){for(var M=$.next,C=0;C<T&&M!==y.tail;C++)M=M.next;$.next=M,M.prev=$,y.length-=C}function h(y){for(var $=[],T=y.head.next;T!==y.tail;)$.push(T.value),T=T.next;return $}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(y){var $=JSON.parse(y.data),T=$.language,M=$.code,C=$.immediateClose;i.postMessage(r.highlight(M,r.languages[T],T)),C&&i.close()},!1)),r;var _=r.util.currentScript();_&&(r.filename=_.src,_.hasAttribute("data-manual")&&(r.manual=!0));function v(){r.manual||r.highlightAll()}if(!r.manual){var k=document.readyState;k==="loading"||k==="interactive"&&_&&_.defer?document.addEventListener("DOMContentLoaded",v):window.requestAnimationFrame?window.requestAnimationFrame(v):window.setTimeout(v,16)}return r}(e);n.exports&&(n.exports=t),typeof bc<"u"&&(bc.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(_,v){return"✖ Error "+_+" while fetching file: "+v},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(_,v,k){var y=new XMLHttpRequest;y.open("GET",_,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?v(y.responseText):y.status>=400?k(s(y.status,y.statusText)):k(l))},y.send(null)}function m(_){var v=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(_||"");if(v){var k=Number(v[1]),y=v[2],$=v[3];return y?$?[k,Number($)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(_){_.selector+=", "+c}),t.hooks.add("before-sanity-check",function(_){var v=_.element;if(v.matches(c)){_.code="",v.setAttribute(r,a);var k=v.appendChild(document.createElement("CODE"));k.textContent=i;var y=v.getAttribute("data-src"),$=_.language;if($==="none"){var T=(/\.(\w+)$/.exec(y)||[,"none"])[1];$=o[T]||T}t.util.setLanguage(k,$),t.util.setLanguage(v,$);var M=t.plugins.autoloader;M&&M.loadLanguages($),d(y,function(C){v.setAttribute(r,u);var O=m(v.getAttribute("data-range"));if(O){var A=C.split(/\r\n?|\n/g),I=O[0],L=O[1]==null?A.length:O[1];I<0&&(I+=A.length),I=Math.max(0,Math.min(I-1,A.length)),L<0&&(L+=A.length),L=Math.max(0,Math.min(L,A.length)),C=A.slice(I,L).join(`
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(I+1))}k.textContent=C,t.highlightElement(k)},function(C){v.setAttribute(r,f),k.textContent=C})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(c),y=0,$;$=k[y++];)t.highlightElement($)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(u3);const Zs=fa;var vc={},f3={get exports(){return vc},set exports(n){vc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=m)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",h="",_=!1,v=0;v<d.length;++v){var k=d[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var y=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(y,o.settings),o.code=o.element.textContent}}}})})()})(f3);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function c3(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),g(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:G,o:G,d(s){s&&w(e)}}}function d3(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Mb extends be{constructor(e){super(),ge(this,e,d3,c3,he,{class:0,content:2,language:3})}}const p3=n=>({}),yc=n=>({}),m3=n=>({}),kc=n=>({});function wc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$=n[4]&&!n[2]&&Sc(n);const T=n[19].header,M=Nt(T,n,n[18],kc);let C=n[4]&&n[2]&&$c(n);const O=n[19].default,A=Nt(O,n,n[18],null),I=n[19].footer,L=Nt(I,n,n[18],yc);return{c(){e=b("div"),t=b("div"),s=D(),l=b("div"),o=b("div"),$&&$.c(),r=D(),M&&M.c(),a=D(),C&&C.c(),u=D(),f=b("div"),A&&A.c(),c=D(),d=b("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",m="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,F){S(N,e,F),g(e,t),g(e,s),g(e,l),g(l,o),$&&$.m(o,null),g(o,r),M&&M.m(o,null),g(o,a),C&&C.m(o,null),g(l,u),g(l,f),A&&A.m(f,null),n[21](f),g(l,c),g(l,d),L&&L.m(d,null),v=!0,k||(y=[Y(t,"click",ft(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,F){n=N,n[4]&&!n[2]?$?$.p(n,F):($=Sc(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!v||F[0]&262144)&&Rt(M,T,n,n[18],v?Ft(T,n[18],F,m3):qt(n[18]),kc),n[4]&&n[2]?C?C.p(n,F):(C=$c(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),A&&A.p&&(!v||F[0]&262144)&&Rt(A,O,n,n[18],v?Ft(O,n[18],F,null):qt(n[18]),null),L&&L.p&&(!v||F[0]&262144)&&Rt(L,I,n,n[18],v?Ft(I,n[18],F,p3):qt(n[18]),yc),(!v||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!v||F[0]&262)&&Q(l,"popup",n[2]),(!v||F[0]&4)&&Q(e,"padded",n[2]),(!v||F[0]&1)&&Q(e,"active",n[0])},i(N){v||(N&&xe(()=>{i||(i=je(t,ko,{duration:hs,opacity:0},!0)),i.run(1)}),E(M,N),E(A,N),E(L,N),xe(()=>{_&&_.end(1),h=v_(l,Pn,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),h.start()}),v=!0)},o(N){N&&(i||(i=je(t,ko,{duration:hs,opacity:0},!1)),i.run(0)),P(M,N),P(A,N),P(L,N),h&&h.invalidate(),_=y_(l,Pn,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),v=!1},d(N){N&&w(e),N&&i&&i.end(),$&&$.d(),M&&M.d(N),C&&C.d(),A&&A.d(N),n[21](null),L&&L.d(N),N&&_&&_.end(),k=!1,Pe(y)}}}function Sc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ft(n[5])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function $c(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ft(n[5])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function h3(n){let e,t,i,s,l=n[0]&&wc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(o,r){S(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&&E(l,1)):(l=wc(o),l.c(),E(l,1),l.m(e,null)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,Pe(s)}}}let Vi,Sr=[];function Db(){return Vi=Vi||document.querySelector(".overlays"),Vi||(Vi=document.createElement("div"),Vi.classList.add("overlays"),document.body.appendChild(Vi)),Vi}let hs=150;function Tc(){return 1e3+Db().querySelectorAll(".overlay-panel-container.active").length}function _3(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=Tt(),h="op_"+z.randomString(10);let _,v,k,y,$="",T=o;function M(){typeof c=="function"&&c()===!1||t(0,o=!0)}function C(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function A(J){t(17,T=J),J?(k=document.activeElement,_==null||_.focus(),m("show")):(clearTimeout(y),k==null||k.focus(),m("hide")),await sn(),I()}function I(){_&&(o?t(6,_.style.zIndex=Tc(),_):t(6,_.style="",_))}function L(){z.pushUnique(Sr,h),document.body.classList.add("overlay-active")}function N(){z.removeByValue(Sr,h),Sr.length||document.body.classList.remove("overlay-active")}function F(J){o&&f&&J.code=="Escape"&&!z.isInput(J.target)&&_&&_.style.zIndex==Tc()&&(J.preventDefault(),C())}function R(J){o&&K(v)}function K(J,fe){fe&&t(8,$=""),J&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!J)return;if(J.scrollHeight-J.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}J.scrollTop==0?t(8,$+=" scroll-top-reached"):J.scrollTop+J.offsetHeight==J.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100)))}Zt(()=>(Db().appendChild(_),()=>{var J;clearTimeout(y),N(),(J=_==null?void 0:_.classList)==null||J.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const x=()=>a?C():!0;function U(J){se[J?"unshift":"push"](()=>{v=J,t(7,v)})}const X=J=>K(J.target);function ne(J){se[J?"unshift":"push"](()=>{_=J,t(6,_)})}return n.$$set=J=>{"class"in J&&t(1,l=J.class),"active"in J&&t(0,o=J.active),"popup"in J&&t(2,r=J.popup),"overlayClose"in J&&t(3,a=J.overlayClose),"btnClose"in J&&t(4,u=J.btnClose),"escClose"in J&&t(12,f=J.escClose),"beforeOpen"in J&&t(13,c=J.beforeOpen),"beforeHide"in J&&t(14,d=J.beforeHide),"$$scope"in J&&t(18,s=J.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&A(o),n.$$.dirty[0]&128&&K(v,!0),n.$$.dirty[0]&64&&_&&I(),n.$$.dirty[0]&1&&(o?L():N())},[o,l,r,a,u,C,_,v,$,F,R,K,f,c,d,M,O,T,s,i,x,U,X,ne]}class Sn extends be{constructor(e){super(),ge(this,e,_3,h3,he,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function g3(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function b3(n){let e,t=n[2].referer+"",i,s;return{c(){e=b("a"),i=V(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&w(e)}}}function v3(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function y3(n){let e,t;return e=new Mb({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function k3(n){var Oe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,m,h,_=n[2].status+"",v,k,y,$,T,M,C=((Oe=n[2].method)==null?void 0:Oe.toUpperCase())+"",O,A,I,L,N,F,R=n[2].auth+"",K,x,U,X,ne,J,fe=n[2].url+"",Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze=n[2].remoteIp+"",te,Fe,ot,Vt,Ae,ie,we=n[2].userIp+"",nt,et,bt,Gt,di,ct,Wn=n[2].userAgent+"",ss,Ll,pi,ls,Nl,Pi,os,rn,Ze,rs,ti,as,Li,Ni,zt,Xt;function Fl(Ee,Ce){return Ee[2].referer?b3:g3}let B=Fl(n),W=B(n);const ee=[y3,v3],oe=[];function $e(Ee,Ce){return Ce&4&&(os=null),os==null&&(os=!z.isEmpty(Ee[2].meta)),os?0:1}return rn=$e(n,-1),Ze=oe[rn]=ee[rn](n),zt=new ui({props:{date:n[2].created}}),{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="ID",l=D(),o=b("td"),a=V(r),u=D(),f=b("tr"),c=b("td"),c.textContent="Status",d=D(),m=b("td"),h=b("span"),v=V(_),k=D(),y=b("tr"),$=b("td"),$.textContent="Method",T=D(),M=b("td"),O=V(C),A=D(),I=b("tr"),L=b("td"),L.textContent="Auth",N=D(),F=b("td"),K=V(R),x=D(),U=b("tr"),X=b("td"),X.textContent="URL",ne=D(),J=b("td"),Z=V(fe),de=D(),ve=b("tr"),Te=b("td"),Te.textContent="Referer",Ne=D(),Re=b("td"),W.c(),ye=D(),Se=b("tr"),We=b("td"),We.textContent="Remote IP",lt=D(),ce=b("td"),te=V(ze),Fe=D(),ot=b("tr"),Vt=b("td"),Vt.textContent="User IP",Ae=D(),ie=b("td"),nt=V(we),et=D(),bt=b("tr"),Gt=b("td"),Gt.textContent="UserAgent",di=D(),ct=b("td"),ss=V(Wn),Ll=D(),pi=b("tr"),ls=b("td"),ls.textContent="Meta",Nl=D(),Pi=b("td"),Ze.c(),rs=D(),ti=b("tr"),as=b("td"),as.textContent="Created",Li=D(),Ni=b("td"),H(zt.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(h,"class","label"),Q(h,"label-danger",n[2].status>=400),p($,"class","min-width txt-hint txt-bold"),p(L,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(Te,"class","min-width txt-hint txt-bold"),p(We,"class","min-width txt-hint txt-bold"),p(Vt,"class","min-width txt-hint txt-bold"),p(Gt,"class","min-width txt-hint txt-bold"),p(ls,"class","min-width txt-hint txt-bold"),p(as,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Ee,Ce){S(Ee,e,Ce),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,a),g(t,u),g(t,f),g(f,c),g(f,d),g(f,m),g(m,h),g(h,v),g(t,k),g(t,y),g(y,$),g(y,T),g(y,M),g(M,O),g(t,A),g(t,I),g(I,L),g(I,N),g(I,F),g(F,K),g(t,x),g(t,U),g(U,X),g(U,ne),g(U,J),g(J,Z),g(t,de),g(t,ve),g(ve,Te),g(ve,Ne),g(ve,Re),W.m(Re,null),g(t,ye),g(t,Se),g(Se,We),g(Se,lt),g(Se,ce),g(ce,te),g(t,Fe),g(t,ot),g(ot,Vt),g(ot,Ae),g(ot,ie),g(ie,nt),g(t,et),g(t,bt),g(bt,Gt),g(bt,di),g(bt,ct),g(ct,ss),g(t,Ll),g(t,pi),g(pi,ls),g(pi,Nl),g(pi,Pi),oe[rn].m(Pi,null),g(t,rs),g(t,ti),g(ti,as),g(ti,Li),g(ti,Ni),q(zt,Ni,null),Xt=!0},p(Ee,Ce){var He;(!Xt||Ce&4)&&r!==(r=Ee[2].id+"")&&le(a,r),(!Xt||Ce&4)&&_!==(_=Ee[2].status+"")&&le(v,_),(!Xt||Ce&4)&&Q(h,"label-danger",Ee[2].status>=400),(!Xt||Ce&4)&&C!==(C=((He=Ee[2].method)==null?void 0:He.toUpperCase())+"")&&le(O,C),(!Xt||Ce&4)&&R!==(R=Ee[2].auth+"")&&le(K,R),(!Xt||Ce&4)&&fe!==(fe=Ee[2].url+"")&&le(Z,fe),B===(B=Fl(Ee))&&W?W.p(Ee,Ce):(W.d(1),W=B(Ee),W&&(W.c(),W.m(Re,null))),(!Xt||Ce&4)&&ze!==(ze=Ee[2].remoteIp+"")&&le(te,ze),(!Xt||Ce&4)&&we!==(we=Ee[2].userIp+"")&&le(nt,we),(!Xt||Ce&4)&&Wn!==(Wn=Ee[2].userAgent+"")&&le(ss,Wn);let Ue=rn;rn=$e(Ee,Ce),rn===Ue?oe[rn].p(Ee,Ce):(ae(),P(oe[Ue],1,1,()=>{oe[Ue]=null}),ue(),Ze=oe[rn],Ze?Ze.p(Ee,Ce):(Ze=oe[rn]=ee[rn](Ee),Ze.c()),E(Ze,1),Ze.m(Pi,null));const Le={};Ce&4&&(Le.date=Ee[2].created),zt.$set(Le)},i(Ee){Xt||(E(Ze),E(zt.$$.fragment,Ee),Xt=!0)},o(Ee){P(Ze),P(zt.$$.fragment,Ee),Xt=!1},d(Ee){Ee&&w(e),W.d(),oe[rn].d(),j(zt)}}}function w3(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function S3(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function $3(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[S3],header:[w3],default:[k3]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function T3(n,e,t){let i,s=new jr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){se[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Ve.call(this,n,c)}function f(c){Ve.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class C3 extends be{constructor(e){super(),ge(this,e,T3,$3,he,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function M3(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[0],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new a3({props:l}),se.push(()=>_e(e,"filter",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Mc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new My({props:l}),se.push(()=>_e(e,"filter",s)),e.$on("select",n[12]),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function D3(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y=n[3],$,T=n[3],M,C;r=new Ea({}),r.$on("refresh",n[7]),d=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[M3,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),h=new Wo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),h.$on("submit",n[9]);let O=Cc(n),A=Mc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),s=b("div"),l=V(n[5]),o=D(),H(r.$$.fragment),a=D(),u=b("div"),f=D(),c=b("div"),H(d.$$.fragment),m=D(),H(h.$$.fragment),_=D(),v=b("div"),k=D(),O.c(),$=D(),A.c(),M=Me(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(v,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(t,o),q(r,t,null),g(t,a),g(t,u),g(t,f),g(t,c),q(d,c,null),g(e,m),q(h,e,null),g(e,_),g(e,v),g(e,k),O.m(e,null),S(I,$,L),A.m(I,L),S(I,M,L),C=!0},p(I,L){(!C||L&32)&&le(l,I[5]);const N={};L&49153&&(N.$$scope={dirty:L,ctx:I}),d.$set(N);const F={};L&4&&(F.value=I[2]),h.$set(F),L&8&&he(y,y=I[3])?(ae(),P(O,1,1,G),ue(),O=Cc(I),O.c(),E(O,1),O.m(e,null)):O.p(I,L),L&8&&he(T,T=I[3])?(ae(),P(A,1,1,G),ue(),A=Mc(I),A.c(),E(A,1),A.m(M.parentNode,M)):A.p(I,L)},i(I){C||(E(r.$$.fragment,I),E(d.$$.fragment,I),E(h.$$.fragment,I),E(O),E(A),C=!0)},o(I){P(r.$$.fragment,I),P(d.$$.fragment,I),P(h.$$.fragment,I),P(O),P(A),C=!1},d(I){I&&w(e),j(r),j(d),j(h),O.d(I),I&&w($),I&&w(M),A.d(I)}}}function O3(n){let e,t,i,s;e=new wn({props:{$$slots:{default:[D3]},$$scope:{ctx:n}}});let l={};return i=new C3({props:l}),n[13](i),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(o,r){q(e,o,r),S(o,t,r),q(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(E(e.$$.fragment,o),E(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[13](null),j(i,o)}}}const Dc="includeAdminLogs";function E3(n,e,t){var k;let i,s;Ye(n,St,y=>t(5,s=y)),Kt(St,s="Request logs",s);let l,o="",r=((k=window.localStorage)==null?void 0:k.getItem(Dc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=y=>t(2,o=y.detail);function m(y){o=y,t(2,o)}function h(y){o=y,t(2,o)}const _=y=>l==null?void 0:l.show(y==null?void 0:y.detail);function v(y){se[y?"unshift":"push"](()=>{l=y,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(Dc,r<<0)},[r,l,o,a,i,s,u,f,c,d,m,h,_,v]}class A3 extends be{constructor(e){super(),ge(this,e,E3,O3,he,{})}}const Ai=Fn([]),Mi=Fn({}),Lo=Fn(!1);function I3(n){Ai.update(e=>{const t=z.findByKey(e,"id",n);return t?Mi.set(t):e.length&&Mi.set(e[0]),e})}function P3(n){Ai.update(e=>(z.removeByKey(e,"id",n.id),Mi.update(t=>t.id===n.id?e[0]:t),e))}async function Ob(n=null){Lo.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),Ai.set(e);const t=n&&z.findByKey(e,"id",n);t?Mi.set(t):e.length&&Mi.set(e[0])}catch(e){me.errorResponseHandler(e)}Lo.set(!1)}const eu=Fn({});function cn(n,e,t){eu.set({text:n,yesCallback:e,noCallback:t})}function Eb(){eu.set({})}function Oc(n){let e,t,i,s;const l=n[14].default,o=Nt(l,n,n[13],null);return{c(){e=b("div"),o&&o.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(r,a){S(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&8192)&&Rt(o,l,r,r[13],s?Ft(l,r[13],a,null):qt(r[13]),null),(!s||a&2)&&p(e,"class",r[1]),(!s||a&3)&&Q(e,"active",r[0])},i(r){s||(E(o,r),r&&xe(()=>{i&&i.end(1),t=v_(e,Pn,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=y_(e,Pn,{duration:150,y:2})),s=!1},d(r){r&&w(e),o&&o.d(r),r&&i&&i.end()}}}function L3(n){let e,t,i,s,l=n[0]&&Oc(n);return{c(){e=b("div"),l&&l.c(),p(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[15](e),t=!0,i||(s=[Y(window,"click",n[3]),Y(window,"keydown",n[4]),Y(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&E(l,1)):(l=Oc(o),l.c(),E(l,1),l.m(e,null)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){t||(E(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[15](null),i=!1,Pe(s)}}}function N3(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f,c;const d=Tt();function m(){t(0,o=!1)}function h(){t(0,o=!0)}function _(){o?m():h()}function v(I){return!f||I.classList.contains(a)||(c==null?void 0:c.contains(I))&&!f.contains(I)||f.contains(I)&&I.closest&&I.closest("."+a)}function k(I){(!o||v(I.target))&&(I.preventDefault(),I.stopPropagation(),_())}function y(I){(I.code==="Enter"||I.code==="Space")&&(!o||v(I.target))&&(I.preventDefault(),I.stopPropagation(),_())}function $(I){o&&!(f!=null&&f.contains(I.target))&&!(c!=null&&c.contains(I.target))&&m()}function T(I){o&&r&&I.code==="Escape"&&(I.preventDefault(),m())}function M(I){return $(I)}function C(I){O(),t(12,c=I||(f==null?void 0:f.parentNode)),c&&(f==null||f.addEventListener("click",k),c.addEventListener("click",k),c.addEventListener("keydown",y))}function O(){c&&(f==null||f.removeEventListener("click",k),c.removeEventListener("click",k),c.removeEventListener("keydown",y))}Zt(()=>(C(),()=>O()));function A(I){se[I?"unshift":"push"](()=>{f=I,t(2,f)})}return n.$$set=I=>{"trigger"in I&&t(6,l=I.trigger),"active"in I&&t(0,o=I.active),"escClose"in I&&t(7,r=I.escClose),"closableClass"in I&&t(8,a=I.closableClass),"class"in I&&t(1,u=I.class),"$$scope"in I&&t(13,s=I.$$scope)},n.$$.update=()=>{var I,L;n.$$.dirty&68&&f&&C(l),n.$$.dirty&4097&&(o?((I=c==null?void 0:c.classList)==null||I.add("active"),d("show")):((L=c==null?void 0:c.classList)==null||L.remove("active"),d("hide")))},[o,u,f,$,T,M,l,r,a,m,h,_,c,s,i,A]}class ei extends be{constructor(e){super(),ge(this,e,N3,L3,he,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const F3=n=>({active:n&1}),Ec=n=>({active:n[0]});function Ac(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){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Rt(l,s,o,o[14],i?Ft(s,o[14],r,null):qt(o[14]),null)},i(o){i||(E(l,o),o&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=je(e,At,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function R3(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Ec);let f=n[0]&&Ac(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=D(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){S(c,e,d),g(e,t),u&&u.m(t,null),g(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",ft(n[17])),Y(t,"drop",ft(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",ft(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Rt(u,a,c,c[14],l?Ft(a,c[14],d,F3):qt(c[14]),Ec),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&E(f,1)):(f=Ac(c),f.c(),E(f,1),f.m(e,null)):f&&(ae(),P(f,1,1,()=>{f=null}),ue()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(E(u,c),E(f),l=!0)},o(c){P(u,c),P(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Pe(r)}}}function q3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function _(){y(),t(0,f=!0),l("expand")}function v(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?v():_()}function y(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const N of L)N.click()}}Zt(()=>()=>clearTimeout(r));function $(L){Ve.call(this,n,L)}const T=()=>c&&k(),M=L=>{u&&(t(7,m=!1),y(),l("drop",L))},C=L=>u&&l("dragstart",L),O=L=>{u&&(t(7,m=!0),l("dragenter",L))},A=L=>{u&&(t(7,m=!1),l("dragleave",L))};function I(L){se[L?"unshift":"push"](()=>{o=L,t(6,o)})}return n.$$set=L=>{"class"in L&&t(1,a=L.class),"draggable"in L&&t(2,u=L.draggable),"active"in L&&t(0,f=L.active),"interactive"in L&&t(3,c=L.interactive),"single"in L&&t(9,d=L.single),"$$scope"in L&&t(14,s=L.$$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,y,o,m,l,d,h,_,v,r,s,i,$,T,M,C,O,A,I]}class ks extends be{constructor(e){super(),ge(this,e,q3,R3,he,{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]}}const j3=n=>({}),Ic=n=>({});function Pc(n,e,t){const i=n.slice();return i[46]=e[t],i}const H3=n=>({}),Lc=n=>({});function Nc(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function Fc(n){let e,t,i;return{c(){e=b("div"),t=V(n[2]),i=D(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5])},m(s,l){S(s,e,l),g(e,t),g(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&Q(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function V3(n){let e,t=n[46]+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function z3(n){let e,t,i;const s=[{item:n[46]},n[9]];var l=n[8];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Je(a,s[u]);return{props:a}}return l&&(e=Ht(l,o())),{c(){e&&H(e.$$.fragment),t=Me()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&513?on(s,[a[0]&1&&{item:r[46]},a[0]&512&&xn(r[9])]):{};if(l!==(l=r[8])){if(e){ae();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=Ht(l,o()),H(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Rc(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=b("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ie(Be.call(null,e,"Clear")),Y(e,"click",kn(ft(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function qc(n){let e,t,i,s,l,o;const r=[z3,V3],a=[];function u(c,d){return c[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&Rc(n);return{c(){e=b("div"),i.c(),s=D(),f&&f.c(),l=D(),p(e,"class","option")},m(c,d){S(c,e,d),a[t].m(e,null),g(e,s),f&&f.m(e,null),g(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ae(),P(a[m],1,1,()=>{a[m]=null}),ue(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=Rc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(E(i),o=!0)},o(c){P(i),o=!1},d(c){c&&w(e),a[t].d(),f&&f.d()}}}function jc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[W3]},$$scope:{ctx:n}};return e=new ei({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612938|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),j(e,s)}}}function Hc(n){let e,t,i,s,l,o,r,a,u=n[15].length&&Vc(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='<i class="ri-search-line"></i>',s=D(),l=b("input"),o=D(),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){S(f,e,c),g(e,t),g(t,i),g(t,s),g(t,l),re(l,n[15]),g(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&32768&&l.value!==f[15]&&re(l,f[15]),f[15].length?u?u.p(f,c):(u=Vc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&w(e),u&&u.d(),r=!1,a()}}}function Vc(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",kn(ft(n[21]))),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function zc(n){let e,t=n[1]&&Bc(n);return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Bc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Bc(n){let e,t;return{c(){e=b("div"),t=V(n[1]),p(e,"class","txt-missing")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function B3(n){let e=n[46]+"",t;return{c(){t=V(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:G,o:G,d(i){i&&w(t)}}}function U3(n){let e,t,i;const s=[{item:n[46]},n[11]];var l=n[10];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Je(a,s[u]);return{props:a}}return l&&(e=Ht(l,o())),{c(){e&&H(e.$$.fragment),t=Me()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&1050624?on(s,[a[0]&1048576&&{item:r[46]},a[0]&2048&&xn(r[11])]):{};if(l!==(l=r[10])){if(e){ae();const f=e;P(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=Ht(l,o()),H(e.$$.fragment),E(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Uc(n){let e,t,i,s,l,o,r;const a=[U3,B3],u=[];function f(m,h){return m[10]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[37](n[46],...m)}function d(...m){return n[38](n[46],...m)}return{c(){e=b("div"),i.c(),s=D(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[7]),Q(e,"selected",n[19](n[46]))},m(m,h){S(m,e,h),u[t].m(e,null),g(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=f(n),t===_?u[t].p(n,h):(ae(),P(u[_],1,1,()=>{u[_]=null}),ue(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),E(i,1),i.m(e,s)),(!l||h[0]&128)&&Q(e,"closable",n[7]),(!l||h[0]&1572864)&&Q(e,"selected",n[19](n[46]))},i(m){l||(E(i),l=!0)},o(m){P(i),l=!1},d(m){m&&w(e),u[t].d(),o=!1,Pe(r)}}}function W3(n){let e,t,i,s,l,o=n[12]&&Hc(n);const r=n[33].beforeOptions,a=Nt(r,n,n[42],Lc);let u=n[20],f=[];for(let _=0;_<u.length;_+=1)f[_]=Uc(Pc(n,u,_));const c=_=>P(f[_],1,1,()=>{f[_]=null});let d=null;u.length||(d=zc(n));const m=n[33].afterOptions,h=Nt(m,n,n[42],Ic);return{c(){o&&o.c(),e=D(),a&&a.c(),t=D(),i=b("div");for(let _=0;_<f.length;_+=1)f[_].c();d&&d.c(),s=D(),h&&h.c(),p(i,"class","options-list")},m(_,v){o&&o.m(_,v),S(_,e,v),a&&a.m(_,v),S(_,t,v),S(_,i,v);for(let k=0;k<f.length;k+=1)f[k].m(i,null);d&&d.m(i,null),S(_,s,v),h&&h.m(_,v),l=!0},p(_,v){if(_[12]?o?o.p(_,v):(o=Hc(_),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||v[1]&2048)&&Rt(a,r,_,_[42],l?Ft(r,_[42],v,H3):qt(_[42]),Lc),v[0]&14158978){u=_[20];let k;for(k=0;k<u.length;k+=1){const y=Pc(_,u,k);f[k]?(f[k].p(y,v),E(f[k],1)):(f[k]=Uc(y),f[k].c(),E(f[k],1),f[k].m(i,null))}for(ae(),k=u.length;k<f.length;k+=1)c(k);ue(),!u.length&&d?d.p(_,v):u.length?d&&(d.d(1),d=null):(d=zc(_),d.c(),d.m(i,null))}h&&h.p&&(!l||v[1]&2048)&&Rt(h,m,_,_[42],l?Ft(m,_[42],v,j3):qt(_[42]),Ic)},i(_){if(!l){E(a,_);for(let v=0;v<u.length;v+=1)E(f[v]);E(h,_),l=!0}},o(_){P(a,_),f=f.filter(Boolean);for(let v=0;v<f.length;v+=1)P(f[v]);P(h,_),l=!1},d(_){o&&o.d(_),_&&w(e),a&&a.d(_),_&&w(t),_&&w(i),ht(f,_),d&&d.d(),_&&w(s),h&&h.d(_)}}}function Y3(n){let e,t,i,s,l,o,r=z.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=qc(Nc(n,r,d));const u=d=>P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Fc(n));let c=!n[5]&&jc(n);return{c(){e=b("div"),t=b("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=D(),c&&c.c(),p(t,"tabindex",i=n[5]?"-1":"0"),p(t,"class","selected-container"),Q(t,"disabled",n[5]),p(e,"class",l="select "+n[13]),Q(e,"multiple",n[4]),Q(e,"disabled",n[5])},m(d,m){S(d,e,m),g(e,t);for(let h=0;h<a.length;h+=1)a[h].m(t,null);f&&f.m(t,null),n[35](t),g(e,s),c&&c.m(e,null),n[41](e),o=!0},p(d,m){if(m[0]&17269){r=z.toArray(d[0]);let h;for(h=0;h<r.length;h+=1){const _=Nc(d,r,h);a[h]?(a[h].p(_,m),E(a[h],1)):(a[h]=qc(_),a[h].c(),E(a[h],1),a[h].m(t,null))}for(ae(),h=r.length;h<a.length;h+=1)u(h);ue(),!r.length&&f?f.p(d,m):r.length?f&&(f.d(1),f=null):(f=Fc(d),f.c(),f.m(t,null))}(!o||m[0]&32&&i!==(i=d[5]?"-1":"0"))&&p(t,"tabindex",i),(!o||m[0]&32)&&Q(t,"disabled",d[5]),d[5]?c&&(ae(),P(c,1,1,()=>{c=null}),ue()):c?(c.p(d,m),m[0]&32&&E(c,1)):(c=jc(d),c.c(),E(c,1),c.m(e,null)),(!o||m[0]&8192&&l!==(l="select "+d[13]))&&p(e,"class",l),(!o||m[0]&8208)&&Q(e,"multiple",d[4]),(!o||m[0]&8224)&&Q(e,"disabled",d[5])},i(d){if(!o){for(let m=0;m<r.length;m+=1)E(a[m]);E(c),o=!0}},o(d){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)P(a[m]);P(c),o=!1},d(d){d&&w(e),ht(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}function K3(n,e){let t=(""+e).replace(/\s+/g,"").toLowerCase(),i=n;try{typeof n=="object"&&n!==null&&(i=JSON.stringify(n))}catch{}return(""+i).replace(/\s+/g,"").toLowerCase().includes(t)}function J3(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:m=!1}=e,{selected:h=d?[]:void 0}=e,{toggle:_=d}=e,{closable:v=!0}=e,{labelComponent:k=void 0}=e,{labelComponentProps:y={}}=e,{optionComponent:$=void 0}=e,{optionComponentProps:T={}}=e,{searchable:M=!1}=e,{searchFunc:C=void 0}=e,{class:O=""}=e,A,I="",L,N;function F(te){if(z.isEmpty(h))return;let Fe=z.toArray(h);z.inArray(Fe,te)&&(z.removeByValue(Fe,te),t(0,h=Fe)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function R(te){if(d){let Fe=z.toArray(h);z.inArray(Fe,te)||t(0,h=[...Fe,te])}else t(0,h=te);L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function K(te){return s(te)?F(te):R(te)}function x(){t(0,h=d?[]:void 0)}function U(){A!=null&&A.show&&(A==null||A.show())}function X(){A!=null&&A.hide&&(A==null||A.hide())}function ne(){if(z.isEmpty(h)||z.isEmpty(c))return;let te=z.toArray(h),Fe=[];for(const ot of te)z.inArray(c,ot)||Fe.push(ot);if(Fe.length){for(const ot of Fe)z.removeByValue(te,ot);t(0,h=d?te:te[0])}}function J(){t(15,I="")}function fe(te,Fe){te=te||[];const ot=C||K3;return te.filter(Vt=>ot(Vt,Fe))||[]}function Z(te,Fe){te.preventDefault(),_&&d?K(Fe):R(Fe)}function de(te,Fe){(te.code==="Enter"||te.code==="Space")&&Z(te,Fe)}function ve(){J(),setTimeout(()=>{const te=L==null?void 0:L.querySelector(".dropdown-item.option.selected");te&&(te.focus(),te.scrollIntoView({block:"nearest"}))},0)}function Te(te){te.stopPropagation(),!m&&(A==null||A.toggle())}Zt(()=>{const te=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of te)Fe.addEventListener("click",Te);return()=>{for(const Fe of te)Fe.removeEventListener("click",Te)}});const Ne=te=>F(te);function Re(te){se[te?"unshift":"push"](()=>{N=te,t(18,N)})}function ye(){I=this.value,t(15,I)}const Se=(te,Fe)=>Z(Fe,te),We=(te,Fe)=>de(Fe,te);function lt(te){se[te?"unshift":"push"](()=>{A=te,t(16,A)})}function ce(te){Ve.call(this,n,te)}function ze(te){se[te?"unshift":"push"](()=>{L=te,t(17,L)})}return n.$$set=te=>{"id"in te&&t(25,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(26,c=te.items),"multiple"in te&&t(4,d=te.multiple),"disabled"in te&&t(5,m=te.disabled),"selected"in te&&t(0,h=te.selected),"toggle"in te&&t(6,_=te.toggle),"closable"in te&&t(7,v=te.closable),"labelComponent"in te&&t(8,k=te.labelComponent),"labelComponentProps"in te&&t(9,y=te.labelComponentProps),"optionComponent"in te&&t(10,$=te.optionComponent),"optionComponentProps"in te&&t(11,T=te.optionComponentProps),"searchable"in te&&t(12,M=te.searchable),"searchFunc"in te&&t(27,C=te.searchFunc),"class"in te&&t(13,O=te.class),"$$scope"in te&&t(42,o=te.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&c&&(ne(),J()),n.$$.dirty[0]&67141632&&t(20,i=fe(c,I)),n.$$.dirty[0]&1&&t(19,s=function(te){const Fe=z.toArray(h);return z.inArray(Fe,te)})},[h,a,u,f,d,m,_,v,k,y,$,T,M,O,F,I,A,L,N,s,i,J,Z,de,ve,r,c,C,R,K,x,U,X,l,Ne,Re,ye,Se,We,lt,ce,ze,o]}class tu extends be{constructor(e){super(),ge(this,e,J3,Y3,he,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,selected:0,toggle:6,closable:7,labelComponent:8,labelComponentProps:9,optionComponent:10,optionComponentProps:11,searchable:12,searchFunc:27,class:13,deselectItem:14,selectItem:28,toggleItem:29,reset:30,showDropdown:31,hideDropdown:32},null,[-1,-1])}get deselectItem(){return this.$$.ctx[14]}get selectItem(){return this.$$.ctx[28]}get toggleItem(){return this.$$.ctx[29]}get reset(){return this.$$.ctx[30]}get showDropdown(){return this.$$.ctx[31]}get hideDropdown(){return this.$$.ctx[32]}}function Wc(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&w(e)}}}function Z3(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&&Wc(n);return{c(){l&&l.c(),e=D(),t=b("span"),s=V(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),g(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Wc(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)+"")&&le(s,i)},i:G,o:G,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function G3(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Yc extends be{constructor(e){super(),ge(this,e,G3,Z3,he,{item:0})}}const X3=n=>({}),Kc=n=>({});function Q3(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[12],Kc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Rt(i,t,s,s[12],e?Ft(t,s[12],l,X3):qt(s[12]),Kc)},i(s){e||(E(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function x3(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:[Q3]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Je(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new tu({props:o}),se.push(()=>_e(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?on(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&xn(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function e$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Et(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Yc}=e,{optionComponent:c=Yc}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h($){$=z.toArray($,!0);let T=[];for(let M of $){const C=z.findByKey(r,d,M);C&&T.push(C)}$.length&&!T.length||t(0,u=a?T:T[0])}async function _($){let T=z.toArray($,!0).map(M=>M[d]);r.length&&t(6,m=a?T:T[0])}function v($){u=$,t(0,u)}function k($){Ve.call(this,n,$)}function y($){Ve.call(this,n,$)}return n.$$set=$=>{e=Je(Je({},e),Qn($)),t(5,s=Et(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,m=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,s,m,d,l,v,k,y,o]}class is extends be{constructor(e){super(),ge(this,e,e$,x3,he,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function t$(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r<s.length;r+=1)o=Je(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new is({props:o}),se.push(()=>_e(e,"keyOfSelected",l)),{c(){H(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&14?on(s,[a&2&&{class:"field-type-select "+r[1]},a&4&&{items:r[2]},a&8&&xn(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function n$(n,e,t){const i=["value","class"];let s=Et(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=Je(Je({},e),Qn(u)),t(3,s=Et(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class i$ extends be{constructor(e){super(),ge(this,e,n$,t$,he,{value:0,class:1})}}function s$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Min length"),s=D(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].min&&re(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function l$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=V("Max length"),s=D(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].max&&re(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function o$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=V("Regex pattern"),s=D(),l=b("input"),r=D(),a=b("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[0].pattern),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&re(l,c[0].pattern)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function r$(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[s$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[l$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[o$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),H(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){S(c,e,d),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),f=!0},p(c,[d]){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&97&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&97&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&97&&(_.$$scope={dirty:d,ctx:c}),u.$set(_)},i(c){f||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&w(e),j(i),j(o),j(u)}}}function a$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=pt(this.value),t(0,s)}function o(){s.max=pt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class u$ extends be{constructor(e){super(),ge(this,e,a$,r$,he,{key:1,options:0})}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Min"),s=D(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].min),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].min&&re(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function c$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=V("Max"),s=D(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].max),a||(u=Y(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].max&&re(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function d$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[f$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[c$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function p$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=pt(this.value),t(0,s)}function o(){s.max=pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class m$ extends be{constructor(e){super(),ge(this,e,p$,d$,he,{key:1,options:0})}}function h$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class _$ extends be{constructor(e){super(),ge(this,e,h$,null,he,{key:0,options:1})}}function g$(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r<l.length;r+=1)o=Je(o,l[r]);return{c(){e=b("input"),Xn(e,o)},m(r,a){S(r,e,a),e.value=o.value,e.autofocus&&e.focus(),i||(s=Y(e,"input",n[4]),i=!0)},p(r,[a]){Xn(e,o=on(l,[a&8&&t!==(t=r[3].type||"text")&&{type:t},a&4&&e.value!==r[2]&&{value:r[2]},a&8&&r[3]])),"value"in o&&(e.value=o.value)},i:G,o:G,d(r){r&&w(e),i=!1,s()}}}function b$(n,e,t){let i;const s=["value","separator"];let l=Et(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=z.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Je(Je({},e),Qn(u)),t(3,l=Et(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class Fs extends be{constructor(e){super(),ge(this,e,b$,g$,he,{value:0,separator:1})}}function v$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[2](v)}let _={id:n[4],disabled:!z.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(_.value=n[0].exceptDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),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[4]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.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(v,k){(!c||k&16&&l!==(l=v[4]))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]),k&1&&(y.disabled=!z.isEmpty(v[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=v[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function y$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[3](v)}let _={id:n[4]+".options.onlyDomains",disabled:!z.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(_.value=n[0].onlyDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),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[4]+".options.onlyDomains"),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.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(v,k){(!c||k&16&&l!==(l=v[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=v[4]+".options.onlyDomains"),k&1&&(y.disabled=!z.isEmpty(v[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=v[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function k$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[v$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[y$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function w$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Ab extends be{constructor(e){super(),ge(this,e,w$,k$,he,{key:1,options:0})}}function S$(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new Ab({props:r}),se.push(()=>_e(e,"key",l)),se.push(()=>_e(e,"options",o)),{c(){H(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],ke(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],ke(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function $$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class T$ extends be{constructor(e){super(),ge(this,e,$$,S$,he,{key:0,options:1})}}function C$(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class M$ extends be{constructor(e){super(),ge(this,e,C$,null,he,{key:0,options:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bl={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},an=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Mn=function(n){return n===!0?1:0};function Jc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Tr=function(n){return n instanceof Array?n:[n]};function Qt(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function st(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 io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Ib(n,e){if(e(n))return n;if(n.parentNode)return Ib(n.parentNode,e)}function so(n,e){var t=st("div","numInputWrapper"),i=st("input","numInput "+n),s=st("span","arrowUp"),l=st("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function _n(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Cr=function(){},No=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},D$={D:Cr,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*Mn(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:Cr,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:Cr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Wi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},rl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[rl.w(n,e,t)]},F:function(n,e,t){return No(rl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return an(rl.h(n,e,t))},H:function(n){return an(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[Mn(n.getHours()>11)]},M:function(n,e){return No(n.getMonth(),!0,e)},S:function(n){return an(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return an(n.getFullYear(),4)},d:function(n){return an(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return an(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return an(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)}},Pb=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?bl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return rl[c]&&m[d-1]!=="\\"?rl[c](r,f,t):c!=="\\"?c:""}).join("")}},ca=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?bl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ws).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var h=void 0,_=[],v=0,k=0,y="";v<d.length;v++){var $=d[v],T=$==="\\",M=d[v-1]==="\\"||T;if(Wi[$]&&!M){y+=Wi[$];var C=new RegExp(y).exec(l);C&&(h=!0)&&_[$!=="Y"?"push":"unshift"]({fn:D$[$],val:C[++k]})}else T||(y+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),_.forEach(function(O){var A=O.fn,I=O.val;return f=A(f,I,u)||f}),f=h?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function gn(n,e,t){return t===void 0&&(t=!0),t!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):n.getTime()-e.getTime()}var O$=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Mr=function(n,e,t){return n*3600+e*60+t},E$=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},A$={DAY:864e5};function Dr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var Ut=globalThis&&globalThis.__assign||function(){return Ut=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},Ut.apply(this,arguments)},Zc=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),s=0,e=0;e<t;e++)for(var l=arguments[e],o=0,r=l.length;o<r;o++,s++)i[s]=l[o];return i},I$=300;function P$(n,e){var t={config:Ut(Ut({},ws),Ot.defaultConfig),l10n:bl};t.parseDate=ca({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=_,t._setHoursFromDate=d,t._positionCalendar=we,t.changeMonth=Z,t.changeYear=ye,t.clear=de,t.close=ve,t.onMouseOver=ze,t._createElement=st,t.createDay=C,t.destroy=Te,t.isEnabled=Se,t.jumpToDate=y,t.updateValue=zt,t.open=Fe,t.redraw=bt,t.set=Wn,t.setDate=Ll,t.toggle=rn;function i(){t.utils={getDaysInMonth:function(B,W){return B===void 0&&(B=t.currentMonth),W===void 0&&(W=t.currentYear),B===1&&(W%4===0&&W%100!==0||W%400===0)?29:t.l10n.daysInMonth[B]}}}function s(){t.element=t.input=n,t.isOpen=!1,Vt(),ie(),Nl(),ls(),i(),t.isMobile||M(),k(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),zt(!1)),r();var B=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&B&&we(),Ze("onReady")}function l(){var B;return((B=t.calendarContainer)===null||B===void 0?void 0:B.getRootNode()).activeElement||document.activeElement}function o(B){return B.bind(t)}function r(){var B=t.config;B.weekNumbers===!1&&B.showMonths===1||B.noCalendar!==!0&&window.requestAnimationFrame(function(){if(t.calendarContainer!==void 0&&(t.calendarContainer.style.visibility="hidden",t.calendarContainer.style.display="block"),t.daysContainer!==void 0){var W=(t.days.offsetWidth+1)*B.showMonths;t.daysContainer.style.width=W+"px",t.calendarContainer.style.width=W+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(B){if(t.selectedDates.length===0){var W=t.config.minDate===void 0||gn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ee=Dr(t.config);W.setHours(ee.hours,ee.minutes,ee.seconds,W.getMilliseconds()),t.selectedDates=[W],t.latestSelectedDateObj=W}B!==void 0&&B.type!=="blur"&&Fl(B);var oe=t._input.value;c(),zt(),t._input.value!==oe&&t._debouncedChange()}function u(B,W){return B%12+12*Mn(W===t.l10n.amPM[1])}function f(B){switch(B%24){case 0:case 12:return 12;default:return B%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var B=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,W=(parseInt(t.minuteElement.value,10)||0)%60,ee=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(B=u(B,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&gn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&gn(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 Oe=Mr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ee=Mr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ce=Mr(B,W,ee);if(Ce>Ee&&Ce<Oe){var Ue=E$(Oe);B=Ue[0],W=Ue[1],ee=Ue[2]}}else{if($e){var Le=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;B=Math.min(B,Le.getHours()),B===Le.getHours()&&(W=Math.min(W,Le.getMinutes())),W===Le.getMinutes()&&(ee=Math.min(ee,Le.getSeconds()))}if(oe){var He=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;B=Math.max(B,He.getHours()),B===He.getHours()&&W<He.getMinutes()&&(W=He.getMinutes()),W===He.getMinutes()&&(ee=Math.max(ee,He.getSeconds()))}}m(B,W,ee)}}function d(B){var W=B||t.latestSelectedDateObj;W&&W instanceof Date&&m(W.getHours(),W.getMinutes(),W.getSeconds())}function m(B,W,ee){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(B%24,W,ee||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=an(t.config.time_24hr?B:(12+B)%12+12*Mn(B%12===0)),t.minuteElement.value=an(W),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Mn(B>=12)]),t.secondElement!==void 0&&(t.secondElement.value=an(ee)))}function h(B){var W=_n(B),ee=parseInt(W.value)+(B.delta||0);(ee/1e3>1||B.key==="Enter"&&!/[^\d]/.test(ee.toString()))&&ye(ee)}function _(B,W,ee,oe){if(W instanceof Array)return W.forEach(function($e){return _(B,$e,ee,oe)});if(B instanceof Array)return B.forEach(function($e){return _($e,W,ee,oe)});B.addEventListener(W,ee,oe),t._handlers.push({remove:function(){return B.removeEventListener(W,ee,oe)}})}function v(){Ze("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ee){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ee+"]"),function(oe){return _(oe,"click",t[ee])})}),t.isMobile){os();return}var B=Jc(te,50);if(t._debouncedChange=Jc(v,I$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ee){t.config.mode==="range"&&ze(_n(ee))}),_(t._input,"keydown",ce),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",ce),!t.config.inline&&!t.config.static&&_(window,"resize",B),window.ontouchstart!==void 0?_(window.document,"touchstart",Re):_(window.document,"mousedown",Re),_(window.document,"focus",Re,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",Xt),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",di)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var W=function(ee){return _n(ee).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",$),_([t.hourElement,t.minuteElement],["focus","click"],W),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ee){a(ee)})}t.config.allowInput&&_(t._input,"blur",lt)}function y(B,W){var ee=B!==void 0?t.parseDate(B):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),oe=t.currentYear,$e=t.currentMonth;try{ee!==void 0&&(t.currentYear=ee.getFullYear(),t.currentMonth=ee.getMonth())}catch(Oe){Oe.message="Invalid date supplied: "+ee,t.config.errorHandler(Oe)}W&&t.currentYear!==oe&&(Ze("onYearChange"),R()),W&&(t.currentYear!==oe||t.currentMonth!==$e)&&Ze("onMonthChange"),t.redraw()}function $(B){var W=_n(B);~W.className.indexOf("arrow")&&T(B,W.classList.contains("arrowUp")?1:-1)}function T(B,W,ee){var oe=B&&_n(B),$e=ee||oe&&oe.parentNode&&oe.parentNode.firstChild,Oe=rs("increment");Oe.delta=W,$e&&$e.dispatchEvent(Oe)}function M(){var B=window.document.createDocumentFragment();if(t.calendarContainer=st("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(B.appendChild(U()),t.innerContainer=st("div","flatpickr-innerContainer"),t.config.weekNumbers){var W=fe(),ee=W.weekWrapper,oe=W.weekNumbers;t.innerContainer.appendChild(ee),t.weekNumbers=oe,t.weekWrapper=ee}t.rContainer=st("div","flatpickr-rContainer"),t.rContainer.appendChild(ne()),t.daysContainer||(t.daysContainer=st("div","flatpickr-days"),t.daysContainer.tabIndex=-1),F(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),B.appendChild(t.innerContainer)}t.config.enableTime&&B.appendChild(X()),Qt(t.calendarContainer,"rangeMode",t.config.mode==="range"),Qt(t.calendarContainer,"animate",t.config.animate===!0),Qt(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(B);var $e=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&&(!$e&&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 Oe=st("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Oe,t.element),Oe.appendChild(t.element),t.altInput&&Oe.appendChild(t.altInput),Oe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function C(B,W,ee,oe){var $e=Se(W,!0),Oe=st("span",B,W.getDate().toString());return Oe.dateObj=W,Oe.$i=oe,Oe.setAttribute("aria-label",t.formatDate(W,t.config.ariaDateFormat)),B.indexOf("hidden")===-1&&gn(W,t.now)===0&&(t.todayDateElem=Oe,Oe.classList.add("today"),Oe.setAttribute("aria-current","date")),$e?(Oe.tabIndex=-1,ti(W)&&(Oe.classList.add("selected"),t.selectedDateElem=Oe,t.config.mode==="range"&&(Qt(Oe,"startRange",t.selectedDates[0]&&gn(W,t.selectedDates[0],!0)===0),Qt(Oe,"endRange",t.selectedDates[1]&&gn(W,t.selectedDates[1],!0)===0),B==="nextMonthDay"&&Oe.classList.add("inRange")))):Oe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&as(W)&&!ti(W)&&Oe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&B!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(W)+"</span>"),Ze("onDayCreate",Oe),Oe}function O(B){B.focus(),t.config.mode==="range"&&ze(B)}function A(B){for(var W=B>0?0:t.config.showMonths-1,ee=B>0?t.config.showMonths:-1,oe=W;oe!=ee;oe+=B)for(var $e=t.daysContainer.children[oe],Oe=B>0?0:$e.children.length-1,Ee=B>0?$e.children.length:-1,Ce=Oe;Ce!=Ee;Ce+=B){var Ue=$e.children[Ce];if(Ue.className.indexOf("hidden")===-1&&Se(Ue.dateObj))return Ue}}function I(B,W){for(var ee=B.className.indexOf("Month")===-1?B.dateObj.getMonth():t.currentMonth,oe=W>0?t.config.showMonths:-1,$e=W>0?1:-1,Oe=ee-t.currentMonth;Oe!=oe;Oe+=$e)for(var Ee=t.daysContainer.children[Oe],Ce=ee-t.currentMonth===Oe?B.$i+W:W<0?Ee.children.length-1:0,Ue=Ee.children.length,Le=Ce;Le>=0&&Le<Ue&&Le!=(W>0?Ue:-1);Le+=$e){var He=Ee.children[Le];if(He.className.indexOf("hidden")===-1&&Se(He.dateObj)&&Math.abs(B.$i-Le)>=Math.abs(W))return O(He)}t.changeMonth($e),L(A($e),0)}function L(B,W){var ee=l(),oe=We(ee||document.body),$e=B!==void 0?B:oe?ee:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:A(W>0?1:-1);$e===void 0?t._input.focus():oe?I($e,W):O($e)}function N(B,W){for(var ee=(new Date(B,W,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((W-1+12)%12,B),$e=t.utils.getDaysInMonth(W,B),Oe=window.document.createDocumentFragment(),Ee=t.config.showMonths>1,Ce=Ee?"prevMonthDay hidden":"prevMonthDay",Ue=Ee?"nextMonthDay hidden":"nextMonthDay",Le=oe+1-ee,He=0;Le<=oe;Le++,He++)Oe.appendChild(C("flatpickr-day "+Ce,new Date(B,W-1,Le),Le,He));for(Le=1;Le<=$e;Le++,He++)Oe.appendChild(C("flatpickr-day",new Date(B,W,Le),Le,He));for(var mt=$e+1;mt<=42-ee&&(t.config.showMonths===1||He%7!==0);mt++,He++)Oe.appendChild(C("flatpickr-day "+Ue,new Date(B,W+1,mt%$e),mt,He));var Yn=st("div","dayContainer");return Yn.appendChild(Oe),Yn}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var B=document.createDocumentFragment(),W=0;W<t.config.showMonths;W++){var ee=new Date(t.currentYear,t.currentMonth,1);ee.setMonth(t.currentMonth+W),B.appendChild(N(ee.getFullYear(),ee.getMonth()))}t.daysContainer.appendChild(B),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&ze()}}function R(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var B=function(oe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&oe<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&oe>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var W=0;W<12;W++)if(B(W)){var ee=st("option","flatpickr-monthDropdown-month");ee.value=new Date(t.currentYear,W).getMonth().toString(),ee.textContent=No(W,t.config.shorthandCurrentMonth,t.l10n),ee.tabIndex=-1,t.currentMonth===W&&(ee.selected=!0),t.monthsDropdownContainer.appendChild(ee)}}}function K(){var B=st("div","flatpickr-month"),W=window.document.createDocumentFragment(),ee;t.config.showMonths>1||t.config.monthSelectorType==="static"?ee=st("span","cur-month"):(t.monthsDropdownContainer=st("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ee){var Ce=_n(Ee),Ue=parseInt(Ce.value,10);t.changeMonth(Ue-t.currentMonth),Ze("onMonthChange")}),R(),ee=t.monthsDropdownContainer);var oe=so("cur-year",{tabindex:"-1"}),$e=oe.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Oe=st("div","flatpickr-current-month");return Oe.appendChild(ee),Oe.appendChild(oe),W.appendChild(Oe),B.appendChild(W),{container:B,yearElement:$e,monthElement:ee}}function x(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var B=t.config.showMonths;B--;){var W=K();t.yearElements.push(W.yearElement),t.monthElements.push(W.monthElement),t.monthNav.appendChild(W.container)}t.monthNav.appendChild(t.nextMonthNav)}function U(){return t.monthNav=st("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=st("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=st("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,x(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(B){t.__hidePrevMonthArrow!==B&&(Qt(t.prevMonthNav,"flatpickr-disabled",B),t.__hidePrevMonthArrow=B)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(B){t.__hideNextMonthArrow!==B&&(Qt(t.nextMonthNav,"flatpickr-disabled",B),t.__hideNextMonthArrow=B)}}),t.currentYearElement=t.yearElements[0],Li(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var B=Dr(t.config);t.timeContainer=st("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var W=st("span","flatpickr-time-separator",":"),ee=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ee.getElementsByTagName("input")[0];var oe=so("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?B.hours:f(B.hours)),t.minuteElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():B.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(ee),t.timeContainer.appendChild(W),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=so("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():B.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(st("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=st("span","flatpickr-am-pm",t.l10n.amPM[Mn((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 ne(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=st("div","flatpickr-weekdays");for(var B=t.config.showMonths;B--;){var W=st("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(W)}return J(),t.weekdayContainer}function J(){if(t.weekdayContainer){var B=t.l10n.firstDayOfWeek,W=Zc(t.l10n.weekdays.shorthand);B>0&&B<W.length&&(W=Zc(W.splice(B,W.length),W.splice(0,B)));for(var ee=t.config.showMonths;ee--;)t.weekdayContainer.children[ee].innerHTML=`
<span class='flatpickr-weekday'>
`+W.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var B=st("div","flatpickr-weekwrapper");B.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var W=st("div","flatpickr-weeks");return B.appendChild(W),{weekWrapper:B,weekNumbers:W}}function Z(B,W){W===void 0&&(W=!0);var ee=W?B:B-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ze("onYearChange"),R()),F(),Ze("onMonthChange"),Li())}function de(B,W){if(B===void 0&&(B=!0),W===void 0&&(W=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,W===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=Dr(t.config),oe=ee.hours,$e=ee.minutes,Oe=ee.seconds;m(oe,$e,Oe)}t.redraw(),B&&Ze("onChange")}function ve(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function Te(){t.config!==void 0&&Ze("onDestroy");for(var B=t._handlers.length;B--;)t._handlers[B].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 W=t.calendarContainer.parentNode;if(W.lastChild&&W.removeChild(W.lastChild),W.parentNode){for(;W.firstChild;)W.parentNode.insertBefore(W.firstChild,W);W.parentNode.removeChild(W)}}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(ee){try{delete t[ee]}catch{}})}function Ne(B){return t.calendarContainer.contains(B)}function Re(B){if(t.isOpen&&!t.config.inline){var W=_n(B),ee=Ne(W),oe=W===t.input||W===t.altInput||t.element.contains(W)||B.path&&B.path.indexOf&&(~B.path.indexOf(t.input)||~B.path.indexOf(t.altInput)),$e=!oe&&!ee&&!Ne(B.relatedTarget),Oe=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(W)});$e&&Oe&&(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 ye(B){if(!(!B||t.config.minDate&&B<t.config.minDate.getFullYear()||t.config.maxDate&&B>t.config.maxDate.getFullYear())){var W=B,ee=t.currentYear!==W;t.currentYear=W||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)),ee&&(t.redraw(),Ze("onYearChange"),R())}}function Se(B,W){var ee;W===void 0&&(W=!0);var oe=t.parseDate(B,void 0,W);if(t.config.minDate&&oe&&gn(oe,t.config.minDate,W!==void 0?W:!t.minDateHasTime)<0||t.config.maxDate&&oe&&gn(oe,t.config.maxDate,W!==void 0?W:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var $e=!!t.config.enable,Oe=(ee=t.config.enable)!==null&&ee!==void 0?ee:t.config.disable,Ee=0,Ce=void 0;Ee<Oe.length;Ee++){if(Ce=Oe[Ee],typeof Ce=="function"&&Ce(oe))return $e;if(Ce instanceof Date&&oe!==void 0&&Ce.getTime()===oe.getTime())return $e;if(typeof Ce=="string"){var Ue=t.parseDate(Ce,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?$e:!$e}else if(typeof Ce=="object"&&oe!==void 0&&Ce.from&&Ce.to&&oe.getTime()>=Ce.from.getTime()&&oe.getTime()<=Ce.to.getTime())return $e}return!$e}function We(B){return t.daysContainer!==void 0?B.className.indexOf("hidden")===-1&&B.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(B):!1}function lt(B){var W=B.target===t._input,ee=t._input.value.trimEnd()!==Ni();W&&ee&&!(B.relatedTarget&&Ne(B.relatedTarget))&&t.setDate(t._input.value,!0,B.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function ce(B){var W=_n(B),ee=t.config.wrap?n.contains(W):W===t._input,oe=t.config.allowInput,$e=t.isOpen&&(!oe||!ee),Oe=t.config.inline&&ee&&!oe;if(B.keyCode===13&&ee){if(oe)return t.setDate(t._input.value,!0,W===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),W.blur();t.open()}else if(Ne(W)||$e||Oe){var Ee=!!t.timeContainer&&t.timeContainer.contains(W);switch(B.keyCode){case 13:Ee?(B.preventDefault(),a(),Gt()):di(B);break;case 27:B.preventDefault(),Gt();break;case 8:case 46:ee&&!t.config.allowInput&&(B.preventDefault(),t.clear());break;case 37:case 39:if(!Ee&&!ee){B.preventDefault();var Ce=l();if(t.daysContainer!==void 0&&(oe===!1||Ce&&We(Ce))){var Ue=B.keyCode===39?1:-1;B.ctrlKey?(B.stopPropagation(),Z(Ue),L(A(1),0)):L(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:B.preventDefault();var Le=B.keyCode===40?1:-1;t.daysContainer&&W.$i!==void 0||W===t.input||W===t.altInput?B.ctrlKey?(B.stopPropagation(),ye(t.currentYear-Le),L(A(1),0)):Ee||L(void 0,Le*7):W===t.currentYearElement?ye(t.currentYear-Le):t.config.enableTime&&(!Ee&&t.hourElement&&t.hourElement.focus(),a(B),t._debouncedChange());break;case 9:if(Ee){var He=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(hn){return hn}),mt=He.indexOf(W);if(mt!==-1){var Yn=He[mt+(B.shiftKey?-1:1)];B.preventDefault(),(Yn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(W)&&B.shiftKey&&(B.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&W===t.amPM)switch(B.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),zt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),zt();break}(ee||Ne(W))&&Ze("onKeyDown",B)}function ze(B,W){if(W===void 0&&(W="flatpickr-day"),!(t.selectedDates.length!==1||B&&(!B.classList.contains(W)||B.classList.contains("flatpickr-disabled")))){for(var ee=B?B.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ee,t.selectedDates[0].getTime()),Oe=Math.max(ee,t.selectedDates[0].getTime()),Ee=!1,Ce=0,Ue=0,Le=$e;Le<Oe;Le+=A$.DAY)Se(new Date(Le),!0)||(Ee=Ee||Le>$e&&Le<Oe,Le<oe&&(!Ce||Le>Ce)?Ce=Le:Le>oe&&(!Ue||Le<Ue)&&(Ue=Le));var He=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+W));He.forEach(function(mt){var Yn=mt.dateObj,hn=Yn.getTime(),Rs=Ce>0&&hn<Ce||Ue>0&&hn>Ue;if(Rs){mt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(us){mt.classList.remove(us)});return}else if(Ee&&!Rs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(us){mt.classList.remove(us)}),B!==void 0&&(B.classList.add(ee<=t.selectedDates[0].getTime()?"startRange":"endRange"),oe<ee&&hn===oe?mt.classList.add("startRange"):oe>ee&&hn===oe&&mt.classList.add("endRange"),hn>=Ce&&(Ue===0||hn<=Ue)&&O$(hn,oe,ee)&&mt.classList.add("inRange"))})}}function te(){t.isOpen&&!t.config.static&&!t.config.inline&&we()}function Fe(B,W){if(W===void 0&&(W=t._positionElement),t.isMobile===!0){if(B){B.preventDefault();var ee=_n(B);ee&&ee.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Ze("onOpen");return}else if(t._input.disabled||t.config.inline)return;var oe=t.isOpen;t.isOpen=!0,oe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Ze("onOpen"),we(W)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(B===void 0||!t.timeContainer.contains(B.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ot(B){return function(W){var ee=t.config["_"+B+"Date"]=t.parseDate(W,t.config.dateFormat),oe=t.config["_"+(B==="min"?"max":"min")+"Date"];ee!==void 0&&(t[B==="min"?"minDateHasTime":"maxDateHasTime"]=ee.getHours()>0||ee.getMinutes()>0||ee.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return Se($e)}),!t.selectedDates.length&&B==="min"&&d(ee),zt()),t.daysContainer&&(bt(),ee!==void 0?t.currentYearElement[B]=ee.getFullYear().toString():t.currentYearElement.removeAttribute(B),t.currentYearElement.disabled=!!oe&&ee!==void 0&&oe.getFullYear()===ee.getFullYear())}}function Vt(){var B=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],W=Ut(Ut({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ee={};t.config.parseDate=W.parseDate,t.config.formatDate=W.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(He){t.config._enable=pi(He)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(He){t.config._disable=pi(He)}});var oe=W.mode==="time";if(!W.dateFormat&&(W.enableTime||oe)){var $e=Ot.defaultConfig.dateFormat||ws.dateFormat;ee.dateFormat=W.noCalendar||oe?"H:i"+(W.enableSeconds?":S":""):$e+" H:i"+(W.enableSeconds?":S":"")}if(W.altInput&&(W.enableTime||oe)&&!W.altFormat){var Oe=Ot.defaultConfig.altFormat||ws.altFormat;ee.altFormat=W.noCalendar||oe?"h:i"+(W.enableSeconds?":S K":" K"):Oe+(" h:i"+(W.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ot("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ot("max")});var Ee=function(He){return function(mt){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(mt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ee("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ee("max")}),W.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ee,W);for(var Ce=0;Ce<B.length;Ce++)t.config[B[Ce]]=t.config[B[Ce]]===!0||t.config[B[Ce]]==="true";$r.filter(function(He){return t.config[He]!==void 0}).forEach(function(He){t.config[He]=Tr(t.config[He]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Ce=0;Ce<t.config.plugins.length;Ce++){var Ue=t.config.plugins[Ce](t)||{};for(var Le in Ue)$r.indexOf(Le)>-1?t.config[Le]=Tr(Ue[Le]).map(o).concat(t.config[Le]):typeof W[Le]>"u"&&(t.config[Le]=Ue[Le])}W.altInputClass||(t.config.altInputClass=Ae().className+" "+t.config.altInputClass),Ze("onParseConfig")}function Ae(){return t.config.wrap?n.querySelector("[data-input]"):n}function ie(){typeof t.config.locale!="object"&&typeof Ot.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Ut(Ut({},Ot.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Ot.l10ns[t.config.locale]:void 0),Wi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Wi.l="("+t.l10n.weekdays.longhand.join("|")+")",Wi.M="("+t.l10n.months.shorthand.join("|")+")",Wi.F="("+t.l10n.months.longhand.join("|")+")",Wi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var B=Ut(Ut({},e),JSON.parse(JSON.stringify(n.dataset||{})));B.time_24hr===void 0&&Ot.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Pb(t),t.parseDate=ca({config:t.config,l10n:t.l10n})}function we(B){if(typeof t.config.position=="function")return void t.config.position(t,B);if(t.calendarContainer!==void 0){Ze("onPreCalendarPosition");var W=B||t._positionElement,ee=Array.prototype.reduce.call(t.calendarContainer.children,function(Wb,Yb){return Wb+Yb.offsetHeight},0),oe=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Oe=$e[0],Ee=$e.length>1?$e[1]:null,Ce=W.getBoundingClientRect(),Ue=window.innerHeight-Ce.bottom,Le=Oe==="above"||Oe!=="below"&&Ue<ee&&Ce.top>ee,He=window.pageYOffset+Ce.top+(Le?-ee-2:W.offsetHeight+2);if(Qt(t.calendarContainer,"arrowTop",!Le),Qt(t.calendarContainer,"arrowBottom",Le),!t.config.inline){var mt=window.pageXOffset+Ce.left,Yn=!1,hn=!1;Ee==="center"?(mt-=(oe-Ce.width)/2,Yn=!0):Ee==="right"&&(mt-=oe-Ce.width,hn=!0),Qt(t.calendarContainer,"arrowLeft",!Yn&&!hn),Qt(t.calendarContainer,"arrowCenter",Yn),Qt(t.calendarContainer,"arrowRight",hn);var Rs=window.document.body.offsetWidth-(window.pageXOffset+Ce.right),us=mt+oe>window.document.body.offsetWidth,qb=Rs+oe>window.document.body.offsetWidth;if(Qt(t.calendarContainer,"rightMost",us),!t.config.static)if(t.calendarContainer.style.top=He+"px",!us)t.calendarContainer.style.left=mt+"px",t.calendarContainer.style.right="auto";else if(!qb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Rs+"px";else{var xo=nt();if(xo===void 0)return;var jb=window.document.body.offsetWidth,Hb=Math.max(0,jb/2-oe/2),Vb=".flatpickr-calendar.centerMost:before",zb=".flatpickr-calendar.centerMost:after",Bb=xo.cssRules.length,Ub="{left:"+Ce.left+"px;right:auto;}";Qt(t.calendarContainer,"rightMost",!1),Qt(t.calendarContainer,"centerMost",!0),xo.insertRule(Vb+","+zb+Ub,Bb),t.calendarContainer.style.left=Hb+"px",t.calendarContainer.style.right="auto"}}}}function nt(){for(var B=null,W=0;W<document.styleSheets.length;W++){var ee=document.styleSheets[W];if(ee.cssRules){try{ee.cssRules}catch{continue}B=ee;break}}return B??et()}function et(){var B=document.createElement("style");return document.head.appendChild(B),B.sheet}function bt(){t.config.noCalendar||t.isMobile||(R(),Li(),F())}function Gt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function di(B){B.preventDefault(),B.stopPropagation();var W=function(He){return He.classList&&He.classList.contains("flatpickr-day")&&!He.classList.contains("flatpickr-disabled")&&!He.classList.contains("notAllowed")},ee=Ib(_n(B),W);if(ee!==void 0){var oe=ee,$e=t.latestSelectedDateObj=new Date(oe.dateObj.getTime()),Oe=($e.getMonth()<t.currentMonth||$e.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Ee=ti($e);Ee?t.selectedDates.splice(parseInt(Ee),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),gn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(He,mt){return He.getTime()-mt.getTime()}));if(c(),Oe){var Ce=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),Ce&&(Ze("onYearChange"),R()),Ze("onMonthChange")}if(Li(),F(),zt(),!Oe&&t.config.mode!=="range"&&t.config.showMonths===1?O(oe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ue=t.config.mode==="single"&&!t.config.enableTime,Le=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ue||Le)&&Gt()}v()}}var ct={locale:[ie,J],showMonths:[x,r,ne],minDate:[y],maxDate:[y],positionElement:[Pi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Wn(B,W){if(B!==null&&typeof B=="object"){Object.assign(t.config,B);for(var ee in B)ct[ee]!==void 0&&ct[ee].forEach(function(oe){return oe()})}else t.config[B]=W,ct[B]!==void 0?ct[B].forEach(function(oe){return oe()}):$r.indexOf(B)>-1&&(t.config[B]=Tr(W));t.redraw(),zt(!0)}function ss(B,W){var ee=[];if(B instanceof Array)ee=B.map(function(oe){return t.parseDate(oe,W)});else if(B instanceof Date||typeof B=="number")ee=[t.parseDate(B,W)];else if(typeof B=="string")switch(t.config.mode){case"single":case"time":ee=[t.parseDate(B,W)];break;case"multiple":ee=B.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,W)});break;case"range":ee=B.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,W)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(B)));t.selectedDates=t.config.allowInvalidPreload?ee:ee.filter(function(oe){return oe instanceof Date&&Se(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,$e){return oe.getTime()-$e.getTime()})}function Ll(B,W,ee){if(W===void 0&&(W=!1),ee===void 0&&(ee=t.config.dateFormat),B!==0&&!B||B instanceof Array&&B.length===0)return t.clear(W);ss(B,ee),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),y(void 0,W),d(),t.selectedDates.length===0&&t.clear(!1),zt(W),W&&Ze("onChange")}function pi(B){return B.slice().map(function(W){return typeof W=="string"||typeof W=="number"||W instanceof Date?t.parseDate(W,void 0,!0):W&&typeof W=="object"&&W.from&&W.to?{from:t.parseDate(W.from,void 0),to:t.parseDate(W.to,void 0)}:W}).filter(function(W){return W})}function ls(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var B=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);B&&ss(B,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()<t.now.getTime()?t.config.maxDate:t.now,t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth(),t.selectedDates.length>0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Nl(){if(t.input=Ae(),!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=st(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"),Pi()}function Pi(){t._positionElement=t.config.positionElement||t._input}function os(){var B=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=st("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=B,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=B==="datetime-local"?"Y-m-d\\TH:i:S":B==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(W){t.setDate(_n(W).value,!1,t.mobileFormatStr),Ze("onChange"),Ze("onClose")})}function rn(B){if(t.isOpen===!0)return t.close();t.open(B)}function Ze(B,W){if(t.config!==void 0){var ee=t.config[B];if(ee!==void 0&&ee.length>0)for(var oe=0;ee[oe]&&oe<ee.length;oe++)ee[oe](t.selectedDates,t.input.value,t,W);B==="onChange"&&(t.input.dispatchEvent(rs("change")),t.input.dispatchEvent(rs("input")))}}function rs(B){var W=document.createEvent("Event");return W.initEvent(B,!0,!0),W}function ti(B){for(var W=0;W<t.selectedDates.length;W++){var ee=t.selectedDates[W];if(ee instanceof Date&&gn(ee,B)===0)return""+W}return!1}function as(B){return t.config.mode!=="range"||t.selectedDates.length<2?!1:gn(B,t.selectedDates[0])>=0&&gn(B,t.selectedDates[1])<=0}function Li(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(B,W){var ee=new Date(t.currentYear,t.currentMonth,1);ee.setMonth(t.currentMonth+W),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[W].textContent=No(ee.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ee.getMonth().toString(),B.value=ee.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYear<t.config.minDate.getFullYear()),t._hideNextMonthArrow=t.config.maxDate!==void 0&&(t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth+1>t.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function Ni(B){var W=B||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ee){return t.formatDate(ee,W)}).filter(function(ee,oe,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ee)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function zt(B){B===void 0&&(B=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ni(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ni(t.config.altFormat)),B!==!1&&Ze("onValueUpdate")}function Xt(B){var W=_n(B),ee=t.prevMonthNav.contains(W),oe=t.nextMonthNav.contains(W);ee||oe?Z(ee?-1:1):t.yearElements.indexOf(W)>=0?W.select():W.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):W.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Fl(B){B.preventDefault();var W=B.type==="keydown",ee=_n(B),oe=ee;t.amPM!==void 0&&ee===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Mn(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(oe.getAttribute("min")),Oe=parseFloat(oe.getAttribute("max")),Ee=parseFloat(oe.getAttribute("step")),Ce=parseInt(oe.value,10),Ue=B.delta||(W?B.which===38?1:-1:0),Le=Ce+Ee*Ue;if(typeof oe.value<"u"&&oe.value.length===2){var He=oe===t.hourElement,mt=oe===t.minuteElement;Le<$e?(Le=Oe+Le+Mn(!He)+(Mn(He)&&Mn(!t.amPM)),mt&&T(void 0,-1,t.hourElement)):Le>Oe&&(Le=oe===t.hourElement?Le-Oe-Mn(!t.amPM):$e,mt&&T(void 0,1,t.hourElement)),t.amPM&&He&&(Ee===1?Le+Ce===23:Math.abs(Le-Ce)>Ee)&&(t.amPM.textContent=t.l10n.amPM[Mn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=an(Le)}}return s(),t}function Ss(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=P$(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Ss(this,n)},HTMLElement.prototype.flatpickr=function(n){return Ss([this],n)});var Ot=function(n,e){return typeof n=="string"?Ss(window.document.querySelectorAll(n),e):n instanceof Node?Ss([n],e):Ss(n,e)};Ot.defaultConfig={};Ot.l10ns={en:Ut({},bl),default:Ut({},bl)};Ot.localize=function(n){Ot.l10ns.default=Ut(Ut({},Ot.l10ns.default),n)};Ot.setDefaults=function(n){Ot.defaultConfig=Ut(Ut({},Ot.defaultConfig),n)};Ot.parseDate=ca({});Ot.formatDate=Pb({});Ot.compareDates=gn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Ss(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Ot);function L$(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=Je(i,t[s]);return{c(){e=b("input"),Xn(e,i)},m(s,l){S(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){Xn(e,i=on(t,[l&2&&s[1]]))},d(s){s&&w(e),n[11](null)}}}function N$(n){let e;const t=n[10].default,i=Nt(t,n,n[9],null),s=i||L$(n);return{c(){s&&s.c()},m(l,o){s&&s.m(l,o),e=!0},p(l,[o]){i?i.p&&(!e||o&512)&&Rt(i,t,l,l[9],e?Ft(t,l[9],o,null):qt(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(E(s,l),e=!0)},o(l){P(s,l),e=!1},d(l){s&&s.d(l)}}}function F$(n){return n.charAt(2).toLowerCase()+n.substring(3)}function Gc(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function Xc(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function R$(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Et(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:_=void 0}=e;Zt(()=>{const T=f??h,M=k(d);return M.onReady.push((C,O,A)=>{a===void 0&&y(C,O,A),sn().then(()=>{t(8,m=!0)})}),t(3,_=Ot(T,Object.assign(M,f?{wrap:!0}:{}))),()=>{_.destroy()}});const v=Tt();function k(T={}){T=Object.assign({},T);for(const M of r){const C=(O,A,I)=>{v(F$(M),[O,A,I])};M in T?(Array.isArray(T[M])||(T[M]=[T[M]]),T[M].push(C)):T[M]=[C]}return T.onChange&&!T.onChange.includes(y)&&T.onChange.push(y),T}function y(T,M,C){const O=Gc(C,T);!Xc(a,O)&&(a||O)&&t(2,a=O),t(4,u=M)}function $(T){se[T?"unshift":"push"](()=>{h=T,t(0,h)})}return n.$$set=T=>{e=Je(Je({},e),Qn(T)),t(1,s=Et(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,h=T.input),"flatpickr"in T&&t(3,_=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(Xc(a,Gc(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[T,M]of Object.entries(k(d)))_.set(T,M)},[h,s,a,_,u,f,c,d,m,o,l,$]}class nu extends be{constructor(e){super(),ge(this,e,R$,N$,he,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function q$(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:z.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new nu({props:u}),se.push(()=>_e(l,"formattedValue",a)),{c(){e=b("label"),t=V("Min date (UTC)"),s=D(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),g(e,t),S(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]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function j$(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:z.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new nu({props:u}),se.push(()=>_e(l,"formattedValue",a)),{c(){e=b("label"),t=V("Max date (UTC)"),s=D(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),g(e,t),S(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]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function H$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[q$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[j$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function V$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class z$ extends be{constructor(e){super(),ge(this,e,V$,H$,he,{key:1,options:0})}}function B$(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new Fs({props:c}),se.push(()=>_e(l,"value",f)),{c(){e=b("label"),t=V("Choices"),s=D(),H(l.$$.fragment),r=D(),a=b("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),q(l,d,m),S(d,r,m),S(d,a,m),u=!0},p(d,m){(!u||m&16&&i!==(i=d[4]))&&p(e,"for",i);const h={};m&16&&(h.id=d[4]),!o&&m&1&&(o=!0,h.value=d[0].values,ke(()=>o=!1)),l.$set(h)},i(d){u||(E(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&w(e),d&&w(s),j(l,d),d&&w(r),d&&w(a)}}}function U$(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Max select"),s=D(),l=b("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].maxSelect),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSelect&&re(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function W$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[B$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[U$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){S(a,e,u),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function Y$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class K$ extends be{constructor(e){super(),ge(this,e,Y$,W$,he,{key:1,options:0})}}function J$(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Z$(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Qc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O='"{"a":1,"b":2}"',A,I,L,N,F,R,K,x,U,X,ne,J,fe;return{c(){e=b("div"),t=b("div"),i=b("div"),s=V("In order to support seamlessly both "),l=b("code"),l.textContent="application/json",o=V(` and
`),r=b("code"),r.textContent="multipart/form-data",a=V(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=V(` field is a
`),c=b("strong"),c.textContent="plain string",d=V(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=D(),v=b("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=D(),y=b("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=D(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),C=b("li"),A=V(O),I=V(" is converted to the json "),L=b("code"),L.textContent='{"a":1,"b":2}',N=D(),F=b("li"),F.textContent="numeric strings are converted to json number",R=D(),K=b("li"),K.textContent="double quoted strings are left as they are (aka. without normalizations)",x=D(),U=b("li"),U.textContent="any other string (empty string too) is double quoted",X=V(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),ne=b("code"),ne.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(Z,de){S(Z,e,de),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(m,h),g(m,_),g(m,v),g(m,k),g(m,y),g(m,$),g(m,T),g(m,M),g(m,C),g(C,A),g(C,I),g(C,L),g(m,N),g(m,F),g(m,R),g(m,K),g(m,x),g(m,U),g(i,X),g(i,ne),fe=!0},i(Z){fe||(Z&&xe(()=>{J||(J=je(e,At,{duration:150},!0)),J.run(1)}),fe=!0)},o(Z){Z&&(J||(J=je(e,At,{duration:150},!1)),J.run(0)),fe=!1},d(Z){Z&&w(e),Z&&J&&J.end()}}}function G$(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?Z$:J$}let u=a(n),f=u(n),c=n[0]&&Qc();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),c&&c.c(),l=Me(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){S(d,e,m),g(e,t),g(e,i),f.m(e,null),S(d,s,m),c&&c.m(d,m),S(d,l,m),o||(r=Y(e,"click",n[3]),o=!0)},p(d,[m]){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[0]?c?m&1&&E(c,1):(c=Qc(),c.c(),E(c,1),c.m(l.parentNode,l)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){E(c)},o(d){P(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function X$(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class Q$ extends be{constructor(e){super(),ge(this,e,X$,G$,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function x$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=V(t),s=D(),l=b("small"),r=V(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),g(e,i),S(a,s,u),S(a,l,u),g(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:G,o:G,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function eT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class xc extends be{constructor(e){super(),ge(this,e,eT,x$,he,{item:0})}}const tT=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function nT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Max file size (bytes)"),s=D(),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")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].maxSize),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSize&&re(l,u[0].maxSize)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Max files"),s=D(),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",""),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].maxSelect),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].maxSelect&&re(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function sT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=D(),i=b("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=D(),l=b("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=D(),r=b("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',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){S(f,e,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),S(f,o,c),S(f,r,c),a||(u=[Y(e,"click",n[6]),Y(i,"click",n[7]),Y(l,"click",n[8]),Y(r,"click",n[9])],a=!0)},p:G,d(f){f&&w(e),f&&w(t),f&&w(i),f&&w(s),f&&w(l),f&&w(o),f&&w(r),a=!1,Pe(u)}}}function lT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$;function T(C){n[5](C)}let M={id:n[12],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[2],labelComponent:xc,optionComponent:xc};return n[0].mimeTypes!==void 0&&(M.keyOfSelected=n[0].mimeTypes),r=new is({props:M}),se.push(()=>_e(r,"keyOfSelected",T)),v=new ei({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[sT]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),f=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=D(),h=b("i"),_=D(),H(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(C,O){S(C,e,O),g(e,t),g(e,i),g(e,s),S(C,o,O),q(r,C,O),S(C,u,O),S(C,f,O),g(f,c),g(c,d),g(c,m),g(c,h),g(c,_),q(v,c,null),k=!0,y||($=Ie(Be.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(C,O){(!k||O&4096&&l!==(l=C[12]))&&p(e,"for",l);const A={};O&4096&&(A.id=C[12]),O&4&&(A.items=C[2]),!a&&O&1&&(a=!0,A.keyOfSelected=C[0].mimeTypes,ke(()=>a=!1)),r.$set(A);const I={};O&8193&&(I.$$scope={dirty:O,ctx:C}),v.$set(I)},i(C){k||(E(r.$$.fragment,C),E(v.$$.fragment,C),k=!0)},o(C){P(r.$$.fragment,C),P(v.$$.fragment,C),k=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(v),y=!1,$()}}}function oT(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function rT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;function C(A){n[10](A)}let O={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(O.value=n[0].thumbs),r=new Fs({props:O}),se.push(()=>_e(r,"value",C)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[oT]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=D(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=D(),v=b("i"),k=D(),H(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(v,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(A,I){S(A,e,I),g(e,t),g(e,i),g(e,s),S(A,o,I),q(r,A,I),S(A,u,I),S(A,f,I),g(f,c),g(f,d),g(f,m),g(m,h),g(m,_),g(m,v),g(m,k),q(y,m,null),$=!0,T||(M=Ie(Be.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(A,I){(!$||I&4096&&l!==(l=A[12]))&&p(e,"for",l);const L={};I&4096&&(L.id=A[12]),!a&&I&1&&(a=!0,L.value=A[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};I&8192&&(N.$$scope={dirty:I,ctx:A}),y.$set(N)},i(A){$||(E(r.$$.fragment,A),E(y.$$.fragment,A),$=!0)},o(A){P(r.$$.fragment,A),P(y.$$.fragment,A),$=!1},d(A){A&&w(e),A&&w(o),j(r,A),A&&w(u),A&&w(f),j(y),T=!1,M()}}}function aT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[nT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[iT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[lT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[rT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),H(u.$$.fragment),f=D(),c=b("div"),H(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(h,_){S(h,e,_),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(h,[_]){const v={};_&2&&(v.name="schema."+h[1]+".options.maxSize"),_&12289&&(v.$$scope={dirty:_,ctx:h}),i.$set(v);const k={};_&2&&(k.name="schema."+h[1]+".options.maxSelect"),_&12289&&(k.$$scope={dirty:_,ctx:h}),o.$set(k);const y={};_&2&&(y.name="schema."+h[1]+".options.mimeTypes"),_&12293&&(y.$$scope={dirty:_,ctx:h}),u.$set(y);const $={};_&2&&($.name="schema."+h[1]+".options.thumbs"),_&12289&&($.$$scope={dirty:_,ctx:h}),d.$set($)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),E(d.$$.fragment,h),m=!0)},o(h){P(i.$$.fragment,h),P(o.$$.fragment,h),P(u.$$.fragment,h),P(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function uT(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=tT.slice();function o(){if(z.isEmpty(s.mimeTypes))return;const _=[];for(const v of s.mimeTypes)l.find(k=>k.mimeType===v)||_.push({mimeType:v});_.length&&t(2,l=l.concat(_))}function r(){s.maxSize=pt(this.value),t(0,s)}function a(){s.maxSelect=pt(this.value),t(0,s)}function u(_){n.$$.not_equal(s.mimeTypes,_)&&(s.mimeTypes=_,t(0,s))}const f=()=>{t(0,s.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},c=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},d=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},m=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function h(_){n.$$.not_equal(s.thumbs,_)&&(s.thumbs=_,t(0,s))}return n.$$set=_=>{"key"in _&&t(1,i=_.key),"options"in _&&t(0,s=_.options)},n.$$.update=()=>{n.$$.dirty&1&&(z.isEmpty(s)?t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]}):o())},[s,i,l,r,a,u,f,c,d,m,h]}class fT extends be{constructor(e){super(),ge(this,e,uT,aT,he,{key:1,options:0})}}function cT(n){let e,t,i,s,l;return{c(){e=b("hr"),t=D(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[10]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function dT(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[23],searchable:n[3].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3],$$slots:{afterOptions:[cT]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=V("Collection"),s=D(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),c&8&&(d.searchable=f[3].length>5),c&8&&(d.items=f[3]),c&16777232&&(d.$$scope={dirty:c,ctx:f}),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function pT(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[23],items:n[6]};return n[2]!==void 0&&(u.keyOfSelected=n[2]),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=V("Relation type"),s=D(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&4&&(o=!0,d.keyOfSelected=f[2],ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function ed(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[mT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[hT,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),H(t.$$.fragment),i=D(),s=b("div"),H(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&25165825&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&25165825&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(E(t.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function mT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Min select"),s=D(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].minSelect),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&&pt(l.value)!==u[0].minSelect&&re(l,u[0].minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function hT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=V("Max select"),s=D(),l=b("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].minSelect||2)},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].maxSelect),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].minSelect||2)&&p(l,"min",r),c&1&&pt(l.value)!==f[0].maxSelect&&re(l,f[0].maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function _T(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[15](h)}let m={multiple:!0,searchable:!0,id:n[23],selectPlaceholder:"Auto",items:n[5]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new tu({props:m}),se.push(()=>_e(r,"selected",d)),{c(){e=b("label"),t=b("span"),t.textContent="Display fields",i=D(),s=b("i"),o=D(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23])},m(h,_){S(h,e,_),g(e,t),g(e,i),g(e,s),S(h,o,_),q(r,h,_),u=!0,f||(c=Ie(Be.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,_){(!u||_&8388608&&l!==(l=h[23]))&&p(e,"for",l);const v={};_&8388608&&(v.id=h[23]),_&32&&(v.items=h[5]),!a&&_&1&&(a=!0,v.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(v)},i(h){u||(E(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function gT(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[7]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=V("Delete main record on relation delete"),s=D(),H(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;i=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[dT,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",$$slots:{default:[pT,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}});let k=!n[2]&&ed(n);f=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[_T,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[gT,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}});let y={};return _=new iu({props:y}),n[17](_),_.$on("save",n[18]),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),k&&k.c(),a=D(),u=b("div"),H(f.$$.fragment),c=D(),d=b("div"),H(m.$$.fragment),h=D(),H(_.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(u,"class","col-sm-6"),p(d,"class","col-sm-6"),p(e,"class","grid")},m($,T){S($,e,T),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),k&&k.m(e,null),g(e,a),g(e,u),q(f,u,null),g(e,c),g(e,d),q(m,d,null),S($,h,T),q(_,$,T),v=!0},p($,[T]){const M={};T&2&&(M.name="schema."+$[1]+".options.collectionId"),T&25165849&&(M.$$scope={dirty:T,ctx:$}),i.$set(M);const C={};T&25165828&&(C.$$scope={dirty:T,ctx:$}),o.$set(C),$[2]?k&&(ae(),P(k,1,1,()=>{k=null}),ue()):k?(k.p($,T),T&4&&E(k,1)):(k=ed($),k.c(),E(k,1),k.m(e,a));const O={};T&2&&(O.name="schema."+$[1]+".options.displayFields"),T&25165857&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const A={};T&2&&(A.name="schema."+$[1]+".options.cascadeDelete"),T&25165825&&(A.$$scope={dirty:T,ctx:$}),m.$set(A);const I={};_.$set(I)},i($){v||(E(i.$$.fragment,$),E(o.$$.fragment,$),E(k),E(f.$$.fragment,$),E(m.$$.fragment,$),E(_.$$.fragment,$),v=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(k),P(f.$$.fragment,$),P(m.$$.fragment,$),P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(i),j(o),k&&k.d(),j(f),j(m),$&&w(h),n[17](null),j(_,$)}}}function vT(n,e,t){let i,s;Ye(n,Ai,L=>t(3,s=L));let{key:l=""}=e,{options:o={}}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}],a=[{label:"False",value:!1},{label:"True",value:!0}],u=["id","created","updated"],f=["username","email","emailVisibility","verified"];let c=null,d=[],m=null,h=(o==null?void 0:o.maxSelect)==1,_=h;function v(){var L;if(t(5,d=u.slice(0)),!!i){i.isAuth&&t(5,d=d.concat(f));for(const N of i.schema)d.push(N.name);if(((L=o==null?void 0:o.displayFields)==null?void 0:L.length)>0)for(let N=o.displayFields.length-1;N>=0;N--)d.includes(o.displayFields[N])||o.displayFields.splice(N,1)}}const k=()=>c==null?void 0:c.show();function y(L){n.$$.not_equal(o.collectionId,L)&&(o.collectionId=L,t(0,o),t(2,h),t(9,_))}function $(L){h=L,t(2,h),t(0,o),t(9,_)}function T(){o.minSelect=pt(this.value),t(0,o),t(2,h),t(9,_)}function M(){o.maxSelect=pt(this.value),t(0,o),t(2,h),t(9,_)}function C(L){n.$$.not_equal(o.displayFields,L)&&(o.displayFields=L,t(0,o),t(2,h),t(9,_))}function O(L){n.$$.not_equal(o.cascadeDelete,L)&&(o.cascadeDelete=L,t(0,o),t(2,h),t(9,_))}function A(L){se[L?"unshift":"push"](()=>{c=L,t(4,c)})}const I=L=>{var N,F;(F=(N=L==null?void 0:L.detail)==null?void 0:N.collection)!=null&&F.id&&t(0,o.collectionId=L.detail.collection.id,o)};return n.$$set=L=>{"key"in L&&t(1,l=L.key),"options"in L&&t(0,o=L.options)},n.$$.update=()=>{n.$$.dirty&5&&z.isEmpty(o)&&(t(0,o={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]}),t(2,h=!0),t(9,_=h)),n.$$.dirty&516&&_!=h&&(t(9,_=h),h?(t(0,o.minSelect=null,o),t(0,o.maxSelect=1,o)):t(0,o.maxSelect=null,o)),n.$$.dirty&9&&(i=s.find(L=>L.id==o.collectionId)||null),n.$$.dirty&257&&m!=o.collectionId&&(t(8,m=o.collectionId),v())},[o,l,h,s,c,d,r,a,m,_,k,y,$,T,M,C,O,A,I]}class yT extends be{constructor(e){super(),ge(this,e,vT,bT,he,{key:1,options:0})}}function kT(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[43],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new i$({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=V("Type"),s=D(),H(l.$$.fragment),p(e,"for",i=n[43])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&4096&&i!==(i=f[43]))&&p(e,"for",i);const d={};c[1]&4096&&(d.id=f[43]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function td(n){let e,t,i;return{c(){e=b("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){S(s,e,l),i=!0},i(s){i||(xe(()=>{t||(t=je(e,Pn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=je(e,Pn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function wT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[5]&&td();return{c(){e=b("label"),t=b("span"),t.textContent="Name",i=D(),h&&h.c(),l=D(),o=b("input"),p(t,"class","txt"),p(e,"for",s=n[43]),p(o,"type","text"),p(o,"id",r=n[43]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(_,v){S(_,e,v),g(e,t),g(e,i),h&&h.m(e,null),S(_,l,v),S(_,o,v),c=!0,n[0].id||o.focus(),d||(m=Y(o,"input",n[18]),d=!0)},p(_,v){_[5]?h&&(ae(),P(h,1,1,()=>{h=null}),ue()):h?v[0]&32&&E(h,1):(h=td(),h.c(),E(h,1),h.m(e,null)),(!c||v[1]&4096&&s!==(s=_[43]))&&p(e,"for",s),(!c||v[1]&4096&&r!==(r=_[43]))&&p(o,"id",r),(!c||v[0]&1&&a!==(a=_[0].id&&_[0].system))&&(o.disabled=a),(!c||v[0]&1&&u!==(u=!_[0].id))&&(o.autofocus=u),(!c||v[0]&1&&f!==(f=_[0].name)&&o.value!==f)&&(o.value=f)},i(_){c||(E(h),c=!0)},o(_){P(h),c=!1},d(_){_&&w(e),h&&h.d(),_&&w(l),_&&w(o),d=!1,m()}}}function ST(n){let e,t,i;function s(o){n[29](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new yT({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $T(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new fT({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TT(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Q$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CT(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new K$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MT(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new z$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DT(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new M$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OT(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new T$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ET(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new Ab({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function AT(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new _$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function IT(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new m$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PT(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new u$({props:l}),se.push(()=>_e(e,"options",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function LT(n){let e,t,i,s,l,o=gs(n[0])+"",r,a,u,f,c,d,m;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),r=V(o),a=D(),u=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(l,"class","txt"),p(u,"class","ri-information-line link-hint"),p(s,"for",c=n[43])},m(h,_){S(h,e,_),e.checked=n[0].required,S(h,i,_),S(h,s,_),g(s,l),g(l,r),g(s,a),g(s,u),d||(m=[Y(e,"change",n[30]),Ie(f=Be.call(null,u,{text:`Requires the field value to be ${gs(n[0])}
(aka. not ${z.zeroDefaultStr(n[0])}).`,position:"right"}))],d=!0)},p(h,_){_[1]&4096&&t!==(t=h[43])&&p(e,"id",t),_[0]&1&&(e.checked=h[0].required),_[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&_[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${z.zeroDefaultStr(h[0])}).`,position:"right"}),_[1]&4096&&c!==(c=h[43])&&p(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Pe(m)}}}function nd(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[NT,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function NT(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[43]),p(s,"for",o=n[43])},m(u,f){S(u,e,f),e.checked=n[0].unique,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[31]),r=!0)},p(u,f){f[1]&4096&&t!==(t=u[43])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&4096&&o!==(o=u[43])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function id(n){let e,t,i,s,l,o,r,a,u,f;a=new ei({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[FT]},$$scope:{ctx:n}}});let c=n[8]&&sd(n);return{c(){e=b("div"),t=b("div"),i=D(),s=b("div"),l=b("button"),o=b("i"),r=D(),H(a.$$.fragment),u=D(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,m){S(d,e,m),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),q(a,l,null),g(s,u),c&&c.m(s,null),f=!0},p(d,m){const h={};m[1]&8192&&(h.$$scope={dirty:m,ctx:d}),a.$set(h),d[8]?c?c.p(d,m):(c=sd(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(E(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function FT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function sd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[3])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function RT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;s=new pe({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[kT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[wT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const O=[PT,IT,AT,ET,OT,DT,MT,CT,TT,$T,ST],A=[];function I(F,R){return F[0].type==="text"?0:F[0].type==="number"?1:F[0].type==="bool"?2:F[0].type==="email"?3:F[0].type==="url"?4:F[0].type==="editor"?5:F[0].type==="date"?6:F[0].type==="select"?7:F[0].type==="json"?8:F[0].type==="file"?9:F[0].type==="relation"?10:-1}~(f=I(n))&&(c=A[f]=O[f](n)),h=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[LT,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&nd(n),N=!n[0].toDelete&&id(n);return{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),H(r.$$.fragment),a=D(),u=b("div"),c&&c.c(),d=D(),m=b("div"),H(h.$$.fragment),_=D(),v=b("div"),L&&L.c(),k=D(),N&&N.c(),y=D(),$=b("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(v,"class","col-sm-4 flex"),p(t,"class","grid"),p($,"type","submit"),p($,"class","hidden"),p($,"tabindex","-1"),p(e,"class","field-form")},m(F,R){S(F,e,R),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),~f&&A[f].m(u,null),g(t,d),g(t,m),q(h,m,null),g(t,_),g(t,v),L&&L.m(v,null),g(t,k),N&&N.m(t,null),g(e,y),g(e,$),T=!0,M||(C=[Y(e,"dragstart",HT),Y(e,"submit",ft(n[32]))],M=!0)},p(F,R){const K={};R[0]&1&&(K.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(K.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(K.$$scope={dirty:R,ctx:F}),s.$set(K);const x={};R[0]&33&&(x.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),R[0]&2&&(x.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(x.$$scope={dirty:R,ctx:F}),r.$set(x);let U=f;f=I(F),f===U?~f&&A[f].p(F,R):(c&&(ae(),P(A[U],1,1,()=>{A[U]=null}),ue()),~f?(c=A[f],c?c.p(F,R):(c=A[f]=O[f](F),c.c()),E(c,1),c.m(u,null)):c=null);const X={};R[0]&1|R[1]&12288&&(X.$$scope={dirty:R,ctx:F}),h.$set(X),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&E(L,1)):(L=nd(F),L.c(),E(L,1),L.m(v,null)):L&&(ae(),P(L,1,1,()=>{L=null}),ue()),F[0].toDelete?N&&(ae(),P(N,1,1,()=>{N=null}),ue()):N?(N.p(F,R),R[0]&1&&E(N,1)):(N=id(F),N.c(),E(N,1),N.m(t,null))},i(F){T||(E(s.$$.fragment,F),E(r.$$.fragment,F),E(c),E(h.$$.fragment,F),E(L),E(N),T=!0)},o(F){P(s.$$.fragment,F),P(r.$$.fragment,F),P(c),P(h.$$.fragment,F),P(L),P(N),T=!1},d(F){F&&w(e),j(s),j(r),~f&&A[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe(C)}}}function ld(n){let e,t,i,s,l=n[0].system&&od(),o=!n[0].id&&rd(n),r=n[0].required&&ad(n),a=n[0].unique&&ud();return{c(){e=b("div"),l&&l.c(),t=D(),o&&o.c(),i=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=od(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=rd(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ad(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=ud(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function od(n){let e;return{c(){e=b("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rd(n){let e;return{c(){e=b("span"),e.textContent="New",p(e,"class","label"),Q(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){S(t,e,i)},p(t,i){i[0]&257&&Q(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&w(e)}}}function ad(n){let e,t=gs(n[0])+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function ud(n){let e;return{c(){e=b("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function cd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",kn(n[16])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function qT(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,_,v,k=!n[0].toDelete&&ld(n),y=n[7]&&!n[0].system&&fd(),$=n[0].toDelete&&cd(n);return{c(){e=b("div"),t=b("span"),i=b("i"),l=D(),o=b("strong"),a=V(r),f=D(),k&&k.c(),c=D(),d=b("div"),m=D(),y&&y.c(),h=D(),$&&$.c(),_=Me(),p(i,"class",s=Si(z.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),Q(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),S(T,f,M),k&&k.m(T,M),S(T,c,M),S(T,d,M),S(T,m,M),y&&y.m(T,M),S(T,h,M),$&&$.m(T,M),S(T,_,M),v=!0},p(T,M){(!v||M[0]&1&&s!==(s=Si(z.getFieldTypeIcon(T[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!v||M[0]&1)&&r!==(r=(T[0].name||"-")+"")&&le(a,r),(!v||M[0]&1&&u!==(u=T[0].name))&&p(o,"title",u),(!v||M[0]&1)&&Q(o,"txt-strikethrough",T[0].toDelete),T[0].toDelete?k&&(k.d(1),k=null):k?k.p(T,M):(k=ld(T),k.c(),k.m(c.parentNode,c)),T[7]&&!T[0].system?y?M[0]&129&&E(y,1):(y=fd(),y.c(),E(y,1),y.m(h.parentNode,h)):y&&(ae(),P(y,1,1,()=>{y=null}),ue()),T[0].toDelete?$?$.p(T,M):($=cd(T),$.c(),$.m(_.parentNode,_)):$&&($.d(1),$=null)},i(T){v||(E(y),v=!0)},o(T){P(y),v=!1},d(T){T&&w(e),T&&w(f),k&&k.d(T),T&&w(c),T&&w(d),T&&w(m),y&&y.d(T),T&&w(h),$&&$.d(T),T&&w(_)}}}function jT(n){let e,t;const i=[{draggable:!0},{single:!0},{interactive:n[8]},{class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion"},n[11]];let s={$$slots:{header:[qT],default:[RT]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[33](e),e.$on("expand",n[34]),e.$on("collapse",n[35]),e.$on("toggle",n[36]),e.$on("dragenter",n[37]),e.$on("dragleave",n[38]),e.$on("dragstart",n[39]),e.$on("drop",n[40]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&2309?on(i,[i[0],i[1],o[0]&256&&{interactive:l[8]},o[0]&5&&{class:l[2]||l[0].toDelete||l[0].system?"field-accordion disabled":"field-accordion"},o[0]&2048&&xn(l[11])]):{};o[0]&483|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[33](null),j(e,l)}}}function gs(n){switch(n==null?void 0:n.type){case"bool":return"Nonfalsey";case"number":return"Nonzero";default:return"Nonempty"}}const HT=n=>{n.stopPropagation(),n.preventDefault(),n.stopImmediatePropagation()};function VT(n,e,t){let i,s,l,o;const r=["key","field","disabled","excludeNames","expand","collapse"];let a=Et(e,r),u;Ye(n,fi,ce=>t(15,u=ce));const f=Tt();let{key:c="0"}=e,{field:d=new mn}=e,{disabled:m=!1}=e,{excludeNames:h=[]}=e,_,v=d.type;function k(){_==null||_.expand()}function y(){_==null||_.collapse()}function $(){d.id?t(0,d.toDelete=!0,d):(y(),f("remove"))}function T(ce){if(ce=(""+ce).toLowerCase(),!ce)return!1;for(const ze of h)if(ze.toLowerCase()===ce)return!1;return!0}function M(ce){return z.slugify(ce)}Zt(()=>{d!=null&&d.onMountExpand&&(t(0,d.onMountExpand=!1,d),k())});const C=()=>{t(0,d.toDelete=!1,d)};function O(ce){n.$$.not_equal(d.type,ce)&&(d.type=ce,t(0,d),t(14,v),t(4,_))}const A=ce=>{t(0,d.name=M(ce.target.value),d),ce.target.value=d.name};function I(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function L(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function N(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function F(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function R(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function K(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function x(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function U(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function X(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function ne(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function J(ce){n.$$.not_equal(d.options,ce)&&(d.options=ce,t(0,d),t(14,v),t(4,_))}function fe(){d.required=this.checked,t(0,d),t(14,v),t(4,_)}function Z(){d.unique=this.checked,t(0,d),t(14,v),t(4,_)}const de=()=>{i&&y()};function ve(ce){se[ce?"unshift":"push"](()=>{_=ce,t(4,_)})}function Te(ce){Ve.call(this,n,ce)}function Ne(ce){Ve.call(this,n,ce)}function Re(ce){Ve.call(this,n,ce)}function ye(ce){Ve.call(this,n,ce)}function Se(ce){Ve.call(this,n,ce)}function We(ce){Ve.call(this,n,ce)}function lt(ce){Ve.call(this,n,ce)}return n.$$set=ce=>{e=Je(Je({},e),Qn(ce)),t(11,a=Et(e,r)),"key"in ce&&t(1,c=ce.key),"field"in ce&&t(0,d=ce.field),"disabled"in ce&&t(2,m=ce.disabled),"excludeNames"in ce&&t(12,h=ce.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&16385&&v!=d.type&&(t(14,v=d.type),t(0,d.options={},d),t(0,d.unique=!1,d)),n.$$.dirty[0]&17&&d.toDelete&&(_&&y(),d.originalName&&d.name!==d.originalName&&t(0,d.name=d.originalName,d)),n.$$.dirty[0]&1&&!d.originalName&&d.name&&t(0,d.originalName=d.name,d),n.$$.dirty[0]&1&&typeof d.toDelete>"u"&&t(0,d.toDelete=!1,d),n.$$.dirty[0]&1&&d.required&&t(0,d.nullable=!1,d),n.$$.dirty[0]&1&&t(6,i=!z.isEmpty(d.name)&&d.type),n.$$.dirty[0]&80&&(i||_&&k()),n.$$.dirty[0]&69&&t(8,s=!m&&!d.system&&!d.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=T(d.name)),n.$$.dirty[0]&32802&&t(7,o=!l||!z.isEmpty(z.getNestedVal(u,`schema.${c}`)))},[d,c,m,y,_,l,i,o,s,$,M,a,h,k,v,u,C,O,A,I,L,N,F,R,K,x,U,X,ne,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt]}class zT extends be{constructor(e){super(),ge(this,e,VT,jT,he,{key:1,field:0,disabled:2,excludeNames:12,expand:13,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[13]}get collapse(){return this.$$.ctx[3]}}function dd(n,e,t){const i=n.slice();return i[13]=e[t],i[14]=e,i[15]=t,i}function pd(n){let e,t,i,s,l,o,r,a;return{c(){e=V(`,
`),t=b("code"),t.textContent="username",i=V(` ,
`),s=b("code"),s.textContent="email",l=V(` ,
`),o=b("code"),o.textContent="emailVisibility",r=V(` ,
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function md(n,e){let t,i,s,l;function o(c){e[6](c,e[13],e[14],e[15])}function r(){return e[7](e[15])}function a(...c){return e[8](e[15],...c)}function u(...c){return e[9](e[15],...c)}let f={key:e[15],excludeNames:e[1].concat(e[4](e[13]))};return e[13]!==void 0&&(f.field=e[13]),i=new zT({props:f}),se.push(()=>_e(i,"field",o)),i.$on("remove",r),i.$on("dragstart",a),i.$on("drop",u),{key:n,first:null,c(){t=Me(),H(i.$$.fragment),this.first=t},m(c,d){S(c,t,d),q(i,c,d),l=!0},p(c,d){e=c;const m={};d&1&&(m.key=e[15]),d&3&&(m.excludeNames=e[1].concat(e[4](e[13]))),!s&&d&1&&(s=!0,m.field=e[13],ke(()=>s=!1)),i.$set(m)},i(c){l||(E(i.$$.fragment,c),l=!0)},o(c){P(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function BT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,_,v,k,y,$,T,M,C,O,A,I,L=n[0].isAuth&&pd(),N=n[0].schema;const F=R=>R[13];for(let R=0;R<N.length;R+=1){let K=dd(n,N,R),x=F(K);h.set(x,m[R]=md(x,K))}return{c(){e=b("div"),t=b("p"),i=V(`System fields:
`),s=b("code"),s.textContent="id",l=V(` ,
`),o=b("code"),o.textContent="created",r=V(` ,
`),a=b("code"),a.textContent="updated",u=D(),L&&L.c(),f=V(`
.`),c=D(),d=b("div");for(let R=0;R<m.length;R+=1)m[R].c();_=D(),v=b("div"),k=D(),y=b("button"),$=b("i"),T=D(),M=b("span"),M.textContent="New field",p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","accordions"),p(v,"class","clearfix m-t-xs"),p($,"class","ri-add-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class",C="btn btn-block "+(n[0].schema.length?"btn-transparent":"btn-secondary"))},m(R,K){S(R,e,K),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),L&&L.m(t,null),g(t,f),S(R,c,K),S(R,d,K);for(let x=0;x<m.length;x+=1)m[x].m(d,null);S(R,_,K),S(R,v,K),S(R,k,K),S(R,y,K),g(y,$),g(y,T),g(y,M),O=!0,A||(I=Y(y,"click",n[3]),A=!0)},p(R,[K]){R[0].isAuth?L||(L=pd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),K&55&&(N=R[0].schema,ae(),m=wt(m,K,F,1,R,N,h,d,ln,md,null,dd),ue()),(!O||K&1&&C!==(C="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",C)},i(R){if(!O){for(let K=0;K<N.length;K+=1)E(m[K]);O=!0}},o(R){for(let K=0;K<m.length;K+=1)P(m[K]);O=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let K=0;K<m.length;K+=1)m[K].d();R&&w(_),R&&w(v),R&&w(k),R&&w(y),A=!1,I()}}}function UT(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function WT(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(v){i.schema[v]&&(i.schema.splice(v,1),t(0,i))}function r(){const v=new mn({name:a()});v.onMountExpand=!0,i.schema.push(v),t(0,i)}function a(v="field"){let k="";for(;u(v+k);)++k;return v+k}function u(v){return!!i.schema.find(k=>k.name===v)}function f(v){let k=[];if(v.toDelete)return k;for(let y of i.schema)y===v||y.toDelete||k.push(y.name);return k}function c(v,k){if(!v)return;v.dataTransfer.dropEffect="move";const y=parseInt(v.dataTransfer.getData("text/plain")),$=i.schema;y<k?($.splice(k+1,0,$[y]),$.splice(y,1)):($.splice(k,0,$[y]),$.splice(y+1,1)),t(0,i.schema=$,i)}function d(v,k,y,$){y[$]=v,t(0,i)}const m=v=>o(v),h=(v,k)=>UT(k==null?void 0:k.detail,v),_=(v,k)=>c(k==null?void 0:k.detail,v);return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof i.schema>"u"&&(t(0,i=i||new pn),t(0,i.schema=[],i)),n.$$.dirty&1&&(i.isAuth?t(1,l=s.concat(["username","email","emailVisibility","verified","tokenKey","passwordHash","lastResetSentAt","lastVerificationSentAt","password","passwordConfirm","oldPassword"])):t(1,l=s.slice(0)))},[i,l,o,r,f,c,d,m,h,_]}class YT extends be{constructor(e){super(),ge(this,e,WT,BT,he,{collection:0})}}const KT=n=>({isAdminOnly:n&256}),hd=n=>({isAdminOnly:n[8]});function JT(n){let e,t;return e=new pe({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[tC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field m-0 "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ZT(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function GT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function XT(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-1izx0et")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function QT(n){let e;return{c(){e=V("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function xT(n){let e,t,i,s,l;return{c(){e=V(`Only admins will be able to perform this action (
`),t=b("button"),t.textContent="unlock to change",i=V(`
).`),p(t,"type","button"),p(t,"class","link-primary")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(t,"click",n[9]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function eC(n){let e;function t(l,o){return l[8]?xT:QT}let i=t(n),s=i(n);return{c(){e=b("p"),s.c()},m(l,o){S(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&&w(e),s.d()}}}function tC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,m,h,_;function v(I,L){return I[8]?XT:GT}let k=v(n),y=k(n);function $(I){n[13](I)}var T=n[6];function M(I){let L={id:I[17],baseCollection:I[1],disabled:I[8]};return I[0]!==void 0&&(L.value=I[0]),{props:L}}T&&(c=Ht(T,M(n)),n[12](c),se.push(()=>_e(c,"value",$)));const C=n[11].default,O=Nt(C,n,n[14],hd),A=O||eC(n);return{c(){e=b("label"),t=b("span"),i=V(n[2]),s=D(),l=b("span"),r=V(o),a=D(),y.c(),f=D(),c&&H(c.$$.fragment),m=D(),h=b("div"),A&&A.c(),p(t,"class","txt"),Q(t,"txt-hint",n[8]),p(l,"class","label label-sm svelte-1izx0et"),p(e,"for",u=n[17]),p(e,"class","svelte-1izx0et"),p(h,"class","help-block")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(e,s),g(e,l),g(l,r),g(e,a),y.m(e,null),S(I,f,L),c&&q(c,I,L),S(I,m,L),S(I,h,L),A&&A.m(h,null),_=!0},p(I,L){(!_||L&4)&&le(i,I[2]),(!_||L&256)&&Q(t,"txt-hint",I[8]),(!_||L&256)&&o!==(o=I[8]?"Admins only":"Custom rule")&&le(r,o),k===(k=v(I))&&y?y.p(I,L):(y.d(1),y=k(I),y&&(y.c(),y.m(e,null))),(!_||L&131072&&u!==(u=I[17]))&&p(e,"for",u);const N={};if(L&131072&&(N.id=I[17]),L&2&&(N.baseCollection=I[1]),L&256&&(N.disabled=I[8]),!d&&L&1&&(d=!0,N.value=I[0],ke(()=>d=!1)),T!==(T=I[6])){if(c){ae();const F=c;P(F.$$.fragment,1,0,()=>{j(F,1)}),ue()}T?(c=Ht(T,M(I)),I[12](c),se.push(()=>_e(c,"value",$)),H(c.$$.fragment),E(c.$$.fragment,1),q(c,m.parentNode,m)):c=null}else T&&c.$set(N);O?O.p&&(!_||L&16640)&&Rt(O,C,I,I[14],_?Ft(C,I[14],L,KT):qt(I[14]),hd):A&&A.p&&(!_||L&256)&&A.p(I,_?L:-1)},i(I){_||(c&&E(c.$$.fragment,I),E(A,I),_=!0)},o(I){c&&P(c.$$.fragment,I),P(A,I),_=!1},d(I){I&&w(e),y.d(),I&&w(f),n[12](null),c&&j(c,I),I&&w(m),I&&w(h),A&&A.d(I)}}}function nC(n){let e,t,i,s;const l=[ZT,JT],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Me()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let _d;function iC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,m=_d,h=!1;_();async function _(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-17b33459.js"),["./FilterAutocompleteInput-17b33459.js","./index-a6ccb683.js"],import.meta.url)).default),_d=m,t(7,h=!1))}async function v(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y(T){se[T?"unshift":"push"](()=>{c=T,t(5,c)})}function $(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"$$scope"in T&&t(14,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,v,k,s,y,$,l]}class $s extends be{constructor(e){super(),ge(this,e,iC,nC,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function gd(n,e,t){const i=n.slice();return i[10]=e[t],i}function bd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O,A,I=n[2],L=[];for(let N=0;N<I.length;N+=1)L[N]=vd(gd(n,I,N));return{c(){e=b("div"),t=b("div"),i=b("div"),s=b("p"),s.textContent="The following record fields are available:",l=D(),o=b("div");for(let N=0;N<L.length;N+=1)L[N].c();r=D(),a=b("hr"),u=D(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=D(),d=b("div"),d.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=D(),h=b("hr"),_=D(),v=b("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=D(),y=b("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=D(),T=b("hr"),M=D(),C=b("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,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(v,"class","m-b-0"),p(y,"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,F){S(N,e,F),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);g(i,r),g(i,a),g(i,u),g(i,f),g(i,c),g(i,d),g(i,m),g(i,h),g(i,_),g(i,v),g(i,k),g(i,y),g(i,$),g(i,T),g(i,M),g(i,C),A=!0},p(N,F){if(F&4){I=N[2];let R;for(R=0;R<I.length;R+=1){const K=gd(N,I,R);L[R]?L[R].p(K,F):(L[R]=vd(K),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=I.length}},i(N){A||(N&&xe(()=>{O||(O=je(e,At,{duration:150},!0)),O.run(1)}),A=!0)},o(N){N&&(O||(O=je(e,At,{duration:150},!1)),O.run(0)),A=!1},d(N){N&&w(e),ht(L,N),N&&O&&O.end()}}}function vd(n){let e,t=n[10]+"",i;return{c(){e=b("code"),i=V(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function yd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;function v(C){n[6](C)}let k={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new $s({props:k}),se.push(()=>_e(i,"rule",v));function y(C){n[7](C)}let $={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&($.rule=n[0].updateRule),a=new $s({props:$}),se.push(()=>_e(a,"rule",y));function T(C){n[8](C)}let M={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new $s({props:M}),se.push(()=>_e(m,"rule",T)),{c(){e=b("hr"),t=D(),H(i.$$.fragment),l=D(),o=b("hr"),r=D(),H(a.$$.fragment),f=D(),c=b("hr"),d=D(),H(m.$$.fragment),p(e,"class","m-t-sm m-b-sm"),p(o,"class","m-t-sm m-b-sm"),p(c,"class","m-t-sm m-b-sm")},m(C,O){S(C,e,O),S(C,t,O),q(i,C,O),S(C,l,O),S(C,o,O),S(C,r,O),q(a,C,O),S(C,f,O),S(C,c,O),S(C,d,O),q(m,C,O),_=!0},p(C,O){const A={};O&1&&(A.collection=C[0]),!s&&O&1&&(s=!0,A.rule=C[0].createRule,ke(()=>s=!1)),i.$set(A);const I={};O&1&&(I.collection=C[0]),!u&&O&1&&(u=!0,I.rule=C[0].updateRule,ke(()=>u=!1)),a.$set(I);const L={};O&1&&(L.collection=C[0]),!h&&O&1&&(h=!0,L.rule=C[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i(C){_||(E(i.$$.fragment,C),E(a.$$.fragment,C),E(m.$$.fragment,C),_=!0)},o(C){P(i.$$.fragment,C),P(a.$$.fragment,C),P(m.$$.fragment,C),_=!1},d(C){C&&w(e),C&&w(t),j(i,C),C&&w(l),C&&w(o),C&&w(r),j(a,C),C&&w(f),C&&w(c),C&&w(d),j(m,C)}}}function kd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[sC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new $s({props:r}),se.push(()=>_e(i,"rule",o)),{c(){e=b("hr"),t=D(),H(i.$$.fragment),p(e,"class","m-t-sm m-b-sm")},m(a,u){S(a,e,u),S(a,t,u),q(i,a,u),l=!0},p(a,u){const f={};u&1&&(f.collection=a[0]),u&8192&&(f.$$scope={dirty:u,ctx:a}),!s&&u&1&&(s=!0,f.rule=a[0].options.manageRule,ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function sC(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:G,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function lC(n){var K,x;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O=n[1]&&bd(n);function A(U){n[4](U)}let I={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(I.rule=n[0].listRule),f=new $s({props:I}),se.push(()=>_e(f,"rule",A));function L(U){n[5](U)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),_=new $s({props:N}),se.push(()=>_e(_,"rule",L));let F=!((K=n[0])!=null&&K.isView)&&yd(n),R=((x=n[0])==null?void 0:x.isAuth)&&kd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=b("button"),r=V(o),a=D(),O&&O.c(),u=D(),H(f.$$.fragment),d=D(),m=b("hr"),h=D(),H(_.$$.fragment),k=D(),F&&F.c(),y=D(),R&&R.c(),$=Me(),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-base handle"),Q(e,"fade",!n[1]),p(m,"class","m-t-sm m-b-sm")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),O&&O.m(e,null),S(U,u,X),q(f,U,X),S(U,d,X),S(U,m,X),S(U,h,X),q(_,U,X),S(U,k,X),F&&F.m(U,X),S(U,y,X),R&&R.m(U,X),S(U,$,X),T=!0,M||(C=Y(l,"click",n[3]),M=!0)},p(U,[X]){var fe,Z;(!T||X&2)&&o!==(o=U[1]?"Hide available fields":"Show available fields")&&le(r,o),U[1]?O?(O.p(U,X),X&2&&E(O,1)):(O=bd(U),O.c(),E(O,1),O.m(e,null)):O&&(ae(),P(O,1,1,()=>{O=null}),ue()),(!T||X&2)&&Q(e,"fade",!U[1]);const ne={};X&1&&(ne.collection=U[0]),!c&&X&1&&(c=!0,ne.rule=U[0].listRule,ke(()=>c=!1)),f.$set(ne);const J={};X&1&&(J.collection=U[0]),!v&&X&1&&(v=!0,J.rule=U[0].viewRule,ke(()=>v=!1)),_.$set(J),(fe=U[0])!=null&&fe.isView?F&&(ae(),P(F,1,1,()=>{F=null}),ue()):F?(F.p(U,X),X&1&&E(F,1)):(F=yd(U),F.c(),E(F,1),F.m(y.parentNode,y)),(Z=U[0])!=null&&Z.isAuth?R?(R.p(U,X),X&1&&E(R,1)):(R=kd(U),R.c(),E(R,1),R.m($.parentNode,$)):R&&(ae(),P(R,1,1,()=>{R=null}),ue())},i(U){T||(E(O),E(f.$$.fragment,U),E(_.$$.fragment,U),E(F),E(R),T=!0)},o(U){P(O),P(f.$$.fragment,U),P(_.$$.fragment,U),P(F),P(R),T=!1},d(U){U&&w(e),O&&O.d(),U&&w(u),j(f,U),U&&w(d),U&&w(m),U&&w(h),j(_,U),U&&w(k),F&&F.d(U),U&&w(y),R&&R.d(U),U&&w($),M=!1,C()}}}function oC(n,e,t){let i,{collection:s=new pn}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class rC extends be{constructor(e){super(),ge(this,e,oC,lC,he,{collection:0})}}function wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function aC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),o!==(o=a[1])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function uC(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Sd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=$d(wd(n,i,l));return{c(){e=b("div"),t=b("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),g(e,t);for(let r=0;r<s.length;r+=1)s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=wd(l,i,r);s[r]?s[r].p(a,o):(s[r]=$d(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function $d(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=V(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function fC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[uC,aC],m=[];function h(v,k){return v[2]?0:1}l=h(n),o=m[l]=d[l](n);let _=n[3].length&&Sd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=D(),_&&_.c(),f=Me(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),m[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),c=!0},p(v,k){(!c||k&256&&i!==(i=v[8]))&&p(e,"for",i);let y=l;l=h(v),l===y?m[l].p(v,k):(ae(),P(m[y],1,1,()=>{m[y]=null}),ue(),o=m[l],o?o.p(v,k):(o=m[l]=d[l](v),o.c()),E(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=Sd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){c||(E(o),c=!0)},o(v){P(o),c=!1},d(v){v&&w(e),v&&w(s),m[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function cC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[fC,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function dC(n,e,t){let i;Ye(n,fi,c=>t(4,i=c));let{collection:s=new pn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=z.getNestedVal(c,"schema",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let _ in d)for(let v in d[_]){const k=d[_][v].message,y=m[_]||_;r.push(z.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-8d5c4b7f.js"),["./CodeEditor-8d5c4b7f.js","./index-a6ccb683.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&Qi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class pC extends be{constructor(e){super(),ge(this,e,dC,cC,he,{collection:0})}}function mC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowUsernameAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function hC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[mC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _C(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function gC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function bC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?gC:_C}let u=a(n),f=u(n),c=n[3]&&Td();return{c(){e=b("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?m&8&&E(c,1):(c=Td(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function vC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Cd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[yC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[kC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(z.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(z.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(E(i.$$.fragment,u),E(o.$$.fragment,u),u&&xe(()=>{r||(r=je(e,At,{duration:150},!0)),r.run(1)}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=je(e,At,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function yC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[7](v)}let _={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),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[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!z.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(v){n[8](v)}let _={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Fs({props:_}),se.push(()=>_e(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),s=b("i"),o=D(),H(r.$$.fragment),u=D(),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[12]),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),q(r,v,k),S(v,u,k),S(v,f,k),c=!0,d||(m=Ie(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(v,k){(!c||k&4096&&l!==(l=v[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=v[12]),k&1&&(y.disabled=!z.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=v[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(v){c||(E(r.$$.fragment,v),c=!0)},o(v){P(r.$$.fragment,v),c=!1},d(v){v&&w(e),v&&w(o),j(r,v),v&&w(u),v&&w(f),d=!1,m()}}}function wC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[vC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Cd(n);return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=Me()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&E(l,1)):(l=Cd(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function SC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $C(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Md(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function TC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowEmailAuth?$C:SC}let u=a(n),f=u(n),c=n[2]&&Md();return{c(){e=b("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?m&4&&E(c,1):(c=Md(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function CC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Dd(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,At,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function MC(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[CC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Dd();return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=Me()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&E(l,1):(l=Dd(),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function DC(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function OC(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Od(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function EC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?OC:DC}let u=a(n),f=u(n),c=n[1]&&Od();return{c(){e=b("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=b("div"),s=D(),f.c(),l=D(),c&&c.c(),o=Me(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(d,m){S(d,e,m),S(d,t,m),S(d,i,m),S(d,s,m),f.m(d,m),S(d,l,m),c&&c.m(d,m),S(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?m&2&&E(c,1):(c=Od(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function AC(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Minimum password length"),s=D(),l=b("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),l.textContent="Always require email",o=D(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Be.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function PC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return s=new ks({props:{single:!0,$$slots:{header:[bC],default:[hC]},$$scope:{ctx:n}}}),o=new ks({props:{single:!0,$$slots:{header:[TC],default:[wC]},$$scope:{ctx:n}}}),a=new ks({props:{single:!0,$$slots:{header:[EC],default:[MC]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[AC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),v=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[IC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=D(),i=b("div"),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),f=b("hr"),c=D(),d=b("h4"),d.textContent="General",m=D(),H(h.$$.fragment),_=D(),H(v.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,$){S(y,e,$),S(y,t,$),S(y,i,$),q(s,i,null),g(i,l),q(o,i,null),g(i,r),q(a,i,null),S(y,u,$),S(y,f,$),S(y,c,$),S(y,d,$),S(y,m,$),q(h,y,$),S(y,_,$),q(v,y,$),k=!0},p(y,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:y}),s.$set(T);const M={};$&8197&&(M.$$scope={dirty:$,ctx:y}),o.$set(M);const C={};$&8195&&(C.$$scope={dirty:$,ctx:y}),a.$set(C);const O={};$&12289&&(O.$$scope={dirty:$,ctx:y}),h.$set(O);const A={};$&12289&&(A.$$scope={dirty:$,ctx:y}),v.$set(A)},i(y){k||(E(s.$$.fragment,y),E(o.$$.fragment,y),E(a.$$.fragment,y),E(h.$$.fragment,y),E(v.$$.fragment,y),k=!0)},o(y){P(s.$$.fragment,y),P(o.$$.fragment,y),P(a.$$.fragment,y),P(h.$$.fragment,y),P(v.$$.fragment,y),k=!1},d(y){y&&w(e),y&&w(t),y&&w(i),j(s),j(o),j(a),y&&w(u),y&&w(f),y&&w(c),y&&w(d),y&&w(m),j(h,y),y&&w(_),j(v,y)}}}function LC(n,e,t){let i,s,l,o;Ye(n,fi,_=>t(4,o=_));let{collection:r=new pn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function c(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,y;n.$$.dirty&1&&r.isAuth&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!z.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!z.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,h]}class NC extends be{constructor(e){super(),ge(this,e,LC,PC,he,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[15]=e[t],i}function Id(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Pd(n){var r;let e,t,i,s,l=n[2]&&Ld(n),o=!((r=n[1])!=null&&r.isView)&&Nd(n);return{c(){e=b("h6"),e.textContent="Changes:",t=D(),i=b("ul"),l&&l.c(),s=D(),o&&o.c(),p(i,"class","changes-list svelte-1ghly2p")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),g(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Ld(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[1])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Nd(a),o.c(),o.m(i,null))},d(a){a&&w(e),a&&w(t),a&&w(i),l&&l.d(),o&&o.d()}}}function Ld(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=b("li"),t=b("div"),i=V(`Renamed collection
`),s=b("strong"),o=V(l),r=D(),a=b("i"),u=D(),f=b("strong"),d=V(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&2&&l!==(l=m[1].originalName+"")&&le(o,l),h&2&&c!==(c=m[1].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Nd(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Fd(Ad(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Rd(Ed(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=D();for(let r=0;r<o.length;r+=1)o[r].c();t=Me()},m(r,a){for(let u=0;u<s.length;u+=1)s[u].m(r,a);S(r,e,a);for(let u=0;u<o.length;u+=1)o[u].m(r,a);S(r,t,a)},p(r,a){if(a&32){i=r[5];let u;for(u=0;u<i.length;u+=1){const f=Ad(r,i,u);s[u]?s[u].p(f,a):(s[u]=Fd(f),s[u].c(),s[u].m(e.parentNode,e))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}if(a&16){l=r[4];let u;for(u=0;u<l.length;u+=1){const f=Ed(r,l,u);o[u]?o[u].p(f,a):(o[u]=Rd(f),o[u].c(),o[u].m(t.parentNode,t))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}},d(r){ht(s,r),r&&w(e),ht(o,r),r&&w(t)}}}function Fd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=b("li"),t=b("div"),i=V(`Renamed field
`),s=b("strong"),o=V(l),r=D(),a=b("i"),u=D(),f=b("strong"),d=V(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(m,h){h&32&&l!==(l=m[15].originalName+"")&&le(o,l),h&32&&c!==(c=m[15].name+"")&&le(d,c)},d(m){m&&w(e)}}}function Rd(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=b("li"),t=V("Removed field "),i=b("span"),l=V(s),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function FC(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Id(),f=n[6]&&Pd(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),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=D(),u&&u.c(),r=D(),f&&f.c(),a=Me(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[4].length?u||(u=Id(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Pd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function RC(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function qC(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[Y(e,"click",n[9]),Y(i,"click",n[10])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function jC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[qC],header:[RC],default:[FC]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&1048694&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function HC(n,e,t){let i,s,l,o;const r=Tt();let a,u;async function f(y){t(1,u=y),await sn(),!i&&!s.length&&!l.length?d():a==null||a.show()}function c(){a==null||a.hide()}function d(){c(),r("confirm")}const m=()=>c(),h=()=>d();function _(y){se[y?"unshift":"push"](()=>{a=y,t(3,a)})}function v(y){Ve.call(this,n,y)}function k(y){Ve.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=(u==null?void 0:u.originalName)!=(u==null?void 0:u.name)),n.$$.dirty&2&&t(5,s=(u==null?void 0:u.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(4,l=(u==null?void 0:u.schema.filter(y=>y.id&&y.toDelete))||[]),n.$$.dirty&6&&t(6,o=i||!(u!=null&&u.isView))},[c,u,i,a,l,s,o,d,f,m,h,_,v,k]}class VC extends be{constructor(e){super(),ge(this,e,HC,jC,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function qd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function zC(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new YT({props:l}),se.push(()=>_e(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function BC(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new pC({props:l}),se.push(()=>_e(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jd(n){let e,t,i,s;function l(r){n[33](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new rC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Hd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new NC({props:o}),se.push(()=>_e(t,"collection",l)),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function UC(n){let e,t,i,s,l,o,r;const a=[BC,zC],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===vl&&jd(n),d=n[2].isAuth&&Hd(n);return{c(){e=b("div"),t=b("div"),s.c(),l=D(),c&&c.c(),o=D(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===yi),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){S(m,e,h),g(e,t),u[i].m(t,null),g(e,l),c&&c.m(e,null),g(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ae(),P(u[_],1,1,()=>{u[_]=null}),ue(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),E(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===yi),m[3]===vl?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=jd(m),c.c(),E(c,1),c.m(e,o)):c&&(ae(),P(c,1,1,()=>{c=null}),ue()),m[2].isAuth?d?(d.p(m,h),h[0]&4&&E(d,1)):(d=Hd(m),d.c(),E(d,1),d.m(e,null)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(m){r||(E(s),E(c),E(d),r=!0)},o(m){P(s),P(c),P(d),r=!1},d(m){m&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Vd(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[WC]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=D(),i=b("button"),s=b("i"),l=D(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),g(i,s),g(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[1]&1048576&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function WC(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,t=D(),i=b("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[23]),Y(i,"click",kn(ft(n[24])))],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function zd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[YC]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=D(),H(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Bd(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[26](n[47])}return{c(){e=b("button"),t=b("i"),s=D(),l=b("span"),r=V(o),a=V(" collection"),u=D(),p(t,"class",i=Si(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(m,h){S(m,e,h),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),g(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Si(z.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(m){m&&w(e),f=!1,c()}}}function YC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Bd(qd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Me()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=qd(s,t,o);i[o]?i[o].p(r,l):(i[o]=Bd(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Ud(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function KC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k=(n[6][n[2].type]||"N/A")+"",y,$,T,M,C,O,A,I,L,N=n[2].isNew&&zd(n),F=n[2].system&&Ud();return{c(){e=b("label"),t=V("Name"),s=D(),l=b("input"),f=D(),c=b("div"),d=b("button"),m=b("span"),h=D(),_=b("span"),v=V("Type: "),y=V(k),$=D(),N&&N.c(),C=D(),F&&F.c(),O=Me(),p(e,"for",i=n[46]),p(l,"type","text"),p(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(_,"class","txt"),p(d,"type","button"),p(d,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,p(c,"class","form-field-addon")},m(R,K){S(R,e,K),g(e,t),S(R,s,K),S(R,l,K),S(R,f,K),S(R,c,K),g(c,d),g(d,m),g(d,h),g(d,_),g(_,v),g(_,y),g(d,$),N&&N.m(d,null),S(R,C,K),F&&F.m(R,K),S(R,O,K),A=!0,n[2].isNew&&l.focus(),I||(L=Y(l,"input",n[25]),I=!0)},p(R,K){(!A||K[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!A||K[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!A||K[0]&8192)&&(l.disabled=R[13]),(!A||K[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!A||K[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!A||K[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!A||K[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?N?(N.p(R,K),K[0]&4&&E(N,1)):(N=zd(R),N.c(),E(N,1),N.m(d,null)):N&&(ae(),P(N,1,1,()=>{N=null}),ue()),(!A||K[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",T),(!A||K[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Ud(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(R){A||(E(N),A=!0)},o(R){P(N),A=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),N&&N.d(),R&&w(C),F&&F.d(R),R&&w(O),I=!1,L()}}}function Wd(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){S(r,e,a),s=!0,l||(o=Ie(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{i||(i=je(e,It,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=je(e,It,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function Yd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function Kd(n){var a,u,f;let e,t,i,s=!z.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&Jd();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=D(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),g(e,t),g(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,_;d[0]&32&&(s=!z.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),s?r?d[0]&32&&E(r,1):(r=Jd(),r.c(),E(r,1),r.m(e,null)):r&&(ae(),P(r,1,1,()=>{r=null}),ue()),d[0]&8&&Q(e,"active",c[3]===Es)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function Jd(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function JC(n){var x,U,X,ne,J,fe,Z,de;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,m,h=(x=n[2])!=null&&x.isView?"Query":"Fields",_,v,k=!z.isEmpty(n[11]),y,$,T,M,C=!z.isEmpty((U=n[5])==null?void 0:U.listRule)||!z.isEmpty((X=n[5])==null?void 0:X.viewRule)||!z.isEmpty((ne=n[5])==null?void 0:ne.createRule)||!z.isEmpty((J=n[5])==null?void 0:J.updateRule)||!z.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!z.isEmpty((de=(Z=n[5])==null?void 0:Z.options)==null?void 0:de.manageRule),O,A,I,L,N=!n[2].isNew&&!n[2].system&&Vd(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[KC,({uniqueId:ve})=>({46:ve}),({uniqueId:ve})=>[0,ve?32768:0]]},$$scope:{ctx:n}}});let F=k&&Wd(n),R=C&&Yd(),K=n[2].isAuth&&Kd(n);return{c(){e=b("h4"),i=V(t),s=D(),N&&N.c(),l=D(),o=b("form"),H(r.$$.fragment),a=D(),u=b("input"),f=D(),c=b("div"),d=b("button"),m=b("span"),_=V(h),v=D(),F&&F.c(),y=D(),$=b("button"),T=b("span"),T.textContent="API Rules",M=D(),R&&R.c(),O=D(),K&&K.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===yi),p(T,"class","txt"),p($,"type","button"),p($,"class","tab-item"),Q($,"active",n[3]===vl),p(c,"class","tabs-header stretched")},m(ve,Te){S(ve,e,Te),g(e,i),S(ve,s,Te),N&&N.m(ve,Te),S(ve,l,Te),S(ve,o,Te),q(r,o,null),g(o,a),g(o,u),S(ve,f,Te),S(ve,c,Te),g(c,d),g(d,m),g(m,_),g(d,v),F&&F.m(d,null),g(c,y),g(c,$),g($,T),g($,M),R&&R.m($,null),g(c,O),K&&K.m(c,null),A=!0,I||(L=[Y(o,"submit",ft(n[27])),Y(d,"click",n[28]),Y($,"click",n[29])],I=!0)},p(ve,Te){var Re,ye,Se,We,lt,ce,ze,te;(!A||Te[0]&4)&&t!==(t=ve[2].isNew?"New collection":"Edit collection")&&le(i,t),!ve[2].isNew&&!ve[2].system?N?(N.p(ve,Te),Te[0]&4&&E(N,1)):(N=Vd(ve),N.c(),E(N,1),N.m(l.parentNode,l)):N&&(ae(),P(N,1,1,()=>{N=null}),ue());const Ne={};Te[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(ve[13]?"disabled":"")),Te[0]&8260|Te[1]&1081344&&(Ne.$$scope={dirty:Te,ctx:ve}),r.$set(Ne),(!A||Te[0]&4)&&h!==(h=(Re=ve[2])!=null&&Re.isView?"Query":"Fields")&&le(_,h),Te[0]&2048&&(k=!z.isEmpty(ve[11])),k?F?(F.p(ve,Te),Te[0]&2048&&E(F,1)):(F=Wd(ve),F.c(),E(F,1),F.m(d,null)):F&&(ae(),P(F,1,1,()=>{F=null}),ue()),(!A||Te[0]&8)&&Q(d,"active",ve[3]===yi),Te[0]&32&&(C=!z.isEmpty((ye=ve[5])==null?void 0:ye.listRule)||!z.isEmpty((Se=ve[5])==null?void 0:Se.viewRule)||!z.isEmpty((We=ve[5])==null?void 0:We.createRule)||!z.isEmpty((lt=ve[5])==null?void 0:lt.updateRule)||!z.isEmpty((ce=ve[5])==null?void 0:ce.deleteRule)||!z.isEmpty((te=(ze=ve[5])==null?void 0:ze.options)==null?void 0:te.manageRule)),C?R?Te[0]&32&&E(R,1):(R=Yd(),R.c(),E(R,1),R.m($,null)):R&&(ae(),P(R,1,1,()=>{R=null}),ue()),(!A||Te[0]&8)&&Q($,"active",ve[3]===vl),ve[2].isAuth?K?K.p(ve,Te):(K=Kd(ve),K.c(),K.m(c,null)):K&&(K.d(1),K=null)},i(ve){A||(E(N),E(r.$$.fragment,ve),E(F),E(R),A=!0)},o(ve){P(N),P(r.$$.fragment,ve),P(F),P(R),A=!1},d(ve){ve&&w(e),ve&&w(s),N&&N.d(ve),ve&&w(l),ve&&w(o),j(r),ve&&w(f),ve&&w(c),F&&F.d(),R&&R.d(),K&&K.d(),I=!1,Pe(L)}}}function ZC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),s=b("button"),l=b("span"),r=V(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=[Y(e,"click",n[21]),Y(s,"click",n[22])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function GC(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[35],$$slots:{footer:[ZC],header:[JC],default:[UC]},$$scope:{ctx:n}};e=new Sn({props:l}),n[36](e),e.$on("hide",n[37]),e.$on("show",n[38]);let o={};return i=new VC({props:o}),n[39](i),i.$on("confirm",n[40]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&1040&&(u.beforeHide=r[35]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[36](null),j(e,r),r&&w(t),n[39](null),j(i,r)}}}const yi="schema",vl="api_rules",Es="options",XC="base",Zd="auth",Gd="view";function Or(n){return JSON.stringify(n)}function QC(n,e,t){let i,s,l,o;Ye(n,fi,te=>t(5,o=te));const r={};r[XC]="Base",r[Gd]="View",r[Zd]="Auth";const a=Tt();let u,f,c=null,d=new pn,m=!1,h=!1,_=yi,v=Or(d),k="";function y(te){t(3,_=te)}function $(te){return M(te),t(10,h=!0),y(yi),u==null?void 0:u.show()}function T(){return u==null?void 0:u.hide()}async function M(te){In({}),typeof te<"u"?(c=te,t(2,d=te==null?void 0:te.clone())):(c=null,t(2,d=new pn)),t(2,d.schema=d.schema||[],d),t(2,d.originalName=d.name||"",d),await sn(),t(20,v=Or(d))}function C(){if(d.isNew)return O();f==null||f.show(d)}function O(){if(m)return;t(9,m=!0);const te=A();let Fe;d.isNew?Fe=me.collections.create(te):Fe=me.collections.update(d.id,te),Fe.then(ot=>{Ma(),Ob(ot.id),t(10,h=!1),T(),jt(d.isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:d.isNew,collection:ot})}).catch(ot=>{me.errorResponseHandler(ot)}).finally(()=>{t(9,m=!1)})}function A(){const te=d.export();te.schema=te.schema.slice(0);for(let Fe=te.schema.length-1;Fe>=0;Fe--)te.schema[Fe].toDelete&&te.schema.splice(Fe,1);return te}function I(){c!=null&&c.id&&cn(`Do you really want to delete collection "${c==null?void 0:c.name}" and all its records?`,()=>me.collections.delete(c==null?void 0:c.id).then(()=>{T(),jt(`Successfully deleted collection "${c==null?void 0:c.name}".`),a("delete",c),P3(c)}).catch(te=>{me.errorResponseHandler(te)}))}function L(te){t(2,d.type=te,d),Qi("schema")}function N(){s?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const te=c==null?void 0:c.clone();if(te&&(te.id="",te.created="",te.updated="",te.name+="_duplicate",!z.isEmpty(te.schema)))for(const Fe of te.schema)Fe.id="";$(te),await sn(),t(20,v="")}const R=()=>T(),K=()=>C(),x=()=>N(),U=()=>I(),X=te=>{t(2,d.name=z.slugify(te.target.value),d),te.target.value=d.name},ne=te=>L(te),J=()=>{l&&C()},fe=()=>y(yi),Z=()=>y(vl),de=()=>y(Es);function ve(te){d=te,t(2,d)}function Te(te){d=te,t(2,d)}function Ne(te){d=te,t(2,d)}function Re(te){d=te,t(2,d)}const ye=()=>s&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,h=!1),T()}),!1):!0;function Se(te){se[te?"unshift":"push"](()=>{u=te,t(7,u)})}function We(te){Ve.call(this,n,te)}function lt(te){Ve.call(this,n,te)}function ce(te){se[te?"unshift":"push"](()=>{f=te,t(8,f)})}const ze=()=>O();return n.$$.update=()=>{var te;n.$$.dirty[0]&32&&(o.schema||(te=o.options)!=null&&te.query?t(11,k=z.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&d.type===Gd&&(t(2,d.createRule=null,d),t(2,d.updateRule=null,d),t(2,d.deleteRule=null,d)),n.$$.dirty[0]&4&&t(13,i=!d.isNew&&d.system),n.$$.dirty[0]&1048580&&t(4,s=v!=Or(d)),n.$$.dirty[0]&20&&t(12,l=d.isNew||s),n.$$.dirty[0]&12&&_===Es&&d.type!==Zd&&y(yi)},[y,T,d,_,s,o,r,u,f,m,h,k,l,i,C,O,I,L,N,$,v,R,K,x,U,X,ne,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze]}class iu extends be{constructor(e){super(),ge(this,e,QC,GC,he,{changeTab:0,show:19,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Xd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Qd(n){let e,t=n[1].length&&xd();return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=xd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function xd(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){S(t,e,i)},d(t){t&&w(e)}}}function ep(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,c,d;return{key:n,first:null,c(){var m;t=b("a"),i=b("i"),l=D(),o=b("span"),a=V(r),u=D(),p(i,"class",s=z.getCollectionTypeIcon(e[15].type)),p(o,"class","txt"),p(t,"href",f="/collections?collectionId="+e[15].id),p(t,"class","sidebar-list-item"),Q(t,"active",((m=e[5])==null?void 0:m.id)===e[15].id),this.first=t},m(m,h){S(m,t,h),g(t,i),g(t,l),g(t,o),g(o,a),g(t,u),c||(d=Ie(xt.call(null,t)),c=!0)},p(m,h){var _;e=m,h&8&&s!==(s=z.getCollectionTypeIcon(e[15].type))&&p(i,"class",s),h&8&&r!==(r=e[15].name+"")&&le(a,r),h&8&&f!==(f="/collections?collectionId="+e[15].id)&&p(t,"href",f),h&40&&Q(t,"active",((_=e[5])==null?void 0:_.id)===e[15].id)},d(m){m&&w(t),c=!1,d()}}}function tp(n){let e,t,i,s;return{c(){e=b("footer"),t=b("button"),t.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){S(l,e,o),g(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:G,d(l){l&&w(e),i=!1,s()}}}function xC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,_,v,k,y,$,T=n[3];const M=I=>I[15].id;for(let I=0;I<T.length;I+=1){let L=Xd(n,T,I),N=M(L);m.set(N,d[I]=ep(N,L))}let C=null;T.length||(C=Qd(n));let O=!n[7]&&tp(n),A={};return v=new iu({props:A}),n[13](v),v.$on("save",n[14]),{c(){e=b("aside"),t=b("header"),i=b("div"),s=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=b("input"),a=D(),u=b("hr"),f=D(),c=b("div");for(let I=0;I<d.length;I+=1)d[I].c();C&&C.c(),h=D(),O&&O.c(),_=D(),H(v.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),re(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);C&&C.m(c,null),g(e,h),O&&O.m(e,null),S(I,_,L),q(v,I,L),k=!0,y||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(I,[L]){(!k||L&16)&&Q(l,"hidden",!I[4]),L&1&&r.value!==I[0]&&re(r,I[0]),(!k||L&16)&&Q(i,"active",I[4]),L&42&&(T=I[3],d=wt(d,L,M,1,I,T,m,c,es,ep,null,Xd),!T.length&&C?C.p(I,L):T.length?C&&(C.d(1),C=null):(C=Qd(I),C.c(),C.m(c,null))),(!k||L&64)&&Q(c,"fade",I[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?O&&(O.d(1),O=null):O?O.p(I,L):(O=tp(I),O.c(),O.m(e,null));const N={};v.$set(N)},i(I){k||(E(v.$$.fragment,I),k=!0)},o(I){P(v.$$.fragment,I),k=!1},d(I){I&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),O&&O.d(),I&&w(_),n[13](null),j(v,I),y=!1,Pe($)}}}function e4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function t4(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,y=>t(5,o=y)),Ye(n,Ai,y=>t(9,r=y)),Ye(n,Lo,y=>t(6,a=y)),Ye(n,Cs,y=>t(7,u=y));let f,c="";function d(y){Kt(Mi,o=y,o)}const m=()=>t(0,c="");function h(){c=this.value,t(0,c)}const _=()=>f==null?void 0:f.show();function v(y){se[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var $;($=y.detail)!=null&&$.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&e4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(y=>y.id==c||y.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,h,_,v,k]}class n4 extends be{constructor(e){super(),ge(this,e,t4,xC,he,{})}}function np(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function ip(n){n[18]=n[19].default}function sp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function lp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function op(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&lp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Me(),c&&c.c(),s=D(),l=b("button"),r=V(o),a=D(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,h){S(m,t,h),c&&c.m(m,h),S(m,s,h),S(m,l,h),g(l,r),g(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=lp(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(m){m&&w(t),c&&c.d(m),m&&w(s),m&&w(l),u=!1,f()}}}function rp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:l4,then:s4,catch:i4,value:19,blocks:[,,,]};return au(t=n[15].component,s),{c(){e=Me(),s.block.c()},m(l,o){S(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)&&au(t,s)||l1(s,n,o)},i(l){i||(E(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function i4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function s4(n){ip(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=D()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){ip(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(E(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function l4(n){return{c:G,m:G,p:G,i:G,o:G,d:G}}function ap(n,e){let t,i,s,l=e[5]===e[14]&&rp(e);return{key:n,first:null,c(){t=Me(),l&&l.c(),i=Me(),this.first=t},m(o,r){S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&E(l,1)):(l=rp(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(ae(),P(l,1,1,()=>{l=null}),ue())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function o4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=_=>_[14];for(let _=0;_<c.length;_+=1){let v=sp(n,c,_),k=d(v);l.set(k,s[_]=op(k,v))}let m=Object.entries(n[3]);const h=_=>_[14];for(let _=0;_<m.length;_+=1){let v=np(n,m,_),k=h(v);u.set(k,a[_]=ap(k,v))}return{c(){var _;e=b("div"),t=b("aside"),i=b("nav");for(let v=0;v<s.length;v+=1)s[v].c();o=D(),r=b("div");for(let v=0;v<a.length;v+=1)a[v].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),Q(t,"compact",(_=n[2])==null?void 0:_.isAuth),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(_,v){S(_,e,v),g(e,t),g(t,i);for(let k=0;k<s.length;k+=1)s[k].m(i,null);g(e,o),g(e,r);for(let k=0;k<a.length;k+=1)a[k].m(r,null);f=!0},p(_,v){var k;v&106&&(c=Object.entries(_[3]),s=wt(s,v,d,1,_,c,l,i,es,op,null,sp)),(!f||v&4)&&Q(t,"compact",(k=_[2])==null?void 0:k.isAuth),v&44&&(m=Object.entries(_[3]),ae(),a=wt(a,v,h,1,_,m,u,r,ln,ap,null,np),ue())},i(_){if(!f){for(let v=0;v<m.length;v+=1)E(a[v]);f=!0}},o(_){for(let v=0;v<a.length;v+=1)P(a[v]);f=!1},d(_){_&&w(e);for(let v=0;v<s.length;v+=1)s[v].d();for(let v=0;v<a.length;v+=1)a[v].d()}}}function r4(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function a4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[r4],default:[o4]},$$scope:{ctx:n}};return e=new Sn({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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function u4(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-b93a5cc7.js"),["./ListApiDocs-b93a5cc7.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-bda1baad.js"),["./ViewApiDocs-bda1baad.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-eec0e141.js"),["./CreateApiDocs-eec0e141.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-2898cf00.js"),["./UpdateApiDocs-2898cf00.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-9d4c43d8.js"),["./DeleteApiDocs-9d4c43d8.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-e592b879.js"),["./RealtimeApiDocs-e592b879.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-fe57b928.js"),["./AuthWithPasswordDocs-fe57b928.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-9bcd6d8e.js"),["./AuthWithOAuth2Docs-9bcd6d8e.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-379bf977.js"),["./AuthRefreshDocs-379bf977.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-34543f5b.js"),["./RequestVerificationDocs-34543f5b.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-d2167d73.js"),["./ConfirmVerificationDocs-d2167d73.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-45dd0a29.js"),["./RequestPasswordResetDocs-45dd0a29.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-89d7be62.js"),["./ConfirmPasswordResetDocs-89d7be62.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-8966db3d.js"),["./RequestEmailChangeDocs-8966db3d.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-78ae5cfc.js"),["./ConfirmEmailChangeDocs-78ae5cfc.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-7e35e2a3.js"),["./AuthMethodsDocs-7e35e2a3.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-5512058e.js"),["./ListExternalAuthsDocs-5512058e.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-d6d02e8b.js"),["./UnlinkExternalAuthDocs-d6d02e8b.js","./SdkTabs-4f96f846.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new pn,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){se[k?"unshift":"push"](()=>{l=k,t(4,l)})}function _(k){Ve.call(this,n,k)}function v(k){Ve.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.isAuth?(t(3,a=Object.assign({},i,s)),!(o!=null&&o.options.allowUsernameAuth)&&!(o!=null&&o.options.allowEmailAuth)&&delete a["auth-with-password"],o!=null&&o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.isView?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,m,h,_,v]}class f4 extends be{constructor(e){super(),ge(this,e,u4,a4,he,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Username",o=D(),r=b("input"),p(t,"class",z.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","text"),p(r,"requried",a=!n[0].isNew),p(r,"placeholder",u=n[0].isNew?"Leave empty to auto generate...":n[3]),p(r,"id",f=n[12])},m(m,h){S(m,e,h),g(e,t),g(e,i),g(e,s),S(m,o,h),S(m,r,h),re(r,n[0].username),c||(d=Y(r,"input",n[4]),c=!0)},p(m,h){h&4096&&l!==(l=m[12])&&p(e,"for",l),h&1&&a!==(a=!m[0].isNew)&&p(r,"requried",a),h&1&&u!==(u=m[0].isNew?"Leave empty to auto generate...":m[3])&&p(r,"placeholder",u),h&4096&&f!==(f=m[12])&&p(r,"id",f),h&1&&r.value!==m[0].username&&re(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),c=!1,d()}}}function d4(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,_,v,k,y,$,T;return{c(){var M;e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Email",o=D(),r=b("div"),a=b("button"),u=b("span"),f=V("Public: "),d=V(c),h=D(),_=b("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[12]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=v=n[0].isNew,p(_,"autocomplete","off"),p(_,"id",k=n[12]),_.required=y=(M=n[1].options)==null?void 0:M.requireEmail,p(_,"class","svelte-1751a4d")},m(M,C){S(M,e,C),g(e,t),g(e,i),g(e,s),S(M,o,C),S(M,r,C),g(r,a),g(a,u),g(u,f),g(u,d),S(M,h,C),S(M,_,C),re(_,n[0].email),n[0].isNew&&_.focus(),$||(T=[Ie(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[5]),Y(_,"input",n[6])],$=!0)},p(M,C){var O;C&4096&&l!==(l=M[12])&&p(e,"for",l),C&1&&c!==(c=M[0].emailVisibility?"On":"Off")&&le(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&1&&v!==(v=M[0].isNew)&&(_.autofocus=v),C&4096&&k!==(k=M[12])&&p(_,"id",k),C&2&&y!==(y=(O=M[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==M[0].email&&re(_,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(h),M&&w(_),$=!1,Pe(T)}}}function up(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[p4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function p4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function fp(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[m4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[h4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[2]),p(e,"class","block")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&12289&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c&12289&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&4)&&Q(t,"p-t-xs",f[2])},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(e,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(e,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function m4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password",o=D(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[0].password),u||(f=Y(r,"input",n[8]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].password&&re(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function h4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password confirm",o=D(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[12]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[9]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&p(e,"for",l),d&4096&&a!==(a=c[12])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&re(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function _4(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].verified,S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"change",n[10]),Y(e,"change",ft(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function g4(n){var v;let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new pe({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[c4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((v=n[1].options)!=null&&v.requireEmail?"required":""),name:"email",$$slots:{default:[d4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let h=!n[0].isNew&&up(n),_=(n[0].isNew||n[2])&&fp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[_4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),h&&h.c(),u=D(),_&&_.c(),f=D(),c=b("div"),H(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,y){S(k,e,y),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),h&&h.m(a,null),g(a,u),_&&_.m(a,null),g(e,f),g(e,c),q(d,c,null),m=!0},p(k,[y]){var C;const $={};y&1&&($.class="form-field "+(k[0].isNew?"":"required")),y&12289&&($.$$scope={dirty:y,ctx:k}),i.$set($);const T={};y&2&&(T.class="form-field "+((C=k[1].options)!=null&&C.requireEmail?"required":"")),y&12291&&(T.$$scope={dirty:y,ctx:k}),o.$set(T),k[0].isNew?h&&(ae(),P(h,1,1,()=>{h=null}),ue()):h?(h.p(k,y),y&1&&E(h,1)):(h=up(k),h.c(),E(h,1),h.m(a,u)),k[0].isNew||k[2]?_?(_.p(k,y),y&5&&E(_,1)):(_=fp(k),_.c(),E(_,1),_.m(a,null)):_&&(ae(),P(_,1,1,()=>{_=null}),ue());const M={};y&12289&&(M.$$scope={dirty:y,ctx:k}),d.$set(M)},i(k){m||(E(i.$$.fragment,k),E(o.$$.fragment,k),E(h),E(_),E(d.$$.fragment,k),m=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(h),P(_),P(d.$$.fragment,k),m=!1},d(k){k&&w(e),j(i),j(o),h&&h.d(),_&&_.d(),j(d)}}}function b4(n,e,t){let{collection:i=new pn}=e,{record:s=new $i}=e,l=s.username||null,o=!1;function r(){s.username=this.value,t(0,s),t(2,o)}const a=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function u(){s.email=this.value,t(0,s),t(2,o)}function f(){o=this.checked,t(2,o)}function c(){s.password=this.value,t(0,s),t(2,o)}function d(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function m(){s.verified=this.checked,t(0,s),t(2,o)}const h=_=>{s.isNew||cn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!_.target.checked,s)})};return n.$$set=_=>{"collection"in _&&t(1,i=_.collection),"record"in _&&t(0,s=_.record)},n.$$.update=()=>{n.$$.dirty&1&&!s.username&&s.username!==null&&t(0,s.username=null,s),n.$$.dirty&4&&(o||(t(0,s.password=null,s),t(0,s.passwordConfirm=null,s),Qi("password"),Qi("passwordConfirm")))},[s,i,o,l,r,a,u,f,c,d,m,h]}class v4 extends be{constructor(e){super(),ge(this,e,b4,g4,he,{collection:1,record:0})}}function y4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("textarea"),Xn(e,l),Q(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),re(e,n[0]),t||(i=[Y(e,"input",n[6]),Y(e,"keydown",n[2])],t=!0)},p(o,[r]){Xn(e,l=on(s,[r&8&&o[3]])),r&1&&re(e,o[0]),Q(e,"svelte-1x1pbts",!0)},i:G,o:G,d(o){o&&w(e),n[5](null),t=!1,Pe(i)}}}function k4(n,e,t){const i=["value","maxHeight"];let s=Et(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Zt(()=>(u(),()=>clearTimeout(a)));function c(m){se[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(3,s=Et(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 w4 extends be{constructor(e){super(),ge(this,e,k4,y4,he,{value:0,maxHeight:4})}}function S4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new w4({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),H(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=z.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),v&2&&(k.required=_[1].required),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function $4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[S4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function T4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class C4 extends be{constructor(e){super(),ge(this,e,T4,$4,he,{field:1,value:0})}}function M4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v;return{c(){var k,y;e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",h=(y=n[1].options)==null?void 0:y.max),p(f,"step","any")},m(k,y){S(k,e,y),g(e,t),g(e,s),g(e,l),g(l,r),S(k,u,y),S(k,f,y),re(f,n[0]),_||(v=Y(f,"input",n[2]),_=!0)},p(k,y){var $,T;y&2&&i!==(i=z.getFieldTypeIcon(k[1].type))&&p(t,"class",i),y&2&&o!==(o=k[1].name+"")&&le(r,o),y&8&&a!==(a=k[3])&&p(e,"for",a),y&8&&c!==(c=k[3])&&p(f,"id",c),y&2&&d!==(d=k[1].required)&&(f.required=d),y&2&&m!==(m=($=k[1].options)==null?void 0:$.min)&&p(f,"min",m),y&2&&h!==(h=(T=k[1].options)==null?void 0:T.max)&&p(f,"max",h),y&1&&pt(f.value)!==k[0]&&re(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),_=!1,v()}}}function D4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[M4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function O4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class E4 extends be{constructor(e){super(),ge(this,e,O4,D4,he,{field:1,value:0})}}function A4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=D(),s=b("label"),o=V(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){S(f,e,c),e.checked=n[0],S(f,i,c),S(f,s,c),g(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function I4(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[A4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function P4(n,e,t){let{field:i=new mn}=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 L4 extends be{constructor(e){super(),ge(this,e,P4,I4,he,{field:1,value:0})}}function N4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),re(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=z.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&f.value!==_[0]&&re(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function F4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[N4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function R4(n,e,t){let{field:i=new mn}=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 q4 extends be{constructor(e){super(),ge(this,e,R4,F4,he,{field:1,value:0})}}function j4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("input"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),re(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(_,v){v&2&&i!==(i=z.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&8&&a!==(a=_[3])&&p(e,"for",a),v&8&&c!==(c=_[3])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&1&&re(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function H4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function V4(n,e,t){let{field:i=new mn}=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 z4 extends be{constructor(e){super(),ge(this,e,V4,H4,he,{field:1,value:0})}}function cp(n){let e,t,i,s;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){S(l,e,o),g(e,t),i||(s=[Ie(Be.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:G,d(l){l&&w(e),i=!1,Pe(s)}}}function B4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,_,v=n[0]&&!n[1].required&&cp(n);function k(T){n[6](T)}function y(T){n[7](T)}let $={id:n[8],options:z.defaultFlatpickrOptions()};return n[2]!==void 0&&($.value=n[2]),n[0]!==void 0&&($.formattedValue=n[0]),d=new nu({props:$}),se.push(()=>_e(d,"value",k)),se.push(()=>_e(d,"formattedValue",y)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),a=V(" (UTC)"),f=D(),v&&v.c(),c=D(),H(d.$$.fragment),p(t,"class",i=Si(z.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,M){S(T,e,M),g(e,t),g(e,s),g(e,l),g(l,r),g(l,a),S(T,f,M),v&&v.m(T,M),S(T,c,M),q(d,T,M),_=!0},p(T,M){(!_||M&2&&i!==(i=Si(z.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||M&2)&&o!==(o=T[1].name+"")&&le(r,o),(!_||M&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?v?v.p(T,M):(v=cp(T),v.c(),v.m(c.parentNode,c)):v&&(v.d(1),v=null);const C={};M&256&&(C.id=T[8]),!m&&M&4&&(m=!0,C.value=T[2],ke(()=>m=!1)),!h&&M&1&&(h=!0,C.formattedValue=T[0],ke(()=>h=!1)),d.$set(C)},i(T){_||(E(d.$$.fragment,T),_=!0)},o(T){P(d.$$.fragment,T),_=!1},d(T){T&&w(e),T&&w(f),v&&v.d(T),T&&w(c),j(d,T)}}}function U4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[B4,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function W4(n,e,t){let{field:i=new mn}=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 Y4 extends be{constructor(e){super(),ge(this,e,W4,U4,he,{field:1,value:0})}}function dp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=b("div"),t=V("Select up to "),s=V(i),l=V(" items."),p(e,"class","help-block")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function K4(n){var y,$,T,M,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;function _(O){n[3](O)}let v={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((y=n[0])==null?void 0:y.length)>=(($=n[1].options)==null?void 0:$.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((M=n[1].options)==null?void 0:M.values)>5};n[0]!==void 0&&(v.selected=n[0]),f=new tu({props:v}),se.push(()=>_e(f,"selected",_));let k=((C=n[1].options)==null?void 0:C.maxSelect)>1&&dp(n);return{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),H(f.$$.fragment),d=D(),k&&k.c(),m=Me(),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(O,A){S(O,e,A),g(e,t),g(e,s),g(e,l),g(l,r),S(O,u,A),q(f,O,A),S(O,d,A),k&&k.m(O,A),S(O,m,A),h=!0},p(O,A){var L,N,F,R,K;(!h||A&2&&i!==(i=z.getFieldTypeIcon(O[1].type)))&&p(t,"class",i),(!h||A&2)&&o!==(o=O[1].name+"")&&le(r,o),(!h||A&16&&a!==(a=O[4]))&&p(e,"for",a);const I={};A&16&&(I.id=O[4]),A&6&&(I.toggle=!O[1].required||O[2]),A&4&&(I.multiple=O[2]),A&7&&(I.closable=!O[2]||((L=O[0])==null?void 0:L.length)>=((N=O[1].options)==null?void 0:N.maxSelect)),A&2&&(I.items=(F=O[1].options)==null?void 0:F.values),A&2&&(I.searchable=((R=O[1].options)==null?void 0:R.values)>5),!c&&A&1&&(c=!0,I.selected=O[0],ke(()=>c=!1)),f.$set(I),((K=O[1].options)==null?void 0:K.maxSelect)>1?k?k.p(O,A):(k=dp(O),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(O){h||(E(f.$$.fragment,O),h=!0)},o(O){P(f.$$.fragment,O),h=!1},d(O){O&&w(e),O&&w(u),j(f,O),O&&w(d),k&&k.d(O),O&&w(m)}}}function J4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[K4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16: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&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Z4(n,e,t){let i,{field:s=new mn}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class G4 extends be{constructor(e){super(),ge(this,e,Z4,J4,he,{field:1,value:0})}}function X4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("textarea"),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4]),p(f,"id",c=n[4]),p(f,"class","txt-mono"),f.required=d=n[1].required,f.value=n[2]},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),S(_,f,v),m||(h=Y(f,"input",n[3]),m=!0)},p(_,v){v&2&&i!==(i=z.getFieldTypeIcon(_[1].type))&&p(t,"class",i),v&2&&o!==(o=_[1].name+"")&&le(r,o),v&16&&a!==(a=_[4])&&p(e,"for",a),v&16&&c!==(c=_[4])&&p(f,"id",c),v&2&&d!==(d=_[1].required)&&(f.required=d),v&4&&(f.value=_[2])},d(_){_&&w(e),_&&w(u),_&&w(f),m=!1,h()}}}function Q4(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[X4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16: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&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function x4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e,l=JSON.stringify(typeof s>"u"?null:s,null,2);const o=r=>{t(2,l=r.target.value),t(0,s=r.target.value.trim())};return n.$$set=r=>{"field"in r&&t(1,i=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(l==null?void 0:l.trim())&&(t(2,l=JSON.stringify(typeof s>"u"?null:s,null,2)),t(0,s=l))},[s,i,l,o]}class eM extends be{constructor(e){super(),ge(this,e,x4,Q4,he,{field:1,value:0})}}function tM(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){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&w(e)}}}function nM(n){let e,t,i;return{c(){e=b("img"),zn(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){S(s,e,l)},p(s,l){l&4&&!zn(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&&w(e)}}}function iM(n){let e;function t(l,o){return l[2]?nM:tM}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(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:G,o:G,d(l){s.d(l),l&&w(e)}}}function sM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),z.hasImageExtension(s==null?void 0:s.name)&&z.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}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 lM extends be{constructor(e){super(),ge(this,e,sM,iM,he,{file:0,size:1})}}function pp(n){let e;function t(l,o){return l[4]==="image"?rM:oM}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function oM(n){let e,t;return{c(){e=b("object"),t=V("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&w(e)}}}function rM(n){let e,t,i;return{c(){e=b("img"),zn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!zn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&w(e)}}}function aM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&pp(n);return{c(){i&&i.c(),t=Me()},m(l,o){i&&i.m(l,o),S(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=pp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function uM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=Y(e,"click",ft(n[0])),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function fM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("a"),t=V(n[2]),i=D(),s=b("i"),l=D(),o=b("div"),r=D(),a=b("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,l,d),S(c,o,d),S(c,r,d),S(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&w(e),c&&w(l),c&&w(o),c&&w(r),c&&w(a),u=!1,f()}}}function cM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[fM],header:[uM],default:[aM]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{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&542&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function dM(n,e,t){let i,s,l,o="";function r(d){d!==""&&(t(1,o=d),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(d){se[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){Ve.call(this,n,d)}function c(d){Ve.call(this,n,d)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=z.getFileType(i))},[a,o,i,l,s,r,u,f,c]}class pM extends be{constructor(e){super(),ge(this,e,dM,cM,he,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function mM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function hM(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function _M(n){let e,t,i,s,l;return{c(){e=b("img"),zn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=Y(e,"error",n[7]),s=!0)},p(o,r){r&16&&!zn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function gM(n){let e,t,i,s,l,o,r,a;function u(m,h){return m[2]==="image"?_M:m[2]==="video"||m[2]==="audio"?hM:mM}let f=u(n),c=f(n),d={};return l=new pM({props:d}),n[10](l),{c(){e=b("a"),c.c(),s=D(),H(l.$$.fragment),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[5]?"Preview":"Download")+" "+n[0])},m(m,h){S(m,e,h),c.m(e,null),S(m,s,h),q(l,m,h),o=!0,r||(a=Y(e,"click",kn(n[9])),r=!0)},p(m,[h]){f===(f=u(m))&&c?c.p(m,h):(c.d(1),c=f(m),c&&(c.c(),c.m(e,null))),(!o||h&2&&t!==(t="thumb "+(m[1]?`thumb-${m[1]}`:"")))&&p(e,"class",t),(!o||h&33&&i!==(i=(m[5]?"Preview":"Download")+" "+m[0]))&&p(e,"title",i);const _={};l.$set(_)},i(m){o||(E(l.$$.fragment,m),o=!0)},o(m){P(l.$$.fragment,m),o=!1},d(m){m&&w(e),c.d(),m&&w(s),n[10](null),j(l,m),r=!1,a()}}}function bM(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=me.getFileUrl(l,o);function c(){t(4,u="")}const d=h=>{s&&(h.preventDefault(),a==null||a.show(f))};function m(h){se[h?"unshift":"push"](()=>{a=h,t(3,a)})}return n.$$set=h=>{"record"in h&&t(8,l=h.record),"filename"in h&&t(0,o=h.filename),"size"in h&&t(1,r=h.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getFileType(o)),n.$$.dirty&5&&t(5,s=["image","audio","video"].includes(i)||o.endsWith(".pdf"))},t(4,u=f?f+"?thumb=100x100":""),[o,r,i,a,u,s,f,c,l,d,m]}class su extends be{constructor(e){super(),ge(this,e,bM,gM,he,{record:8,filename:0,size:1})}}function mp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function hp(n,e,t){const i=n.slice();i[25]=e[t],i[24]=t;const s=i[1].includes(i[24]);return i[26]=s,i}function vM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ie(Be.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function yM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function _p(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,m,h,_;s=new su({props:{record:e[2],filename:e[25]}});function v($,T){return T&18&&(h=null),h==null&&(h=!!$[1].includes($[24])),h?yM:vM}let k=v(e,-1),y=k(e);return{key:n,first:null,c(){t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),r=b("a"),u=V(a),d=D(),m=b("div"),y.c(),Q(i,"fade",e[1].includes(e[24])),p(r,"href",f=me.getFileUrl(e[2],e[25])),p(r,"class",c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),p(r,"title","Download"),p(r,"target","_blank"),p(r,"rel","noopener noreferrer"),p(o,"class","content"),p(m,"class","actions"),p(t,"class","list-item"),this.first=t},m($,T){S($,t,T),g(t,i),q(s,i,null),g(t,l),g(t,o),g(o,r),g(r,u),g(t,d),g(t,m),y.m(m,null),_=!0},p($,T){e=$;const M={};T&4&&(M.record=e[2]),T&16&&(M.filename=e[25]),s.$set(M),(!_||T&18)&&Q(i,"fade",e[1].includes(e[24])),(!_||T&16)&&a!==(a=e[25]+"")&&le(u,a),(!_||T&20&&f!==(f=me.getFileUrl(e[2],e[25])))&&p(r,"href",f),(!_||T&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&p(r,"class",c),k===(k=v(e,T))&&y?y.p(e,T):(y.d(1),y=k(e),y&&(y.c(),y.m(m,null)))},i($){_||(E(s.$$.fragment,$),_=!0)},o($){P(s.$$.fragment,$),_=!1},d($){$&&w(t),j(s),y.d()}}}function gp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,m,h,_,v;i=new lM({props:{file:n[22]}});function k(){return n[15](n[24])}return{c(){e=b("div"),t=b("figure"),H(i.$$.fragment),s=D(),l=b("div"),o=b("small"),o.textContent="New",r=D(),a=b("span"),f=V(u),d=D(),m=b("button"),m.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[22].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(y,$){S(y,e,$),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(l,r),g(l,a),g(a,f),g(e,d),g(e,m),h=!0,_||(v=[Ie(Be.call(null,m,"Remove file")),Y(m,"click",k)],_=!0)},p(y,$){n=y;const T={};$&1&&(T.file=n[22]),i.$set(T),(!h||$&1)&&u!==(u=n[22].name+"")&&le(f,u),(!h||$&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(y){h||(E(i.$$.fragment,y),h=!0)},o(y){P(i.$$.fragment,y),h=!1},d(y){y&&w(e),j(i),_=!1,Pe(v)}}}function kM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,h,_,v,k,y,$,T,M,C,O,A,I=n[4];const L=K=>K[25]+K[2].id;for(let K=0;K<I.length;K+=1){let x=hp(n,I,K),U=L(x);d.set(U,c[K]=_p(U,x))}let N=n[0],F=[];for(let K=0;K<N.length;K+=1)F[K]=gp(mp(n,N,K));const R=K=>P(F[K],1,1,()=>{F[K]=null});return{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("div");for(let K=0;K<c.length;K+=1)c[K].c();m=D();for(let K=0;K<F.length;K+=1)F[K].c();h=D(),_=b("div"),v=b("input"),k=D(),y=b("button"),$=b("i"),T=D(),M=b("span"),M.textContent="Upload new file",p(t,"class",i=z.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(v,"type","file"),p(v,"class","hidden"),v.multiple=n[5],p($,"class","ri-upload-cloud-line"),p(M,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),y.disabled=n[8],p(_,"class","list-item list-item-btn"),p(f,"class","list")},m(K,x){S(K,e,x),g(e,t),g(e,s),g(e,l),g(l,r),S(K,u,x),S(K,f,x);for(let U=0;U<c.length;U+=1)c[U].m(f,null);g(f,m);for(let U=0;U<F.length;U+=1)F[U].m(f,null);g(f,h),g(f,_),g(_,v),n[16](v),g(_,k),g(_,y),g(y,$),g(y,T),g(y,M),n[19](f),C=!0,O||(A=[Y(v,"change",n[17]),Y(y,"click",n[18])],O=!0)},p(K,x){if((!C||x&8&&i!==(i=z.getFieldTypeIcon(K[3].type)))&&p(t,"class",i),(!C||x&8)&&o!==(o=K[3].name+"")&&le(r,o),(!C||x&2097152&&a!==(a=K[21]))&&p(e,"for",a),x&1558&&(I=K[4],ae(),c=wt(c,x,L,1,K,I,d,f,ln,_p,m,hp),ue()),x&2049){N=K[0];let U;for(U=0;U<N.length;U+=1){const X=mp(K,N,U);F[U]?(F[U].p(X,x),E(F[U],1)):(F[U]=gp(X),F[U].c(),E(F[U],1),F[U].m(f,h))}for(ae(),U=N.length;U<F.length;U+=1)R(U);ue()}(!C||x&32)&&(v.multiple=K[5]),(!C||x&256)&&(y.disabled=K[8])},i(K){if(!C){for(let x=0;x<I.length;x+=1)E(c[x]);for(let x=0;x<N.length;x+=1)E(F[x]);C=!0}},o(K){for(let x=0;x<c.length;x+=1)P(c[x]);F=F.filter(Boolean);for(let x=0;x<F.length;x+=1)P(F[x]);C=!1},d(K){K&&w(e),K&&w(u),K&&w(f);for(let x=0;x<c.length;x+=1)c[x].d();ht(F,K),n[16](null),n[19](null),O=!1,Pe(A)}}}function wM(n){let e,t;return e=new pe({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[kM,({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&8&&(l.class="form-field form-field-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function SM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new mn}=e,c,d;function m(A){z.removeByValue(u,A),t(1,u)}function h(A){z.pushUnique(u,A),t(1,u)}function _(A){z.isEmpty(a[A])||a.splice(A,1),t(0,a)}function v(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const k=A=>m(A),y=A=>h(A),$=A=>_(A);function T(A){se[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},C=()=>c==null?void 0:c.click();function O(A){se[A?"unshift":"push"](()=>{d=A,t(7,d)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=z.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&z.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=z.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,o,f,s,i,c,d,l,m,h,_,r,k,y,$,T,M,C,O]}class $M extends be{constructor(e){super(),ge(this,e,SM,wM,he,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function bp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function TM(n,e){e=bp(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=bp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const CM=n=>({dragging:n&2,dragover:n&4}),vp=n=>({dragging:n[1],dragover:n[2]});function MM(n){let e,t,i,s;const l=n[8].default,o=Nt(l,n,n[7],vp);return{c(){e=b("div"),o&&o.c(),p(e,"draggable",!0),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[1]),Q(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[Y(e,"dragover",ft(n[9])),Y(e,"dragleave",ft(n[10])),Y(e,"dragend",n[11]),Y(e,"dragstart",n[12]),Y(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&Rt(o,l,r,r[7],t?Ft(l,r[7],a,CM):qt(r[7]),vp),(!t||a&2)&&Q(e,"dragging",r[1]),(!t||a&4)&&Q(e,"dragover",r[2])},i(r){t||(E(o,r),t=!0)},o(r){P(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Pe(s)}}}function DM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(y,$){!y&&!a||(t(1,u=!0),y.dataTransfer.effectAllowed="move",y.dataTransfer.dropEffect="move",y.dataTransfer.setData("text/plain",$))}function d(y,$){if(!y&&!a)return;t(2,f=!1),t(1,u=!1),y.dataTransfer.dropEffect="move";const T=parseInt(y.dataTransfer.getData("text/plain"));T<$?(r.splice($+1,0,r[T]),r.splice(T,1)):(r.splice($,0,r[T]),r.splice(T+1,1)),t(5,r),l("sort",r)}const m=()=>{t(2,f=!0)},h=()=>{t(2,f=!1)},_=()=>{t(2,f=!1),t(1,u=!1)},v=y=>c(y,o),k=y=>d(y,o);return n.$$set=y=>{"index"in y&&t(0,o=y.index),"list"in y&&t(5,r=y.list),"disabled"in y&&t(6,a=y.disabled),"$$scope"in y&&t(7,s=y.$$scope)},[o,u,f,c,d,r,a,s,i,m,h,_,v,k]}class OM extends be{constructor(e){super(),ge(this,e,DM,MM,he,{index:0,list:5,disabled:6})}}function yp(n,e,t){const i=n.slice();return i[6]=e[t],i}function kp(n){let e,t;return e=new su({props:{record:n[0],filename:n[0][n[6]],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[0][i[6]]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wp(n){let e,t,i=n[0][n[6]]&&kp(n);return{c(){i&&i.c(),e=Me()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[0][s[6]]?i?(i.p(s,l),l&3&&E(i,1)):(i=kp(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function EM(n){let e,t,i,s,l,o,r=z.truncate(z.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=n[1],m=[];for(let _=0;_<d.length;_+=1)m[_]=wp(yp(n,d,_));const h=_=>P(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),s=D();for(let _=0;_<m.length;_+=1)m[_].c();l=D(),o=b("span"),a=V(r),p(t,"class","link-hint txt-sm ri-information-line svelte-fhw3qk"),p(o,"class","txt txt-ellipsis svelte-fhw3qk"),p(e,"class","record-info svelte-fhw3qk")},m(_,v){S(_,e,v),g(e,t),g(e,s);for(let k=0;k<m.length;k+=1)m[k].m(e,null);g(e,l),g(e,o),g(o,a),u=!0,f||(c=Ie(i=Be.call(null,t,{text:z.truncate(JSON.stringify(z.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),f=!0)},p(_,[v]){if(i&&Bt(i.update)&&v&1&&i.update.call(null,{text:z.truncate(JSON.stringify(z.truncateObject(_[0]),null,2),800,!0),class:"code",position:"left"}),v&3){d=_[1];let k;for(k=0;k<d.length;k+=1){const y=yp(_,d,k);m[k]?(m[k].p(y,v),E(m[k],1)):(m[k]=wp(y),m[k].c(),E(m[k],1),m[k].m(e,l))}for(ae(),k=d.length;k<m.length;k+=1)h(k);ue()}(!u||v&5)&&r!==(r=z.truncate(z.displayValue(_[0],_[2]),70)+"")&&le(a,r)},i(_){if(!u){for(let v=0;v<d.length;v+=1)E(m[v]);u=!0}},o(_){m=m.filter(Boolean);for(let v=0;v<m.length;v+=1)P(m[v]);u=!1},d(_){_&&w(e),ht(m,_),f=!1,c()}}}function AM(n,e,t){let i,s,l,o;Ye(n,Ai,u=>t(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(c=>c.name==u&&c.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(u=>!s.includes(u)):a)||[])},[r,s,l,a,i,o]}class Qo extends be{constructor(e){super(),ge(this,e,AM,EM,he,{record:0,displayFields:3})}}function Sp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function $p(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function Tp(n){let e,t;function i(o,r){return o[11]?PM:IM}let s=i(n),l=s(n);return{c(){e=b("div"),l.c(),t=D(),p(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&w(e),l.d()}}}function IM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Cp(n);return{c(){e=b("span"),e.textContent="No records found.",t=D(),s&&s.c(),i=Me(),p(e,"class","txt txt-hint")},m(o,r){S(o,e,r),S(o,t,r),s&&s.m(o,r),S(o,i,r)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=Cp(o),s.c(),s.m(i.parentNode,i)):s&&(s.d(1),s=null)},d(o){o&&w(e),o&&w(t),s&&s.d(o),o&&w(i)}}}function PM(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Cp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function LM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function NM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Mp(n,e){let t,i,s,l,o,r,a,u,f,c,d;function m($,T){return $[6]?NM:LM}let h=m(e),_=h(e);l=new Qo({props:{record:e[49],displayFields:e[13]}});function v(){return e[32](e[49])}function k(){return e[33](e[49])}function y(...$){return e[34](e[49],...$)}return{key:n,first:null,c(){t=b("div"),_.c(),i=D(),s=b("div"),H(l.$$.fragment),o=D(),r=b("div"),a=b("button"),a.innerHTML='<i class="ri-pencil-line"></i>',u=D(),p(s,"class","content"),p(a,"type","button"),p(a,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(r,"class","actions nonintrusive"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m($,T){S($,t,T),_.m(t,null),g(t,i),g(t,s),q(l,s,null),g(t,o),g(t,r),g(r,a),g(t,u),f=!0,c||(d=[Ie(Be.call(null,a,"Edit")),Y(a,"keydown",kn(e[27])),Y(a,"click",kn(v)),Y(t,"click",k),Y(t,"keydown",y)],c=!0)},p($,T){e=$,h!==(h=m(e))&&(_.d(1),_=h(e),_&&(_.c(),_.m(t,i)));const M={};T[0]&8&&(M.record=e[49]),T[0]&8192&&(M.displayFields=e[13]),l.$set(M),(!f||T[0]&264)&&Q(t,"selected",e[6]),(!f||T[0]&808)&&Q(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i($){f||(E(l.$$.fragment,$),f=!0)},o($){P(l.$$.fragment,$),f=!1},d($){$&&w(t),_.d(),j(l),c=!1,Pe(d)}}}function Dp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=V("("),i=V(t),s=V(" of MAX "),l=V(n[5]),o=V(")")},m(r,a){S(r,e,a),S(r,i,a),S(r,s,a),S(r,l,a),S(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&32&&le(l,r[5])},d(r){r&&w(e),r&&w(i),r&&w(s),r&&w(l),r&&w(o)}}}function FM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function RM(n){let e,t,i=n[6],s=[];for(let o=0;o<i.length;o+=1)s[o]=Op(Sp(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(e,"class","selected-list svelte-1u8jhky")},m(o,r){S(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r[0]&73792|r[1]&6291456){i=o[6];let a;for(a=0;a<i.length;a+=1){const u=Sp(o,i,a);s[a]?(s[a].p(u,r),E(s[a],1)):(s[a]=Op(u),s[a].c(),E(s[a],1),s[a].m(e,null))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&w(e),ht(s,o)}}}function qM(n){let e,t,i,s,l,o,r,a;t=new Qo({props:{record:n[49],displayFields:n[13]}});function u(){return n[37](n[49])}return{c(){e=b("span"),H(t.$$.fragment),i=D(),s=b("button"),s.innerHTML='<i class="ri-close-line"></i>',l=D(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){S(f,e,c),q(t,e,null),g(e,i),g(e,s),S(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),c[0]&8192&&(d.displayFields=n[13]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(E(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function Op(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[qM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new OM({props:l}),se.push(()=>_e(e,"list",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8256|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jM(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m,h,_,v,k,y,$;t=new Wo({props:{value:n[2],autocompleteCollection:n[12]}}),t.$on("submit",n[30]);let T=n[3];const M=N=>N[49].id;for(let N=0;N<T.length;N+=1){let F=$p(n,T,N),R=M(F);a.set(R,r[N]=Mp(R,F))}let C=null;T.length||(C=Tp(n));let O=n[5]>1&&Dp(n);const A=[RM,FM],I=[];function L(N,F){return N[6].length?0:1}return h=L(n),_=I[h]=A[h](n),{c(){e=b("div"),H(t.$$.fragment),i=D(),s=b("button"),s.innerHTML='<div class="txt">New record</div>',l=D(),o=b("div");for(let N=0;N<r.length;N+=1)r[N].c();C&&C.c(),f=D(),c=b("h5"),d=V(`Selected
`),O&&O.c(),m=D(),_.c(),v=Me(),p(s,"type","button"),p(s,"class","btn btn-transparent btn-hint p-l-sm p-r-sm"),p(e,"class","flex m-b-base flex-gap-10"),p(o,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,F){S(N,e,F),q(t,e,null),g(e,i),g(e,s),S(N,l,F),S(N,o,F);for(let R=0;R<r.length;R+=1)r[R].m(o,null);C&&C.m(o,null),S(N,f,F),S(N,c,F),g(c,d),O&&O.m(c,null),S(N,m,F),I[h].m(N,F),S(N,v,F),k=!0,y||($=[Y(s,"click",n[31]),Ie(u=TM.call(null,o,n[36]))],y=!0)},p(N,F){const R={};F[0]&4&&(R.value=N[2]),F[0]&4096&&(R.autocompleteCollection=N[12]),t.$set(R),F[0]&142252&&(T=N[3],ae(),r=wt(r,F,M,1,N,T,a,o,ln,Mp,null,$p),ue(),!T.length&&C?C.p(N,F):T.length?C&&(C.d(1),C=null):(C=Tp(N),C.c(),C.m(o,null))),u&&Bt(u.update)&&F[0]&1040&&u.update.call(null,N[36]),N[5]>1?O?O.p(N,F):(O=Dp(N),O.c(),O.m(c,null)):O&&(O.d(1),O=null);let K=h;h=L(N),h===K?I[h].p(N,F):(ae(),P(I[K],1,1,()=>{I[K]=null}),ue(),_=I[h],_?_.p(N,F):(_=I[h]=A[h](N),_.c()),E(_,1),_.m(v.parentNode,v))},i(N){if(!k){E(t.$$.fragment,N);for(let F=0;F<T.length;F+=1)E(r[F]);E(_),k=!0}},o(N){P(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)P(r[F]);P(_),k=!1},d(N){N&&w(e),j(t),N&&w(l),N&&w(o);for(let F=0;F<r.length;F+=1)r[F].d();C&&C.d(),N&&w(f),N&&w(c),O&&O.d(),N&&w(m),I[h].d(N),N&&w(v),y=!1,Pe($)}}}function HM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=b("h4"),t=V("Select "),i=b("strong"),l=V(s),o=V(" records")},m(a,u){S(a,e,u),g(e,t),g(e,i),g(i,l),g(e,o)},p(a,u){var f;u[0]&4096&&s!==(s=(((f=a[12])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function VM(n){let e,t,i,s,l;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=b("button"),i.innerHTML='<span class="txt">Save selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function zM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[VM],header:[HM],default:[jM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Sn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[12]};return i=new Fb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?on(l,[l[0],l[1],xn(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&4096&&(c.collection=a[12]),i.$set(c)},i(a){s||(E(e.$$.fragment,a),E(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Er=100;function BM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Et(e,c),m;Ye(n,Ai,Ae=>t(26,m=Ae));const h=Tt(),_="picker_"+z.randomString(5);let{value:v}=e,{field:k}=e,y,$,T="",M=[],C=[],O=1,A=0,I=!1,L=!1;function N(){return t(2,T=""),t(3,M=[]),t(6,C=[]),R(),K(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=z.toArray(v);if(!s||!Ae.length)return;t(24,L=!0);let ie=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Er))et.push(`id="${bt}"`);nt.push(me.collection(s).getFullList(Er,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ie=ie.concat(...et)}),t(6,C=[]);for(const et of Ae){const bt=z.findByKey(ie,"id",et);bt&&C.push(bt)}T.trim()||t(3,M=z.filterDuplicatesByKey(C.concat(M)))}catch(et){me.errorResponseHandler(et)}t(24,L=!1)}async function K(Ae=!1){if(s){t(4,I=!0),Ae&&(T.trim()?t(3,M=[]):t(3,M=z.toArray(C).slice()));try{const ie=Ae?1:O+1,we=await me.collection(s).getList(ie,Er,{filter:T,sort:"-created",$cancelKey:_+"loadList"});t(3,M=z.filterDuplicatesByKey(M.concat(we.items))),O=we.page,t(23,A=we.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,I=!1)}}function x(Ae){i==1?t(6,C=[Ae]):u&&(z.pushOrReplaceByKey(C,Ae),t(6,C))}function U(Ae){z.removeByKey(C,"id",Ae.id),t(6,C)}function X(Ae){f(Ae)?U(Ae):x(Ae)}function ne(){var Ae;i!=1?t(20,v=C.map(ie=>ie.id)):t(20,v=((Ae=C==null?void 0:C[0])==null?void 0:Ae.id)||""),h("save",C),F()}function J(Ae){Ve.call(this,n,Ae)}const fe=()=>F(),Z=()=>ne(),de=Ae=>t(2,T=Ae.detail),ve=()=>$==null?void 0:$.show(),Te=Ae=>$==null?void 0:$.show(Ae),Ne=Ae=>X(Ae),Re=(Ae,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),X(Ae))},ye=()=>t(2,T=""),Se=()=>{a&&!I&&K()},We=Ae=>U(Ae);function lt(Ae){C=Ae,t(6,C)}function ce(Ae){se[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function ze(Ae){Ve.call(this,n,Ae)}function te(Ae){Ve.call(this,n,Ae)}function Fe(Ae){se[Ae?"unshift":"push"](()=>{$=Ae,t(7,$)})}const ot=Ae=>{z.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),x(Ae.detail)},Vt=Ae=>{z.removeByKey(M,"id",Ae.detail.id),t(3,M),U(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e),Qn(Ae)),t(19,d=Et(e,c)),"value"in Ae&&t(20,v=Ae.value),"field"in Ae&&t(21,k=Ae.field)},n.$$.update=()=>{var Ae,ie,we;n.$$.dirty[0]&2097152&&t(5,i=((Ae=k==null?void 0:k.options)==null?void 0:Ae.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ie=k==null?void 0:k.options)==null?void 0:ie.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(we=k==null?void 0:k.options)==null?void 0:we.displayFields),n.$$.dirty[0]&100663296&&t(12,o=m.find(nt=>nt.id==s)||null),n.$$.dirty[0]&16777222&&typeof T<"u"&&!L&&y!=null&&y.isActive()&&K(!0),n.$$.dirty[0]&16777232&&t(11,r=I||L),n.$$.dirty[0]&8388616&&t(10,a=A>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>C.length),n.$$.dirty[0]&64&&t(8,f=function(nt){return z.findByKey(C,"id",nt.id)})},[F,y,T,M,I,i,C,$,f,u,a,r,o,l,K,x,U,X,ne,d,v,k,N,A,L,s,m,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze,te,Fe,ot,Vt]}class UM extends be{constructor(e){super(),ge(this,e,BM,zM,he,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Ep(n,e,t){const i=n.slice();return i[15]=e[t],i}function Ap(n,e,t){const i=n.slice();return i[18]=e[t],i}function Ip(n){let e,t=n[5]&&Pp(n);return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=Pp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Pp(n){let e,t=z.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=Lp(Ap(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Me()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l&1){t=z.toArray(s[0]).slice(0,10);let o;for(o=0;o<t.length;o+=1){const r=Ap(s,t,o);i[o]?i[o].p(r,l):(i[o]=Lp(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Lp(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Np(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),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")},m(m,h){S(m,e,h),g(e,t),q(i,t,null),g(e,s),g(e,l),g(l,o),g(e,r),a=!0,u||(f=[Ie(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var v;n=m;const _={};h&16&&(_.record=n[15]),h&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_)},i(m){a||(E(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function WM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y=n[4],$=[];for(let C=0;C<y.length;C+=1)$[C]=Np(Ep(n,y,C));const T=C=>P($[C],1,1,()=>{$[C]=null});let M=null;return y.length||(M=Ip(n)),{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),f=b("div"),c=b("div");for(let C=0;C<$.length;C+=1)$[C].c();M&&M.c(),d=D(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,p(t,"class",i=Si(z.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[14]),p(c,"class","relations-list svelte-1ynw0pc"),p(h,"type","button"),p(h,"class","btn btn-transparent btn-sm btn-block"),p(m,"class","list-item list-item-btn"),p(f,"class","list")},m(C,O){S(C,e,O),g(e,t),g(e,s),g(e,l),g(l,r),S(C,u,O),S(C,f,O),g(f,c);for(let A=0;A<$.length;A+=1)$[A].m(c,null);M&&M.m(c,null),g(f,d),g(f,m),g(m,h),_=!0,v||(k=Y(h,"click",n[9]),v=!0)},p(C,O){if((!_||O&4&&i!==(i=Si(z.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!_||O&4)&&o!==(o=C[2].name+"")&&le(r,o),(!_||O&16384&&a!==(a=C[14]))&&p(e,"for",a),O&181){y=C[4];let A;for(A=0;A<y.length;A+=1){const I=Ep(C,y,A);$[A]?($[A].p(I,O),E($[A],1)):($[A]=Np(I),$[A].c(),E($[A],1),$[A].m(c,null))}for(ae(),A=y.length;A<$.length;A+=1)T(A);ue(),!y.length&&M?M.p(C,O):y.length?M&&(M.d(1),M=null):(M=Ip(C),M.c(),M.m(c,null))}},i(C){if(!_){for(let O=0;O<y.length;O+=1)E($[O]);_=!0}},o(C){$=$.filter(Boolean);for(let O=0;O<$.length;O+=1)P($[O]);_=!1},d(C){C&&w(e),C&&w(u),C&&w(f),ht($,C),M&&M.d(),v=!1,k()}}}function YM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[WM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new UM({props:o}),n[11](i),i.$on("save",n[12]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(r,a){q(e,r,a),S(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&2113591&&(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||(E(e.$$.fragment,r),E(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Fp=100;function KM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r,a=[],u=!1;f();async function f(){var T,M;const k=z.toArray(s);if(!((T=o==null?void 0:o.options)!=null&&T.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const y=k.slice(),$=[];for(;y.length>0;){const C=[];for(const O of y.splice(0,Fp))C.push(`id="${O}"`);$.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Fp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all($).then(O=>{C=C.concat(...O)});for(const O of k){const A=z.findByKey(C,"id",O);A&&a.push(A)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(k){var y;z.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map($=>$.id)):t(0,s=((y=a[0])==null?void 0:y.id)||"")}const d=k=>c(k),m=()=>l==null?void 0:l.show();function h(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const v=k=>{var y;t(4,a=k.detail||[]),t(0,s=i?a.map($=>$.id):((y=a[0])==null?void 0:y.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,m,h,_,v]}class JM extends be{constructor(e){super(),ge(this,e,KM,YM,he,{value:0,picker:1,field:2})}}const ZM=["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"],GM=(n,e)=>{ZM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function XM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),Lr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function QM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function xM(n){let e;function t(l,o){return l[1]?QM:XM}let i=t(n),s=i(n);return{c(){e=b("div"),s.c(),p(e,"class",n[2])},m(l,o){S(l,e,o),s.m(e,null),n[19](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:G,o:G,d(l){l&&w(e),s.d(),n[19](null)}}}const Lb=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),e5=()=>{let n={listeners:[],scriptId:Lb("tiny-script"),scriptLoaded:!1,injected:!1};const e=(i,s,l,o)=>{n.injected=!0;const r=s.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=l,r.onload=()=>{o()},s.head&&s.head.appendChild(r)};return{load:(i,s,l)=>{n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(n.scriptId,i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}}};let t5=e5();function n5(n,e,t){var i;let{id:s=Lb("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:m=""}=e,{cssClass:h="tinymce-wrapper"}=e,_,v,k,y="",$=o;const T=Tt(),M=()=>{const N=(()=>typeof window<"u"?window:global)();return N&&N.tinymce?N.tinymce:null},C=()=>{const L=Object.assign(Object.assign({},f),{target:v,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:N=>{t(14,k=N),N.on("init",()=>{N.setContent(d),N.on(c,()=>{t(15,y=N.getContent()),y!==d&&(t(5,d=y),t(6,m=N.getContent({format:"text"})))})}),GM(N,T),typeof f.setup=="function"&&f.setup(N)}});t(4,v.style.visibility="",v),M().init(L)};Zt(()=>{if(M()!==null)C();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;t5.load(_.ownerDocument,L,()=>{C()})}}),__(()=>{var L;k&&((L=M())===null||L===void 0||L.remove(k))});function O(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function A(L){se[L?"unshift":"push"](()=>{v=L,t(4,v)})}function I(L){se[L?"unshift":"push"](()=>{_=L,t(3,_)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,m=L.text),"cssClass"in L&&t(2,h=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&y!==d&&(k.setContent(d),t(6,m=k.getContent({format:"text"}))),k&&o!==$&&(t(16,$=o),typeof(t(13,i=k.mode)===null||i===void 0?void 0:i.set)=="function"?k.mode.set(o?"readonly":"design"):k.setMode(o?"readonly":"design")))},[s,l,h,_,v,d,m,o,r,a,u,f,c,i,k,y,$,O,A,I]}class Nb extends be{constructor(e){super(),ge(this,e,n5,xM,he,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function i5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:z.defaultEditorOptions()};return n[0]!==void 0&&(h.value=n[0]),f=new Nb({props:h}),se.push(()=>_e(f,"value",m)),{c(){e=b("label"),t=b("i"),s=D(),l=b("span"),r=V(o),u=D(),H(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(_,v){S(_,e,v),g(e,t),g(e,s),g(e,l),g(l,r),S(_,u,v),q(f,_,v),d=!0},p(_,v){(!d||v&2&&i!==(i=z.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||v&2)&&o!==(o=_[1].name+"")&&le(r,o),(!d||v&8&&a!==(a=_[3]))&&p(e,"for",a);const k={};v&8&&(k.id=_[3]),!c&&v&1&&(c=!0,k.value=_[0],ke(()=>c=!1)),f.$set(k)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){P(f.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(u),j(f,_)}}}function s5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[i5,({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function l5(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class o5 extends be{constructor(e){super(),ge(this,e,l5,s5,he,{field:1,value:0})}}function r5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Auth URL"),s=D(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].authUrl),r||(a=Y(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&re(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function a5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Token URL"),s=D(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].tokenUrl),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&re(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function u5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("User API URL"),s=D(),l=b("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].userApiUrl),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&re(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function f5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new pe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[r5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[a5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[u5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Selfhosted endpoints (optional)",t=D(),i=b("div"),s=b("div"),H(l.$$.fragment),o=D(),r=b("div"),H(a.$$.fragment),u=D(),f=b("div"),H(c.$$.fragment),p(e,"class","section-title"),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){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function c5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Rp extends be{constructor(e){super(),ge(this,e,c5,f5,he,{key:1,config:0})}}function d5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("Auth URL"),s=D(),l=b("input"),a=D(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&re(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function p5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("Token URL"),s=D(),l=b("input"),a=D(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&re(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function m5(n){let e,t,i,s,l,o,r,a,u;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[d5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[p5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=D(),i=b("div"),s=b("div"),H(l.$$.fragment),o=D(),r=b("div"),H(a.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&1&&(d.class="form-field "+(f[0].enabled?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&1&&(m.class="form-field "+(f[0].enabled?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&49&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(E(l.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){P(l.$$.fragment,f),P(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function h5(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 _5 extends be{constructor(e){super(),ge(this,e,h5,m5,he,{key:1,config:0})}}function g5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("Auth URL"),s=D(),l=b("input"),a=D(),u=b("div"),u.textContent="Eg. https://example.com/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0].authUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[2]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&re(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function b5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("Token URL"),s=D(),l=b("input"),a=D(),u=b("div"),u.textContent="Eg. https://example.com/token/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0].tokenUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[3]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&re(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function v5(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("User API URL"),s=D(),l=b("input"),a=D(),u=b("div"),u.textContent="Eg. https://example.com/userinfo/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0].userApiUrl),S(d,a,m),S(d,u,m),f||(c=Y(l,"input",n[4]),f=!0)},p(d,m){m&32&&i!==(i=d[5])&&p(e,"for",i),m&32&&o!==(o=d[5])&&p(l,"id",o),m&1&&r!==(r=d[0].enabled)&&(l.required=r),m&1&&re(l,d[0].userApiUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function y5(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[g5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[b5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[v5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Endpoints",t=D(),i=b("div"),s=b("div"),H(l.$$.fragment),o=D(),r=b("div"),H(a.$$.fragment),u=D(),f=b("div"),H(c.$$.fragment),p(e,"class","section-title"),p(s,"class","col-lg-12"),p(r,"class","col-lg-12"),p(f,"class","col-lg-12"),p(i,"class","grid")},m(m,h){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),q(l,s,null),g(i,o),g(i,r),q(a,r,null),g(i,u),g(i,f),q(c,f,null),d=!0},p(m,[h]){const _={};h&1&&(_.class="form-field "+(m[0].enabled?"required":"")),h&2&&(_.name=m[1]+".authUrl"),h&97&&(_.$$scope={dirty:h,ctx:m}),l.$set(_);const v={};h&1&&(v.class="form-field "+(m[0].enabled?"required":"")),h&2&&(v.name=m[1]+".tokenUrl"),h&97&&(v.$$scope={dirty:h,ctx:m}),a.$set(v);const k={};h&1&&(k.class="form-field "+(m[0].enabled?"required":"")),h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(E(l.$$.fragment,m),E(a.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){P(l.$$.fragment,m),P(a.$$.fragment,m),P(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function k5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class Ar extends be{constructor(e){super(),ge(this,e,k5,y5,he,{key:1,config:0})}}function w5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Client ID"),s=D(),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){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function S5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Team ID"),s=D(),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){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&re(l,u[3])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $5(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Key ID"),s=D(),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){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&re(l,u[4])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function T5(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=D(),s=b("i"),o=D(),r=b("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",po),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[6]),u||(f=[Ie(Be.call(null,s,{text:`Max ${po} seconds (~${po/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&re(r,c[6])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Pe(f)}}}function C5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=V("Private key"),s=D(),l=b("textarea"),r=D(),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){S(c,e,d),g(e,t),S(c,s,d),S(c,l,d),re(l,n[5]),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&re(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function M5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[w5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[S5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[$5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[T5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[C5,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),H(r.$$.fragment),a=D(),u=b("div"),H(f.$$.fragment),c=D(),d=b("div"),H(m.$$.fragment),h=D(),H(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){S($,e,T),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),g(t,a),g(t,u),q(f,u,null),g(t,c),g(t,d),q(m,d,null),g(t,h),q(_,t,null),v=!0,k||(y=Y(e,"submit",ft(n[17])),k=!0)},p($,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:$}),s.$set(M);const C={};T&25165832&&(C.$$scope={dirty:T,ctx:$}),r.$set(C);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const A={};T&25165888&&(A.$$scope={dirty:T,ctx:$}),m.$set(A);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:$}),_.$set(I)},i($){v||(E(s.$$.fragment,$),E(r.$$.fragment,$),E(f.$$.fragment,$),E(m.$$.fragment,$),E(_.$$.fragment,$),v=!0)},o($){P(s.$$.fragment,$),P(r.$$.fragment,$),P(f.$$.fragment,$),P(m.$$.fragment,$),P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(s),j(r),j(f),j(m),j(_),k=!1,y()}}}function D5(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function O5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=V("Close"),i=D(),s=b("button"),l=b("i"),o=D(),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],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function E5(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[O5],header:[D5],default:[M5]},$$scope:{ctx:n}};return e=new Sn({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||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function A5(n,e,t){let i;const s=Tt(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),In({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),jt("Successfully generated client secret."),s("submit",L),o==null||o.hide()}catch(L){me.errorResponseHandler(L)}t(7,d=!1)}function v(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function y(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const M=()=>_(),C=()=>!d;function O(L){se[L?"unshift":"push"](()=>{o=L,t(1,o)})}function A(L){Ve.call(this,n,L)}function I(L){Ve.call(this,n,L)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,_,m,v,k,y,$,T,M,C,O,A,I]}class I5 extends be{constructor(e){super(),ge(this,e,A5,E5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function P5(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new I5({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=D(),s=b("span"),s.textContent="Generate secret",o=D(),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){S(d,e,m),g(e,t),g(e,i),g(e,s),S(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||(E(r.$$.fragment,d),a=!0)},o(d){P(r.$$.fragment,d),a=!1},d(d){d&&w(e),d&&w(o),n[4](null),j(r,d),u=!1,f()}}}function L5(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){se[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 N5 extends be{constructor(e){super(),ge(this,e,L5,P5,he,{key:1,config:0})}}const As={appleAuth:{title:"Apple",icon:"ri-apple-fill",optionsComponent:N5},googleAuth:{title:"Google",icon:"ri-google-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:_5},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:Rp},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Rp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",optionsComponent:Ar},oidc2Auth:{title:"(2) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar},oidc3Auth:{title:"(3) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ar}};function qp(n,e,t){const i=n.slice();return i[9]=e[t],i}function F5(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){S(t,e,i)},p:G,d(t){t&&w(e)}}}function R5(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=jp(qp(n,t,s));return{c(){e=b("div");for(let s=0;s<i.length;s+=1)i[s].c();p(e,"class","list")},m(s,l){S(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&58){t=s[1];let o;for(o=0;o<t.length;o+=1){const r=qp(s,t,o);i[o]?i[o].p(r,l):(i[o]=jp(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&w(e),ht(i,s)}}}function q5(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function jp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,m,h,_,v,k;function y(){return n[6](n[9])}return{c(){e=b("div"),t=b("i"),s=D(),l=b("span"),r=V(o),a=D(),u=b("div"),f=V("ID: "),d=V(c),m=D(),h=b("button"),h.innerHTML='<i class="ri-close-line"></i>',_=D(),p(t,"class",i=n[4](n[9].provider)),p(l,"class","txt"),p(u,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,T){S($,e,T),g(e,t),g(e,s),g(e,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,d),g(e,m),g(e,h),g(e,_),v||(k=Y(h,"click",y),v=!0)},p($,T){n=$,T&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),T&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),T&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d($){$&&w(e),v=!1,k()}}}function j5(n){let e;function t(l,o){var r;return l[2]?q5:(r=l[0])!=null&&r.id&&l[1].length?R5:F5}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(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:G,o:G,d(l){s.d(l),l&&w(e)}}}function H5(n,e,t){const i=Tt();let{record:s}=e,l=[],o=!1;function r(d){var m;return((m=As[d+"Auth"])==null?void 0:m.title)||z.sentenize(d,!1)}function a(d){var m;return((m=As[d+"Auth"])==null?void 0:m.icon)||`ri-${d}-line`}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 me.collection(s.collectionId).listExternalAuths(s.id))}catch(d){me.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||cn(`Do you really want to unlink the ${r(d)} provider?`,()=>me.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{jt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(m=>{me.errorResponseHandler(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class V5 extends be{constructor(e){super(),ge(this,e,H5,j5,he,{record:0})}}function Hp(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function Vp(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[z5,({uniqueId:i})=>({54:i}),({uniqueId:i})=>[0,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]&4|s[1]&25165824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function z5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="id",l=D(),o=b("span"),a=D(),u=b("div"),f=b("i"),d=D(),m=b("input"),p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[54]),p(f,"class","ri-calendar-event-line txt-disabled"),p(u,"class","form-field-addon"),p(m,"type","text"),p(m,"id",h=n[54]),m.value=_=n[2].id,m.readOnly=!0},m(y,$){S(y,e,$),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),S(y,a,$),S(y,u,$),g(u,f),S(y,d,$),S(y,m,$),v||(k=Ie(c=Be.call(null,f,{text:`Created: ${n[2].created}
Updated: ${n[2].updated}`,position:"left"})),v=!0)},p(y,$){$[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&$[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),$[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),$[0]&4&&_!==(_=y[2].id)&&m.value!==_&&(m.value=_)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),v=!1,k()}}}function zp(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new v4({props:r}),se.push(()=>_e(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Bp();return{c(){H(e.$$.fragment),i=D(),a&&a.c(),s=Me()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,_;const m={};d[0]&1&&(m.collection=c[0]),!t&&d[0]&4&&(t=!0,m.record=c[2],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Bp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(E(e.$$.fragment,c),l=!0)},o(c){P(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Bp(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B5(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new JM({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function U5(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new $M({props:u}),se.push(()=>_e(e,"value",o)),se.push(()=>_e(e,"uploadedFiles",r)),se.push(()=>_e(e,"deletedFileIndexes",a)),{c(){H(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function W5(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new eM({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Y5(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new G4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function K5(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new Y4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function J5(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new o5({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Z5(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new z4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function G5(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new q4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function X5(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new L4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Q5(n){let e,t,i;function s(o){n[31](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new E4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function x5(n){let e,t,i;function s(o){n[30](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new C4({props:l}),se.push(()=>_e(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]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Up(n,e){let t,i,s,l,o;const r=[x5,Q5,X5,G5,Z5,J5,K5,Y5,W5,U5,B5],a=[];function u(f,c){return f[51].type==="text"?0:f[51].type==="number"?1:f[51].type==="bool"?2:f[51].type==="email"?3:f[51].type==="url"?4:f[51].type==="editor"?5:f[51].type==="date"?6:f[51].type==="select"?7:f[51].type==="json"?8:f[51].type==="file"?9:f[51].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=Me(),s&&s.c(),l=Me(),this.first=t},m(f,c){S(f,t,c),~i&&a[i].m(f,c),S(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(ae(),P(a[d],1,1,()=>{a[d]=null}),ue()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),E(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(E(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function Wp(n){let e,t,i;return t=new V5({props:{record:n[2]}}),{c(){e=b("div"),H(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[10]===yl)},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&4&&(o.record=s[2]),t.$set(o),(!i||l[0]&1024)&&Q(e,"active",s[10]===yl)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function eD(n){var v,k;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&Vp(n),d=((v=n[0])==null?void 0:v.isAuth)&&zp(n),m=((k=n[0])==null?void 0:k.schema)||[];const h=y=>y[51].name;for(let y=0;y<m.length;y+=1){let $=Hp(n,m,y),T=h($);o.set(T,l[y]=Up(T,$))}let _=n[0].isAuth&&!n[2].isNew&&Wp(n);return{c(){e=b("div"),t=b("form"),c&&c.c(),i=D(),d&&d.c(),s=D();for(let y=0;y<l.length;y+=1)l[y].c();r=D(),_&&_.c(),p(t,"id",n[13]),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(e,"class","tabs-content")},m(y,$){S(y,e,$),g(e,t),c&&c.m(t,null),g(t,i),d&&d.m(t,null),g(t,s);for(let T=0;T<l.length;T+=1)l[T].m(t,null);g(e,r),_&&_.m(e,null),a=!0,u||(f=Y(t,"submit",ft(n[14])),u=!0)},p(y,$){var T,M;y[2].isNew?c&&(ae(),P(c,1,1,()=>{c=null}),ue()):c?(c.p(y,$),$[0]&4&&E(c,1)):(c=Vp(y),c.c(),E(c,1),c.m(t,i)),(T=y[0])!=null&&T.isAuth?d?(d.p(y,$),$[0]&1&&E(d,1)):(d=zp(y),d.c(),E(d,1),d.m(t,s)):d&&(ae(),P(d,1,1,()=>{d=null}),ue()),$[0]&29&&(m=((M=y[0])==null?void 0:M.schema)||[],ae(),l=wt(l,$,h,1,y,m,o,t,ln,Up,null,Hp),ue()),(!a||$[0]&1024)&&Q(t,"active",y[10]===Gi),y[0].isAuth&&!y[2].isNew?_?(_.p(y,$),$[0]&5&&E(_,1)):(_=Wp(y),_.c(),E(_,1),_.m(e,null)):_&&(ae(),P(_,1,1,()=>{_=null}),ue())},i(y){if(!a){E(c),E(d);for(let $=0;$<m.length;$+=1)E(l[$]);E(_),a=!0}},o(y){P(c),P(d);for(let $=0;$<l.length;$+=1)P(l[$]);P(_),a=!1},d(y){y&&w(e),c&&c.d(),d&&d.d();for(let $=0;$<l.length;$+=1)l[$].d();_&&_.d(),u=!1,f()}}}function Yp(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[tD]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=D(),i=b("button"),s=b("i"),l=D(),H(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),g(i,s),g(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[0]&129|u[1]&16777216&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function Kp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Jp(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[24]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Kp(n),u=n[0].isAuth&&n[7].email&&Jp(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=b("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=b("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[Y(i,"click",n[25]),Y(l,"click",kn(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Kp(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=Jp(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Pe(r)}}}function Zp(n){let e,t,i,s,l,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=D(),s=b("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[10]===yl),p(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),l||(o=[Y(t,"click",n[27]),Y(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===Gi),a[0]&1024&&Q(s,"active",r[10]===yl)},d(r){r&&w(e),l=!1,Pe(o)}}}function nD(n){var _;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Yp(n),h=n[0].isAuth&&!n[2].isNew&&Zp(n);return{c(){e=b("h4"),i=V(t),s=D(),l=b("strong"),r=V(o),a=V(" record"),u=D(),m&&m.c(),f=D(),h&&h.c(),c=Me()},m(v,k){S(v,e,k),g(e,i),g(e,s),g(e,l),g(l,r),g(e,a),S(v,u,k),m&&m.m(v,k),S(v,f,k),h&&h.m(v,k),S(v,c,k),d=!0},p(v,k){var y;(!d||k[0]&4)&&t!==(t=v[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=v[0])==null?void 0:y.name)+"")&&le(r,o),v[2].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(v,k),k[0]&4&&E(m,1)):(m=Yp(v),m.c(),E(m,1),m.m(f.parentNode,f)),v[0].isAuth&&!v[2].isNew?h?h.p(v,k):(h=Zp(v),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(v){d||(E(m),d=!0)},o(v){P(m),d=!1},d(v){v&&w(e),v&&w(u),m&&m.d(v),v&&w(f),h&&h.d(v),v&&w(c)}}}function iD(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),s=b("button"),l=b("span"),r=V(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[8],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[13]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(l,r),u||(f=Y(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function sD(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[iD],header:[nD],default:[eD]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function Gp(n){return JSON.stringify(n)}function lD(n,e,t){let i,s,l,o;const r=Tt(),a="record_"+z.randomString(5);let{collection:u}=e,f,c=null,d=new $i,m=!1,h=!1,_={},v={},k="",y=Gi;function $(ie){return M(ie),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function T(){return f==null?void 0:f.hide()}async function M(ie){In({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new $i),t(3,_={}),t(4,v={}),await sn(),t(20,k=Gp(d))}function C(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ie=A();let we;d.isNew?we=me.collection(u.id).create(ie):we=me.collection(u.id).update(d.id,ie),we.then(nt=>{jt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),T(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function O(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{T(),jt("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function A(){const ie=(d==null?void 0:d.export())||{},we=new FormData,nt={};for(const et of(u==null?void 0:u.schema)||[])nt[et.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const et in ie)nt[et]&&(typeof ie[et]>"u"&&(ie[et]=null),z.addValueToFormData(we,et,ie[et]));for(const et in _){const bt=z.toArray(_[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in v){const bt=z.toArray(v[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function I(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{jt(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{jt(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ie[nt.name]}$(ie),await sn(),t(20,k="")}const R=()=>T(),K=()=>I(),x=()=>L(),U=()=>N(),X=()=>O(),ne=()=>t(10,y=Gi),J=()=>t(10,y=yl);function fe(ie){d=ie,t(2,d)}function Z(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function de(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ve(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Ne(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Re(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ye(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function Se(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function We(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function lt(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}function ce(ie,we){n.$$.not_equal(_[we.name],ie)&&(_[we.name]=ie,t(3,_))}function ze(ie,we){n.$$.not_equal(v[we.name],ie)&&(v[we.name]=ie,t(4,v))}function te(ie,we){n.$$.not_equal(d[we.name],ie)&&(d[we.name]=ie,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),T()}),!1):(In({}),!0);function ot(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Vt(ie){Ve.call(this,n,ie)}function Ae(ie){Ve.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=z.hasNonEmptyProps(_)||z.hasNonEmptyProps(v)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=Gp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,T,d,_,v,l,f,c,m,h,y,o,i,a,C,O,I,L,N,$,k,s,R,K,x,U,X,ne,J,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze,te,Fe,ot,Vt,Ae]}class Fb extends be{constructor(e){super(),ge(this,e,lD,sD,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Xp(n,e,t){const i=n.slice();return i[15]=e[t],i[7]=t,i}function Qp(n,e,t){const i=n.slice();return i[12]=e[t],i}function xp(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function em(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function oD(n){const e=n.slice(),t=z.toArray(e[3]);e[8]=t;const i=z.toArray(e[0].expand[e[1].name]);e[9]=i;const s=e[2]?20:200;return e[10]=s,e}function rD(n){let e,t=z.truncate(n[3],2e3)+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","block txt-break")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=z.truncate(s[3],2e3)+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function aD(n){let e,t=z.truncate(n[3])+"",i,s;return{c(){e=b("span"),i=V(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=z.truncate(n[3]))},m(l,o){S(l,e,o),g(e,i)},p(l,o){o&8&&t!==(t=z.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=z.truncate(l[3]))&&p(e,"title",s)},i:G,o:G,d(l){l&&w(e)}}}function uD(n){let e,t=[],i=new Map,s,l=z.toArray(n[3]);const o=r=>r[7]+r[15];for(let r=0;r<l.length;r+=1){let a=Xp(n,l,r),u=o(a);i.set(u,t[r]=tm(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","inline-flex")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&9&&(l=z.toArray(r[3]),ae(),t=wt(t,a,o,1,r,l,i,e,ln,tm,null,Xp),ue())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function fD(n){let e,t,i,s,l;const o=[yD,vD],r=[];function a(f,c){return f[9].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[8].length>n[10]&&sm();return{c(){e=b("div"),i.c(),s=D(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),g(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ae(),P(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,s)),f[8].length>f[10]?u||(u=sm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function cD(n){let e,t=[],i=new Map,s=z.toArray(n[3]);const l=o=>o[7]+o[5];for(let o=0;o<s.length;o+=1){let r=em(n,s,o),a=l(r);i.set(a,t[o]=lm(a,r))}return{c(){e=b("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){S(o,e,r);for(let a=0;a<t.length;a+=1)t[a].m(e,null)},p(o,r){r&8&&(s=z.toArray(o[3]),t=wt(t,r,l,1,o,s,i,e,es,lm,null,em))},i:G,o:G,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function dD(n){let e,t;return e=new ui({props:{date:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.date=i[3]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function pD(n){let e,t,i,s;const l=[wD,kD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Me()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),P(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function mD(n){let e,t=z.truncate(n[3])+"",i,s,l;return{c(){e=b("a"),i=V(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),g(e,i),s||(l=[Ie(Be.call(null,e,"Open in new tab")),Y(e,"click",kn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=z.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function hD(n){let e,t;return{c(){e=b("span"),t=V(n[3]),p(e,"class","txt")},m(i,s){S(i,e,s),g(e,t)},p(i,s){s&8&&le(t,i[3])},i:G,o:G,d(i){i&&w(e)}}}function _D(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=V(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function gD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function bD(n){let e,t=(n[2]?z.truncate(JSON.stringify(n[3])):z.truncate(JSON.stringify(n[3],null,2),2e3,!0))+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&12&&t!==(t=(s[2]?z.truncate(JSON.stringify(s[3])):z.truncate(JSON.stringify(s[3],null,2),2e3,!0))+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function tm(n,e){let t,i,s;return i=new su({props:{record:e[0],filename:e[15],size:"sm"}}),{key:n,first:null,c(){t=Me(),H(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[15]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function vD(n){let e,t=n[8].slice(0,n[10]),i=[];for(let s=0;s<t.length;s+=1)i[s]=nm(Qp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Me()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[8].slice(0,s[10]);let o;for(o=0;o<t.length;o+=1){const r=Qp(s,t,o);i[o]?i[o].p(r,l):(i[o]=nm(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:G,o:G,d(s){ht(i,s),s&&w(e)}}}function yD(n){let e=[],t=new Map,i,s,l=n[9].slice(0,n[10]);const o=r=>r[7]+r[5];for(let r=0;r<l.length;r+=1){let a=xp(n,l,r),u=o(a);t.set(u,e[r]=im(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Me()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);S(r,i,a),s=!0},p(r,a){a&7&&(l=r[9].slice(0,r[10]),ae(),e=wt(e,a,o,1,r,l,t,i.parentNode,ln,im,i,xp),ue())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function nm(n){let e,t=n[12]+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","label")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&12&&t!==(t=s[12]+"")&&le(i,t)},d(s){s&&w(e)}}}function im(n,e){var o;let t,i,s,l;return i=new Qo({props:{record:e[5],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=b("span"),H(i.$$.fragment),s=D(),p(t,"class","label"),this.first=t},m(r,a){S(r,t,a),q(i,t,null),g(t,s),l=!0},p(r,a){var f;e=r;const u={};a&7&&(u.record=e[5]),a&2&&(u.displayFields=(f=e[1].options)==null?void 0:f.displayFields),i.$set(u)},i(r){l||(E(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(t),j(i)}}}function sm(n){let e;return{c(){e=V("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lm(n,e){let t,i=e[5]+"",s;return{key:n,first:null,c(){t=b("span"),s=V(i),p(t,"class","label"),this.first=t},m(l,o){S(l,t,o),g(t,s)},p(l,o){e=l,o&8&&i!==(i=e[5]+"")&&le(s,i)},d(l){l&&w(t)}}}function kD(n){let e,t;return e=new Nb({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",cssClass:"tinymce-preview",conf:{branding:!1,promotion:!1,menubar:!1,min_height:30,statusbar:!1,height:59,max_height:500,autoresize_bottom_margin:5,resize:!1,skin:"pocketbase",content_style:"body { font-size: 14px }",toolbar:"",plugins:["autoresize"]},value:n[3],disabled:!0}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=i[3]),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wD(n){let e,t=z.truncate(z.plainText(n[3]),250)+"",i;return{c(){e=b("span"),i=V(t),p(e,"class","txt")},m(s,l){S(s,e,l),g(e,i)},p(s,l){l&8&&t!==(t=z.truncate(z.plainText(s[3]),250)+"")&&le(i,t)},i:G,o:G,d(s){s&&w(e)}}}function SD(n){let e,t,i,s,l;const o=[bD,gD,_D,hD,mD,pD,dD,cD,fD,uD,aD,rD],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!z.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===8?oD(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=Me()},m(f,c){r[t].m(f,c),S(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ae(),P(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),E(i,1),i.m(s.parentNode,s))},i(f){l||(E(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function $D(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Ve.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s[l.name])},[s,l,o,i,r]}class Rb extends be{constructor(e){super(),ge(this,e,$D,SD,he,{record:0,field:1,short:2})}}function TD(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ie(i=Be.call(null,e,n[2]?"":"Copy")),Y(e,"click",kn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:G,o:G,d(o){o&&w(e),s=!1,Pe(l)}}}function CD(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(z.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Zt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class lu extends be{constructor(e){super(),ge(this,e,CD,TD,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function om(n,e,t){const i=n.slice();return i[10]=e[t],i}function rm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new Rb({props:{field:n[10],record:n[3]}}),{c(){e=b("tr"),t=b("td"),s=V(i),l=D(),o=b("td"),H(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(u,f){S(u,e,f),g(e,t),g(t,s),g(e,l),g(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function am(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=D(),s=b("td"),H(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function um(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=D(),s=b("td"),H(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),g(e,t),g(e,i),g(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(E(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function MD(n){var C;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,h,_,v;a=new lu({props:{value:n[3].id}});let k=(C=n[0])==null?void 0:C.schema,y=[];for(let O=0;O<k.length;O+=1)y[O]=rm(om(n,k,O));const $=O=>P(y[O],1,1,()=>{y[O]=null});let T=n[3].created&&am(n),M=n[3].updated&&um(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),s=b("td"),s.textContent="id",l=D(),o=b("td"),r=b("div"),H(a.$$.fragment),u=D(),f=b("span"),d=V(c),m=D();for(let O=0;O<y.length;O+=1)y[O].c();h=D(),T&&T.c(),_=D(),M&&M.c(),p(s,"class","min-width txt-hint txt-bold"),p(f,"class","txt"),p(r,"class","label"),p(e,"class","table-border")},m(O,A){S(O,e,A),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,r),q(a,r,null),g(r,u),g(r,f),g(f,d),g(t,m);for(let I=0;I<y.length;I+=1)y[I].m(t,null);g(t,h),T&&T.m(t,null),g(t,_),M&&M.m(t,null),v=!0},p(O,A){var L;const I={};if(A&8&&(I.value=O[3].id),a.$set(I),(!v||A&8)&&c!==(c=O[3].id+"")&&le(d,c),A&9){k=(L=O[0])==null?void 0:L.schema;let N;for(N=0;N<k.length;N+=1){const F=om(O,k,N);y[N]?(y[N].p(F,A),E(y[N],1)):(y[N]=rm(F),y[N].c(),E(y[N],1),y[N].m(t,h))}for(ae(),N=k.length;N<y.length;N+=1)$(N);ue()}O[3].created?T?(T.p(O,A),A&8&&E(T,1)):(T=am(O),T.c(),E(T,1),T.m(t,_)):T&&(ae(),P(T,1,1,()=>{T=null}),ue()),O[3].updated?M?(M.p(O,A),A&8&&E(M,1)):(M=um(O),M.c(),E(M,1),M.m(t,null)):M&&(ae(),P(M,1,1,()=>{M=null}),ue())},i(O){if(!v){E(a.$$.fragment,O);for(let A=0;A<k.length;A+=1)E(y[A]);E(T),E(M),v=!0}},o(O){P(a.$$.fragment,O),y=y.filter(Boolean);for(let A=0;A<y.length;A+=1)P(y[A]);P(T),P(M),v=!1},d(O){O&&w(e),j(a),ht(y,O),T&&T.d(),M&&M.d()}}}function DD(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",s,l;return{c(){e=b("h4"),t=b("strong"),s=V(i),l=V(" record preview")},m(r,a){S(r,e,a),g(e,t),g(t,s),g(e,l)},p(r,a){var u;a&1&&i!==(i=((u=r[0])==null?void 0:u.name)+"")&&le(s,i)},d(r){r&&w(e)}}}function OD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[6]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function ED(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[OD],header:[DD],default:[MD]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function AD(n,e,t){let i,{collection:s}=e,l,o=new $i;function r(m){return t(3,o=m),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(m){se[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){Ve.call(this,n,m)}function d(m){Ve.call(this,n,m)}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{var m;n.$$.dirty&1&&t(4,i=!!((m=s==null?void 0:s.schema)!=null&&m.find(h=>h.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class ID extends be{constructor(e){super(),ge(this,e,AD,ED,he,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function fm(n,e,t){const i=n.slice();return i[55]=e[t],i}function cm(n,e,t){const i=n.slice();return i[58]=e[t],i}function dm(n,e,t){const i=n.slice();return i[58]=e[t],i}function pm(n,e,t){const i=n.slice();return i[51]=e[t],i}function mm(n){let e;function t(l,o){return l[12]?LD:PD}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){S(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&&w(e),s.d()}}}function PD(n){let e,t,i,s,l,o,r;return{c(){e=b("div"),t=b("input"),s=D(),l=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),o||(r=Y(t,"change",n[28]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&65536&&(t.checked=a[16])},d(a){a&&w(e),o=!1,r()}}}function LD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function hm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[ND]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function ND(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function _m(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&gm(n),r=i&&bm(n);return{c(){o&&o.c(),t=D(),r&&r.c(),s=Me()},m(a,u){o&&o.m(a,u),S(a,t,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,u){u[0]&128&&(e=!a[7].includes("@username")),e?o?(o.p(a,u),u[0]&128&&E(o,1)):(o=gm(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(ae(),P(o,1,1,()=>{o=null}),ue()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&E(r,1)):(r=bm(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(ae(),P(r,1,1,()=>{r=null}),ue())},i(a){l||(E(o),E(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function gm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[FD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function FD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="username",p(t,"class",z.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function bm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[RD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function RD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function qD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=b("div"),t=b("i"),s=D(),l=b("span"),r=V(o),p(t,"class",i=z.getFieldTypeIcon(n[58].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),g(l,r)},p(a,u){u[0]&262144&&i!==(i=z.getFieldTypeIcon(a[58].type))&&p(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function vm(n,e){let t,i,s,l;function o(a){e[32](a)}let r={class:"col-type-"+e[58].type+" col-field-"+e[58].name,name:e[58].name,$$slots:{default:[qD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Wt({props:r}),se.push(()=>_e(i,"sort",o)),{key:n,first:null,c(){t=Me(),H(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&262144&&(f.class="col-type-"+e[58].type+" col-field-"+e[58].name),u[0]&262144&&(f.name=e[58].name),u[0]&262144|u[2]&2&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ke(()=>s=!1)),i.$set(f)},i(a){l||(E(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function ym(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[jD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function jD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function km(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[HD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),se.push(()=>_e(e,"sort",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function HD(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="updated",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function wm(n){let e;return{c(){e=b("button"),e.innerHTML='<i class="ri-more-line"></i>',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:G,d(t){t&&w(e),n[35](null)}}}function Sm(n){let e;function t(l,o){return l[12]?zD:VD}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function VD(n){let e,t,i,s,l;function o(u,f){var c,d;if((c=u[1])!=null&&c.length)return UD;if(!((d=u[2])!=null&&d.isView))return BD}let r=o(n),a=r&&r(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",s=D(),a&&a.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),g(e,t),g(t,i),g(t,s),a&&a.m(t,null),g(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a&&a.d()}}}function zD(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function BD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[40]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function UD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[39]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function $m(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=D(),r=b("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],p(r,"for",a="checkbox_"+n[55].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){S(d,e,m),g(e,t),g(t,i),g(t,o),g(t,r),u||(f=[Y(i,"change",c),Y(t,"click",kn(n[26]))],u=!0)},p(d,m){n=d,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&p(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&p(r,"for",a)},d(d){d&&w(e),u=!1,Pe(f)}}}function Tm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new lu({props:{value:n[55].id}});let c=n[2].isAuth&&Cm(n);return{c(){e=b("td"),t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),a=V(r),u=D(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){S(d,e,m),g(e,t),g(t,i),q(s,i,null),g(i,l),g(i,o),g(o,a),g(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&16&&(h.value=d[55].id),s.$set(h),(!f||m[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,m):(c=Cm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(s.$$.fragment,d),f=!0)},o(d){P(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Cm(n){let e;function t(l,o){return l[55].verified?YD:WD}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function WD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function YD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ie(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Mm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Dm(n),o=i&&Om(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=Me()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Dm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Om(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Dm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].username)),t?JD:KD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function KD(n){let e,t=n[55].username+"",i,s;return{c(){e=b("span"),i=V(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&p(e,"title",s)},d(l){l&&w(e)}}}function JD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Om(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].email)),t?GD:ZD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=b("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function ZD(n){let e,t=n[55].email+"",i,s;return{c(){e=b("span"),i=V(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),g(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&p(e,"title",s)},d(l){l&&w(e)}}}function GD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Em(n,e){let t,i,s,l;return i=new Rb({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=b("td"),H(i.$$.fragment),p(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&p(t,"class",s)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Am(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=b("td"),H(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Im(n){let e,t,i;return t=new ui({props:{date:n[55].updated}}),{c(){e=b("td"),H(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(E(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Pm(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),c,d=e[9]&&!e[7].includes("@updated"),m,h,_,v,k,y,$=!e[2].isView&&$m(e),T=s&&Tm(e),M=e[2].isAuth&&Mm(e),C=e[18];const O=F=>F[58].name;for(let F=0;F<C.length;F+=1){let R=cm(e,C,F),K=O(R);a.set(K,r[F]=Em(K,R))}let A=f&&Am(e),I=d&&Im(e);function L(){return e[37](e[55])}function N(...F){return e[38](e[55],...F)}return{key:n,first:null,c(){t=b("tr"),$&&$.c(),i=D(),T&&T.c(),l=D(),M&&M.c(),o=D();for(let F=0;F<r.length;F+=1)r[F].c();u=D(),A&&A.c(),c=D(),I&&I.c(),m=D(),h=b("td"),h.innerHTML='<i class="ri-arrow-right-line"></i>',_=D(),p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,R){S(F,t,R),$&&$.m(t,null),g(t,i),T&&T.m(t,null),g(t,l),M&&M.m(t,null),g(t,o);for(let K=0;K<r.length;K+=1)r[K].m(t,null);g(t,u),A&&A.m(t,null),g(t,c),I&&I.m(t,null),g(t,m),g(t,h),g(t,_),v=!0,k||(y=[Y(t,"click",L),Y(t,"keydown",N)],k=!0)},p(F,R){e=F,e[2].isView?$&&($.d(1),$=null):$?$.p(e,R):($=$m(e),$.c(),$.m(t,i)),R[0]&128&&(s=!e[7].includes("@id")),s?T?(T.p(e,R),R[0]&128&&E(T,1)):(T=Tm(e),T.c(),E(T,1),T.m(t,l)):T&&(ae(),P(T,1,1,()=>{T=null}),ue()),e[2].isAuth?M?M.p(e,R):(M=Mm(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&(C=e[18],ae(),r=wt(r,R,O,1,e,C,a,t,ln,Em,u,cm),ue()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,R),R[0]&1152&&E(A,1)):(A=Am(e),A.c(),E(A,1),A.m(t,c)):A&&(ae(),P(A,1,1,()=>{A=null}),ue()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?I?(I.p(e,R),R[0]&640&&E(I,1)):(I=Im(e),I.c(),E(I,1),I.m(t,m)):I&&(ae(),P(I,1,1,()=>{I=null}),ue())},i(F){if(!v){E(T);for(let R=0;R<C.length;R+=1)E(r[R]);E(A),E(I),v=!0}},o(F){P(T);for(let R=0;R<r.length;R+=1)P(r[R]);P(A),P(I),v=!1},d(F){F&&w(t),$&&$.d(),T&&T.d(),M&&M.d();for(let R=0;R<r.length;R+=1)r[R].d();A&&A.d(),I&&I.d(),k=!1,Pe(y)}}}function XD(n){let e,t,i,s,l=!n[7].includes("@id"),o,r,a=[],u=new Map,f,c=n[10]&&!n[7].includes("@created"),d,m=n[9]&&!n[7].includes("@updated"),h,_,v,k,y=[],$=new Map,T,M=!n[2].isView&&mm(n),C=l&&hm(n),O=n[2].isAuth&&_m(n),A=n[18];const I=U=>U[58].name;for(let U=0;U<A.length;U+=1){let X=dm(n,A,U),ne=I(X);u.set(ne,a[U]=vm(ne,X))}let L=c&&ym(n),N=m&&km(n),F=n[15].length&&wm(n),R=n[4];const K=U=>U[2].isView?U[55]:U[55].id;for(let U=0;U<R.length;U+=1){let X=fm(n,R,U),ne=K(X);$.set(ne,y[U]=Pm(ne,X))}let x=null;return R.length||(x=Sm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),M&&M.c(),s=D(),C&&C.c(),o=D(),O&&O.c(),r=D();for(let U=0;U<a.length;U+=1)a[U].c();f=D(),L&&L.c(),d=D(),N&&N.c(),h=D(),_=b("th"),F&&F.c(),v=D(),k=b("tbody");for(let U=0;U<y.length;U+=1)y[U].c();x&&x.c(),p(_,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[12])},m(U,X){S(U,e,X),g(e,t),g(t,i),M&&M.m(i,null),g(i,s),C&&C.m(i,null),g(i,o),O&&O.m(i,null),g(i,r);for(let ne=0;ne<a.length;ne+=1)a[ne].m(i,null);g(i,f),L&&L.m(i,null),g(i,d),N&&N.m(i,null),g(i,h),g(i,_),F&&F.m(_,null),g(e,v),g(e,k);for(let ne=0;ne<y.length;ne+=1)y[ne].m(k,null);x&&x.m(k,null),T=!0},p(U,X){U[2].isView?M&&(M.d(1),M=null):M?M.p(U,X):(M=mm(U),M.c(),M.m(i,s)),X[0]&128&&(l=!U[7].includes("@id")),l?C?(C.p(U,X),X[0]&128&&E(C,1)):(C=hm(U),C.c(),E(C,1),C.m(i,o)):C&&(ae(),P(C,1,1,()=>{C=null}),ue()),U[2].isAuth?O?(O.p(U,X),X[0]&4&&E(O,1)):(O=_m(U),O.c(),E(O,1),O.m(i,r)):O&&(ae(),P(O,1,1,()=>{O=null}),ue()),X[0]&262145&&(A=U[18],ae(),a=wt(a,X,I,1,U,A,u,i,ln,vm,f,dm),ue()),X[0]&1152&&(c=U[10]&&!U[7].includes("@created")),c?L?(L.p(U,X),X[0]&1152&&E(L,1)):(L=ym(U),L.c(),E(L,1),L.m(i,d)):L&&(ae(),P(L,1,1,()=>{L=null}),ue()),X[0]&640&&(m=U[9]&&!U[7].includes("@updated")),m?N?(N.p(U,X),X[0]&640&&E(N,1)):(N=km(U),N.c(),E(N,1),N.m(i,h)):N&&(ae(),P(N,1,1,()=>{N=null}),ue()),U[15].length?F?F.p(U,X):(F=wm(U),F.c(),F.m(_,null)):F&&(F.d(1),F=null),X[0]&4986582&&(R=U[4],ae(),y=wt(y,X,K,1,U,R,$,k,ln,Pm,null,fm),ue(),!R.length&&x?x.p(U,X):R.length?x&&(x.d(1),x=null):(x=Sm(U),x.c(),x.m(k,null))),(!T||X[0]&4096)&&Q(e,"table-loading",U[12])},i(U){if(!T){E(C),E(O);for(let X=0;X<A.length;X+=1)E(a[X]);E(L),E(N);for(let X=0;X<R.length;X+=1)E(y[X]);T=!0}},o(U){P(C),P(O);for(let X=0;X<a.length;X+=1)P(a[X]);P(L),P(N);for(let X=0;X<y.length;X+=1)P(y[X]);T=!1},d(U){U&&w(e),M&&M.d(),C&&C.d(),O&&O.d();for(let X=0;X<a.length;X+=1)a[X].d();L&&L.d(),N&&N.d(),F&&F.d();for(let X=0;X<y.length;X+=1)y[X].d();x&&x.d()}}}function Lm(n){let e,t;return e=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[14],$$slots:{default:[xD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&16384&&(l.trigger=i[14]),s[0]&32896|s[2]&2&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QD(n){let e,t,i,s,l,o=n[51].name+"",r,a,u,f,c;function d(...m){return n[27](n[51],...m)}return{c(){e=b("input"),s=D(),l=b("label"),r=V(o),u=D(),p(e,"type","checkbox"),p(e,"id",t=n[54]),e.checked=i=!n[7].includes(n[51].id),p(l,"for",a=n[54])},m(m,h){S(m,e,h),S(m,s,h),S(m,l,h),g(l,r),S(m,u,h),f||(c=Y(e,"change",d),f=!0)},p(m,h){n=m,h[1]&8388608&&t!==(t=n[54])&&p(e,"id",t),h[0]&32896&&i!==(i=!n[7].includes(n[51].id))&&(e.checked=i),h[0]&32768&&o!==(o=n[51].name+"")&&le(r,o),h[1]&8388608&&a!==(a=n[54])&&p(l,"for",a)},d(m){m&&w(e),m&&w(s),m&&w(l),m&&w(u),f=!1,c()}}}function Nm(n,e){let t,i,s;return i=new pe({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[QD,({uniqueId:l})=>({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Me(),H(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&32896|o[1]&8388608|o[2]&2&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function xD(n){let e,t,i=[],s=new Map,l,o,r=n[15];const a=u=>u[51].id+u[51].name;for(let u=0;u<r.length;u+=1){let f=pm(n,r,u),c=a(f);s.set(c,i[u]=Nm(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=D();for(let u=0;u<i.length;u+=1)i[u].c();l=Me(),p(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){S(u,e,f),S(u,t,f);for(let c=0;c<i.length;c+=1)i[c].m(u,f);S(u,l,f),o=!0},p(u,f){f[0]&32896|f[1]&8388608&&(r=u[15],ae(),i=wt(i,f,a,1,u,r,s,l.parentNode,ln,Nm,l,pm),ue())},i(u){if(!o){for(let f=0;f<r.length;f+=1)E(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)P(i[f]);o=!1},d(u){u&&w(e),u&&w(t);for(let f=0;f<i.length;f+=1)i[f].d(u);u&&w(l)}}}function eO(n){let e,t,i=n[14]&&Lm(n);return{c(){i&&i.c(),e=Me()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[14]?i?(i.p(s,l),l[0]&16384&&E(i,1)):(i=Lm(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Fm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=b("small"),t=V("Showing "),s=V(i),l=V(" of "),o=V(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&16&&i!==(i=r[4].length+"")&&le(s,i),a[0]&32&&le(o,r[5])},d(r){r&&w(e)}}}function Rm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=b("div"),t=b("button"),i=b("span"),s=V("Load more ("),o=V(l),r=V(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[12]),Q(t,"btn-disabled",n[12]),p(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=Y(t,"click",n[41]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),c[0]&4096&&Q(t,"btn-loading",f[12]),c[0]&4096&&Q(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function qm(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,m,h,_,v,k,y;return{c(){e=b("div"),t=b("div"),i=V("Selected "),s=b("strong"),l=V(n[8]),o=D(),a=V(r),u=D(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=b("div"),m=D(),h=b("button"),h.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[13]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),Q(h,"btn-loading",n[13]),Q(h,"btn-disabled",n[13]),p(e,"class","bulkbar")},m($,T){S($,e,T),g(e,t),g(t,i),g(t,s),g(s,l),g(t,o),g(t,a),g(e,u),g(e,f),g(e,c),g(e,d),g(e,m),g(e,h),v=!0,k||(y=[Y(f,"click",n[42]),Y(h,"click",n[43])],k=!0)},p($,T){(!v||T[0]&256)&&le(l,$[8]),(!v||T[0]&256)&&r!==(r=$[8]===1?"record":"records")&&le(a,r),(!v||T[0]&8192)&&Q(f,"btn-disabled",$[13]),(!v||T[0]&8192)&&Q(h,"btn-loading",$[13]),(!v||T[0]&8192)&&Q(h,"btn-disabled",$[13])},i($){v||($&&xe(()=>{_||(_=je(e,Pn,{duration:150,y:5},!0)),_.run(1)}),v=!0)},o($){$&&(_||(_=je(e,Pn,{duration:150,y:5},!1)),_.run(0)),v=!1},d($){$&&w(e),$&&_&&_.end(),k=!1,Pe(y)}}}function tO(n){let e,t,i,s,l,o;e=new Aa({props:{class:"table-wrapper",$$slots:{before:[eO],default:[XD]},$$scope:{ctx:n}}});let r=n[4].length&&Fm(n),a=n[4].length&&n[17]&&Rm(n),u=n[8]&&qm(n);return{c(){H(e.$$.fragment),t=D(),r&&r.c(),i=D(),a&&a.c(),s=D(),u&&u.c(),l=Me()},m(f,c){q(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&382679|c[2]&2&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=Fm(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,c):(a=Rm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&E(u,1)):(u=qm(f),u.c(),E(u,1),u.m(l.parentNode,l)):u&&(ae(),P(u,1,1,()=>{u=null}),ue())},i(f){o||(E(e.$$.fragment,f),E(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const nO=/^([\+\-])?(\w+)$/;function iO(n,e,t){let i,s,l,o,r,a,u,f;const c=Tt();let{collection:d}=e,{sort:m=""}=e,{filter:h=""}=e,_=[],v=1,k=0,y={},$=!0,T=!1,M=0,C,O=[],A=[];function I(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(O))}function L(){if(t(7,O=[]),!!(d!=null&&d.id))try{const ie=localStorage.getItem(d.id+"@hiddenCollumns");ie&&t(7,O=JSON.parse(ie)||[])}catch{}}async function N(){const ie=v;for(let we=1;we<=ie;we++)(we===1||o)&&await F(we,!1)}async function F(ie=1,we=!0){var Gt,di;if(!(d!=null&&d.id))return;t(12,$=!0);let nt=m;const et=nt.match(nO),bt=et?s.find(ct=>ct.name===et[2]):null;if(et&&((di=(Gt=bt==null?void 0:bt.options)==null?void 0:Gt.displayFields)==null?void 0:di.length)>0){const ct=[];for(const Wn of bt.options.displayFields)ct.push((et[1]||"")+et[2]+"."+Wn);nt=ct.join(",")}return me.collection(d.id).getList(ie,30,{sort:nt,filter:h,expand:s.map(ct=>ct.name).join(","),$cancelKey:"records_list"}).then(async ct=>{if(ie<=1&&R(),t(12,$=!1),t(11,v=ct.page),t(5,k=ct.totalItems),c("load",_.concat(ct.items)),we){const Wn=++M;for(;ct.items.length&&M==Wn;)t(4,_=_.concat(ct.items.splice(0,15))),await z.yieldToMain()}else t(4,_=_.concat(ct.items))}).catch(ct=>{ct!=null&&ct.isAbort||(t(12,$=!1),console.warn(ct),R(),me.errorResponseHandler(ct,!1))})}function R(){t(4,_=[]),t(11,v=1),t(5,k=0),t(6,y={})}function K(){a?x():U()}function x(){t(6,y={})}function U(){for(const ie of _)t(6,y[ie.id]=ie,y);t(6,y)}function X(ie){y[ie.id]?delete y[ie.id]:t(6,y[ie.id]=ie,y),t(6,y)}function ne(){cn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,J)}async function J(){if(T||!r||!(d!=null&&d.id))return;let ie=[];for(const we of Object.keys(y))ie.push(me.collection(d.id).delete(we));return t(13,T=!0),Promise.all(ie).then(()=>{jt(`Successfully deleted the selected ${r===1?"record":"records"}.`),x()}).catch(we=>{me.errorResponseHandler(we)}).finally(()=>(t(13,T=!1),N()))}function fe(ie){Ve.call(this,n,ie)}const Z=(ie,we)=>{we.target.checked?z.removeByValue(O,ie.id):z.pushUnique(O,ie.id),t(7,O)},de=()=>K();function ve(ie){m=ie,t(0,m)}function Te(ie){m=ie,t(0,m)}function Ne(ie){m=ie,t(0,m)}function Re(ie){m=ie,t(0,m)}function ye(ie){m=ie,t(0,m)}function Se(ie){m=ie,t(0,m)}function We(ie){se[ie?"unshift":"push"](()=>{C=ie,t(14,C)})}const lt=ie=>X(ie),ce=ie=>c("select",ie),ze=(ie,we)=>{we.code==="Enter"&&(we.preventDefault(),c("select",ie))},te=()=>t(1,h=""),Fe=()=>c("new"),ot=()=>F(v+1),Vt=()=>x(),Ae=()=>ne();return n.$$set=ie=>{"collection"in ie&&t(2,d=ie.collection),"sort"in ie&&t(0,m=ie.sort),"filter"in ie&&t(1,h=ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&d!=null&&d.id&&(L(),R()),n.$$.dirty[0]&4&&t(25,i=(d==null?void 0:d.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(ie=>ie.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ie=>!O.includes(ie.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&m!==-1&&h!==-1&&F(1),n.$$.dirty[0]&48&&t(17,o=k>_.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(y).length),n.$$.dirty[0]&272&&t(16,a=_.length&&r===_.length),n.$$.dirty[0]&128&&O!==-1&&I(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||_.length>0&&_[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||_.length>0&&_[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ie=>({id:ie.id,name:ie.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,h,d,F,_,k,y,O,r,f,u,v,$,T,C,A,a,o,l,c,K,x,X,ne,N,i,fe,Z,de,ve,Te,Ne,Re,ye,Se,We,lt,ce,ze,te,Fe,ot,Vt,Ae]}class sO extends be{constructor(e){super(),ge(this,e,iO,tO,he,{collection:2,sort:0,filter:1,reloadLoadedPages:24,load:3},null,[-1,-1,-1])}get reloadLoadedPages(){return this.$$.ctx[24]}get load(){return this.$$.ctx[3]}}function lO(n){let e,t,i,s;return e=new n4({}),i=new wn({props:{$$slots:{default:[aO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&8&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function oO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[cO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function rO(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[dO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ie(Be.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[15])],t=!0)},p:G,d(s){s&&w(e),t=!1,Pe(i)}}}function Hm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function aO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O,A,I,L,N=!n[10]&&jm(n);c=new Ea({}),c.$on("refresh",n[16]);let F=!n[2].isView&&Hm(n);k=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(U){n[21](U)}function K(U){n[22](U)}let x={collection:n[2]};return n[0]!==void 0&&(x.filter=n[0]),n[1]!==void 0&&(x.sort=n[1]),M=new sO({props:x}),n[20](M),se.push(()=>_e(M,"filter",R)),se.push(()=>_e(M,"sort",K)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",s=D(),l=b("div"),r=V(o),a=D(),u=b("div"),N&&N.c(),f=D(),H(c.$$.fragment),d=D(),m=b("div"),h=b("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=D(),F&&F.c(),v=D(),H(k.$$.fragment),y=D(),$=b("div"),T=D(),H(M.$$.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-base")},m(U,X){S(U,e,X),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),N&&N.m(u,null),g(u,f),q(c,u,null),g(e,d),g(e,m),g(m,h),g(m,_),F&&F.m(m,null),S(U,v,X),q(k,U,X),S(U,y,X),S(U,$,X),S(U,T,X),q(M,U,X),A=!0,I||(L=Y(h,"click",n[17]),I=!0)},p(U,X){(!A||X[0]&4)&&o!==(o=U[2].name+"")&&le(r,o),U[10]?N&&(N.d(1),N=null):N?N.p(U,X):(N=jm(U),N.c(),N.m(u,f)),U[2].isView?F&&(F.d(1),F=null):F?F.p(U,X):(F=Hm(U),F.c(),F.m(m,null));const ne={};X[0]&1&&(ne.value=U[0]),X[0]&4&&(ne.autocompleteCollection=U[2]),k.$set(ne);const J={};X[0]&4&&(J.collection=U[2]),!C&&X[0]&1&&(C=!0,J.filter=U[0],ke(()=>C=!1)),!O&&X[0]&2&&(O=!0,J.sort=U[1],ke(()=>O=!1)),M.$set(J)},i(U){A||(E(c.$$.fragment,U),E(k.$$.fragment,U),E(M.$$.fragment,U),A=!0)},o(U){P(c.$$.fragment,U),P(k.$$.fragment,U),P(M.$$.fragment,U),A=!1},d(U){U&&w(e),N&&N.d(),j(c),F&&F.d(),U&&w(v),j(k,U),U&&w(y),U&&w($),U&&w(T),n[20](null),j(M,U),I=!1,L()}}}function uO(n){let e,t,i,s,l;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=D(),i=b("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:G,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function fO(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){S(t,e,i)},p:G,d(t){t&&w(e)}}}function cO(n){let e,t,i;function s(r,a){return r[10]?fO:uO}let l=s(n),o=l(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),g(e,t),g(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function dO(n){let e;return{c(){e=b("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function pO(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[rO,oO,lO],m=[];function h($,T){return $[3]&&!$[9].length?0:$[9].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};s=new iu({props:_}),n[25](s);let v={};o=new f4({props:v}),n[26](o);let k={collection:n[2]};a=new Fb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new ID({props:y}),n[30](f),{c(){t.c(),i=D(),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment)},m($,T){m[e].m($,T),S($,i,T),q(s,$,T),S($,l,T),q(o,$,T),S($,r,T),q(a,$,T),S($,u,T),q(f,$,T),c=!0},p($,T){let M=e;e=h($),e===M?m[e].p($,T):(ae(),P(m[M],1,1,()=>{m[M]=null}),ue(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),E(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const O={};o.$set(O);const A={};T[0]&4&&(A.collection=$[2]),a.$set(A);const I={};T[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(E(t),E(s.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(f.$$.fragment,$),c=!0)},o($){P(t),P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&w(i),n[25](null),j(s,$),$&&w(l),n[26](null),j(o,$),$&&w(r),n[27](null),j(a,$),$&&w(u),n[30](null),j(f,$)}}}function mO(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,Z=>t(2,s=Z)),Ye(n,St,Z=>t(31,l=Z)),Ye(n,Lo,Z=>t(3,o=Z)),Ye(n,_a,Z=>t(13,r=Z)),Ye(n,Ai,Z=>t(9,a=Z)),Ye(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,m,h,_,v=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,y=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.isView&&!z.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ob(y);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>_==null?void 0:_.load(),O=()=>d==null?void 0:d.show(s),A=()=>m==null?void 0:m.show(),I=Z=>t(0,v=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{_=Z,t(8,_)})}function N(Z){v=Z,t(0,v)}function F(Z){k=Z,t(1,k)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):m==null||m.show(Z==null?void 0:Z.detail)},K=()=>m==null?void 0:m.show();function x(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function U(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function X(Z){se[Z?"unshift":"push"](()=>{m=Z,t(6,m)})}const ne=()=>_==null?void 0:_.reloadLoadedPages(),J=()=>_==null?void 0:_.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=y&&I3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&$(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Di("/collections?"+Z)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,c,d,m,h,_,a,u,y,i,r,T,M,C,O,A,I,L,N,F,R,K,x,U,X,ne,J,fe]}class hO extends be{constructor(e){super(),ge(this,e,mO,pO,he,{},null,[-1,-1])}}function _O(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O,A,I;return{c(){e=b("aside"),t=b("div"),i=b("div"),i.textContent="System",s=D(),l=b("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=b("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=b("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=b("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),m=b("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),_=b("a"),_.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,v=D(),k=b("div"),k.textContent="Authentication",y=D(),$=b("a"),$.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,T=D(),M=b("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=D(),O=b("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p($,"href","/settings/auth-providers"),p($,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,m),g(t,h),g(t,_),g(t,v),g(t,k),g(t,y),g(t,$),g(t,T),g(t,M),g(t,C),g(t,O),A||(I=[Ie(jn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(jn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(jn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(jn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(jn.call(null,_,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,_)),Ie(jn.call(null,$,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,$)),Ie(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(jn.call(null,O,{path:"/settings/admins/?.*"})),Ie(xt.call(null,O))],A=!0)},p:G,i:G,o:G,d(L){L&&w(e),A=!1,Pe(I)}}}class Ii extends be{constructor(e){super(),ge(this,e,null,_O,he,{})}}function Vm(n,e,t){const i=n.slice();return i[30]=e[t],i}function zm(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[gO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="id",o=D(),r=b("div"),a=b("i"),f=D(),c=b("input"),p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[29]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[29]),c.value=m=n[1].id,c.readOnly=!0},m(v,k){S(v,e,k),g(e,t),g(e,i),g(e,s),S(v,o,k),S(v,r,k),g(r,a),S(v,f,k),S(v,c,k),h||(_=Ie(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=v[29])&&p(c,"id",d),k[0]&2&&m!==(m=v[1].id)&&c.value!==m&&(c.value=m)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(c),h=!1,_()}}}function Bm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=b("button"),t=b("img"),s=D(),zn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[30]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),g(e,t),g(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function bO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Email",o=D(),r=b("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Um(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[vO,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function vO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[29]),p(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Wm(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[yO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[kO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),H(s.$$.fragment),l=D(),o=b("div"),H(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){S(f,e,c),g(e,t),g(t,i),q(s,i,null),g(t,l),g(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&536871424|c[1]&4&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(s.$$.fragment,f),E(r.$$.fragment,f),f&&xe(()=>{a||(a=je(t,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=je(t,At,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function yO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password",o=D(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[8]),u||(f=Y(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&re(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function kO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=D(),s=b("span"),s.textContent="Password confirm",o=D(),r=b("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[29]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),S(c,o,d),S(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&p(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function wO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[1].isNew&&zm(n),_=[0,1,2,3,4,5,6,7,8,9],v=[];for(let $=0;$<10;$+=1)v[$]=Bm(Vm(n,_,$));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[bO,({uniqueId:$})=>({29:$}),({uniqueId:$})=>[$?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Um(n),y=(n[1].isNew||n[4])&&Wm(n);return{c(){e=b("form"),h&&h.c(),t=D(),i=b("div"),s=b("p"),s.textContent="Avatar",l=D(),o=b("div");for(let $=0;$<10;$+=1)v[$].c();r=D(),H(a.$$.fragment),u=D(),k&&k.c(),f=D(),y&&y.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m($,T){S($,e,T),h&&h.m(e,null),g(e,t),g(e,i),g(i,s),g(i,l),g(i,o);for(let M=0;M<10;M+=1)v[M].m(o,null);g(e,r),q(a,e,null),g(e,u),k&&k.m(e,null),g(e,f),y&&y.m(e,null),c=!0,d||(m=Y(e,"submit",ft(n[12])),d=!0)},p($,T){if($[1].isNew?h&&(ae(),P(h,1,1,()=>{h=null}),ue()):h?(h.p($,T),T[0]&2&&E(h,1)):(h=zm($),h.c(),E(h,1),h.m(e,t)),T[0]&4){_=[0,1,2,3,4,5,6,7,8,9];let C;for(C=0;C<10;C+=1){const O=Vm($,_,C);v[C]?v[C].p(O,T):(v[C]=Bm(O),v[C].c(),v[C].m(o,null))}for(;C<10;C+=1)v[C].d(1)}const M={};T[0]&536870920|T[1]&4&&(M.$$scope={dirty:T,ctx:$}),a.$set(M),$[1].isNew?k&&(ae(),P(k,1,1,()=>{k=null}),ue()):k?(k.p($,T),T[0]&2&&E(k,1)):(k=Um($),k.c(),E(k,1),k.m(e,f)),$[1].isNew||$[4]?y?(y.p($,T),T[0]&18&&E(y,1)):(y=Wm($),y.c(),E(y,1),y.m(e,null)):y&&(ae(),P(y,1,1,()=>{y=null}),ue())},i($){c||(E(h),E(a.$$.fragment,$),E(k),E(y),c=!0)},o($){P(h),P(a.$$.fragment,$),P(k),P(y),c=!1},d($){$&&w(e),h&&h.d(),ht(v,$),j(a),k&&k.d(),y&&y.d(),d=!1,m()}}}function SO(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=V(t)},m(s,l){S(s,e,l),g(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&le(i,t)},d(s){s&&w(e)}}}function Ym(n){let e,t,i,s,l,o,r,a,u;return o=new ei({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[$O]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=D(),s=b("i"),l=D(),H(o.$$.fragment),r=D(),a=b("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){S(f,e,c),g(e,t),g(e,i),g(e,s),g(e,l),q(o,e,null),S(f,r,c),S(f,a,c),u=!0},p(f,c){const d={};c[1]&4&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(E(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),j(o),f&&w(r),f&&w(a)}}}function $O(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[15]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function TO(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Ym(n);return{c(){m&&m.c(),e=D(),t=b("button"),i=b("span"),i.textContent="Cancel",s=D(),l=b("button"),o=b("span"),a=V(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,_){m&&m.m(h,_),S(h,e,_),S(h,t,_),g(t,i),S(h,s,_),S(h,l,_),g(l,o),g(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,_){h[1].isNew?m&&(ae(),P(m,1,1,()=>{m=null}),ue()):m?(m.p(h,_),_[0]&2&&E(m,1)):(m=Ym(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=h[6]),(!f||_[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||_[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(E(m),f=!0)},o(h){P(m),f=!1},d(h){m&&m.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function CO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[TO],header:[SO],default:[wO]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function MO(n,e,t){let i;const s=Tt(),l="admin_"+z.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function _(U){return k(U),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(U){t(1,r=U!=null&&U.clone?U.clone():new Xi),y()}function y(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,m=""),In({})}function $(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||h)&&(U.password=d,U.passwordConfirm=m);let X;r.isNew?X=me.admins.create(U):X=me.admins.update(r.id,U),X.then(async ne=>{var J;t(7,u=!1),v(),jt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((J=me.authStore.model)==null?void 0:J.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),v(),jt("Successfully deleted admin."),s("delete",r)}).catch(U=>{me.errorResponseHandler(U)}))}const M=()=>T(),C=()=>v(),O=U=>t(2,f=U);function A(){c=this.value,t(3,c)}function I(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function N(){m=this.value,t(9,m)}const F=()=>i&&u?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function R(U){se[U?"unshift":"push"](()=>{o=U,t(5,o)})}function K(U){Ve.call(this,n,U)}function x(U){Ve.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[v,r,f,c,h,o,a,u,d,m,i,l,$,T,_,M,C,O,A,I,L,N,F,R,K,x]}class DO extends be{constructor(e){super(),ge(this,e,MO,CO,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Km(n,e,t){const i=n.slice();return i[24]=e[t],i}function OO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function EO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function AO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function IO(n){let e,t,i,s;return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),s.textContent="updated",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){S(l,e,o),g(e,t),g(e,i),g(e,s)},p:G,d(l){l&&w(e)}}}function Jm(n){let e;function t(l,o){return l[5]?LO:PO}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function PO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Zm(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Zm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function LO(n){let e;return{c(){e=b("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function Zm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function Gm(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Xm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,_,v,k,y,$=e[24].email+"",T,M,C,O,A,I,L,N,F,R,K,x,U,X;f=new lu({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&Gm();A=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function J(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),s=b("figure"),l=b("img"),r=D(),a=b("td"),u=b("div"),H(f.$$.fragment),c=D(),d=b("span"),h=V(m),_=D(),ne&&ne.c(),v=D(),k=b("td"),y=b("span"),T=V($),C=D(),O=b("td"),H(A.$$.fragment),I=D(),L=b("td"),H(N.$$.fragment),F=D(),R=b("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',K=D(),zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(y,"class","txt txt-ellipsis"),p(y,"title",M=e[24].email),p(k,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,de){S(Z,t,de),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),g(a,u),q(f,u,null),g(u,c),g(u,d),g(d,h),g(a,_),ne&&ne.m(a,null),g(t,v),g(t,k),g(k,y),g(y,T),g(t,C),g(t,O),q(A,O,null),g(t,I),g(t,L),q(N,L,null),g(t,F),g(t,R),g(t,K),x=!0,U||(X=[Y(t,"click",J),Y(t,"keydown",fe)],U=!0)},p(Z,de){e=Z,(!x||de&16&&!zn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const ve={};de&16&&(ve.value=e[24].id),f.$set(ve),(!x||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?ne||(ne=Gm(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!x||de&16)&&$!==($=e[24].email+"")&&le(T,$),(!x||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const Te={};de&16&&(Te.date=e[24].created),A.$set(Te);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(Z){x||(E(f.$$.fragment,Z),E(A.$$.fragment,Z),E(N.$$.fragment,Z),x=!0)},o(Z){P(f.$$.fragment,Z),P(A.$$.fragment,Z),P(N.$$.fragment,Z),x=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(A),j(N),U=!1,Pe(X)}}}function NO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M=[],C=new Map,O;function A(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[OO]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new Wt({props:I}),se.push(()=>_e(o,"sort",A));function L(J){n[12](J)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[EO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),se.push(()=>_e(u,"sort",L));function F(J){n[13](J)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[AO]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),se.push(()=>_e(d,"sort",F));function K(J){n[14](J)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[IO]},$$scope:{ctx:n}};n[2]!==void 0&&(x.sort=n[2]),_=new Wt({props:x}),se.push(()=>_e(_,"sort",K));let U=n[4];const X=J=>J[24].id;for(let J=0;J<U.length;J+=1){let fe=Km(n,U,J),Z=X(fe);C.set(Z,M[J]=Xm(Z,fe))}let ne=null;return U.length||(ne=Jm(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),s=b("th"),l=D(),H(o.$$.fragment),a=D(),H(u.$$.fragment),c=D(),H(d.$$.fragment),h=D(),H(_.$$.fragment),k=D(),y=b("th"),$=D(),T=b("tbody");for(let J=0;J<M.length;J+=1)M[J].c();ne&&ne.c(),p(s,"class","min-width"),p(y,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(J,fe){S(J,e,fe),g(e,t),g(t,i),g(i,s),g(i,l),q(o,i,null),g(i,a),q(u,i,null),g(i,c),q(d,i,null),g(i,h),q(_,i,null),g(i,k),g(i,y),g(e,$),g(e,T);for(let Z=0;Z<M.length;Z+=1)M[Z].m(T,null);ne&&ne.m(T,null),O=!0},p(J,fe){const Z={};fe&134217728&&(Z.$$scope={dirty:fe,ctx:J}),!r&&fe&4&&(r=!0,Z.sort=J[2],ke(()=>r=!1)),o.$set(Z);const de={};fe&134217728&&(de.$$scope={dirty:fe,ctx:J}),!f&&fe&4&&(f=!0,de.sort=J[2],ke(()=>f=!1)),u.$set(de);const ve={};fe&134217728&&(ve.$$scope={dirty:fe,ctx:J}),!m&&fe&4&&(m=!0,ve.sort=J[2],ke(()=>m=!1)),d.$set(ve);const Te={};fe&134217728&&(Te.$$scope={dirty:fe,ctx:J}),!v&&fe&4&&(v=!0,Te.sort=J[2],ke(()=>v=!1)),_.$set(Te),fe&186&&(U=J[4],ae(),M=wt(M,fe,X,1,J,U,C,T,ln,Xm,null,Km),ue(),!U.length&&ne?ne.p(J,fe):U.length?ne&&(ne.d(1),ne=null):(ne=Jm(J),ne.c(),ne.m(T,null))),(!O||fe&32)&&Q(e,"table-loading",J[5])},i(J){if(!O){E(o.$$.fragment,J),E(u.$$.fragment,J),E(d.$$.fragment,J),E(_.$$.fragment,J);for(let fe=0;fe<U.length;fe+=1)E(M[fe]);O=!0}},o(J){P(o.$$.fragment,J),P(u.$$.fragment,J),P(d.$$.fragment,J),P(_.$$.fragment,J);for(let fe=0;fe<M.length;fe+=1)P(M[fe]);O=!1},d(J){J&&w(e),j(o),j(u),j(d),j(_);for(let fe=0;fe<M.length;fe+=1)M[fe].d();ne&&ne.d()}}}function Qm(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=b("small"),t=V("Showing "),s=V(i),l=V(" of "),r=V(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),g(e,t),g(e,s),g(e,l),g(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&le(s,i),u&16&&o!==(o=a[4].length+"")&&le(r,o)},d(a){a&&w(e)}}}function FO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O;a=new Ea({}),a.$on("refresh",n[8]),h=new Wo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),h.$on("submit",n[10]),y=new Aa({props:{class:"table-wrapper",$$slots:{default:[NO]},$$scope:{ctx:n}}});let A=n[4].length&&Qm(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[6]),r=D(),H(a.$$.fragment),u=D(),f=b("div"),c=D(),d=b("button"),d.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,m=D(),H(h.$$.fragment),_=D(),v=b("div"),k=D(),H(y.$$.fragment),$=D(),A&&A.c(),T=Me(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(v,"class","clearfix m-b-base")},m(I,L){S(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),q(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),S(I,m,L),q(h,I,L),S(I,_,L),S(I,v,L),S(I,k,L),q(y,I,L),S(I,$,L),A&&A.m(I,L),S(I,T,L),M=!0,C||(O=Y(d,"click",n[9]),C=!0)},p(I,L){(!M||L&64)&&le(o,I[6]);const N={};L&2&&(N.value=I[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:I}),y.$set(F),I[4].length?A?A.p(I,L):(A=Qm(I),A.c(),A.m(T.parentNode,T)):A&&(A.d(1),A=null)},i(I){M||(E(a.$$.fragment,I),E(h.$$.fragment,I),E(y.$$.fragment,I),M=!0)},o(I){P(a.$$.fragment,I),P(h.$$.fragment,I),P(y.$$.fragment,I),M=!1},d(I){I&&w(e),j(a),I&&w(m),j(h,I),I&&w(_),I&&w(v),I&&w(k),j(y,I),I&&w($),A&&A.d(I),I&&w(T),C=!1,O()}}}function RO(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[FO]},$$scope:{ctx:n}}});let r={};return l=new DO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function qO(n,e,t){let i,s,l;Ye(n,_a,N=>t(21,i=N)),Ye(n,St,N=>t(6,s=N)),Ye(n,Oa,N=>t(7,l=N)),Kt(St,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),me.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),v=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),C=(N,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(N))},O=()=>t(1,f="");function A(N){se[N?"unshift":"push"](()=>{r=N,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Di("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,h,_,v,k,y,$,T,M,C,O,A,I,L]}class jO extends be{constructor(e){super(),ge(this,e,qO,RO,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function HO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Email"),s=D(),l=b("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=b("label"),t=V("Password"),s=D(),l=b("input"),r=D(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[1]),S(d,r,m),S(d,a,m),g(a,u),f||(c=[Y(l,"input",n[5]),Ie(xt.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Pe(c)}}}function zO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[HO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[VO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),a=b("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){S(d,e,m),g(e,t),g(e,i),q(s,e,null),g(e,l),q(o,e,null),g(e,r),g(e,a),u=!0,f||(c=Y(e,"submit",ft(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function BO(n){let e,t;return e=new Dg({props:{$$slots:{default:[zO]},$$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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function UO(n,e,t){let i;Ye(n,_a,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Ma(),Di("/")}).catch(()=>{dl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class WO extends be{constructor(e){super(),ge(this,e,UO,BO,he,{})}}function YO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[JO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[ZO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[GO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[XO,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&xm(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),c=D(),d=b("div"),m=b("div"),h=D(),C&&C.c(),_=D(),v=b("button"),k=b("span"),k.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(k,"class","txt"),p(v,"type","submit"),p(v,"class","btn btn-expanded"),v.disabled=y=!n[3]||n[2],Q(v,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,A){S(O,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),q(a,e,null),g(e,u),q(f,e,null),g(e,c),g(e,d),g(d,m),g(d,h),C&&C.m(d,null),g(d,_),g(d,v),g(v,k),$=!0,T||(M=Y(v,"click",n[13]),T=!0)},p(O,A){const I={};A&1572865&&(I.$$scope={dirty:A,ctx:O}),i.$set(I);const L={};A&1572865&&(L.$$scope={dirty:A,ctx:O}),o.$set(L);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:O}),a.$set(N);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:O}),f.$set(F),O[3]?C?C.p(O,A):(C=xm(O),C.c(),C.m(d,_)):C&&(C.d(1),C=null),(!$||A&12&&y!==(y=!O[3]||O[2]))&&(v.disabled=y),(!$||A&4)&&Q(v,"btn-loading",O[2])},i(O){$||(E(i.$$.fragment,O),E(o.$$.fragment,O),E(a.$$.fragment,O),E(f.$$.fragment,O),$=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(a.$$.fragment,O),P(f.$$.fragment,O),$=!1},d(O){O&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),T=!1,M()}}}function KO(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Application name"),s=D(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Application url"),s=D(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&re(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function GO(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Logs max days retention"),s=D(),l=b("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&re(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function XO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),l.textContent="Hide collection create and edit controls",o=D(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){S(c,e,d),e.checked=n[0].meta.hideControls,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[11]),Ie(Be.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function xm(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){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function QO(n){let e,t,i,s,l,o,r,a,u;const f=[KO,YO],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=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=D(),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){S(m,e,h),S(m,t,h),S(m,i,h),g(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",ft(n[4])),a=!0)},p(m,h){let _=l;l=d(m),l===_?c[l].p(m,h):(ae(),P(c[_],1,1,()=>{c[_]=null}),ue(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),E(o,1),o.m(s,null))},i(m){r||(E(o),r=!0)},o(m){P(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function xO(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[QO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function eE(n,e,t){let i,s,l,o;Ye(n,Cs,C=>t(14,s=C)),Ye(n,yo,C=>t(15,l=C)),Ye(n,St,C=>t(16,o=C)),Kt(St,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(z.filterRedactedProps(a));h(C),jt("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var O,A;Kt(yo,l=(O=C==null?void 0:C.meta)==null?void 0:O.appName,l),Kt(Cs,s=!!((A=C==null?void 0:C.meta)!=null&&A.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=pt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,v,k,y,$,T,M]}class tE extends be{constructor(e){super(),ge(this,e,eE,xO,he,{})}}function nE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Je(l,s[o]);return{c(){e=b("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){Xn(e,l=on(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function iE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Je(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),Xn(s,a)},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ie(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){Xn(s,a=on(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Pe(o)}}}function sE(n){let e;function t(l,o){return l[3]?iE:nE}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(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:G,o:G,d(l){s.d(l),l&&w(e)}}}function lE(n,e,t){const i=["value","mask"];let s=Et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await sn(),r==null||r.focus()}const f=()=>u();function c(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Je(Je({},e),Qn(m)),t(5,s=Et(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends be{constructor(e){super(),ge(this,e,lE,sE,he,{value:0,mask:1})}}function oE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=V("Subject"),s=D(),l=b("input"),r=D(),a=b("div"),u=V(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=V(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=V("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(v,k){S(v,e,k),g(e,t),S(v,s,k),S(v,l,k),re(l,n[0].subject),S(v,r,k),S(v,a,k),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),h||(_=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&p(e,"for",i),k[1]&1&&o!==(o=v[31])&&p(l,"id",o),k[0]&1&&l.value!==v[0].subject&&re(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),h=!1,Pe(_)}}}function rE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;return{c(){e=b("label"),t=V("Action URL"),s=D(),l=b("input"),r=D(),a=b("div"),u=V(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=V(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=V(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=V("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(y,$){S(y,e,$),g(e,t),S(y,s,$),S(y,l,$),re(l,n[0].actionUrl),S(y,r,$),S(y,a,$),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),v||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],v=!0)},p(y,$){$[1]&1&&i!==(i=y[31])&&p(e,"for",i),$[1]&1&&o!==(o=y[31])&&p(l,"id",o),$[0]&1&&l.value!==y[0].actionUrl&&re(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),v=!1,Pe(k)}}}function aE(n){let e,t,i,s;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:G,o:G,d(l){l&&w(e),i=!1,s()}}}function uE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Ht(o,r(n)),se.push(()=>_e(e,"value",l))),{c(){e&&H(e.$$.fragment),i=Me()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),o!==(o=a[4])){if(e){ae();const c=e;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=Ht(o,r(a)),se.push(()=>_e(e,"value",l)),H(e.$$.fragment),E(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function fE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T;const M=[uE,aE],C=[];function O(A,I){return A[4]&&!A[5]?0:1}return l=O(n),o=C[l]=M[l](n),{c(){e=b("label"),t=V("Body (HTML)"),s=D(),o.c(),r=D(),a=b("div"),u=V(`Available placeholder parameters:
`),f=b("button"),f.textContent=`{APP_NAME}
`,c=V(`,
`),d=b("button"),d.textContent=`{APP_URL}
`,m=V(`,
`),h=b("button"),h.textContent=`{TOKEN}
`,_=V(`,
`),v=b("button"),v.textContent=`{ACTION_URL}
`,k=V("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(v,"type","button"),p(v,"class","label label-sm link-primary txt-mono"),p(v,"title","Required parameter"),p(a,"class","help-block")},m(A,I){S(A,e,I),g(e,t),S(A,s,I),C[l].m(A,I),S(A,r,I),S(A,a,I),g(a,u),g(a,f),g(a,c),g(a,d),g(a,m),g(a,h),g(a,_),g(a,v),g(a,k),y=!0,$||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(v,"click",n[25])],$=!0)},p(A,I){(!y||I[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let L=l;l=O(A),l===L?C[l].p(A,I):(ae(),P(C[L],1,1,()=>{C[L]=null}),ue(),o=C[l],o?o.p(A,I):(o=C[l]=M[l](A),o.c()),E(o,1),o.m(r.parentNode,r))},i(A){y||(E(o),y=!0)},o(A){P(o),y=!1},d(A){A&&w(e),A&&w(s),C[l].d(A),A&&w(r),A&&w(a),$=!1,Pe(T)}}}function cE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[oE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[rE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[fE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function eh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function dE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&eh();return{c(){e=b("div"),t=b("i"),i=D(),s=b("span"),l=V(n[2]),o=D(),r=b("div"),a=D(),f&&f.c(),u=Me(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),g(e,t),g(e,i),g(e,s),g(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=eh(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(ae(),P(f,1,1,()=>{f=null}),ue())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function pE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[dE],default:[cE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?on(i,[xn(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let th;function mE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Et(e,s),o;Ye(n,fi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=th,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-8d5c4b7f.js"),["./CodeEditor-8d5c4b7f.js","./index-a6ccb683.js"],import.meta.url)).default),th=c,t(5,d=!1))}function k(J){z.copyToClipboard(J),Cg(`Copied ${J} to clipboard`,2e3)}v();function y(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function I(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),K=()=>k("{ACTION_URL}");function x(J){se[J?"unshift":"push"](()=>{f=J,t(3,f)})}function U(J){Ve.call(this,n,J)}function X(J){Ve.call(this,n,J)}function ne(J){Ve.call(this,n,J)}return n.$$set=J=>{e=Je(Je({},e),Qn(J)),t(8,l=Et(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||Qi(r))},[u,r,a,f,c,d,i,k,l,m,h,_,o,y,$,T,M,C,O,A,I,L,N,F,R,K,x,U,X,ne]}class Ir extends be{constructor(e){super(),ge(this,e,mE,pE,he,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function nh(n,e,t){const i=n.slice();return i[21]=e[t],i}function ih(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=b("div"),i=b("input"),l=D(),o=b("label"),a=V(r),f=D(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,e[11][0].push(i),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),this.first=t},m(m,h){S(m,t,h),g(t,i),i.checked=i.__value===e[2],g(t,l),g(t,o),g(o,a),g(t,f),c||(d=Y(i,"change",e[10]),c=!0)},p(m,h){e=m,h&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(m){m&&w(t),e[11][0].splice(e[11][0].indexOf(i),1),c=!1,d()}}}function hE(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o<s.length;o+=1){let r=nh(n,s,o),a=l(r);t.set(a,e[o]=ih(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Me()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r&1048708&&(s=o[7],e=wt(e,r,l,1,o,s,t,i.parentNode,es,ih,i,nh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function _E(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("To email address"),s=D(),l=b("input"),p(e,"for",i=n[20]),p(l,"type","email"),p(l,"id",o=n[20]),l.autofocus=!0,l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1]),l.focus(),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&2&&l.value!==u[1]&&re(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gE(n){let e,t,i,s,l,o,r;return t=new pe({props:{class:"form-field required",name:"template",$$slots:{default:[hE,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[_E,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),H(t.$$.fragment),i=D(),H(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),g(e,i),q(s,e,null),l=!0,o||(r=Y(e,"submit",ft(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(E(t.$$.fragment,a),E(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function bE(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function vE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("button"),t=V("Close"),i=D(),s=b("button"),l=b("i"),o=D(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){S(c,e,d),g(e,t),S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function yE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[vE],header:[bE],default:[gE]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{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[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[15](null),j(e,s)}}}const Pr="last_email_test",sh="email_test_request";function kE(n,e,t){let i;const s=Tt(),l="email_test_"+z.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Pr),u=o[0].value,f=!1,c=null;function d(O="",A=""){t(1,a=O||localStorage.getItem(Pr)),t(2,u=A||o[0].value),In({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Pr,a),clearTimeout(c),c=setTimeout(()=>{me.cancelRequest(sh),dl("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,{$cancelKey:sh}),jt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),m()}catch(O){t(4,f=!1),me.errorResponseHandler(O)}clearTimeout(c)}}const _=[[]];function v(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const y=()=>h(),$=()=>!f;function T(O){se[O?"unshift":"push"](()=>{r=O,t(3,r)})}function M(O){Ve.call(this,n,O)}function C(O){Ve.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,h,d,v,_,k,y,$,T,M,C]}class wE extends be{constructor(e){super(),ge(this,e,kE,yE,he,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function SE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O,A,I,L;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[TE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[CE,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});function N(Z){n[14](Z)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new Ir({props:F}),se.push(()=>_e(u,"config",N));function R(Z){n[15](Z)}let K={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(K.config=n[0].meta.resetPasswordTemplate),d=new Ir({props:K}),se.push(()=>_e(d,"config",R));function x(Z){n[16](Z)}let U={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(U.config=n[0].meta.confirmEmailChangeTemplate),_=new Ir({props:U}),se.push(()=>_e(_,"config",x)),T=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[ME,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&lh(n);function ne(Z,de){return Z[4]?NE:LE}let J=ne(n),fe=J(n);return{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),H(u.$$.fragment),c=D(),H(d.$$.fragment),h=D(),H(_.$$.fragment),k=D(),y=b("hr"),$=D(),H(T.$$.fragment),M=D(),X&&X.c(),C=D(),O=b("div"),A=b("div"),I=D(),fe.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(A,"class","flex-fill"),p(O,"class","flex")},m(Z,de){S(Z,e,de),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),S(Z,r,de),S(Z,a,de),q(u,a,null),g(a,c),q(d,a,null),g(a,h),q(_,a,null),S(Z,k,de),S(Z,y,de),S(Z,$,de),q(T,Z,de),S(Z,M,de),X&&X.m(Z,de),S(Z,C,de),S(Z,O,de),g(O,A),g(O,I),fe.m(O,null),L=!0},p(Z,de){const ve={};de[0]&1|de[1]&3&&(ve.$$scope={dirty:de,ctx:Z}),i.$set(ve);const Te={};de[0]&1|de[1]&3&&(Te.$$scope={dirty:de,ctx:Z}),o.$set(Te);const Ne={};!f&&de[0]&1&&(f=!0,Ne.config=Z[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Ne);const Re={};!m&&de[0]&1&&(m=!0,Re.config=Z[0].meta.resetPasswordTemplate,ke(()=>m=!1)),d.$set(Re);const ye={};!v&&de[0]&1&&(v=!0,ye.config=Z[0].meta.confirmEmailChangeTemplate,ke(()=>v=!1)),_.$set(ye);const Se={};de[0]&1|de[1]&3&&(Se.$$scope={dirty:de,ctx:Z}),T.$set(Se),Z[0].smtp.enabled?X?(X.p(Z,de),de[0]&1&&E(X,1)):(X=lh(Z),X.c(),E(X,1),X.m(C.parentNode,C)):X&&(ae(),P(X,1,1,()=>{X=null}),ue()),J===(J=ne(Z))&&fe?fe.p(Z,de):(fe.d(1),fe=J(Z),fe&&(fe.c(),fe.m(O,null)))},i(Z){L||(E(i.$$.fragment,Z),E(o.$$.fragment,Z),E(u.$$.fragment,Z),E(d.$$.fragment,Z),E(_.$$.fragment,Z),E(T.$$.fragment,Z),E(X),L=!0)},o(Z){P(i.$$.fragment,Z),P(o.$$.fragment,Z),P(u.$$.fragment,Z),P(d.$$.fragment,Z),P(_.$$.fragment,Z),P(T.$$.fragment,Z),P(X),L=!1},d(Z){Z&&w(e),j(i),j(o),Z&&w(r),Z&&w(a),j(u),j(d),j(_),Z&&w(k),Z&&w(y),Z&&w($),j(T,Z),Z&&w(M),X&&X.d(Z),Z&&w(C),Z&&w(O),fe.d()}}}function $E(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function TE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Sender name"),s=D(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.senderName),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&re(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Sender address"),s=D(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","email"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&re(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ME(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=D(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[31])},m(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(Be.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function lh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;return i=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[DE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[OE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[EE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[AE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[IE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),y=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[PE,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),H(u.$$.fragment),f=D(),c=b("div"),H(d.$$.fragment),m=D(),h=b("div"),H(_.$$.fragment),v=D(),k=b("div"),H(y.$$.fragment),$=D(),T=b("div"),p(t,"class","col-lg-4"),p(l,"class","col-lg-2"),p(a,"class","col-lg-3"),p(c,"class","col-lg-3"),p(h,"class","col-lg-6"),p(k,"class","col-lg-6"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(O,A){S(O,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,$),g(e,T),C=!0},p(O,A){const I={};A[0]&1|A[1]&3&&(I.$$scope={dirty:A,ctx:O}),i.$set(I);const L={};A[0]&1|A[1]&3&&(L.$$scope={dirty:A,ctx:O}),o.$set(L);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:O}),u.$set(N);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:O}),d.$set(F);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:O}),_.$set(R);const K={};A[0]&1|A[1]&3&&(K.$$scope={dirty:A,ctx:O}),y.$set(K)},i(O){C||(E(i.$$.fragment,O),E(o.$$.fragment,O),E(u.$$.fragment,O),E(d.$$.fragment,O),E(_.$$.fragment,O),E(y.$$.fragment,O),O&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),C=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(_.$$.fragment,O),P(y.$$.fragment,O),O&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),O&&M&&M.end()}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("SMTP server host"),s=D(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].smtp.host),r||(a=Y(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&re(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function OE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Port"),s=D(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].smtp.port),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&re(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[31],items:n[6]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=V("TLS encryption"),s=D(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function AE(n){let e,t,i,s,l,o,r;function a(f){n[21](f)}let u={id:n[31],items:n[7]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new is({props:u}),se.push(()=>_e(l,"keyOfSelected",a)),{c(){e=b("label"),t=V("AUTH method"),s=D(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function IE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Username"),s=D(),l=b("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[0].smtp.username),r||(a=Y(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&re(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function PE(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=V("Password"),s=D(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&p(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function LE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function NE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),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[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),g(e,t),S(u,i,f),S(u,s,f),g(s,l),r||(a=[Y(e,"click",n[24]),Y(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Pe(a)}}}function FE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[$E,SE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[5]),r=D(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),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,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[27])),_=!0)},p(T,M){(!h||M[0]&32)&&le(o,T[5]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function RE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[FE]},$$scope:{ctx:n}}});let r={};return l=new wE({props:r}),n[28](l),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function qE(n,e,t){let i,s,l;Ye(n,St,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Kt(St,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};_(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(z.filterRedactedProps(f));_(ne),In({}),jt("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function _(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function y(){f.meta.senderAddress=this.value,t(0,f)}function $(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function T(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function I(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>v(),K=()=>h(),x=()=>a==null?void 0:a.show(),U=()=>h();function X(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,v,u,i,k,y,$,T,M,C,O,A,I,L,N,F,R,K,x,U,X]}class jE extends be{constructor(e){super(),ge(this,e,qE,RE,he,{},null,[-1,-1])}}function HE(n){var T,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[zE,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let v=((T=n[0].s3)==null?void 0:T.enabled)!=n[1].s3.enabled&&oh(n),k=n[1].s3.enabled&&rh(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&ah(n),$=n[6]&&uh(n);return{c(){H(e.$$.fragment),t=D(),v&&v.c(),i=D(),k&&k.c(),s=D(),l=b("div"),o=b("div"),r=D(),y&&y.c(),a=D(),$&&$.c(),u=D(),f=b("button"),c=b("span"),c.textContent="Save changes",p(o,"class","flex-fill"),p(c,"class","txt"),p(f,"type","submit"),p(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],Q(f,"btn-loading",n[3]),p(l,"class","flex")},m(C,O){q(e,C,O),S(C,t,O),v&&v.m(C,O),S(C,i,O),k&&k.m(C,O),S(C,s,O),S(C,l,O),g(l,o),g(l,r),y&&y.m(l,null),g(l,a),$&&$.m(l,null),g(l,u),g(l,f),g(f,c),m=!0,h||(_=Y(f,"click",n[19]),h=!0)},p(C,O){var I,L;const A={};O&100663298&&(A.$$scope={dirty:O,ctx:C}),e.$set(A),((I=C[0].s3)==null?void 0:I.enabled)!=C[1].s3.enabled?v?(v.p(C,O),O&3&&E(v,1)):(v=oh(C),v.c(),E(v,1),v.m(i.parentNode,i)):v&&(ae(),P(v,1,1,()=>{v=null}),ue()),C[1].s3.enabled?k?(k.p(C,O),O&2&&E(k,1)):(k=rh(C),k.c(),E(k,1),k.m(s.parentNode,s)):k&&(ae(),P(k,1,1,()=>{k=null}),ue()),(L=C[1].s3)!=null&&L.enabled&&!C[6]&&!C[3]?y?y.p(C,O):(y=ah(C),y.c(),y.m(l,a)):y&&(y.d(1),y=null),C[6]?$?$.p(C,O):($=uh(C),$.c(),$.m(l,u)):$&&($.d(1),$=null),(!m||O&72&&d!==(d=!C[6]||C[3]))&&(f.disabled=d),(!m||O&8)&&Q(f,"btn-loading",C[3])},i(C){m||(E(e.$$.fragment,C),E(v),E(k),m=!0)},o(C){P(e.$$.fragment,C),P(v),P(k),m=!1},d(C){j(e,C),C&&w(t),v&&v.d(C),C&&w(i),k&&k.d(C),C&&w(s),C&&w(l),y&&y.d(),$&&$.d(),h=!1,_()}}}function VE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function zE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[25]),e.required=!0,p(s,"for",o=n[25])},m(u,f){S(u,e,f),e.checked=n[1].s3.enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function oh(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,_,v,k,y,$,T,M,C,O,A;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=D(),l=b("div"),o=V(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=b("strong"),u=V(a),f=V(`
to the
`),c=b("strong"),m=V(d),h=V(`.
`),_=b("br"),v=V(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,y=V(`,
`),$=b("a"),$.textContent=`s5cmd
`,T=V(", etc."),M=D(),C=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(C,"class","clearfix m-t-base")},m(L,N){S(L,e,N),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,m),g(l,h),g(l,_),g(l,v),g(l,k),g(l,y),g(l,$),g(l,T),g(e,M),g(e,C),A=!0},p(L,N){var F;(!A||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!A||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){A||(L&&xe(()=>{O||(O=je(e,At,{duration:150},!0)),O.run(1)}),A=!0)},o(L){L&&(O||(O=je(e,At,{duration:150},!1)),O.run(0)),A=!1},d(L){L&&w(e),L&&O&&O.end()}}}function rh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[BE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[UE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[WE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[YE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[KE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),y=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[JE,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),H(i.$$.fragment),s=D(),l=b("div"),H(o.$$.fragment),r=D(),a=b("div"),H(u.$$.fragment),f=D(),c=b("div"),H(d.$$.fragment),m=D(),h=b("div"),H(_.$$.fragment),v=D(),k=b("div"),H(y.$$.fragment),$=D(),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(O,A){S(O,e,A),g(e,t),q(i,t,null),g(e,s),g(e,l),q(o,l,null),g(e,r),g(e,a),q(u,a,null),g(e,f),g(e,c),q(d,c,null),g(e,m),g(e,h),q(_,h,null),g(e,v),g(e,k),q(y,k,null),g(e,$),g(e,T),C=!0},p(O,A){const I={};A&100663298&&(I.$$scope={dirty:A,ctx:O}),i.$set(I);const L={};A&100663298&&(L.$$scope={dirty:A,ctx:O}),o.$set(L);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:O}),u.$set(N);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:O}),d.$set(F);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:O}),_.$set(R);const K={};A&100663298&&(K.$$scope={dirty:A,ctx:O}),y.$set(K)},i(O){C||(E(i.$$.fragment,O),E(o.$$.fragment,O),E(u.$$.fragment,O),E(d.$$.fragment,O),E(_.$$.fragment,O),E(y.$$.fragment,O),O&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),C=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(_.$$.fragment,O),P(y.$$.fragment,O),O&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(_),j(y),O&&M&&M.end()}}}function BE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Endpoint"),s=D(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.endpoint),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&re(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function UE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Bucket"),s=D(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.bucket),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&re(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function WE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Region"),s=D(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.region),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&re(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function YE(n){let e,t,i,s,l,o,r,a;return{c(){e=b("label"),t=V("Access key"),s=D(),l=b("input"),p(e,"for",i=n[25]),p(l,"type","text"),p(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),g(e,t),S(u,s,f),S(u,l,f),re(l,n[1].s3.accessKey),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&p(e,"for",i),f&33554432&&o!==(o=u[25])&&p(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&re(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function KE(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[25],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=V("Secret"),s=D(),H(l.$$.fragment),p(e,"for",i=n[25])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&33554432&&i!==(i=f[25]))&&p(e,"for",i);const d={};c&33554432&&(d.id=f[25]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=b("input"),i=D(),s=b("label"),l=b("span"),l.textContent="Force path-style addressing",o=D(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[25])},m(c,d){S(c,e,d),e.checked=n[1].s3.forcePathStyle,S(c,i,d),S(c,s,d),g(s,l),g(s,o),g(s,r),u||(f=[Y(e,"change",n[17]),Ie(Be.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&33554432&&t!==(t=c[25])&&p(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&33554432&&a!==(a=c[25])&&p(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Pe(f)}}}function ah(n){let e;function t(l,o){return l[4]?XE:l[5]?GE:ZE}let i=t(n),s=i(n);return{c(){s.c(),e=Me()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function ZE(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function GE(n){let e,t,i,s;return{c(){e=b("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ie(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function XE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function uh(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[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[VE,HE],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[7]),r=D(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),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,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[20])),_=!0)},p(T,M){(!h||M&128)&&le(o,T[7]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function xE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[QE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function eA(n,e,t){let i,s,l;Ye(n,St,F=>t(7,l=F)),Kt(St,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;m();async function m(){t(2,a=!0);try{const F=await me.settings.getAll()||{};_(F)}catch(F){me.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(lo);const F=await me.settings.update(z.filterRedactedProps(r));In({}),await _(F),Ma(),c?Av("Successfully saved but failed to establish S3 connection."):jt("Successfully saved files storage settings.")}catch(F){me.errorResponseHandler(F)}t(3,u=!1)}}async function _(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function v(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:lo})}catch(F){t(5,c=F)}t(4,f=!1),clearTimeout(d)}}Zt(()=>()=>{clearTimeout(d)});function y(){r.s3.enabled=this.checked,t(1,r)}function $(){r.s3.endpoint=this.value,t(1,r)}function T(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function O(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const I=()=>v(),L=()=>h(),N=()=>h();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,h,v,i,y,$,T,M,C,O,A,I,L,N]}class tA extends be{constructor(e){super(),ge(this,e,eA,xE,he,{})}}function nA(n){let e,t,i,s,l,o,r,a;return{c(){e=b("input"),i=D(),s=b("label"),l=V("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),g(s,l),r||(a=Y(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function iA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("label"),t=V("Client ID"),s=D(),l=b("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),g(e,t),S(f,s,c),S(f,l,c),re(l,n[0].clientId),a||(u=Y(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&p(e,"for",i),c&2097152&&o!==(o=f[21])&&p(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&re(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function sA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>_e(l,"value",a)),{c(){e=b("label"),t=V("Client secret"),s=D(),H(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){S(f,e,c),g(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(E(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function fh(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=Ht(o,r(n)),se.push(()=>_e(t,"config",l))),{c(){e=b("div"),t&&H(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),o!==(o=a[4])){if(t){ae();const c=t;P(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(t=Ht(o,r(a)),se.push(()=>_e(t,"config",l)),H(t.$$.fragment),E(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&E(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function lA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k;t=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[nA,({uniqueId:$})=>({21:$}),({uniqueId:$})=>$?2097152:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientId",$$slots:{default:[iA,({uniqueId:$})=>({21:$}),({uniqueId:$})=>$?2097152:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientSecret",$$slots:{default:[sA,({uniqueId:$})=>({21:$}),({uniqueId:$})=>$?2097152:0]},$$scope:{ctx:n}}});let y=n[4]&&fh(n);return{c(){e=b("div"),H(t.$$.fragment),i=D(),s=b("button"),s.innerHTML='<span class="txt">Clear all fields</span>',l=D(),o=b("div"),r=b("div"),a=D(),u=b("div"),H(f.$$.fragment),c=D(),d=b("div"),H(m.$$.fragment),h=D(),y&&y.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(e,"class","flex"),p(r,"class","col-12 spacing"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(o,"class","grid")},m($,T){S($,e,T),q(t,e,null),g(e,i),g(e,s),S($,l,T),S($,o,T),g(o,r),g(o,a),g(o,u),q(f,u,null),g(o,c),g(o,d),q(m,d,null),g(o,h),y&&y.m(o,null),_=!0,v||(k=Y(s,"click",n[7]),v=!0)},p($,T){const M={};T&2&&(M.name=$[1]+".enabled"),T&6291457&&(M.$$scope={dirty:T,ctx:$}),t.$set(M);const C={};T&1&&(C.class="form-field "+($[0].enabled?"required":"")),T&2&&(C.name=$[1]+".clientId"),T&6291457&&(C.$$scope={dirty:T,ctx:$}),f.$set(C);const O={};T&1&&(O.class="form-field "+($[0].enabled?"required":"")),T&2&&(O.name=$[1]+".clientSecret"),T&6291457&&(O.$$scope={dirty:T,ctx:$}),m.$set(O),$[4]?y?(y.p($,T),T&16&&E(y,1)):(y=fh($),y.c(),E(y,1),y.m(o,null)):y&&(ae(),P(y,1,1,()=>{y=null}),ue())},i($){_||(E(t.$$.fragment,$),E(f.$$.fragment,$),E(m.$$.fragment,$),E(y),_=!0)},o($){P(t.$$.fragment,$),P(f.$$.fragment,$),P(m.$$.fragment,$),P(y),_=!1},d($){$&&w(e),j(t),$&&w(l),$&&w(o),j(f),j(m),y&&y.d(),v=!1,k()}}}function ch(n){let e;return{c(){e=b("i"),p(e,"class",n[3])},m(t,i){S(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&w(e)}}}function dh(n){let e,t,i,s,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ie(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{t||(t=je(e,It,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=je(e,It,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function oA(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rA(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function aA(n){let e,t,i,s,l,o,r,a=n[1].substring(0,n[1].length-4)+"",u,f,c,d,m,h,_,v=n[3]&&ch(n),k=n[6]&&dh();function y(M,C){return M[0].enabled?rA:oA}let $=y(n),T=$(n);return{c(){e=b("div"),v&&v.c(),t=D(),i=b("span"),s=V(n[2]),l=D(),o=b("em"),r=V("("),u=V(a),f=V(")"),c=D(),d=b("div"),m=D(),k&&k.c(),h=D(),T.c(),_=Me(),p(i,"class","txt"),p(o,"class","txt-hint"),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m(M,C){S(M,e,C),v&&v.m(e,null),g(e,t),g(e,i),g(i,s),g(e,l),g(e,o),g(o,r),g(o,u),g(o,f),S(M,c,C),S(M,d,C),S(M,m,C),k&&k.m(M,C),S(M,h,C),T.m(M,C),S(M,_,C)},p(M,C){M[3]?v?v.p(M,C):(v=ch(M),v.c(),v.m(e,t)):v&&(v.d(1),v=null),C&4&&le(s,M[2]),C&2&&a!==(a=M[1].substring(0,M[1].length-4)+"")&&le(u,a),M[6]?k?C&64&&E(k,1):(k=dh(),k.c(),E(k,1),k.m(h.parentNode,h)):k&&(ae(),P(k,1,1,()=>{k=null}),ue()),$!==($=y(M))&&(T.d(1),T=$(M),T&&(T.c(),T.m(_.parentNode,_)))},d(M){M&&w(e),v&&v.d(),M&&w(c),M&&w(d),M&&w(m),k&&k.d(M),M&&w(h),T.d(M),M&&w(_)}}}function uA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[aA],default:[lA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ks({props:s}),n[17](e),e.$on("expand",n[18]),e.$on("collapse",n[19]),e.$on("toggle",n[20]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&256?on(i,[xn(l[8])]):{};o&4194399&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[17](null),j(e,l)}}}function fA(n,e,t){let i;const s=["key","title","icon","config","optionsComponent","expand","collapse","collapseSiblings"];let l=Et(e,s),o;Ye(n,fi,I=>t(12,o=I));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:c}=e,d;function m(){d==null||d.expand()}function h(){d==null||d.collapse()}function _(){d==null||d.collapseSiblings()}function v(){for(let I in f)t(0,f[I]="",f);t(0,f.enabled=!1,f)}function k(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function $(I){n.$$.not_equal(f.clientSecret,I)&&(f.clientSecret=I,t(0,f))}function T(I){f=I,t(0,f)}function M(I){se[I?"unshift":"push"](()=>{d=I,t(5,d)})}function C(I){Ve.call(this,n,I)}function O(I){Ve.call(this,n,I)}function A(I){Ve.call(this,n,I)}return n.$$set=I=>{e=Je(Je({},e),Qn(I)),t(8,l=Et(e,s)),"key"in I&&t(1,r=I.key),"title"in I&&t(2,a=I.title),"icon"in I&&t(3,u=I.icon),"config"in I&&t(0,f=I.config),"optionsComponent"in I&&t(4,c=I.optionsComponent)},n.$$.update=()=>{n.$$.dirty&4098&&t(6,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Qi(r))},[f,r,a,u,c,d,i,v,l,m,h,_,o,k,y,$,T,M,C,O,A]}class cA extends be{constructor(e){super(),ge(this,e,fA,uA,he,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:9,collapse:10,collapseSiblings:11})}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function ph(n,e,t){const i=n.slice();return i[18]=e[t][0],i[19]=e[t][1],i[20]=e,i[21]=t,i}function dA(n){let e,t,i,s,l,o,r,a,u,f,c,d=Object.entries(As),m=[];for(let k=0;k<d.length;k+=1)m[k]=hh(ph(n,d,k));const h=k=>P(m[k],1,1,()=>{m[k]=null});let _=!n[4]&&_h(n),v=n[5]&&gh(n);return{c(){e=b("div");for(let k=0;k<m.length;k+=1)m[k].c();t=D(),_&&_.c(),i=D(),s=b("div"),l=b("div"),o=D(),v&&v.c(),r=D(),a=b("button"),u=b("span"),u.textContent="Save changes",p(e,"class","accordions"),p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[5]||n[3],Q(a,"btn-loading",n[3]),p(s,"class","flex m-t-base")},m(k,y){S(k,e,y);for(let $=0;$<m.length;$+=1)m[$].m(e,null);S(k,t,y),_&&_.m(k,y),S(k,i,y),S(k,s,y),g(s,l),g(s,o),v&&v.m(s,null),g(s,r),g(s,a),g(a,u),c=!0},p(k,y){if(y&19){d=Object.entries(As);let $;for($=0;$<d.length;$+=1){const T=ph(k,d,$);m[$]?(m[$].p(T,y),E(m[$],1)):(m[$]=hh(T),m[$].c(),E(m[$],1),m[$].m(e,null))}for(ae(),$=d.length;$<m.length;$+=1)h($);ue()}k[4]?_&&(_.d(1),_=null):_?_.p(k,y):(_=_h(k),_.c(),_.m(i.parentNode,i)),k[5]?v?v.p(k,y):(v=gh(k),v.c(),v.m(s,r)):v&&(v.d(1),v=null),(!c||y&40&&f!==(f=!k[5]||k[3]))&&(a.disabled=f),(!c||y&8)&&Q(a,"btn-loading",k[3])},i(k){if(!c){for(let y=0;y<d.length;y+=1)E(m[y]);c=!0}},o(k){m=m.filter(Boolean);for(let y=0;y<m.length;y+=1)P(m[y]);c=!1},d(k){k&&w(e),ht(m,k),k&&w(t),_&&_.d(k),k&&w(i),k&&w(s),v&&v.d()}}}function pA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function mh(n){let e,t=n[18],i,s;const l=()=>n[12](e,t),o=()=>n[12](null,t);function r(u){n[13](u,n[18])}let a={single:!0,key:n[18],title:n[19].title,icon:n[19].icon||"ri-fingerprint-line",optionsComponent:n[19].optionsComponent};return n[0][n[18]]!==void 0&&(a.config=n[0][n[18]]),e=new cA({props:a}),l(),se.push(()=>_e(e,"config",r)),{c(){H(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,f){n=u,t!==n[18]&&(o(),t=n[18],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[18]],ke(()=>i=!1)),e.$set(c)},i(u){s||(E(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function hh(n){var s;let e,t,i=(n[4]||!n[19].hidden||((s=n[0][n[18]])==null?void 0:s.enabled))&&mh(n);return{c(){i&&i.c(),e=Me()},m(l,o){i&&i.m(l,o),S(l,e,o),t=!0},p(l,o){var r;l[4]||!l[19].hidden||(r=l[0][l[18]])!=null&&r.enabled?i?(i.p(l,o),o&17&&E(i,1)):(i=mh(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ae(),P(i,1,1,()=>{i=null}),ue())},i(l){t||(E(i),t=!0)},o(l){P(i),t=!1},d(l){i&&i.d(l),l&&w(e)}}}function _h(n){let e,t,i,s,l,o,r,a,u;return{c(){e=b("button"),t=b("i"),i=D(),s=b("span"),l=V("Show all ("),o=V(n[6]),r=V(")"),p(t,"class","ri-arrow-down-s-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(f,c){S(f,e,c),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),a||(u=Y(e,"click",n[14]),a=!0)},p(f,c){c&64&&le(o,f[6])},d(f){f&&w(e),a=!1,u()}}}function gh(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[3]},m(l,o){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function mA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[pA,dA],y=[];function $(T,M){return T[2]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[7]),r=D(),a=b("div"),u=b("form"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=D(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[8])),_=!0)},p(T,M){(!h||M&128)&&le(o,T[7]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function hA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[mA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&4194559&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function _A(n,e,t){let i,s,l,o;Ye(n,St,M=>t(7,o=M)),Kt(St,o="Auth providers",o);let r={},a={},u={},f=!1,c=!1,d=!1;m();async function m(){t(2,f=!0);try{const M=await me.settings.getAll()||{};_(M)}catch(M){me.errorResponseHandler(M)}t(2,f=!1)}async function h(){var M;if(!(c||!s)){t(3,c=!0);try{const C=await me.settings.update(z.filterRedactedProps(u));_(C),In({}),(M=r[Object.keys(r)[0]])==null||M.collapseSiblings(),jt("Successfully updated auth providers.")}catch(C){me.errorResponseHandler(C)}t(3,c=!1)}}function _(M){M=M||{},t(0,u={});for(const C in As)t(0,u[C]=Object.assign({enabled:!1},M[C]),u);t(10,a=JSON.parse(JSON.stringify(u)))}function v(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function k(M,C){se[M?"unshift":"push"](()=>{r[C]=M,t(1,r)})}function y(M,C){n.$$.not_equal(u[C],M)&&(u[C]=M,t(0,u))}const $=()=>t(4,d=!0),T=()=>v();return n.$$.update=()=>{n.$$.dirty&1024&&t(11,i=JSON.stringify(a)),n.$$.dirty&2049&&t(5,s=i!=JSON.stringify(u))},t(6,l=Object.values(As).filter(M=>M.hidden).length),[u,r,f,c,d,s,l,o,h,v,a,i,k,y,$,T]}class gA extends be{constructor(e){super(),ge(this,e,_A,hA,he,{})}}function bh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function bA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const _=k=>k[16].key;for(let k=0;k<h.length;k+=1){let y=bh(n,h,k),$=_(y);t.set($,e[k]=vh($,y))}let v=n[3]&&yh(n);return{c(){for(let k=0;k<e.length;k+=1)e[k].c();i=D(),s=b("div"),l=b("div"),o=D(),v&&v.c(),r=D(),a=b("button"),u=b("span"),u.textContent="Save changes",p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],Q(a,"btn-loading",n[2]),p(s,"class","flex")},m(k,y){for(let $=0;$<e.length;$+=1)e[$].m(k,y);S(k,i,y),S(k,s,y),g(s,l),g(s,o),v&&v.m(s,null),g(s,r),g(s,a),g(a,u),c=!0,d||(m=Y(a,"click",n[13]),d=!0)},p(k,y){y&524321&&(h=k[5],ae(),e=wt(e,y,_,1,k,h,t,i.parentNode,ln,vh,i,bh),ue()),k[3]?v?v.p(k,y):(v=yh(k),v.c(),v.m(s,r)):v&&(v.d(1),v=null),(!c||y&12&&f!==(f=!k[3]||k[2]))&&(a.disabled=f),(!c||y&4)&&Q(a,"btn-loading",k[2])},i(k){if(!c){for(let y=0;y<h.length;y+=1)E(e[y]);c=!0}},o(k){for(let y=0;y<e.length;y+=1)P(e[y]);c=!1},d(k){for(let y=0;y<e.length;y+=1)e[y].d(k);k&&w(i),k&&w(s),v&&v.d(),d=!1,m()}}}function vA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function yA(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,m;function h(){n[10].call(r,n[16])}function _(){return n[11](n[16])}return{c(){e=b("label"),i=V(t),s=V(" duration (in seconds)"),o=D(),r=b("input"),u=D(),f=b("div"),c=b("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[19]),p(r,"type","number"),p(r,"id",a=n[19]),r.required=!0,p(c,"class","link-primary"),Q(c,"txt-success",n[0][n[16].key].secret),p(f,"class","help-block")},m(v,k){S(v,e,k),g(e,i),g(e,s),S(v,o,k),S(v,r,k),re(r,n[0][n[16].key].duration),S(v,u,k),S(v,f,k),g(f,c),d||(m=[Y(r,"input",h),Y(c,"click",_)],d=!0)},p(v,k){n=v,k&524288&&l!==(l=n[19])&&p(e,"for",l),k&524288&&a!==(a=n[19])&&p(r,"id",a),k&33&&pt(r.value)!==n[0][n[16].key].duration&&re(r,n[0][n[16].key].duration),k&33&&Q(c,"txt-success",n[0][n[16].key].secret)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(u),v&&w(f),d=!1,Pe(m)}}}function vh(n,e){let t,i,s;return i=new pe({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[yA,({uniqueId:l})=>({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Me(),H(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function yh(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){S(l,e,o),g(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function kA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v;const k=[vA,bA],y=[];function $(T,M){return T[1]?0:1}return d=$(n),m=y[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[4]),r=D(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Adjust common token options.</p>",c=D(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(T,r,M),S(T,a,M),g(a,u),g(u,f),g(u,c),y[d].m(u,null),h=!0,_||(v=Y(u,"submit",ft(n[6])),_=!0)},p(T,M){(!h||M&16)&&le(o,T[4]);let C=d;d=$(T),d===C?y[d].p(T,M):(ae(),P(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p(T,M):(m=y[d]=k[d](T),m.c()),E(m,1),m.m(u,null))},i(T){h||(E(m),h=!0)},o(T){P(m),h=!1},d(T){T&&w(e),T&&w(r),T&&w(a),y[d].d(),_=!1,v()}}}function wA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[kA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function SA(n,e,t){let i,s,l;Ye(n,St,$=>t(4,l=$));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];Kt(St,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const $=await me.settings.getAll()||{};m($)}catch($){me.errorResponseHandler($)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const $=await me.settings.update(z.filterRedactedProps(a));m($),jt("Successfully saved tokens options.")}catch($){me.errorResponseHandler($)}t(2,f=!1)}}function m($){var T;$=$||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:((T=$[M.key])==null?void 0:T.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _($){a[$.key].duration=pt(this.value),t(0,a)}const v=$=>{a[$.key].secret?(delete a[$.key].secret,t(0,a)):t(0,a[$.key].secret=z.randomString(50),a)},k=()=>h(),y=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,h,r,i,_,v,k,y]}class $A extends be{constructor(e){super(),ge(this,e,SA,wA,he,{})}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return o=new Mb({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=D(),i=b("div"),s=b("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),H(o.$$.fragment),r=D(),a=b("div"),u=b("div"),f=D(),c=b("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),g(i,s),g(i,l),q(o,i,null),n[8](i),S(_,r,v),S(_,a,v),g(a,u),g(a,f),g(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){d||(E(o.$$.fragment,_),d=!0)},o(_){P(o.$$.fragment,_),d=!1},d(_){_&&w(e),_&&w(t),_&&w(i),j(o),n[8](null),_&&w(r),_&&w(a),m=!1,Pe(h)}}}function CA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function MA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[CA,TA],h=[];function _(v,k){return v[1]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[3]),r=D(),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(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k&8)&&le(o,v[3]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function DA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[MA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function OA(n,e,t){let i,s;Ye(n,St,v=>t(3,s=v)),Kt(St,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l}));for(let v of r)delete v.created,delete v.updated}catch(v){me.errorResponseHandler(v)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),Cg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(v){se[v?"unshift":"push"](()=>{o=v,t(0,o)})}const h=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,h,_]}class EA extends be{constructor(e){super(),ge(this,e,OA,DA,he,{})}}function kh(n,e,t){const i=n.slice();return i[14]=e[t],i}function wh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Sh(n,e,t){const i=n.slice();return i[14]=e[t],i}function $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Th(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Mh(n,e,t){const i=n.slice();return i[30]=e[t],i}function AA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Dh(),a=n[0].name!==n[1].name&&Oh(n);return{c(){e=b("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=b("strong"),o=V(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Dh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Oh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function IA(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=D(),i=b("strong"),l=V(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function PA(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=D(),i=b("strong"),l=V(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),g(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&w(e),r&&w(t),r&&w(i)}}}function Dh(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Oh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=b("strong"),i=V(t),s=D(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Eh(n){var v,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((v=n[0])==null?void 0:v[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var y,$,T,M,C,O;e=b("tr"),t=b("td"),i=b("span"),l=V(s),o=D(),r=b("td"),a=b("pre"),f=V(u),c=D(),d=b("td"),m=b("pre"),_=V(h),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),Q(r,"changed-old-col",!n[10]&&un((y=n[0])==null?void 0:y[n[30]],($=n[1])==null?void 0:$[n[30]])),Q(r,"changed-none-col",n[10]),p(m,"class","txt"),p(d,"class","svelte-lmkr38"),Q(d,"changed-new-col",!n[5]&&un((T=n[0])==null?void 0:T[n[30]],(M=n[1])==null?void 0:M[n[30]])),Q(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",un((C=n[0])==null?void 0:C[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m(y,$){S(y,e,$),g(e,t),g(t,i),g(i,l),g(e,o),g(e,r),g(r,a),g(a,f),g(e,c),g(e,d),g(d,m),g(m,_)},p(y,$){var T,M,C,O,A,I,L,N;$[0]&1&&u!==(u=y[12]((T=y[0])==null?void 0:T[y[30]])+"")&&le(f,u),$[0]&3075&&Q(r,"changed-old-col",!y[10]&&un((M=y[0])==null?void 0:M[y[30]],(C=y[1])==null?void 0:C[y[30]])),$[0]&1024&&Q(r,"changed-none-col",y[10]),$[0]&2&&h!==(h=y[12]((O=y[1])==null?void 0:O[y[30]])+"")&&le(_,h),$[0]&2083&&Q(d,"changed-new-col",!y[5]&&un((A=y[0])==null?void 0:A[y[30]],(I=y[1])==null?void 0:I[y[30]])),$[0]&32&&Q(d,"changed-none-col",y[5]),$[0]&2051&&Q(e,"txt-primary",un((L=y[0])==null?void 0:L[y[30]],(N=y[1])==null?void 0:N[y[30]]))},d(y){y&&w(e)}}}function Ah(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=Ph(Th(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Me()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&4160){t=s[6];let o;for(o=0;o<t.length;o+=1){const r=Th(s,t,o);i[o]?i[o].p(r,l):(i[o]=Ph(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function Ih(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=b("tr"),t=b("td"),s=V(i),l=D(),o=b("td"),r=b("pre"),u=V(a),f=D(),c=b("td"),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-lmkr38"),p(c,"class","changed-none-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(m,h){S(m,e,h),g(e,t),g(t,s),g(e,l),g(e,o),g(o,r),g(r,u),g(e,f),g(e,c),g(e,d)},p(m,h){h[0]&64&&i!==(i=m[17]+"")&&le(s,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&le(u,a)},d(m){m&&w(e)}}}function Ph(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,m=n[14].name+"",h,_,v,k,y=Object.entries(n[14]),$=[];for(let T=0;T<y.length;T+=1)$[T]=Ih(Ch(n,y,T));return{c(){e=b("tr"),t=b("th"),i=b("span"),s=V("field: "),o=V(l),r=D(),a=b("span"),u=V("Deleted - "),f=b("small"),c=V("All stored data related to "),d=b("strong"),h=V(m),_=V(" will be deleted!"),v=D();for(let T=0;T<$.length;T+=1)$[T].c();k=Me(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(T,M){S(T,e,M),g(e,t),g(t,i),g(i,s),g(i,o),g(t,r),g(t,a),g(a,u),g(a,f),g(f,c),g(f,d),g(d,h),g(f,_),S(T,v,M);for(let C=0;C<$.length;C+=1)$[C].m(T,M);S(T,k,M)},p(T,M){if(M[0]&64&&l!==(l=T[14].name+"")&&le(o,l),M[0]&64&&m!==(m=T[14].name+"")&&le(h,m),M[0]&4160){y=Object.entries(T[14]);let C;for(C=0;C<y.length;C+=1){const O=Ch(T,y,C);$[C]?$[C].p(O,M):($[C]=Ih(O),$[C].c(),$[C].m(k.parentNode,k))}for(;C<$.length;C+=1)$[C].d(1);$.length=y.length}},d(T){T&&w(e),T&&w(v),ht($,T),T&&w(k)}}}function Lh(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Nh(n){var _;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((_=Dn(n[3],n[14].id))==null?void 0:_[n[17]])+"",u,f,c,d,m=n[12](n[23])+"",h;return{c(){var v,k,y;e=b("tr"),t=b("td"),s=V(i),l=D(),o=b("td"),r=b("pre"),u=V(a),f=D(),c=b("td"),d=b("pre"),h=V(m),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","svelte-lmkr38"),Q(o,"changed-old-col",un((v=Dn(n[3],n[14].id))==null?void 0:v[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),Q(c,"changed-new-col",un((k=Dn(n[3],n[14].id))==null?void 0:k[n[17]],n[23])),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",un((y=Dn(n[3],n[14].id))==null?void 0:y[n[17]],n[23]))},m(v,k){S(v,e,k),g(e,t),g(t,s),g(e,l),g(e,o),g(o,r),g(r,u),g(e,f),g(e,c),g(c,d),g(d,h)},p(v,k){var y,$,T,M;k[0]&128&&i!==(i=v[17]+"")&&le(s,i),k[0]&136&&a!==(a=v[12]((y=Dn(v[3],v[14].id))==null?void 0:y[v[17]])+"")&&le(u,a),k[0]&136&&Q(o,"changed-old-col",un(($=Dn(v[3],v[14].id))==null?void 0:$[v[17]],v[23])),k[0]&128&&m!==(m=v[12](v[23])+"")&&le(h,m),k[0]&136&&Q(c,"changed-new-col",un((T=Dn(v[3],v[14].id))==null?void 0:T[v[17]],v[23])),k[0]&136&&Q(e,"txt-primary",un((M=Dn(v[3],v[14].id))==null?void 0:M[v[17]],v[23]))},d(v){v&&w(e)}}}function Fh(n){let e,t,i,s,l=n[14].name+"",o,r,a=un(Dn(n[3],n[14].id),Dn(n[4],n[14].id)),u,f,c=a&&Lh(),d=Object.entries(n[14]),m=[];for(let h=0;h<d.length;h+=1)m[h]=Nh($h(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),s=V("field: "),o=V(l),r=D(),c&&c.c(),u=D();for(let h=0;h<m.length;h+=1)m[h].c();f=Me(),p(i,"class","txt"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(h,_){S(h,e,_),g(e,t),g(t,i),g(i,s),g(i,o),g(t,r),c&&c.m(t,null),S(h,u,_);for(let v=0;v<m.length;v+=1)m[v].m(h,_);S(h,f,_)},p(h,_){if(_[0]&128&&l!==(l=h[14].name+"")&&le(o,l),_[0]&152&&(a=un(Dn(h[3],h[14].id),Dn(h[4],h[14].id))),a?c||(c=Lh(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),_[0]&4232){d=Object.entries(h[14]);let v;for(v=0;v<d.length;v+=1){const k=$h(h,d,v);m[v]?m[v].p(k,_):(m[v]=Nh(k),m[v].c(),m[v].m(f.parentNode,f))}for(;v<m.length;v+=1)m[v].d(1);m.length=d.length}},d(h){h&&w(e),c&&c.d(),h&&w(u),ht(m,h),h&&w(f)}}}function Rh(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=b("tr"),t=b("td"),s=V(i),l=D(),o=b("td"),r=D(),a=b("td"),u=b("pre"),c=V(f),d=D(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(o,"class","changed-none-col svelte-lmkr38"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(m,h){S(m,e,h),g(e,t),g(t,s),g(e,l),g(e,o),g(e,r),g(e,a),g(a,u),g(u,c),g(e,d)},p(m,h){h[0]&256&&i!==(i=m[17]+"")&&le(s,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&le(c,f)},d(m){m&&w(e)}}}function qh(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c=Object.entries(n[14]),d=[];for(let m=0;m<c.length;m+=1)d[m]=Rh(wh(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),s=V("field: "),o=V(l),r=D(),a=b("span"),a.textContent="Added",u=D();for(let m=0;m<d.length;m+=1)d[m].c();f=Me(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(m,h){S(m,e,h),g(e,t),g(t,i),g(i,s),g(i,o),g(t,r),g(t,a),S(m,u,h);for(let _=0;_<d.length;_+=1)d[_].m(m,h);S(m,f,h)},p(m,h){if(h[0]&256&&l!==(l=m[14].name+"")&&le(o,l),h[0]&4352){c=Object.entries(m[14]);let _;for(_=0;_<c.length;_+=1){const v=wh(m,c,_);d[_]?d[_].p(v,h):(d[_]=Rh(v),d[_].c(),d[_].m(f.parentNode,f))}for(;_<d.length;_+=1)d[_].d(1);d.length=c.length}},d(m){m&&w(e),m&&w(u),ht(d,m),m&&w(f)}}}function LA(n){let e,t,i,s,l,o,r,a,u;function f(T,M){var C,O;return(C=T[0])!=null&&C.id?(O=T[1])!=null&&O.id?AA:IA:PA}let c=f(n),d=c(n),m=n[11],h=[];for(let T=0;T<m.length;T+=1)h[T]=Eh(Mh(n,m,T));let _=(n[2]||n[5])&&Ah(n),v=n[7],k=[];for(let T=0;T<v.length;T+=1)k[T]=Fh(Sh(n,v,T));let y=n[8],$=[];for(let T=0;T<y.length;T+=1)$[T]=qh(kh(n,y,T));return{c(){e=b("div"),d.c(),t=D(),i=b("table"),s=b("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=b("tbody");for(let T=0;T<h.length;T+=1)h[T].c();r=D(),_&&_.c(),a=D();for(let T=0;T<k.length;T+=1)k[T].c();u=D();for(let T=0;T<$.length;T+=1)$[T].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,M){S(T,e,M),d.m(e,null),S(T,t,M),S(T,i,M),g(i,s),g(i,l),g(i,o);for(let C=0;C<h.length;C+=1)h[C].m(o,null);g(o,r),_&&_.m(o,null),g(o,a);for(let C=0;C<k.length;C+=1)k[C].m(o,null);g(o,u);for(let C=0;C<$.length;C+=1)$[C].m(o,null)},p(T,M){if(c===(c=f(T))&&d?d.p(T,M):(d.d(1),d=c(T),d&&(d.c(),d.m(e,null))),M[0]&7203){m=T[11];let C;for(C=0;C<m.length;C+=1){const O=Mh(T,m,C);h[C]?h[C].p(O,M):(h[C]=Eh(O),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=m.length}if(T[2]||T[5]?_?_.p(T,M):(_=Ah(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=T[7];let C;for(C=0;C<v.length;C+=1){const O=Sh(T,v,C);k[C]?k[C].p(O,M):(k[C]=Fh(O),k[C].c(),k[C].m(o,u))}for(;C<k.length;C+=1)k[C].d(1);k.length=v.length}if(M[0]&4352){y=T[8];let C;for(C=0;C<y.length;C+=1){const O=kh(T,y,C);$[C]?$[C].p(O,M):($[C]=qh(O),$[C].c(),$[C].m(o,null))}for(;C<$.length;C+=1)$[C].d(1);$.length=y.length}},i:G,o:G,d(T){T&&w(e),d.d(),T&&w(t),T&&w(i),ht(h,T),_&&_.d(),ht(k,T),ht($,T)}}}function Dn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function un(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function NA(n,e,t){let i,s,l,{collectionA:o=new pn}=e,{collectionB:r=new pn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(new pn().export()).filter(k=>!["schema","created","updated"].includes(k));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find(y=>k.id==y.id))))}function v(k){return typeof k>"u"?"":z.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(y=>k.id==y.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(y=>y.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(y=>y.id==k.id))),n.$$.dirty[0]&7&&t(9,l=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,h,v]}class FA extends be{constructor(e){super(),ge(this,e,NA,LA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function jh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Hh(n){let e,t;return e=new FA({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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Hh(jh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Me()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=jh(o,i,a);s[a]?(s[a].p(u,r),E(s[a],1)):(s[a]=Hh(u),s[a].c(),E(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function qA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:G,d(t){t&&w(e)}}}function jA(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=V("Close"),i=D(),s=b("button"),l=b("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],Q(s,"btn-loading",n[4])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),o||(r=[Y(e,"click",n[0]),Y(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function HA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[jA],header:[qA],default:[RA]},$$scope:{ctx:n}};return e=new Sn({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.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function VA(n,e,t){const i=Tt();let s,l=[],o=[],r=[],a=!1,u=!1;function f(T,M,C=!1){t(7,l=T),t(8,o=M),t(3,a=C),s==null||s.show()}function c(){return s==null?void 0:s.hide()}function d(){t(2,r=[]);for(const T of l){const M=z.findByKey(o,"id",T.id)||null;(a&&!(M!=null&&M.id)||M!=null&&M.id&&z.hasCollectionChanges(T,M,a))&&r.push({old:T,new:M})}for(const T of o){const M=z.findByKey(l,"id",T.id)||null;M!=null&&M.id||r.push({old:M,new:T})}}function m(){const T=[];if(a)for(const M of l){const C=z.findByKey(o,"id",M.id);if(!C)T.push(M.name+".*");else{const O=Array.isArray(M.schema)?M.schema:[];for(const A of O)z.findByKey(C.schema,"id",A.id)||T.push(`${M.name}.${A.name} (${A.id})`)}}T.length?cn(`Do you really want to delete the following collection fields and their related records data:
- ${T.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){me.errorResponseHandler(T)}t(4,u=!1),c()}}const _=()=>m(),v=()=>!u;function k(T){se[T?"unshift":"push"](()=>{s=T,t(1,s)})}function y(T){Ve.call(this,n,T)}function $(T){Ve.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,_,v,k,y,$]}class zA extends be{constructor(e){super(),ge(this,e,VA,HA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Vh(n,e,t){const i=n.slice();return i[32]=e[t],i}function zh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[32]=e[t],i}function BA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y,$,T,M,C,O;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[WA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let A=!1,I=n[6]&&n[1].length&&!n[7]&&Wh(),L=n[6]&&n[1].length&&n[7]&&Yh(n),N=n[13].length&&i_(n),F=!!n[0]&&s_(n);return{c(){e=b("input"),t=D(),i=b("div"),s=b("p"),l=V(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),H(a.$$.fragment),u=D(),f=D(),I&&I.c(),c=D(),L&&L.c(),d=D(),N&&N.c(),m=D(),h=b("div"),F&&F.c(),_=D(),v=b("div"),k=D(),y=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(v,"class","flex-fill"),p($,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=T=!n[14],p(h,"class","flex m-t-base")},m(R,K){S(R,e,K),n[19](e),S(R,t,K),S(R,i,K),g(i,s),g(s,l),g(s,o),S(R,r,K),q(a,R,K),S(R,u,K),S(R,f,K),I&&I.m(R,K),S(R,c,K),L&&L.m(R,K),S(R,d,K),N&&N.m(R,K),S(R,m,K),S(R,h,K),F&&F.m(h,null),g(h,_),g(h,v),g(h,k),g(h,y),g(y,$),M=!0,C||(O=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],C=!0)},p(R,K){(!M||K[0]&4096)&&Q(o,"btn-loading",R[12]);const x={};K[0]&64&&(x.class="form-field "+(R[6]?"":"field-error")),K[0]&65|K[1]&1536&&(x.$$scope={dirty:K,ctx:R}),a.$set(x),R[6]&&R[1].length&&!R[7]?I||(I=Wh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?L?L.p(R,K):(L=Yh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,K):(N=i_(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,K):(F=s_(R),F.c(),F.m(h,_)):F&&(F.d(1),F=null),(!M||K[0]&16384&&T!==(T=!R[14]))&&(y.disabled=T)},i(R){M||(E(a.$$.fragment,R),E(A),M=!0)},o(R){P(a.$$.fragment,R),P(A),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),I&&I.d(R),R&&w(c),L&&L.d(R),R&&w(d),N&&N.d(R),R&&w(m),R&&w(h),F&&F.d(),C=!1,Pe(O)}}}function UA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:G,i:G,o:G,d(t){t&&w(e)}}}function Uh(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function WA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Uh();return{c(){e=b("label"),t=V("Collections"),s=D(),l=b("textarea"),r=D(),c&&c.c(),a=Me(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){S(d,e,m),g(e,t),S(d,s,m),S(d,l,m),re(l,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=Uh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function Wh(n){let e;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Yh(n){let e,t,i,s,l,o=n[9].length&&Kh(n),r=n[4].length&&Gh(n),a=n[8].length&&e_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=D(),i=b("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Kh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Gh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=e_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Kh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Bh(n,s,o),a=l(r);t.set(a,e[o]=Zh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Me()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=wt(e,r,l,1,o,s,t,i.parentNode,es,Zh,i,Bh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Jh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=V("("),s=V(i),l=V(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Zh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Jh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",s=D(),l=b("strong"),r=V(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=Jh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Gh(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=zh(n,s,o),a=l(r);t.set(a,e[o]=xh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Me()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=wt(e,r,l,1,o,s,t,i.parentNode,es,xh,i,zh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Xh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=b("strong"),i=V(t),s=D(),l=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),g(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function Qh(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=b("small"),t=V("("),s=V(i),l=V(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function xh(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Xh(e),m=e[35].new.id&&Qh(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",s=D(),l=b("div"),d&&d.c(),o=D(),r=b("strong"),u=V(a),f=D(),m&&m.c(),c=D(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,_){S(h,t,_),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),m&&m.m(l,null),g(t,c)},p(h,_){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,_):(d=Xh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,_):(m=Qh(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(h){h&&w(t),d&&d.d(),m&&m.d()}}}function e_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Vh(n,s,o),a=l(r);t.set(a,e[o]=n_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Me()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,n_,i,Vh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function t_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=b("small"),t=V("("),s=V(i),l=V(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function n_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&t_(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",s=D(),l=b("strong"),r=V(o),a=D(),f&&f.c(),u=D(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=t_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function i_(n){let e,t,i,s,l,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=b("div"),s.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',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){S(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:G,d(u){u&&w(e),r=!1,a()}}}function s_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:G,d(s){s&&w(e),t=!1,i()}}}function YA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[UA,BA],h=[];function _(v,k){return v[5]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",s=D(),l=b("div"),o=V(n[15]),r=D(),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(v,k){S(v,e,k),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),S(v,r,k),S(v,a,k),g(a,u),h[f].m(u,null),d=!0},p(v,k){(!d||k[0]&32768)&&le(o,v[15]);let y=f;f=_(v),f===y?h[f].p(v,k):(ae(),P(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(v,k):(c=h[f]=m[f](v),c.c()),E(c,1),c.m(u,null))},i(v){d||(E(c),d=!0)},o(v){P(c),d=!1},d(v){v&&w(e),v&&w(r),v&&w(a),h[f].d()}}}function KA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[YA]},$$scope:{ctx:n}}});let r={};return l=new zA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function JA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,J=>t(15,u=J)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],v=!0,k=[],y=!1;$();async function $(){t(5,y=!0);try{t(2,_=await me.collections.getFullList(200));for(let J of _)delete J.created,delete J.updated}catch(J){me.errorResponseHandler(J)}t(5,y=!1)}function T(){if(t(4,k=[]),!!i)for(let J of h){const fe=z.findByKey(_,"id",J.id);!(fe!=null&&fe.id)||!z.hasCollectionChanges(fe,J,v)||k.push({new:J,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=z.filterDuplicatesByKey(h)):t(1,h=[]);for(let J of h)delete J.created,delete J.updated,J.schema=z.filterDuplicatesByKey(J.schema)}function C(){var J,fe;for(let Z of h){const de=z.findByKey(_,"name",Z.name)||z.findByKey(_,"id",Z.id);if(!de)continue;const ve=Z.id,Te=de.id;Z.id=Te;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(Z.schema)?Z.schema:[];for(const ye of Re){const Se=z.findByKey(Ne,"name",ye.name);Se&&Se.id&&(ye.id=Se.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let Se of ye.schema)(J=Se.options)!=null&&J.collectionId&&((fe=Se.options)==null?void 0:fe.collectionId)===ve&&(Se.options.collectionId=Te)}t(0,d=JSON.stringify(h,null,4))}function O(J){t(12,m=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Z.target.result),await sn(),h.length||(dl("Invalid collections configuration."),A())},fe.onerror=Z=>{console.warn(Z),dl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(J)}function A(){t(0,d=""),t(10,f.value="",f),In({})}function I(J){se[J?"unshift":"push"](()=>{f=J,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){v=this.checked,t(3,v)}const K=()=>C(),x=()=>A(),U=()=>c==null?void 0:c.show(_,h,v);function X(J){se[J?"unshift":"push"](()=>{c=J,t(11,c)})}const ne=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(J=>i&&v&&!z.findByKey(h,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(J=>i&&!z.findByKey(_,"id",J.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof v<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!y&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(J=>{let fe=z.findByKey(_,"name",J.name)||z.findByKey(_,"id",J.id);if(!fe)return!1;if(fe.id!=J.id)return!0;const Z=Array.isArray(fe.schema)?fe.schema:[],de=Array.isArray(J.schema)?J.schema:[];for(const ve of de){if(z.findByKey(Z,"id",ve.id))continue;const Ne=z.findByKey(Z,"name",ve.name);if(Ne&&ve.id!=Ne.id)return!0}return!1}))},[d,h,_,v,k,y,i,o,l,s,f,c,m,a,r,u,C,O,A,I,L,N,F,R,K,x,U,X,ne]}class ZA extends be{constructor(e){super(),ge(this,e,JA,KA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Di("/"):!0}],GA={"/login":Mt({component:WO,conditions:Pt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Mt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-3fcfed27.js"),[],import.meta.url),conditions:Pt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-7bcbfe8e.js"),[],import.meta.url),conditions:Pt.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Mt({component:hO,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Mt({component:A3,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Mt({component:tE,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Mt({component:jO,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Mt({component:jE,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Mt({component:tA,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Mt({component:gA,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Mt({component:$A,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Mt({component:EA,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Mt({component:ZA,conditions:Pt.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-987e89a4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-987e89a4.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-015785f2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-015785f2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-a2517f76.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-a2517f76.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Mt({component:Qv,userData:{showAppSidebar:!1}})};function XA(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=Uo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,v=h*u,k=m+h*e.width/t.width,y=m+h*e.height/t.height;return`transform: ${l} translate(${_}px, ${v}px) scale(${k}, ${y});`}}}function l_(n,e,t){const i=n.slice();return i[2]=e[t],i}function QA(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xA(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function e6(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function t6(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function o_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m=G,h,_,v;function k(M,C){return M[2].type==="info"?t6:M[2].type==="success"?e6:M[2].type==="warning"?xA:QA}let y=k(e),$=y(e);function T(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),s=D(),l=b("div"),r=V(o),a=D(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,C){S(M,t,C),g(t,i),$.m(i,null),g(t,s),g(t,l),g(l,r),g(t,a),g(t,u),g(t,f),h=!0,_||(v=Y(u,"click",ft(T)),_=!0)},p(M,C){e=M,y!==(y=k(e))&&($.d(1),$=y(e),$&&($.c(),$.m(i,null))),(!h||C&1)&&o!==(o=e[2].message+"")&&le(r,o),(!h||C&1)&&Q(t,"alert-info",e[2].type=="info"),(!h||C&1)&&Q(t,"alert-success",e[2].type=="success"),(!h||C&1)&&Q(t,"alert-danger",e[2].type=="error"),(!h||C&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){n1(t),m(),h_(t,d)},a(){m(),m=t1(t,d,XA,{duration:150})},i(M){h||(xe(()=>{c||(c=je(t,ko,{duration:150},!0)),c.run(1)}),h=!0)},o(M){c||(c=je(t,ko,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),$.d(),M&&c&&c.end(),_=!1,v()}}}function n6(n){let e,t=[],i=new Map,s,l=n[0];const o=r=>r[2].message;for(let r=0;r<l.length;r+=1){let a=l_(n,l,r),u=o(a);i.set(u,t[r]=o_(u,a))}return{c(){e=b("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","toasts-wrapper")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],ae();for(let u=0;u<t.length;u+=1)t[u].r();t=wt(t,a,o,1,r,l,i,e,o1,o_,null,l_);for(let u=0;u<t.length;u+=1)t[u].a();ue()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function i6(n,e,t){let i;return Ye(n,zo,l=>t(0,i=l)),[i,l=>Mg(l)]}class s6 extends be{constructor(e){super(),ge(this,e,i6,n6,he,{})}}function l6(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=b("h4"),i=V(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),g(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&w(e)}}}function o6(n){let e,t,i,s,l,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=D(),s=b("button"),l=b("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){S(a,e,u),g(e,t),S(a,i,u),S(a,s,u),g(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Pe(r)}}}function r6(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[o6],header:[l6]},$$scope:{ctx:n}};return e=new Sn({props:i}),n[6](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&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function a6(n,e,t){let i;Ye(n,eu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){se[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),Eb()};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 u6 extends be{constructor(e){super(),ge(this,e,a6,r6,he,{})}}function r_(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,_,v,k,y;return _=new ei({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[f6]},$$scope:{ctx:n}}}),{c(){var $;e=b("aside"),t=b("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=D(),s=b("nav"),l=b("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=D(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=D(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=D(),c=b("figure"),d=b("img"),h=D(),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"),zn(d.src,m="./images/avatars/avatar"+((($=n[0])==null?void 0:$.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m($,T){S($,e,T),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),g(s,r),g(s,a),g(s,u),g(e,f),g(e,c),g(c,d),g(c,h),q(_,c,null),v=!0,k||(y=[Ie(xt.call(null,t)),Ie(xt.call(null,l)),Ie(jn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(Be.call(null,l,{text:"Collections",position:"right"})),Ie(xt.call(null,r)),Ie(jn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(Be.call(null,r,{text:"Logs",position:"right"})),Ie(xt.call(null,u)),Ie(jn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(Be.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p($,T){var C;(!v||T&1&&!zn(d.src,m="./images/avatars/avatar"+(((C=$[0])==null?void 0:C.avatar)||0)+".svg"))&&p(d,"src",m);const M={};T&1024&&(M.$$scope={dirty:T,ctx:$}),_.$set(M)},i($){v||(E(_.$$.fragment,$),v=!0)},o($){P(_.$$.fragment,$),v=!1},d($){$&&w(e),j(_),k=!1,Pe(y)}}}function f6(n){let e,t,i,s,l,o,r;return{c(){e=b("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=D(),i=b("hr"),s=D(),l=b("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Ie(xt.call(null,e)),Y(l,"click",n[6])],o=!0)},p:G,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function c6(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=z.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&r_(n);return o=new m1({props:{routes:GA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new s6({}),f=new u6({}),{c(){t=D(),i=b("div"),d&&d.c(),s=D(),l=b("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,_){S(h,t,_),S(h,i,_),d&&d.m(i,null),g(i,s),g(i,l),q(o,l,null),g(l,r),q(a,l,null),S(h,u,_),q(f,h,_),c=!0},p(h,[_]){var v;(!c||_&12)&&e!==(e=z.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(v=h[0])!=null&&v.id&&h[1]?d?(d.p(h,_),_&3&&E(d,1)):(d=r_(h),d.c(),E(d,1),d.m(i,s)):d&&(ae(),P(d,1,1,()=>{d=null}),ue())},i(h){c||(E(d),E(o.$$.fragment,h),E(a.$$.fragment,h),E(f.$$.fragment,h),c=!0)},o(h){P(d),P(o.$$.fragment,h),P(a.$$.fragment,h),P(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function d6(n,e,t){let i,s,l,o;Ye(n,Cs,m=>t(8,i=m)),Ye(n,yo,m=>t(2,s=m)),Ye(n,Oa,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,_,v,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((v=(_=m==null?void 0:m.detail)==null?void 0:_.userData)!=null&&v.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),In({}),Eb())}function f(){Di("/")}async function c(){var m,h;if(l!=null&&l.id)try{const _=await me.settings.getAll({$cancelKey:"initialAppSettings"});Kt(yo,s=((m=_==null?void 0:_.meta)==null?void 0:m.appName)||"",s),Kt(Cs,i=!!((h=_==null?void 0:_.meta)!=null&&h.hideControls),i)}catch(_){_!=null&&_.isAbort||console.warn("Failed to load app settings.",_)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class p6 extends be{constructor(e){super(),ge(this,e,d6,c6,he,{})}}new p6({target:document.getElementById("app")});export{Pe as A,jt as B,z as C,Di as D,Me as E,Dg as F,ba as G,_u as H,Ye as I,Ai as J,Tt as K,Zt as L,se as M,Mb as N,wt as O,es as P,ln as Q,pn as R,be as S,Lr as T,P as a,D as b,H as c,j as d,b as e,p as f,S as g,g as h,ge as i,Ie as j,ae as k,xt as l,q as m,ue as n,w as o,me as p,pe as q,Q as r,he as s,E as t,Y as u,ft as v,V as w,le as x,G as y,re as z};