pocketbase/ui/dist/assets/index-ffbb9561.js

205 lines
877 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 Z(){}const kl=n=>n;function Je(n,e){for(const t in e)n[t]=e[t];return n}function zb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function ig(n){return n()}function lu(){return Object.create(null)}function Pe(n){n.forEach(ig)}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 Vn(n,e){return Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href}function Bb(n){return Object.keys(n).length===0}function sg(n,...e){if(n==null)return Z;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ye(n,e,t){n.$$.on_destroy.push(sg(e,t))}function Nt(n,e,t,i){if(n){const s=lg(n,e,t,i);return n[0](s)}}function lg(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=lg(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:Z}const og=typeof window<"u";let No=og?()=>window.performance.now():()=>Date.now(),fa=og?n=>requestAnimationFrame(n):Z;const _s=new Set;function rg(n){_s.forEach(e=>{e.c(n)||(_s.delete(e),e.f())}),_s.size!==0&&fa(rg)}function Fo(n){let e;return _s.size===0&&fa(rg),{promise:new Promise(t=>{_s.add(e={c:n,f:t})}),abort(){_s.delete(e)}}}function _(n,e){n.appendChild(e)}function ag(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Ub(n){const e=v("style");return Wb(ag(n),e),e.sheet}function Wb(n,e){return _(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 mt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function O(){return B(" ")}function Me(){return B("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function dt(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 ht(n){return n===""?null:+n}function Yb(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function Ir(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 ug(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function jt(n,e){return new n(e)}const po=new Map;let mo=0;function Kb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Jb(n,e){const t={stylesheet:Ub(e),rules:{}};return po.set(n,t),t}function rl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let b=0;b<=1;b+=a){const k=e+(t-e)*l(b);u+=b*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${Kb(f)}_${r}`,d=ag(n),{stylesheet:m,rules:h}=po.get(d)||Jb(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,mo+=1,c}function al(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(", "),mo-=s,mo||Zb())}function Zb(){fa(()=>{mo||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),po.clear())})}function Gb(n,e,t,i){if(!e)return Z;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Z;const{delay:l=0,duration:o=300,easing:r=kl,start:a=No()+l,end:u=a+o,tick:f=Z,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,h;function g(){c&&(h=rl(n,0,1,o,l,r,c)),l||(m=!0)}function b(){c&&al(n,h),d=!1}return Fo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),b()),!d)return!1;if(m){const y=k-a,T=0+1*r(y/o);f(T,1-T)}return!0}),g(),f(0,1),b}function Xb(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,fg(n,s)}}function fg(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 ul;function oi(n){ul=n}function wl(){if(!ul)throw new Error("Function called outside component initialization");return ul}function Zt(n){wl().$$.on_mount.push(n)}function Qb(n){wl().$$.after_update.push(n)}function cg(n){wl().$$.on_destroy.push(n)}function Ct(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ug(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ze(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const hs=[],ie=[],oo=[],Pr=[],dg=Promise.resolve();let Lr=!1;function pg(){Lr||(Lr=!0,dg.then(ca))}function sn(){return pg(),dg}function xe(n){oo.push(n)}function ke(n){Pr.push(n)}const xo=new Set;let us=0;function ca(){if(us!==0)return;const n=ul;do{try{for(;us<hs.length;){const e=hs[us];us++,oi(e),xb(e.$$)}}catch(e){throw hs.length=0,us=0,e}for(oi(null),hs.length=0,us=0;ie.length;)ie.pop()();for(let e=0;e<oo.length;e+=1){const t=oo[e];xo.has(t)||(xo.add(t),t())}oo.length=0}while(hs.length);for(;Pr.length;)Pr.pop()();Lr=!1,xo.clear(),oi(n)}function xb(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 Rs;function da(){return Rs||(Rs=Promise.resolve(),Rs.then(()=>{Rs=null})),Rs}function Ki(n,e,t){n.dispatchEvent(ug(`${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 A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(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 pa={duration:0};function mg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&al(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=kl,tick:g=Z,css:b}=s||pa;b&&(o=rl(n,0,1,m,d,h,b,a++)),g(0,1);const k=No()+d,y=k+m;r&&r.abort(),l=!0,xe(()=>Ki(n,!0,"start")),r=Fo(T=>{if(l){if(T>=y)return g(1,0),Ki(n,!0,"end"),u(),l=!1;if(T>=k){const $=h((T-k)/m);g($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,al(n),Bt(s)?(s=s(i),da().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function hg(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=Z,css:m}=s||pa;m&&(o=rl(n,1,0,f,u,c,m));const h=No()+u,g=h+f;xe(()=>Ki(n,!1,"start")),Fo(b=>{if(l){if(b>=g)return d(0,1),Ki(n,!1,"end"),--r.r||Pe(r.c),!1;if(b>=h){const k=c((b-h)/f);d(1-k,k)}}return l})}return Bt(s)?da().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&al(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&&al(n,u)}function c(m,h){const g=m.b-o;return h*=Math.abs(g),{a:o,b:m.b,d:g,duration:h,start:m.start,end:m.start+h,group:m.group}}function d(m){const{delay:h=0,duration:g=300,easing:b=kl,tick:k=Z,css:y}=l||pa,T={start:No()+h,b:m};m||(T.group=Jn,Jn.r+=1),r||a?a=T:(y&&(f(),u=rl(n,o,m,g,h,b,y)),m&&k(0,1),r=c(T,g),xe(()=>Ki(n,m,"start")),Fo($=>{if(a&&$>a.start&&(r=c(a,g),a=null,Ki(n,r.b,"start"),y&&(f(),u=rl(n,o,r.b,r.duration,0,b,l.css))),r){if($>=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($>=r.start){const M=$-r.start;o=r.a+r.d*b(M/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(m){Bt(l)?da().then(()=>{l=l(s),d(m)}):d(m)},end(){f(),r=a=null}}}function ou(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(),I(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ue())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ca()}if(zb(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 e1(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){I(n,1,1,()=>{e.delete(n.key)})}function t1(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 g={};for(;h--;)g[n[h].key]=h;const b=[],k=new Map,y=new Map;for(h=m;h--;){const C=c(s,l,h),D=t(C);let E=o.get(D);E?i&&E.p(C,e):(E=u(D,C),E.c()),k.set(D,b[h]=E),D in g&&y.set(D,Math.abs(h-g[D]))}const T=new Set,$=new Set;function M(C){A(C,1),C.m(r,f),o.set(C.key,C),f=C.first,m--}for(;d&&m;){const C=b[m-1],D=n[d-1],E=C.key,P=D.key;C===D?(f=C.first,d--,m--):k.has(P)?!o.has(E)||T.has(E)?M(C):$.has(P)?d--:y.get(E)>y.get(P)?($.add(E),M(C)):(T.add(P),d--):(a(D,o),d--)}for(;d--;){const C=n[d];k.has(C.key)||a(C,o)}for(;m;)M(b[m-1]);return b}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 ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function H(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||xe(()=>{const o=n.$$.on_mount.map(ig).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 n1(n,e){n.$$.dirty[0]===-1&&(hs.push(n),pg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function ve(n,e,t,i,s,l,o,r=[-1]){const a=ul;oi(n);const u=n.$$={fragment:null,ctx:[],props:l,update:Z,not_equal:s,bound:lu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:lu(),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&&n1(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=Yb(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),ca()}oi(a)}class ye{$destroy(){j(this,1),this.$destroy=Z}$on(e,t){if(!Bt(t))return Z;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&&!Bb(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 fs=[];function gg(n,e){return{subscribe:Ln(n,e).subscribe}}function Ln(n,e=Z){let t;const i=new Set;function s(r){if(he(n,r)&&(n=r,t)){const a=!fs.length;for(const u of i)u[1](),fs.push(u,n);if(a){for(let u=0;u<fs.length;u+=2)fs[u][0](fs[u+1]);fs.length=0}}}function l(r){s(r(n))}function o(r,a=Z){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||Z),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function _g(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return gg(t,o=>{let r=!1;const a=[];let u=0,f=Z;const c=()=>{if(u)return;f();const m=e(i?a[0]:a,o);l?o(m):f=Bt(m)?m:Z},d=s.map((m,h)=>sg(m,g=>{a[h]=g,u&=~(1<<h),r&&c()},()=>{u|=1<<h}));return r=!0,c(),function(){Pe(d),f()}})}function bg(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 i1(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=jt(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;I(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=jt(l,o()),e.$on("routeEvent",r[7]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function s1(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=jt(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;I(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=jt(l,o()),e.$on("routeEvent",r[6]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function l1(n){let e,t,i,s;const l=[s1,i1],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(),I(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function ru(){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 Ro=gg(null,function(e){e(ru());const t=()=>{e(ru())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});_g(Ro,n=>n.location);const ma=_g(Ro,n=>n.querystring),au=Ln(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=fu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return uu(n,e),{update(t){t=fu(t),uu(n,t)}}}function o1(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function uu(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||r1(i.currentTarget.getAttribute("href"))})}function fu(n){return n&&typeof n=="string"?{href:n}:n||{}}function r1(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function a1(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:D,keys:E}=bg(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=D,this._keys=E}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 P=M.match(s);if(P&&P[0])M=M.substr(P[0].length)||"/";else return null}}const C=this._pattern.exec(M);if(C===null)return null;if(this._keys===!1)return C;const D={};let E=0;for(;E<this._keys.length;){try{D[this._keys[E]]=decodeURIComponent(C[E+1]||"")||null}catch{D[this._keys[E]]=null}E++}return D}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(($,M)=>{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=Ct();async function d($,M){await sn(),c($,M)}let m=null,h=null;l&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),Qb(()=>{o1(m)}));let g=null,b=null;const k=Ro.subscribe(async $=>{g=$;let M=0;for(;M<r.length;){const C=r[M].match($.location);if(!C){M++;continue}const D={route:r[M].path,location:$.location,querystring:$.querystring,userData:r[M].userData,params:C&&typeof C=="object"&&Object.keys(C).length?C:null};if(!await r[M].checkConditions(D)){t(0,a=null),b=null,d("conditionsFailed",D);return}d("routeLoading",Object.assign({},D));const E=r[M].component;if(b!=E){E.loading?(t(0,a=E.loading),b=E,t(1,u=E.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},D,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const P=await E();if($!=g)return;t(0,a=P&&P.default||P),b=E}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({},D,{component:a,name:a.name,params:u})).then(()=>{au.set(u)});return}t(0,a=null),b=null,au.set(void 0)});cg(()=>{k(),h&&window.removeEventListener("popstate",h)});function y($){ze.call(this,n,$)}function T($){ze.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,y,T]}class u1 extends ye{constructor(e){super(),ve(this,e,a1,l1,he,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let vg;function yg(n){const e=n.pattern.test(vg);cu(n,n.className,e),cu(n,n.inactiveClassName,!e)}function cu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{vg=n.location+(n.querystring?"?"+n.querystring:""),ao.map(yg)});function qn(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"?bg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),yg(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const f1="modulepreload",c1=function(n,e){return new URL(n,e).href},du={},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=c1(l,i),l in du)return;du[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":f1,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 Nr=function(n,e){return Nr=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])},Nr(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}Nr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Fr=function(){return Fr=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},Fr.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 kg,fl=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 Fr({},this)},e}(Error),ql=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function pu(n,e,t){var i=Object.assign({},t||{}),s=i.encode||p1;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 d1(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function p1(n){return encodeURIComponent(n)}function mu(n){if(n)try{var e=decodeURIComponent(kg(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}kg=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}(),Ti=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),m1=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=mu(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 Ti(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||d1,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=mu(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=pu(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 Ti&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=pu(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}(),wg=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 Ti(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}(m1),Tl=function(e){this.client=e},h1=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}(Tl),Sg=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||[]},ha=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 Sg((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 fl({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}(Tl)),g1=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}(ha),_1=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),b1=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 Ti(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 _1(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}(ha),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),v1=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}(ha),Rr=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),y1=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 Rr(u))}}return new Sg((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 Rr(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}(Tl),k1=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 fl(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 fl(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}(Tl),w1=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}(Tl),ga=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 wg,this.admins=new g1(this),this.collections=new v1(this),this.logs=new y1(this),this.settings=new h1(this),this.realtime=new k1(this),this.health=new w1(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new b1(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,g,b=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&&((g=this.serializeQueryParams(c.params))&&(h+=(h.includes("?")?"&":"?")+g),delete c.params),this.beforeSend&&(c=Object.assign({},this.beforeSend(h,c))),[2,fetch(h,c).then(function(y){return en(b,void 0,void 0,function(){var T;return tn(this,function($){switch($.label){case 0:T={},$.label=1;case 1:return $.trys.push([1,3,,4]),[4,y.json()];case 2:return T=$.sent(),[3,4];case 3:return $.sent(),[3,4];case 4:if(this.afterSend&&(T=this.afterSend(y,T)),y.status>=400)throw new fl({url:y.url,status:y.status,data:T});return[2,T]}})})}).catch(function(y){throw new fl(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 S1 extends ts{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class T1 extends ts{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class $1 extends ts{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Zs extends ts{}class Tg extends ts{constructor(e){super(`Invalid unit ${e}`)}}class Dn extends ts{}class mi extends ts{constructor(){super("Zone is an abstract class")}}const De="numeric",zn="short",yn="long",qr={year:De,month:De,day:De},$g={year:De,month:zn,day:De},C1={year:De,month:zn,day:De,weekday:zn},Cg={year:De,month:yn,day:De},Mg={year:De,month:yn,day:De,weekday:yn},Dg={hour:De,minute:De},Og={hour:De,minute:De,second:De},Eg={hour:De,minute:De,second:De,timeZoneName:zn},Ag={hour:De,minute:De,second:De,timeZoneName:yn},Ig={hour:De,minute:De,hourCycle:"h23"},Pg={hour:De,minute:De,second:De,hourCycle:"h23"},Lg={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:zn},Ng={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:yn},Fg={year:De,month:De,day:De,hour:De,minute:De},Rg={year:De,month:De,day:De,hour:De,minute:De,second:De},qg={year:De,month:zn,day:De,hour:De,minute:De},jg={year:De,month:zn,day:De,hour:De,minute:De,second:De},M1={year:De,month:zn,day:De,weekday:zn,hour:De,minute:De},Hg={year:De,month:yn,day:De,hour:De,minute:De,timeZoneName:zn},Vg={year:De,month:yn,day:De,hour:De,minute:De,second:De,timeZoneName:zn},zg={year:De,month:yn,day:De,weekday:yn,hour:De,minute:De,timeZoneName:yn},Bg={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 qo(n){return typeof n=="number"&&n%1===0}function D1(n){return typeof n=="string"}function O1(n){return Object.prototype.toString.call(n)==="[object Date]"}function Ug(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function E1(n){return Array.isArray(n)?n:[n]}function hu(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 A1(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 qo(n)&&n>=e&&n<=t}function I1(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 gi(n){if(!(Ge(n)||n===null||n===""))return parseInt(n,10)}function Fi(n){if(!(Ge(n)||n===null||n===""))return parseFloat(n)}function _a(n){if(!(Ge(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ba(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function $l(n){return n%4===0&&(n%100!==0||n%400===0)}function xs(n){return $l(n)?366:365}function ho(n,e){const t=I1(e-1,12)+1,i=n+(e-t)/12;return t===2?$l(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function va(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 jr(n){return n>99?n:n>60?1900+n:2e3+n}function Wg(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 jo(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 Yg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Dn(`Invalid unit value ${n}`);return e}function _o(n,e){const t={};for(const i in n)if(Ts(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Yg(s)}return t}function el(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 Ho(n){return A1(n,["hour","minute","second","millisecond"])}const Kg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,P1=["January","February","March","April","May","June","July","August","September","October","November","December"],Jg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],L1=["J","F","M","A","M","J","J","A","S","O","N","D"];function Zg(n){switch(n){case"narrow":return[...L1];case"short":return[...Jg];case"long":return[...P1];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 Gg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Xg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],N1=["M","T","W","T","F","S","S"];function Qg(n){switch(n){case"narrow":return[...N1];case"short":return[...Xg];case"long":return[...Gg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const xg=["AM","PM"],F1=["Before Christ","Anno Domini"],R1=["BC","AD"],q1=["B","A"];function e_(n){switch(n){case"narrow":return[...q1];case"short":return[...R1];case"long":return[...F1];default:return null}}function j1(n){return xg[n.hour<12?0:1]}function H1(n,e){return Qg(e)[n.weekday-1]}function V1(n,e){return Zg(e)[n.month-1]}function z1(n,e){return e_(e)[n.year<0?0:1]}function B1(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 gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const U1={D:qr,DD:$g,DDD:Cg,DDDD:Mg,t:Dg,tt:Og,ttt:Eg,tttt:Ag,T:Ig,TT:Pg,TTT:Lg,TTTT:Ng,f:Fg,ff:qg,fff:Hg,ffff:zg,F:Rg,FF:jg,FFF:Vg,FFFF:Bg};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 U1[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?j1(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?V1(e,m):l(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?H1(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?z1(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 gu(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 gu(l,s(r))}}class jn{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 er=null;class ya extends Cl{static get instance(){return er===null&&(er=new ya),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Wg(e,t,i)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function W1(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 Y1={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function K1(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 J1(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=Y1[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 Wg(e,t,i,this.name)}formatOffset(e,t){return el(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=W1(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?J1(i,t):K1(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=va({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 tr=null;class nn extends Cl{static get utcInstance(){return tr===null&&(tr=new nn(0)),tr}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(jo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${el(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${el(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return el(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 Z1 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 _i(n,e){if(Ge(n)||n===null)return e;if(n instanceof Cl)return n;if(D1(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 Z1(n)}let _u=()=>Date.now(),bu="system",vu=null,yu=null,ku=null,wu;class Lt{static get now(){return _u}static set now(e){_u=e}static set defaultZone(e){bu=e}static get defaultZone(){return _i(bu,ya.instance)}static get defaultLocale(){return vu}static set defaultLocale(e){vu=e}static get defaultNumberingSystem(){return yu}static set defaultNumberingSystem(e){yu=e}static get defaultOutputCalendar(){return ku}static set defaultOutputCalendar(e){ku=e}static get throwOnInvalid(){return wu}static set throwOnInvalid(e){wu=e}static resetCaches(){_t.resetCache(),ai.resetCache()}}let Su={};function G1(n,e={}){const t=JSON.stringify([n,e]);let i=Su[t];return i||(i=new Intl.ListFormat(n,e),Su[t]=i),i}let Hr={};function Vr(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.DateTimeFormat(n,e),Hr[t]=i),i}let zr={};function X1(n,e={}){const t=JSON.stringify([n,e]);let i=zr[t];return i||(i=new Intl.NumberFormat(n,e),zr[t]=i),i}let Br={};function Q1(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Br[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Br[s]=l),l}let Gs=null;function x1(){return Gs||(Gs=new Intl.DateTimeFormat().resolvedOptions().locale,Gs)}function e0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Vr(n).resolvedOptions()}catch{t=Vr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function t0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function n0(n){const e=[];for(let t=1;t<=12;t++){const i=qe.utc(2016,t,1);e.push(n(i))}return e}function i0(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 s0(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 l0{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=X1(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):ba(e,3);return Dt(t,this.padTo)}}}class o0{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=Vr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class r0{constructor(e,t,i){this.opts={style:"long",...i},!t&&Ug()&&(this.rtf=Q1(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):B1(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class _t{static fromOpts(e){return _t.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":x1()),r=t||Lt.defaultNumberingSystem,a=i||Lt.defaultOutputCalendar;return new _t(o,r,a,l)}static resetCache(){Gs=null,Hr={},zr={},Br={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return _t.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=e0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=t0(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=s0(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:_t.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,Zg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=n0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,Qg,()=>{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]=i0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>xg,()=>{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,e_,()=>{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 l0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new o0(e,this.intl,t)}relFormatter(e={}){return new r0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return G1(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 Es(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function As(...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 Is(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 t_(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=gi(e[t+s]);return[i,null,t+s]}}const n_=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,a0=`(?:${n_.source}?(?:\\[(${Kg.source})\\])?)?`,ka=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,i_=RegExp(`${ka.source}${a0}`),wa=RegExp(`(?:T${i_.source})?`),u0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,f0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,c0=/(\d{4})-?(\d{3})/,d0=t_("weekYear","weekNumber","weekDay"),p0=t_("year","ordinal"),m0=/(\d{4})-(\d\d)-(\d\d)/,s_=RegExp(`${ka.source} ?(?:${n_.source}|(${Kg.source}))?`),h0=RegExp(`(?: ${s_.source})?`);function bs(n,e,t){const i=n[e];return Ge(i)?t:gi(i)}function g0(n,e){return[{year:bs(n,e),month:bs(n,e+1,1),day:bs(n,e+2,1)},null,e+3]}function Ps(n,e){return[{hours:bs(n,e,0),minutes:bs(n,e+1,0),seconds:bs(n,e+2,0),milliseconds:_a(n[e+3])},null,e+4]}function Ml(n,e){const t=!n[e]&&!n[e+1],i=jo(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 _0=RegExp(`^T?${ka.source}$`),b0=/^-?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 v0(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(_a(u),c)}]}const y0={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 Sa(n,e,t,i,s,l,o){const r={year:e.length===2?jr(gi(e)):gi(e),month:Jg.indexOf(t)+1,day:gi(i),hour:gi(s),minute:gi(l)};return o&&(r.second=gi(o)),n&&(r.weekday=n.length>3?Gg.indexOf(n)+1:Xg.indexOf(n)+1),r}const k0=/^(?:(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 w0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Sa(e,s,i,t,l,o,r);let m;return a?m=y0[a]:u?m=0:m=jo(f,c),[d,new nn(m)]}function S0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const T0=/^(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$/,$0=/^(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$/,C0=/^(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 Tu(n){const[,e,t,i,s,l,o,r]=n;return[Sa(e,s,i,t,l,o,r),nn.utcInstance]}function M0(n){const[,e,t,i,s,l,o,r]=n;return[Sa(e,r,t,i,s,l,o),nn.utcInstance]}const D0=Es(u0,wa),O0=Es(f0,wa),E0=Es(c0,wa),A0=Es(i_),l_=As(g0,Ps,Ml,Dl),I0=As(d0,Ps,Ml,Dl),P0=As(p0,Ps,Ml,Dl),L0=As(Ps,Ml,Dl);function N0(n){return Is(n,[D0,l_],[O0,I0],[E0,P0],[A0,L0])}function F0(n){return Is(S0(n),[k0,w0])}function R0(n){return Is(n,[T0,Tu],[$0,Tu],[C0,M0])}function q0(n){return Is(n,[b0,v0])}const j0=As(Ps);function H0(n){return Is(n,[_0,j0])}const V0=Es(m0,h0),z0=Es(s_),B0=As(Ps,Ml,Dl);function U0(n){return Is(n,[V0,l_],[z0,B0])}const W0="Invalid Duration",o_={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}},Y0={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},...o_},Sn=146097/400,cs=146097/4800,K0={years:{quarters:4,months:12,weeks:Sn/7,days:Sn,hours:Sn*24,minutes:Sn*24*60,seconds:Sn*24*60*60,milliseconds:Sn*24*60*60*1e3},quarters:{months:3,weeks:Sn/28,days:Sn/4,hours:Sn*24/4,minutes:Sn*24*60/4,seconds:Sn*24*60*60/4,milliseconds:Sn*24*60*60*1e3/4},months:{weeks:cs/7,days:cs,hours:cs*24,minutes:cs*24*60,seconds:cs*24*60*60,milliseconds:cs*24*60*60*1e3},...o_},zi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],J0=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 Z0(n){return n<0?Math.floor(n):Math.ceil(n)}function r_(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?Z0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function G0(n,e){J0.reduce((t,i)=>Ge(e[i])?t:(t&&r_(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||_t.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?K0:Y0,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 Dn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new tt({values:_o(e,tt.normalizeUnit),loc:_t.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 Dn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=q0(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]=H0(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 Dn("need to specify a reason the Duration is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new $1(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 Tg(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):W0}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+=ba(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]=Yg(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,..._o(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 G0(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)&&r_(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 qs="Invalid Interval";function X0(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 Dn("need to specify a reason the Interval is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new T1(i);return new vt({invalid:i})}static fromDateTimes(e,t){const i=Vs(e),s=Vs(t),l=X0(i,s);return l??new vt({start:i,end:s})}static after(e,t){const i=tt.fromDurationLike(t),s=Vs(e);return vt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=tt.fromDurationLike(t),s=Vs(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(Vs).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()})`:qs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:qs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:qs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:qs}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:qs}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 _i(e,Lt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||_t.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||_t.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||_t.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||_t.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return _t.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return _t.create(t,null,"gregory").eras(e)}static features(){return{relative:Ug()}}}function $u(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 Q0(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=$u(r,a);return(u-u%7)/7}],["days",$u]],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 x0(n,e,t,i){let[s,l,o,r]=Q0(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 Ta={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Cu={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]},ev=Ta.hanidec.replace(/[\[|\]]/g,"").split("");function tv(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(Ta.hanidec)!==-1)e+=ev.indexOf(n[t]);else for(const s in Cu){const[l,o]=Cu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Fn({numberingSystem:n},e=""){return new RegExp(`${Ta[n||"latn"]}${e}`)}const nv="missing Intl.DateTimeFormat.formatToParts support";function it(n,e=t=>t){return{regex:n,deser:([t])=>e(tv(t))}}const iv=String.fromCharCode(160),a_=`[ ${iv}]`,u_=new RegExp(a_,"g");function sv(n){return n.replace(/\./g,"\\.?").replace(u_,a_)}function Mu(n){return n.replace(/\./g,"").replace(u_," ").toLowerCase()}function Rn(n,e){return n===null?null:{regex:RegExp(n.map(sv).join("|")),deser:([t])=>n.findIndex(i=>Mu(t)===Mu(i))+e}}function Du(n,e){return{regex:n,deser:([,t,i])=>jo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function lv(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ov(n,e){const t=Fn(e),i=Fn(e,"{2}"),s=Fn(e,"{3}"),l=Fn(e,"{4}"),o=Fn(e,"{6}"),r=Fn(e,"{1,2}"),a=Fn(e,"{1,3}"),u=Fn(e,"{1,6}"),f=Fn(e,"{1,9}"),c=Fn(e,"{2,4}"),d=Fn(e,"{4,6}"),m=b=>({regex:RegExp(lv(b.val)),deser:([k])=>k,literal:!0}),g=(b=>{if(n.literal)return m(b);switch(b.val){case"G":return Rn(e.eras("short",!1),0);case"GG":return Rn(e.eras("long",!1),0);case"y":return it(u);case"yy":return it(c,jr);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 Rn(e.months("short",!0,!1),1);case"MMMM":return Rn(e.months("long",!0,!1),1);case"L":return it(r);case"LL":return it(i);case"LLL":return Rn(e.months("short",!1,!1),1);case"LLLL":return Rn(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 nr(f);case"uu":return nr(r);case"uuu":return it(t);case"a":return Rn(e.meridiems(),0);case"kkkk":return it(l);case"kk":return it(c,jr);case"W":return it(r);case"WW":return it(i);case"E":case"c":return it(t);case"EEE":return Rn(e.weekdays("short",!1,!1),1);case"EEEE":return Rn(e.weekdays("long",!1,!1),1);case"ccc":return Rn(e.weekdays("short",!0,!1),1);case"cccc":return Rn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Du(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Du(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return m(b)}})(n)||{invalidReason:nv};return g.token=n,g}const rv={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 av(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=rv[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function uv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function fv(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 cv(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=_a(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function dv(){return ir||(ir=qe.fromMillis(1555555555555)),ir}function pv(n,e){if(n.literal)return n;const t=dn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=dn.create(e,t).formatDateTimeParts(dv()).map(o=>av(o,e,t));return l.includes(void 0)?n:l}function mv(n,e){return Array.prototype.concat(...n.map(t=>pv(t,e)))}function f_(n,e,t){const i=mv(dn.parseFormat(t),n),s=i.map(o=>ov(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=uv(s),a=RegExp(o,"i"),[u,f]=fv(e,a,r),[c,d,m]=f?cv(f):[null,null,void 0];if(Ts(f,"a")&&Ts(f,"H"))throw new Zs("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 hv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=f_(n,e,t);return[i,s,l,o]}const c_=[0,31,59,90,120,151,181,212,243,273,304,334],d_=[0,31,60,91,121,152,182,213,244,274,305,335];function En(n,e){return new jn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function p_(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 m_(n,e,t){return t+($l(n)?d_:c_)[e-1]}function h_(n,e){const t=$l(n)?d_:c_,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Ur(n){const{year:e,month:t,day:i}=n,s=m_(e,t,i),l=p_(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,...Ho(n)}}function Ou(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=p_(e,1,4),l=xs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=xs(r)):o>l?(r=e+1,o-=xs(e)):r=e;const{month:a,day:u}=h_(r,o);return{year:r,month:a,day:u,...Ho(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=m_(e,t,i);return{year:e,ordinal:s,...Ho(n)}}function Eu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=h_(e,t);return{year:e,month:i,day:s,...Ho(n)}}function gv(n){const e=qo(n.weekYear),t=ri(n.weekNumber,1,go(n.weekYear)),i=ri(n.weekday,1,7);return e?t?i?!1:En("weekday",n.weekday):En("week",n.week):En("weekYear",n.weekYear)}function _v(n){const e=qo(n.year),t=ri(n.ordinal,1,xs(n.year));return e?t?!1:En("ordinal",n.ordinal):En("year",n.year)}function g_(n){const e=qo(n.year),t=ri(n.month,1,12),i=ri(n.day,1,ho(n.year,n.month));return e?t?i?!1:En("day",n.day):En("month",n.month):En("year",n.year)}function __(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:En("millisecond",s):En("second",i):En("minute",t):En("hour",e)}const lr="Invalid DateTime",Au=864e13;function zl(n){return new jn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=Ur(n.c)),n.weekData}function js(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 b_(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 Iu(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 b_(va(n),e,t)}function Pu(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,ho(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=va(l);let[a,u]=b_(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Hs(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 jn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?dn.create(_t.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(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 Lu(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 v_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},vv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},y_=["year","month","day","hour","minute","second","millisecond"],yv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],kv=["year","ordinal","hour","minute","second","millisecond"];function Nu(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 Tg(n);return e}function Fu(n,e){const t=_i(e.zone,Lt.defaultZone),i=_t.fromObject(e),s=Lt.now();let l,o;if(Ge(n.year))l=s;else{for(const u of y_)Ge(n[u])&&(n[u]=v_[u]);const r=g_(n)||__(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 Ru(n,e,t){const i=Ge(t.round)?!0:t.round,s=(o,r)=>(o=ba(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 qu(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 jn("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=Iu(this.ts,r),i=Number.isNaN(s.year)?new jn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||_t.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]=qu(arguments),[i,s,l,o,r,a,u]=t;return Fu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=qu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=nn.utcInstance,Fu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=O1(e)?e.valueOf():NaN;if(Number.isNaN(i))return qe.invalid("invalid input");const s=_i(t.zone,Lt.defaultZone);return s.isValid?new qe({ts:i,zone:s,loc:_t.fromObject(t)}):qe.invalid(zl(s))}static fromMillis(e,t={}){if(Ji(e))return e<-Au||e>Au?qe.invalid("Timestamp out of range"):new qe({ts:e,zone:_i(t.zone,Lt.defaultZone),loc:_t.fromObject(t)});throw new Dn(`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:_i(t.zone,Lt.defaultZone),loc:_t.fromObject(t)});throw new Dn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=_i(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=_o(e,Nu),r=!Ge(o.ordinal),a=!Ge(o.year),u=!Ge(o.month)||!Ge(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=_t.fromObject(t);if((f||r)&&c)throw new Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Zs("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let h,g,b=Iu(s,l);m?(h=yv,g=bv,b=Ur(b)):r?(h=kv,g=vv,b=sr(b)):(h=y_,g=v_);let k=!1;for(const E of h){const P=o[E];Ge(P)?k?o[E]=g[E]:o[E]=b[E]:k=!0}const y=m?gv(o):r?_v(o):g_(o),T=y||__(o);if(T)return qe.invalid(T);const $=m?Ou(o):r?Eu(o):o,[M,C]=fo($,l,i),D=new qe({ts:M,zone:i,o:C,loc:d});return o.weekday&&f&&e.weekday!==D.weekday?qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[i,s]=N0(e);return Hs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=F0(e);return Hs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=R0(e);return Hs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Ge(e)||Ge(t))throw new Dn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=_t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=hv(o,e,t);return f?qe.invalid(f):Hs(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]=U0(e);return Hs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Dn("need to specify a reason the DateTime is invalid");const i=e instanceof jn?e:new jn(e,t);if(Lt.throwOnInvalid)throw new S1(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?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(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 $l(this.year)}get daysInMonth(){return ho(this.year,this.month)}get daysInYear(){return this.isValid?xs(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=_i(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 js(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 js(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=_o(e,Nu),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 Zs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Zs("Can't mix ordinal dates with month/day");let u;i?u=Ou({...Ur(this.c),...t}):Ge(t.ordinal)?(u={...this.toObject(),...t},Ge(t.day)&&(u.day=Math.min(ho(u.year,u.month),u.day))):u=Eu({...sr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return js(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e);return js(this,Pu(this,t))}minus(e){if(!this.isValid)return this;const t=tt.fromDurationLike(e).negate();return js(this,Pu(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):lr}toLocaleString(e=qr,t={}){return this.isValid?dn.create(this.loc.clone(t),e).formatDateTime(this):lr}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=rr(this,o);return r+="T",r+=Lu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(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":"")+Lu(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?rr(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():lr}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=E1(t).map(tt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=x0(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),Ru(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Ru(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 Dn("min requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(qe.isDateTime))throw new Dn("max requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=_t.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return f_(o,e,t)}static fromStringExplain(e,t,i={}){return qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return qr}static get DATE_MED(){return $g}static get DATE_MED_WITH_WEEKDAY(){return C1}static get DATE_FULL(){return Cg}static get DATE_HUGE(){return Mg}static get TIME_SIMPLE(){return Dg}static get TIME_WITH_SECONDS(){return Og}static get TIME_WITH_SHORT_OFFSET(){return Eg}static get TIME_WITH_LONG_OFFSET(){return Ag}static get TIME_24_SIMPLE(){return Ig}static get TIME_24_WITH_SECONDS(){return Pg}static get TIME_24_WITH_SHORT_OFFSET(){return Lg}static get TIME_24_WITH_LONG_OFFSET(){return Ng}static get DATETIME_SHORT(){return Fg}static get DATETIME_SHORT_WITH_SECONDS(){return Rg}static get DATETIME_MED(){return qg}static get DATETIME_MED_WITH_SECONDS(){return jg}static get DATETIME_MED_WITH_WEEKDAY(){return M1}static get DATETIME_FULL(){return Hg}static get DATETIME_FULL_WITH_SECONDS(){return Vg}static get DATETIME_HUGE(){return zg}static get DATETIME_HUGE_WITH_SECONDS(){return Bg}}function Vs(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 Dn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const wv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Sv=[".mp4",".avi",".mov",".3gp",".wmv"],Tv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],$v=[".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 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!!wv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Sv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Tv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!$v.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 s,l,o,r,a;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,created:"2022-01-01 01:00:00.123Z",updated:"2022-01-01 23:59:59.456Z"};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com");for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00.123Z":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)!==1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)!==1&&(f=[f])):u.type==="relation"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)!==1&&(f=[f])):f="test",i[u.name]=f}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-terminal-box-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)}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 Vo=Ln([]);function k_(n,e=4e3){return zo(n,"info",e)}function zt(n,e=3e3){return zo(n,"success",e)}function cl(n,e=4500){return zo(n,"error",e)}function Cv(n,e=4500){return zo(n,"warning",e)}function zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{w_(i)},t)};Vo.update(s=>(Ca(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function w_(n){Vo.update(e=>(Ca(e,n),e))}function $a(){Vo.update(n=>{for(let e of n)Ca(n,e);return[]})}function Ca(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=Ln({});function Bn(n){fi.set(n||{})}function Qi(n){fi.update(e=>(z.deleteByPath(e,n),e))}const Ma=Ln({});function Wr(n){Ma.set(n||{})}ga.prototype.logout=function(n=!0){this.authStore.clear(),n&&Di("/login")};ga.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&&cl(l)}if(z.isEmpty(s.data)||Bn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Di("/")};class Mv extends wg{save(e,t){super.save(e,t),t instanceof Xi&&Wr(t)}clear(){super.clear(),Wr(null)}}const pe=new ga("../",new Mv("pb_admin_auth"));pe.authStore.model instanceof Xi&&Wr(pe.authStore.model);function Dv(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=v("div"),t=v("main"),h&&h.c(),i=O(),s=v("footer"),l=v("a"),l.innerHTML='<span class="txt">Docs</span>',o=O(),r=v("span"),r.textContent="|",a=O(),u=v("a"),f=v("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(g,b){S(g,e,b),_(e,t),h&&h.m(t,null),_(e,i),_(e,s),_(s,l),_(s,o),_(s,r),_(s,a),_(s,u),_(u,f),d=!0},p(g,[b]){h&&h.p&&(!d||b&4)&&Rt(h,m,g,g[2],d?Ft(m,g[2],b,null):qt(g[2]),null),(!d||b&2&&c!==(c="page-wrapper "+g[1]))&&p(e,"class",c),(!d||b&3)&&Q(e,"center-content",g[0])},i(g){d||(A(h,g),d=!0)},o(g){I(h,g),d=!1},d(g){g&&w(e),h&&h.d(g)}}}function Ov(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 ye{constructor(e){super(),ve(this,e,Ov,Dv,he,{center:0,class:1})}}function ju(n){let e,t,i;return{c(){e=v("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=O(),i=v("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 Ev(n){let e,t,i,s=!n[0]&&ju();const l=n[1].default,o=Nt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=O(),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),_(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=ju(),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||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Av(n){let e,t;return e=new wn({props:{class:"full-page",center:!0,$$slots:{default:[Ev]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Iv(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 S_ extends ye{constructor(e){super(),ve(this,e,Iv,Av,he,{nobranding:0})}}function Hu(n,e,t){const i=n.slice();return i[11]=e[t],i}const Pv=n=>({}),Vu=n=>({uniqueId:n[3]});function Lv(n){let e=(n[11]||bo)+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||bo)+"")&&le(t,e)},d(i){i&&w(t)}}}function Nv(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||bo)+"",i;return{c(){e=v("pre"),i=B(t)},m(o,r){S(o,e,r),_(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)||bo)+"")&&le(i,t)},d(o){o&&w(e)}}}function zu(n){let e,t;function i(o,r){return typeof o[11]=="object"?Nv:Lv}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=O(),p(e,"class","help-block help-block-error")},m(o,r){S(o,e,r),l.m(e,null),_(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 Fv(n){let e,t,i,s,l;const o=n[7].default,r=Nt(o,n,n[6],Vu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=zu(Hu(n,a,f));return{c(){e=v("div"),r&&r.c(),t=O();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),_(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=Y(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Rt(r,o,f,f[6],i?Ft(o,f[6],c,Pv):qt(f[6]),Vu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const m=Hu(f,a,d);u[d]?u[d].p(m,c):(u[d]=zu(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||(A(r,f),i=!0)},o(f){I(r,f),i=!1},d(f){f&&w(e),r&&r.d(f),mt(u,f),n[9](null),s=!1,l()}}}const bo="Invalid value";function Rv(n,e,t){let i;Ye(n,fi,h=>t(5,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){ze.call(this,n,h)}function m(h){ie[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(6,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=z.toArray(z.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,m]}class me extends ye{constructor(e){super(),ve(this,e,Rv,Fv,he,{name:4,class:0})}}function qv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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]&&ce(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function jv(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Password"),s=O(),l=v("input"),r=O(),a=v("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),_(e,t),S(c,s,d),S(c,l,d),ce(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]&&ce(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function Hv(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Password confirm"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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]&&ce(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Vv(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[qv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[jv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Hv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),f=v("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,g){S(h,e,g),_(e,t),_(e,i),q(s,e,null),_(e,l),q(o,e,null),_(e,r),q(a,e,null),_(e,u),_(e,f),c=!0,d||(m=Y(e,"submit",dt(n[4])),d=!0)},p(h,[g]){const b={};g&1537&&(b.$$scope={dirty:g,ctx:h}),s.$set(b);const k={};g&1538&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const y={};g&1540&&(y.$$scope={dirty:g,ctx:h}),a.$set(y),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){I(s.$$.fragment,h),I(o.$$.fragment,h),I(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,m()}}}function zv(n,e,t){const i=Ct();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await pe.admins.create({email:s,password:l,passwordConfirm:o}),await pe.admins.authWithPassword(s,l),i("submit")}catch(d){pe.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 Bv extends ye{constructor(e){super(),ve(this,e,zv,Vv,he,{})}}function Bu(n){let e,t;return e=new S_({props:{$$slots:{default:[Uv]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Uv(n){let e,t;return e=new Bv({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:Z,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Wv(n){let e,t,i=n[0]&&Bu(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&&A(i,1)):(i=Bu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),I(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Yv(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){pe.logout(!1),t(0,i=!0);return}pe.authStore.isValid?Di("/collections"):pe.logout()}return[i,async()=>{t(0,i=!1),await sn(),window.location.search=""}]}class Kv extends ye{constructor(e){super(),ve(this,e,Yv,Wv,he,{})}}const St=Ln(""),vo=Ln(""),$s=Ln(!1);function Bo(n){const e=n-1;return e*e*e+1}function yo(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 An(n,{delay:e=0,duration:t=400,easing:i=Bo,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=Bo}={}){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=Bo,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 Jv(n){let e,t,i,s;return{c(){e=v("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),ce(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]&&ce(e,l[7])},i:Z,o:Z,d(l){l&&w(e),n[13](null),i=!1,s()}}}function Zv(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=jt(o,r(n)),ie.push(()=>ge(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;I(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Uu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Wu();return{c(){r&&r.c(),e=O(),t=v("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&&A(r,1):(r=Wu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(ae(),I(r,1,1,()=>{r=null}),ue())},i(a){s||(A(r),a&&xe(()=>{i||(i=je(t,An,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){I(r),a&&(i||(i=je(t,An,{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 Wu(n){let e,t,i;return{c(){e=v("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,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=je(e,An,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Gv(n){let e,t,i,s,l,o,r,a,u,f;const c=[Zv,Jv],d=[];function m(g,b){return g[4]&&!g[5]?0:1}l=m(n),o=d[l]=c[l](n);let h=(n[0].length||n[7].length)&&Uu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=O(),o.c(),r=O(),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(g,b){S(g,e,b),_(e,t),_(t,i),_(e,s),d[l].m(e,null),_(e,r),h&&h.m(e,null),a=!0,u||(f=[Y(e,"click",kn(n[11])),Y(e,"submit",dt(n[10]))],u=!0)},p(g,[b]){let k=l;l=m(g),l===k?d[l].p(g,b):(ae(),I(d[k],1,1,()=>{d[k]=null}),ue(),o=d[l],o?o.p(g,b):(o=d[l]=c[l](g),o.c()),A(o,1),o.m(e,r)),g[0].length||g[7].length?h?(h.p(g,b),b&129&&A(h,1)):(h=Uu(g),h.c(),A(h,1),h.m(e,null)):h&&(ae(),I(h,1,1,()=>{h=null}),ue())},i(g){a||(A(o),A(h),a=!0)},o(g){I(o),I(h),a=!1},d(g){g&&w(e),d[l].d(),h&&h.d(),u=!1,Pe(f)}}}function Xv(n,e,t){const i=Ct(),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 g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-80716b22.js"),["./FilterAutocompleteInput-80716b22.js","./index-a6ccb683.js"],import.meta.url)).default),t(5,f=!1))}Zt(()=>{g()});function b(M){ze.call(this,n,M)}function k(M){d=M,t(7,d),t(0,l)}function y(M){ie[M?"unshift":"push"](()=>{c=M,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const $=()=>{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,b,k,y,T,$]}class Uo extends ye{constructor(e){super(),ve(this,e,Xv,Gv,he,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Yr,qi;const Kr="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function ki(){return qi=qi||document.querySelector("."+Kr),qi||(qi=document.createElement("div"),qi.classList.add(Kr),document.body.appendChild(qi)),qi}function T_(n,e){let t=ki();if(!t.classList.contains("active")||!(e!=null&&e.text)){Jr();return}t.textContent=e.text,t.className=Kr+" 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 Jr(){clearTimeout(Yr),ki().classList.remove("active"),ki().activeNode=void 0}function Qv(n,e){ki().activeNode=n,clearTimeout(Yr),Yr=setTimeout(()=>{ki().classList.add("active"),T_(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Yu(e);function i(){Qv(n,t)}function s(){Jr()}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=Yu(l),(r=(o=ki())==null?void 0:o.activeNode)!=null&&r.contains(n)&&T_(n,t)},destroy(){var l,o;(o=(l=ki())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Jr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function xv(n){let e,t,i,s;return{c(){e=v("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:Z,o:Z,d(l){l&&w(e),i=!1,Pe(s)}}}function ey(n,e,t){const i=Ct();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 Da extends ye{constructor(e){super(),ve(this,e,ey,xv,he,{tooltip:0})}}function ty(n){let e,t,i,s,l;const o=n[6].default,r=Nt(o,n,n[5],null);return{c(){e=v("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||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,Pe(l)}}}function ny(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 ye{constructor(e){super(),ve(this,e,ny,ty,he,{class:1,name:2,sort:0,disable:3})}}function iy(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function sy(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("div"),i=B(n[2]),s=O(),l=v("div"),o=B(n[1]),r=B(" UTC"),p(t,"class","date"),p(l,"class","time svelte-zdiknu"),p(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(e,s),_(e,l),_(l,o),_(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function ly(n){let e;function t(l,o){return l[0]?sy:iy}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:Z,o:Z,d(l){s.d(l),l&&w(e)}}}function oy(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 ye{constructor(e){super(),ve(this,e,oy,ly,he,{date:0})}}const ry=n=>({}),Ku=n=>({}),ay=n=>({}),Ju=n=>({});function uy(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Nt(u,n,n[4],Ju),c=n[5].default,d=Nt(c,n,n[4],null),m=n[5].after,h=Nt(m,n,n[4],Ku);return{c(){e=v("div"),f&&f.c(),t=O(),i=v("div"),d&&d.c(),l=O(),h&&h.c(),p(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),p(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,b){S(g,e,b),f&&f.m(e,null),_(e,t),_(e,i),d&&d.m(i,null),n[6](i),_(e,l),h&&h.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[b]){f&&f.p&&(!o||b&16)&&Rt(f,u,g,g[4],o?Ft(u,g[4],b,ay):qt(g[4]),Ju),d&&d.p&&(!o||b&16)&&Rt(d,c,g,g[4],o?Ft(c,g[4],b,null):qt(g[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&p(i,"class",s),h&&h.p&&(!o||b&16)&&Rt(h,m,g,g[4],o?Ft(m,g[4],b,ry):qt(g[4]),Ku)},i(g){o||(A(f,g),A(d,g),A(h,g),o=!0)},o(g){I(f,g),I(d,g),I(h,g),o=!1},d(g){g&&w(e),f&&f.d(g),d&&d.d(g),n[6](null),h&&h.d(g),r=!1,Pe(a)}}}function fy(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){ie[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 Oa extends ye{constructor(e){super(),ve(this,e,fy,uy,he,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function Zu(n,e,t){const i=n.slice();return i[23]=e[t],i}function cy(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e)}}}function dy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function py(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function my(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function hy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function gy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function Gu(n){let e;function t(l,o){return l[6]?by:_y}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 _y(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Xu(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(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 by(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Xu(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function Qu(n){let e;return{c(){e=v("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 xu(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,g,b,k,y=(e[23].referer||"N/A")+"",T,$,M,C,D,E=(e[23].userIp||"N/A")+"",P,L,N,F,R,X=e[23].status+"",se,W,G,te,K,re,J,de,_e,$e,Ne=(((We=e[23].meta)==null?void 0:We.errorMessage)||((lt=e[23].meta)==null?void 0:lt.errorData))&&Qu();te=new ui({props:{date:e[23].created}});function Re(){return e[17](e[23])}function be(...fe){return e[18](e[23],...fe)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=B(l),a=O(),u=v("td"),f=v("span"),d=B(c),h=O(),Ne&&Ne.c(),g=O(),b=v("td"),k=v("span"),T=B(y),M=O(),C=v("td"),D=v("span"),P=B(E),N=O(),F=v("td"),R=v("span"),se=B(X),W=O(),G=v("td"),H(te.$$.fragment),K=O(),re=v("td"),re.innerHTML='<i class="ri-arrow-right-line"></i>',J=O(),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",$=e[23].referer),Q(k,"txt-hint",!e[23].referer),p(b,"class","col-type-text col-field-referer"),p(D,"class","txt txt-ellipsis"),p(D,"title",L=e[23].userIp),Q(D,"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(G,"class","col-type-date col-field-created"),p(re,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(fe,Ve){S(fe,t,Ve),_(t,i),_(i,s),_(s,o),_(t,a),_(t,u),_(u,f),_(f,d),_(u,h),Ne&&Ne.m(u,null),_(t,g),_(t,b),_(b,k),_(k,T),_(t,M),_(t,C),_(C,D),_(D,P),_(t,N),_(t,F),_(F,R),_(R,se),_(t,W),_(t,G),q(te,G,null),_(t,K),_(t,re),_(t,J),de=!0,_e||($e=[Y(t,"click",Re),Y(t,"keydown",be)],_e=!0)},p(fe,Ve){var Fe,ot,Ht;e=fe,(!de||Ve&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!de||Ve&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!de||Ve&8)&&c!==(c=e[23].url+"")&&le(d,c),(!de||Ve&8&&m!==(m=e[23].url))&&p(f,"title",m),(ot=e[23].meta)!=null&&ot.errorMessage||(Ht=e[23].meta)!=null&&Ht.errorData?Ne||(Ne=Qu(),Ne.c(),Ne.m(u,null)):Ne&&(Ne.d(1),Ne=null),(!de||Ve&8)&&y!==(y=(e[23].referer||"N/A")+"")&&le(T,y),(!de||Ve&8&&$!==($=e[23].referer))&&p(k,"title",$),(!de||Ve&8)&&Q(k,"txt-hint",!e[23].referer),(!de||Ve&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(P,E),(!de||Ve&8&&L!==(L=e[23].userIp))&&p(D,"title",L),(!de||Ve&8)&&Q(D,"txt-hint",!e[23].userIp),(!de||Ve&8)&&X!==(X=e[23].status+"")&&le(se,X),(!de||Ve&8)&&Q(R,"label-danger",e[23].status>=400);const ee={};Ve&8&&(ee.date=e[23].created),te.$set(ee)},i(fe){de||(A(te.$$.fragment,fe),de=!0)},o(fe){I(te.$$.fragment,fe),de=!1},d(fe){fe&&w(t),Ne&&Ne.d(),j(te),_e=!1,Pe($e)}}}function vy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D,E,P=[],L=new Map,N;function F(be){n[11](be)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[cy]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Wt({props:R}),ie.push(()=>ge(s,"sort",F));function X(be){n[12](be)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[dy]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),r=new Wt({props:se}),ie.push(()=>ge(r,"sort",X));function W(be){n[13](be)}let G={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[py]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),f=new Wt({props:G}),ie.push(()=>ge(f,"sort",W));function te(be){n[14](be)}let K={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[my]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),m=new Wt({props:K}),ie.push(()=>ge(m,"sort",te));function re(be){n[15](be)}let J={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[hy]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),b=new Wt({props:J}),ie.push(()=>ge(b,"sort",re));function de(be){n[16](be)}let _e={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[gy]},$$scope:{ctx:n}};n[1]!==void 0&&(_e.sort=n[1]),T=new Wt({props:_e}),ie.push(()=>ge(T,"sort",de));let $e=n[3];const Ne=be=>be[23].id;for(let be=0;be<$e.length;be+=1){let Se=Zu(n,$e,be),We=Ne(Se);L.set(We,P[be]=xu(We,Se))}let Re=null;return $e.length||(Re=Gu(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),H(s.$$.fragment),o=O(),H(r.$$.fragment),u=O(),H(f.$$.fragment),d=O(),H(m.$$.fragment),g=O(),H(b.$$.fragment),y=O(),H(T.$$.fragment),M=O(),C=v("th"),D=O(),E=v("tbody");for(let be=0;be<P.length;be+=1)P[be].c();Re&&Re.c(),p(C,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[6])},m(be,Se){S(be,e,Se),_(e,t),_(t,i),q(s,i,null),_(i,o),q(r,i,null),_(i,u),q(f,i,null),_(i,d),q(m,i,null),_(i,g),q(b,i,null),_(i,y),q(T,i,null),_(i,M),_(i,C),_(e,D),_(e,E);for(let We=0;We<P.length;We+=1)P[We].m(E,null);Re&&Re.m(E,null),N=!0},p(be,Se){const We={};Se&67108864&&(We.$$scope={dirty:Se,ctx:be}),!l&&Se&2&&(l=!0,We.sort=be[1],ke(()=>l=!1)),s.$set(We);const lt={};Se&67108864&&(lt.$$scope={dirty:Se,ctx:be}),!a&&Se&2&&(a=!0,lt.sort=be[1],ke(()=>a=!1)),r.$set(lt);const fe={};Se&67108864&&(fe.$$scope={dirty:Se,ctx:be}),!c&&Se&2&&(c=!0,fe.sort=be[1],ke(()=>c=!1)),f.$set(fe);const Ve={};Se&67108864&&(Ve.$$scope={dirty:Se,ctx:be}),!h&&Se&2&&(h=!0,Ve.sort=be[1],ke(()=>h=!1)),m.$set(Ve);const ee={};Se&67108864&&(ee.$$scope={dirty:Se,ctx:be}),!k&&Se&2&&(k=!0,ee.sort=be[1],ke(()=>k=!1)),b.$set(ee);const Fe={};Se&67108864&&(Fe.$$scope={dirty:Se,ctx:be}),!$&&Se&2&&($=!0,Fe.sort=be[1],ke(()=>$=!1)),T.$set(Fe),Se&841&&($e=be[3],ae(),P=wt(P,Se,Ne,1,be,$e,L,E,ln,xu,null,Zu),ue(),!$e.length&&Re?Re.p(be,Se):$e.length?Re&&(Re.d(1),Re=null):(Re=Gu(be),Re.c(),Re.m(E,null))),(!N||Se&64)&&Q(e,"table-loading",be[6])},i(be){if(!N){A(s.$$.fragment,be),A(r.$$.fragment,be),A(f.$$.fragment,be),A(m.$$.fragment,be),A(b.$$.fragment,be),A(T.$$.fragment,be);for(let Se=0;Se<$e.length;Se+=1)A(P[Se]);N=!0}},o(be){I(s.$$.fragment,be),I(r.$$.fragment,be),I(f.$$.fragment,be),I(m.$$.fragment,be),I(b.$$.fragment,be),I(T.$$.fragment,be);for(let Se=0;Se<P.length;Se+=1)I(P[Se]);N=!1},d(be){be&&w(e),j(s),j(r),j(f),j(m),j(b),j(T);for(let Se=0;Se<P.length;Se+=1)P[Se].d();Re&&Re.d()}}}function ef(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),_(e,t),_(e,s),_(e,l),_(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 tf(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=B("Load more ("),o=B(l),r=B(")"),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),_(e,t),_(t,i),_(i,s),_(i,o),_(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 yy(n){let e,t,i,s,l;e=new Oa({props:{class:"table-wrapper",$$slots:{default:[vy]},$$scope:{ctx:n}}});let o=n[3].length&&ef(n),r=n[3].length&&n[7]&&tf(n);return{c(){H(e.$$.fragment),t=O(),o&&o.c(),i=O(),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=ef(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=tf(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(A(e.$$.fragment,a),l=!0)},o(a){I(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 ky(n,e,t){let i;const s=Ct(),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),pe.logs.getRequestsList(L,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async F=>{if(L<=1&&g(),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),g(),pe.errorResponseHandler(F,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function b(L){a=L,t(1,a)}function k(L){a=L,t(1,a)}function y(L){a=L,t(1,a)}function T(L){a=L,t(1,a)}function $(L){a=L,t(1,a)}function M(L){a=L,t(1,a)}const C=L=>s("select",L),D=(L,N)=>{N.code==="Enter"&&(N.preventDefault(),s("select",L))},E=()=>t(0,o=""),P=()=>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")&&(g(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,b,k,y,T,$,M,C,D,E,P]}class wy extends ye{constructor(e){super(),ve(this,e,ky,yy,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 Sy=function(){let n=0;return function(){return n++}}();function at(n){return n===null||typeof n>"u"}function gt(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 $t=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function $n(n,e){return $t(n)?n:e}function Xe(n,e){return typeof n>"u"?e:n}const Ty=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,$_=(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(gt(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 ko(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 wo(n){if(gt(n))return n.map(wo);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]]=wo(n[t[s]]);return e}return n}function C_(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function $y(n,e,t,i){if(!C_(n))return;const s=e[n],l=t[n];Ke(s)&&Ke(l)?dl(s,l,i):e[n]=wo(l)}function dl(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ke(n))return n;t=t||{};const l=t.merger||$y;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 tl(n,e){return dl(n,e,{merger:Cy})}function Cy(n,e,t){if(!C_(n))return;const i=e[n],s=t[n];Ke(i)&&Ke(s)?tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=wo(s))}const nf={"":n=>n,x:n=>n.x,y:n=>n.y};function $i(n,e){return(nf[e]||(nf[e]=My(e)))(n)}function My(n){const e=Dy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Dy(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 Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const In=n=>typeof n<"u",Ci=n=>typeof n=="function",sf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Oy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,ct=2*Tt,Ey=ct+Tt,So=Number.POSITIVE_INFINITY,Ay=Tt/180,kt=Tt/2,zs=Tt/4,lf=Tt*2/3,On=Math.log10,Gn=Math.sign;function of(n){const e=Math.round(n);n=nl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(On(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Iy(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 Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function nl(n,e,t){return Math.abs(n-e)<t}function Py(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function M_(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 Hn(n){return n*(Tt/180)}function Aa(n){return n*(180/Tt)}function rf(n){if(!$t(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function D_(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*Tt&&(l+=ct),{angle:l,distance:s}}function Zr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Ly(n,e){return(n-e+Ey)%ct-Tt}function bn(n){return(n%ct+ct)%ct}function pl(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 Ny(n){return Yt(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(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)=>Ia(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Fy=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function Ry(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 O_=["push","pop","shift","splice","unshift"];function qy(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),O_.forEach(t=>{const i="_onData"+Ea(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 af(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)&&(O_.forEach(l=>{delete n[l]}),delete n._chartjs)}function E_(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 A_=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function I_(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,A_.call(window,()=>{s=!1,n.apply(e,l)}))}}function jy(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Hy=n=>n==="start"?"left":n==="end"?"right":"center",uf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function P_(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 L_(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,ff=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ct/t)),cf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ct/t)+1,il={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(Tt*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:ff(n,.075,.3),easeOutElastic:n=>Ul(n)?n:cf(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*ff(n*2,.1125,.45):.5+.5*cf(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-il.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?il.easeInBounce(n*2)*.5:il.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 Xs(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 df(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},Gr=[..."0123456789ABCDEF"],Vy=n=>Gr[n&15],zy=n=>Gr[(n&240)>>4]+Gr[n&15],Wl=n=>(n&240)>>4===(n&15),By=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function Uy(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 Wy=(n,e)=>n<255?e(n):"";function Yy(n){var e=By(n)?Vy:zy;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Wy(n.a,e):void 0}const Ky=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function N_(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 Jy(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 Zy(n,e,t){const i=N_(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 Gy(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 Pa(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=Gy(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function La(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(wi)}function Na(n,e,t){return La(N_,n,e,t)}function Xy(n,e,t){return La(Zy,n,e,t)}function Qy(n,e,t){return La(Jy,n,e,t)}function F_(n){return(n%360+360)%360}function xy(n){const e=Ky.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xs(+e[5]):wi(+e[5]));const s=F_(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Xy(s,l,o):e[1]==="hsv"?i=Qy(s,l,o):i=Na(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function e2(n,e){var t=Pa(n);t[0]=F_(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function t2(n){if(!n)return;const e=Pa(n),t=e[0],i=df(e[1]),s=df(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${li(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const pf={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"},mf={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 n2(){const n={},e=Object.keys(mf),t=Object.keys(pf);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,pf[l]);l=parseInt(mf[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Yl;function i2(n){Yl||(Yl=n2(),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 s2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function l2(n){const e=s2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Xs(o):bi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Xs(i):bi(i,0,255)),s=255&(e[4]?Xs(s):bi(s,0,255)),l=255&(e[6]?Xs(l):bi(l,0,255)),{r:i,g:s,b:l,a:t}}}function o2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${li(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ds=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function r2(n,e,t){const i=ds(li(n.r)),s=ds(li(n.g)),l=ds(li(n.b));return{r:wi(ar(i+t*(ds(li(e.r))-i))),g:wi(ar(s+t*(ds(li(e.g))-s))),b:wi(ar(l+t*(ds(li(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=Pa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Na(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function R_(n,e){return n&&Object.assign(e||{},n)}function hf(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=R_(n,{r:0,g:0,b:0,a:1}),e.a=wi(e.a)),e}function a2(n){return n.charAt(0)==="r"?l2(n):xy(n)}class To{constructor(e){if(e instanceof To)return e;const t=typeof e;let i;t==="object"?i=hf(e):t==="string"&&(i=Uy(e)||i2(e)||a2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=R_(this._rgb);return e&&(e.a=li(e.a)),e}set rgb(e){this._rgb=hf(e)}rgbString(){return this._valid?o2(this._rgb):void 0}hexString(){return this._valid?Yy(this._rgb):void 0}hslString(){return this._valid?t2(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=r2(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 e2(this._rgb,e),this}}function q_(n){return new To(n)}function j_(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function gf(n){return j_(n)?n:q_(n)}function ur(n){return j_(n)?n:q_(n).saturate(.5).darken(.1).hexString()}const xi=Object.create(null),Xr=Object.create(null);function sl(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 fr(n,e,t){return typeof e=="string"?dl(sl(n,e),t):dl(sl(n,""),e)}class u2{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)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(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 fr(this,e,t)}get(e){return sl(this,e)}describe(e,t){return fr(Xr,e,t)}override(e,t){return fr(xi,e,t)}route(e,t,i,s){const l=sl(this,e),o=sl(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 u2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function f2(n){return!n||at(n.size)||at(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function $o(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 c2(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&&gt(c)!==!0)o=$o(n,s,l,o,c);else if(gt(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!gt(d)&&(o=$o(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 _f(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Qr(n,e,t,i){d2(n,e,t,i,null)}function d2(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)*Ay;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,ct):n.arc(t,i,m,0,ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(h)*m,i-Math.cos(h)*m),h+=lf,n.lineTo(t+Math.sin(h)*m,i-Math.cos(h)*m),h+=lf,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+zs)*a,r=Math.sin(h+zs)*a,n.arc(t-o,i-r,u,h-Tt,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+Tt),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+=zs;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+=zs;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+=zs,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 hl(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 Fa(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Ra(n){n.restore()}function p2(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 m2(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 Co(n,e,t,i,s,l={}){const o=gt(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,h2(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),g2(n,t,i,u,l),i+=s.lineHeight;n.restore()}function h2(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 g2(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 Mo(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,Tt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Tt,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 _2=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),b2=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function v2(n,e){const t=(""+n).match(_2);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 y2=n=>+n||0;function qa(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]=y2(l(o));return t}function H_(n){return qa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vs(n){return qa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Pn(n){const e=H_(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(b2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:Xe(n.family,e.family),lineHeight:v2(Xe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Xe(n.weight,e.weight),string:""};return s.string=f2(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&&gt(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function k2(n,e,t){const{min:i,max:s}=n,l=$_(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 ja(n,e=[""],t=n,i,s=()=>n[0]){In(i)||(i=U_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>ja([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 z_(o,r,()=>O2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return vf(o).includes(r)},ownKeys(o){return vf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ms(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:V_(n,i),setContext:l=>Ms(n,l,t,i),override:l=>Ms(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 z_(l,o,()=>S2(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 V_(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 w2=(n,e)=>n?n+Ea(e):e,Ha=(n,e)=>Ke(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function z_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function S2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Ci(r)&&o.isScriptable(e)&&(r=T2(e,r,n,t)),gt(r)&&r.length&&(r=$2(e,r,n,o.isIndexable)),Ha(e,r)&&(r=Ms(r,s,l&&l[e],o)),r}function T2(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),Ha(n,e)&&(e=Va(s._scopes,s,n,e)),e}function $2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(In(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=Va(u,s,n,f);e.push(Ms(c,l,o&&o[n],r))}}return e}function B_(n,e,t){return Ci(n)?n(e,t):n}const C2=(n,e)=>n===!0?e:typeof n=="string"?$i(e,n):void 0;function M2(n,e,t,i,s){for(const l of e){const o=C2(t,l);if(o){n.add(o);const r=B_(o._fallback,t,s);if(In(r)&&r!==t&&r!==i)return r}else if(o===!1&&In(i)&&t!==i)return null}return!1}function Va(n,e,t,i){const s=e._rootScopes,l=B_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=bf(r,o,t,l||t,i);return a===null||In(l)&&l!==t&&(a=bf(r,o,l,a,i),a===null)?!1:ja(Array.from(r),[""],s,l,()=>D2(e,t,i))}function bf(n,e,t,i,s){for(;t;)t=M2(n,e,t,i,s);return t}function D2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return gt(s)&&Ke(t)?t:s}function O2(n,e,t,i){let s;for(const l of e)if(s=U_(w2(l,n),t),In(s))return Ha(n,s)?Va(t,i,n,s):s}function U_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(In(i))return i}}function vf(n){let e=n._keys;return e||(e=n._keys=E2(n._scopes)),e}function E2(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 W_(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($i(f,l),u)};return o}const A2=Number.EPSILON||1e-14,Ds=(n,e)=>e<n.length&&!n[e].skip&&n[e],Y_=n=>n==="x"?"y":"x";function I2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Zr(l,s),a=Zr(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 P2(n,e,t){const i=n.length;let s,l,o,r,a,u=Ds(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Ds(n,f+1),!(!a||!u)){if(nl(e[f],0,A2)){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 L2(n,e,t="x"){const i=Y_(t),s=n.length;let l,o,r,a=Ds(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Ds(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 N2(n,e="x"){const t=Y_(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Ds(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Ds(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]}P2(n,s,l),L2(n,l,e)}function Zl(n,e,t){return Math.max(Math.min(n,t),e)}function F2(n,e){let t,i,s,l,o,r=hl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&hl(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 R2(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")N2(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=I2(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&&F2(n,t)}function K_(){return typeof window<"u"&&typeof document<"u"}function za(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Do(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 Wo=n=>window.getComputedStyle(n,null);function q2(n,e){return Wo(n).getPropertyValue(e)}const j2=["top","right","bottom","left"];function Zi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=j2[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const H2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function V2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(H2(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=Wo(t),l=s.boxSizing==="border-box",o=Zi(s,"padding"),r=Zi(s,"border","width"),{x:a,y:u,box:f}=V2(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 z2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=za(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(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=Do(r.maxWidth,l,"clientWidth"),s=Do(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||So,maxHeight:s||So}}const cr=n=>Math.round(n*10)/10;function B2(n,e,t,i){const s=Wo(n),l=Zi(s,"margin"),o=Do(s.maxWidth,n,"clientWidth")||So,r=Do(s.maxHeight,n,"clientHeight")||So,a=z2(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=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function yf(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 U2=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 kf(n,e){const t=q2(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 W2(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 Y2(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 wf=new Map;function K2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=wf.get(t);return i||(i=new Intl.NumberFormat(n,e),wf.set(t,i)),i}function El(n,e,t){return K2(e,t).format(n)}const J2=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}}},Z2=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?J2(e,t):Z2()}function G2(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 X2(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function J_(n){return n==="angle"?{between:pl,compare:Ly,normalize:bn}:{between:ml,compare:(e,t)=>e-t,normalize:e=>e}}function Sf({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 Q2(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=J_(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 Z_(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=J_(i),{start:f,end:c,loop:d,style:m}=Q2(n,e,t),h=[];let g=!1,b=null,k,y,T;const $=()=>a(s,T,k)&&r(s,T)!==0,M=()=>r(l,k)===0||a(l,T,k),C=()=>g||$(),D=()=>!g||M();for(let E=f,P=f;E<=c;++E)y=e[E%o],!y.skip&&(k=u(y[i]),k!==T&&(g=a(k,s,l),b===null&&C()&&(b=r(k,s)===0?E:P),b!==null&&D()&&(h.push(Sf({start:b,end:E,loop:d,count:o,style:m})),b=null),P=E,T=k));return b!==null&&h.push(Sf({start:b,end:c,loop:d,count:o,style:m})),h}function G_(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=Z_(i[s],n.points,e);l.length&&t.push(...l)}return t}function x2(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 ek(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 tk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=x2(t,s,l,i);if(i===!0)return Tf(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 Tf(n,ek(t,o,a,u),t,e)}function Tf(n,e,t,i){return!i||!i.setContext||!t?e:nk(n,e,t,i)}function nk(n,e,t,i){const s=n._chart.getContext(),l=$f(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function m(h,g,b,k){const y=r?-1:1;if(h!==g){for(h+=a;t[h%a].skip;)h-=y;for(;t[g%a].skip;)g+=y;h%a!==g%a&&(u.push({start:h%a,end:g%a,loop:b,style:k}),f=k,c=g%a)}}for(const h of e){c=r?c:h.start;let g=t[c%a],b;for(d=c+1;d<=h.end;d++){const k=t[d%a];b=$f(i.setContext(Oi(s,{type:"segment",p0:g,p1:k,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),ik(b,f)&&m(c,d-1,h.loop,f),g=k,f=b}c<d-1&&m(c,d-1,h.loop,f)}return u}function $f(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function ik(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 sk{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=A_.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 sk;const Cf="transparent",lk={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=gf(n||Cf),s=i.valid&&gf(e||Cf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class ok{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||lk[e.type||typeof o],this._easing=il[e.easing]||il.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 rk=["x","y","borderWidth","radius","tension"],ak=["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 uk=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:ak},numbers:{type:"number",properties:rk}});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 X_{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 uk)l[o]=s[o];(gt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=ck(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&fk(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 ok(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 fk(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 ck(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 Mf(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 dk(n,e,t){if(t===!1)return!1;const i=Mf(n,t),s=Mf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function pk(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 Q_(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 Df(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],$t(u)&&(l||e===0||Gn(e)===Gn(u))&&(e+=u)}return e}}function mk(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 Of(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function hk(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function gk(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 _k(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Ef(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 Af(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=hk(l,o,i),c=e.length;let d;for(let m=0;m<c;++m){const h=e[m],{[a]:g,[u]:b}=h,k=h._stacks||(h._stacks={});d=k[u]=_k(s,f,g),d[r]=b,d._top=Ef(d,o,!0,i.type),d._bottom=Ef(d,o,!1,i.type)}}function pr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function bk(n,e){return Oi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function vk(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 Bs(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 mr=n=>n==="reset"||n==="none",If=(n,e)=>e?n:Object.assign({},n),yk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Q_(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=Of(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Bs(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,pr(e,"x")),o=t.yAxisID=Xe(i.yAxisID,pr(e,"y")),r=t.rAxisID=Xe(i.rAxisID,pr(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&&af(this._data,this),e._stacked&&Bs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Ke(t))this._data=mk(t);else if(i!==t){if(i){af(i,this);const s=this._cachedMeta;Bs(s),s._parsed=[]}t&&Object.isExtensible(t)&&qy(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=Of(t.vScale,t),t.stack!==i.stack&&(s=!0,Bs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Af(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{gt(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&&Af(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($i(m,r),d),y:o.parse($i(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:Q_(s,!0),values:t._stacks[e.axis]};return Df(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=Df(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=yk(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=gk(r);let d,m;function h(){m=s[d];const g=m[r.axis];return!$t(m[e.axis])||f>g||c<g}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],$t(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=pk(Xe(this.options.clip,dk(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=vk(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=bk(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&&In(i);if(r)return If(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),g=u.resolveNamedOptions(d,m,h,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(If(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new X_(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||mr(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){mr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!mr(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&&Bs(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 kk(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=E_(i.sort((s,l)=>s-l))}return n._cache.$bar}function wk(n){const e=n.iScale,t=kk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(In(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 Sk(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 Tk(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 $k(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 x_(n,e,t,i){return gt(n)?$k(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Pf(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(x_(d,c,l,u));return a}function hr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ck(n,e,t){return n!==0?Gn(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Mk(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 Dk(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}=Mk(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Lf(f,o,r,a)]=!0,s=u)),l[Lf(s,o,r,a)]=!0,n.borderSkipped=l}function Lf(n,e,t,i){return i?(n=Ok(n,e,t),n=Nf(n,t,e)):n=Nf(n,e,t),n}function Ok(n,e,t){return n===e?t:n===t?e:n}function Nf(n,e,t){return n==="start"?e:n==="end"?t:n}function Ek(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ba extends Un{parsePrimitiveData(e,t,i,s){return Pf(e,t,i,s)}parseArrayData(e,t,i,s){return Pf(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,g;for(d=i,m=i+s;d<m;++d)g=t[d],h={},h[l.axis]=l.parse($i(g,u),d),c.push(x_($i(g,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=hr(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),g=l||at(h[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,f),k=(h._stacks||{})[r.axis],y={horizontal:u,base:g.base,enableBorderRadius:!k||hr(h._custom)||o===k._top||o===k._bottom,x:u?g.head:b.center,y:u?b.center:g.head,height:u?b.size:Math.abs(g.size),width:u?Math.abs(g.size):b.size};d&&(y.options=c||this.resolveDataElementOptions(m,e[m].active?"active":s));const T=y.options||e[m].options;Dk(y,T,k,o),Ek(y,T,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||wk(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=hr(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 g=!at(s)&&!u?s:c;let b=t.getPixelForValue(g);if(this.chart.getDataVisibility(e)?m=t.getPixelForValue(c+d):m=b,h=m-b,Math.abs(h)<l){h=Ck(h,t,o)*l,f===o&&(b-=h/2);const k=t.getPixelForDecimal(0),y=t.getPixelForDecimal(1),T=Math.min(k,y),$=Math.max(k,y);b=Math.max(Math.min(b,$),T),m=b+h}if(b===t.getPixelForValue(o)){const k=Gn(h)*t.getLineWidthForValue(o)/2;b+=k,h-=k}return{size:h,base:b,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"?Tk(e,t,s,u):Sk(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)}}Ba.id="bar";Ba.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ba.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ua 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),g={},b=g[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(h[f]),k=g[c]=l?r.getBasePixel():r.getPixelForValue(h[c]);g.skip=isNaN(b)||isNaN(k),u&&(g.options=a||this.resolveDataElementOptions(d,m.active?"active":s),l&&(g.options.radius=0)),this.updateElement(m,d,g,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}}Ua.id="bubble";Ua.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ua.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Ak(n,e,t){let i=1,s=1,l=0,o=0;if(e<ct){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)=>pl(T,r,a,!0)?1:Math.max($,$*t,M,M*t),h=(T,$,M)=>pl(T,r,a,!0)?-1:Math.min($,$*t,M,M*t),g=m(0,u,c),b=m(kt,f,d),k=h(Tt,u,c),y=h(Tt+kt,f,d);i=(g-k)/2,s=(b-y)/2,l=-(g+k)/2,o=-(b+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=>+$i(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Hn(this.options.rotation-90)}_getCircumference(){return Hn(this.options.circumference)}_getRotationExtents(){let e=ct,t=-ct;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(Ty(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:m,offsetX:h,offsetY:g}=Ak(c,f,a),b=(i.width-o)/d,k=(i.height-o)/m,y=Math.max(Math.min(b,k)/2,0),T=$_(this.options.radius,y),$=Math.max(T*a,0),M=(T-$)/this._getVisibleDatasetWeightTotal();this.offsetX=h*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-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/ct)}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:g,includeOptions:b}=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 T=this._circumference(y,l),$=e[y],M={x:f+this.offsetX,y:c+this.offsetY,startAngle:k,endAngle:k+T,circumference:T,outerRadius:h,innerRadius:m};b&&(M.options=g||this.resolveDataElementOptions(y,$.active?"active":s)),k+=T,this.updateElement($,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)?ct*(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 gt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo 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}=P_(t,s,o);this._drawStart=r,this._drawCount=a,L_(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:g}=this.options,b=Cs(h)?h:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let y=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){const $=e[T],M=this.getParsed(T),C=k?$:{},D=at(M[m]),E=C[d]=o.getPixelForValue(M[d],T),P=C[m]=l||D?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[m],T);C.skip=isNaN(E)||isNaN(P)||D,C.stop=T>0&&Math.abs(M[d]-y[d])>b,g&&(C.parsed=M,C.raw=u.data[T]),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()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Wa 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 W_.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*Tt;let m=d,h;const g=360/this.countVisibleElements();for(h=0;h<t;++h)m+=this._computeAngle(h,s,g);for(h=t;h<t+i;h++){const b=e[h];let k=m,y=m+this._computeAngle(h,s,g),T=o.getDataVisibility(h)?u.getDistanceFromCenterForValue(this.getParsed(h).r):0;m=y,l&&(a.animateScale&&(T=0),a.animateRotate&&(k=y=d));const $={x:f,y:c,innerRadius:0,outerRadius:T,startAngle:k,endAngle:y,options:this.resolveDataElementOptions(h,b.active?"active":s)};this.updateElement(b,h,$,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)?Hn(this.resolveDataElementOptions(e,t).angle||i):0}}Wa.id="polarArea";Wa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Wa.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 eb extends Al{}eb.id="pie";eb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Ya 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 W_.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)}}}Ya.id="radar";Ya.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Ya.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 Cs(this.x)&&Cs(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 tb={values(n){return gt(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=Ik(n,t)}const o=On(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(On(n)));return i===1||i===2||i===5?tb.numeric.call(this,n,e,t):""}};function Ik(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 Ko={formatters:tb};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:Ko.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 Pk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Lk(n),s=t.major.enabled?Fk(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Rk(e,a,s,l/i),a;const u=Nk(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 Lk(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 Nk(n,e,t){const i=qk(n),s=e.length/t;if(!i)return Math.max(s,1);const l=Iy(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 Fk(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function Rk(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 qk(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 jk=n=>n==="left"?"right":n==="right"?"left":n,Ff=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Rf(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 Hk(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 Vk(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 Us(n){return n.drawTicks?n.tickLength:0}function qf(n,e){if(!n.display)return 0;const t=vn(n.font,e),i=Pn(n.padding);return(gt(n.text)?n.text.length:1)*t.lineHeight+i.height}function zk(n,e){return Oi(n,{scale:e,type:"scale"})}function Bk(n,e,t){return Oi(n,{tick:t,index:e,type:"tick"})}function Uk(n,e,t){let i=Hy(n);return(t&&e!=="right"||!t&&e==="right")&&(i=jk(i)),i}function Wk(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 g=o-s,b=r-l;if(n.isHorizontal()){if(m=uf(i,l,r),Ke(t)){const k=Object.keys(t)[0],y=t[k];h=f[k].getPixelForValue(y)+g-e}else t==="center"?h=(u.bottom+u.top)/2+g-e:h=Ff(n,t,e);d=r-l}else{if(Ke(t)){const k=Object.keys(t)[0],y=t[k];m=f[k].getPixelForValue(y)-b+e}else t==="center"?m=(u.left+u.right)/2-b+e:m=Ff(n,t,e);h=uf(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=$n(e,Number.POSITIVE_INFINITY),t=$n(t,Number.NEGATIVE_INFINITY),i=$n(i,Number.POSITIVE_INFINITY),s=$n(s,Number.NEGATIVE_INFINITY),{min:$n(e,i),max:$n(t,s),minDefined:$t(e),maxDefined:$t(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:$n(t,$n(i,t)),max:$n(i,$n(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=k2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Rf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Pk(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-Us(e.grid)-t.padding-qf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Aa(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=qf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Us(l)+a):(e.height=this.maxHeight,e.width=Us(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Hn(this.labelRotation),g=Math.cos(h),b=Math.sin(h);if(r){const k=i.mirror?0:b*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:g*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,b,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=s*e.width,m=i*t.height):(d=i*e.height,m=s*t.width):l==="start"?m=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){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=Rf(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,g,b,k,y,T;for(u=0;u<t;++u){if(d=e[u].label,m=this._resolveTickFontOptions(u),i.font=h=m.string,g=s[h]=s[h]||{data:{},gc:[]},b=m.lineHeight,k=y=0,!at(d)&&!gt(d))k=$o(i,g.data,g.gc,k,d),y=b;else if(gt(d))for(f=0,c=d.length;f<c;++f)T=d[f],!at(T)&&!gt(T)&&(k=$o(i,g.data,g.gc,k,T),y+=b);l.push(k),o.push(y),r=Math.max(k,r),a=Math.max(y,a)}Vk(s,t);const $=l.indexOf(r),M=o.indexOf(a),C=D=>({width:l[D]||0,height:o[D]||0});return{first:C(0),last:C(t-1),widest:C($),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 Ny(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=Bk(this.getContext(),e,i))}return this.$context||(this.$context=zk(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Hn(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=Us(l),d=[],m=l.setContext(this.getContext()),h=m.drawBorder?m.borderWidth:0,g=h/2,b=function(se){return ji(i,se,h)};let k,y,T,$,M,C,D,E,P,L,N,F;if(o==="top")k=b(this.bottom),C=this.bottom-c,E=k-g,L=b(e.top)+g,F=e.bottom;else if(o==="bottom")k=b(this.top),L=e.top,F=b(e.bottom)-g,C=k+g,E=this.top+c;else if(o==="left")k=b(this.right),M=this.right-c,D=k-g,P=b(e.left)+g,N=e.right;else if(o==="right")k=b(this.left),P=e.left,N=b(e.right)-g,M=k+g,D=this.left+c;else if(t==="x"){if(o==="center")k=b((e.top+e.bottom)/2+.5);else if(Ke(o)){const se=Object.keys(o)[0],W=o[se];k=b(this.chart.scales[se].getPixelForValue(W))}L=e.top,F=e.bottom,C=k+g,E=C+c}else if(t==="y"){if(o==="center")k=b((e.left+e.right)/2);else if(Ke(o)){const se=Object.keys(o)[0],W=o[se];k=b(this.chart.scales[se].getPixelForValue(W))}M=k-g,D=M-c,P=e.left,N=e.right}const R=Xe(s.ticks.maxTicksLimit,f),X=Math.max(1,Math.ceil(f/R));for(y=0;y<f;y+=X){const se=l.setContext(this.getContext(y)),W=se.lineWidth,G=se.color,te=se.borderDash||[],K=se.borderDashOffset,re=se.tickWidth,J=se.tickColor,de=se.tickBorderDash||[],_e=se.tickBorderDashOffset;T=Hk(this,y,r),T!==void 0&&($=ji(i,T,W),a?M=D=P=N=$:C=E=L=F=$,d.push({tx1:M,ty1:C,tx2:D,ty2:E,x1:P,y1:L,x2:N,y2:F,width:W,color:G,borderDash:te,borderDashOffset:K,tickWidth:re,tickColor:J,tickBorderDash:de,tickBorderDashOffset:_e}))}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=Us(i.grid),m=d+f,h=c?-f:m,g=-Hn(this.labelRotation),b=[];let k,y,T,$,M,C,D,E,P,L,N,F,R="middle";if(s==="top")C=this.bottom-h,D=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+h,D=this._getXAxisLabelAlignment();else if(s==="left"){const se=this._getYAxisLabelAlignment(d);D=se.textAlign,M=se.x}else if(s==="right"){const se=this._getYAxisLabelAlignment(d);D=se.textAlign,M=se.x}else if(t==="x"){if(s==="center")C=(e.top+e.bottom)/2+m;else if(Ke(s)){const se=Object.keys(s)[0],W=s[se];C=this.chart.scales[se].getPixelForValue(W)+m}D=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-m;else if(Ke(s)){const se=Object.keys(s)[0],W=s[se];M=this.chart.scales[se].getPixelForValue(W)}D=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?R="top":a==="end"&&(R="bottom"));const X=this._getLabelSizes();for(k=0,y=r.length;k<y;++k){T=r[k],$=T.label;const se=l.setContext(this.getContext(k));E=this.getPixelForTick(k)+l.labelOffset,P=this._resolveTickFontOptions(k),L=P.lineHeight,N=gt($)?$.length:1;const W=N/2,G=se.color,te=se.textStrokeColor,K=se.textStrokeWidth;let re=D;o?(M=E,D==="inner"&&(k===y-1?re=this.options.reverse?"left":"right":k===0?re=this.options.reverse?"right":"left":re="center"),s==="top"?u==="near"||g!==0?F=-N*L+L/2:u==="center"?F=-X.highest.height/2-W*L+L:F=-X.highest.height+L/2:u==="near"||g!==0?F=L/2:u==="center"?F=X.highest.height/2-W*L:F=X.highest.height-N*L,c&&(F*=-1)):(C=E,F=(1-N)*L/2);let J;if(se.showLabelBackdrop){const de=Pn(se.backdropPadding),_e=X.heights[k],$e=X.widths[k];let Ne=C+F-de.top,Re=M-de.left;switch(R){case"middle":Ne-=_e/2;break;case"bottom":Ne-=_e;break}switch(D){case"center":Re-=$e/2;break;case"right":Re-=$e;break}J={left:Re,top:Ne,width:$e+de.width,height:_e+de.height,color:se.backdropColor}}b.push({rotation:g,label:$,font:P,color:G,strokeColor:te,strokeWidth:K,textOffset:F,textAlign:re,textBaseline:R,translation:[M,C],backdrop:J})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Hn(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&&Fa(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;Co(i,f,0,c,u,a)}s&&Ra(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=vn(i.font),o=Pn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||Ke(t)?(a+=o.bottom,gt(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=Wk(this,a,t,r);Co(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:Uk(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;Jk(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,Yk(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 Yk(n,e,t){const i=dl(Object.create(null),[t?Qe.get(t):{},Qe.get(e),n.defaults]);Qe.set(e,i),n.defaultRoutes&&Kk(e,n.defaultRoutes),n.descriptors&&Qe.describe(e,n.descriptors)}function Kk(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 Jk(n){return"id"in n&&"defaults"in n}class Zk{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=Ea(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 Zk;class Ka extends Un{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=P_(t,i,s);if(this._drawStart=l,this._drawCount=o,L_(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:g,segment:b}=this.options,k=Cs(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let T=t>0&&this.getParsed(t-1);for(let $=t;$<t+i;++$){const M=e[$],C=this.getParsed($),D=y?M:{},E=at(C[h]),P=D[m]=o.getPixelForValue(C[m],$),L=D[h]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,C,a):C[h],$);D.skip=isNaN(P)||isNaN(L)||E,D.stop=$>0&&Math.abs(C[m]-T[m])>k,b&&(D.parsed=C,D.raw=u.data[$]),d&&(D.options=c||this.resolveDataElementOptions($,M.active?"active":s)),y||this.updateElement(M,$,D,s),T=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}}Ka.id="scatter";Ka.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ka.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 xr{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()}}xr.override=function(n){Object.assign(xr.prototype,n)};var nb={_date:xr};function Gk(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?Fy: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}=Gk(l[r],e,o,s);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function Xk(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&&!hl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Qk(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=D_(o,{x:e.x,y:e.y});pl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Il(n,t,e,l),s}function xk(n,e,t,i,s,l){let o=[];const r=Xk(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 b=r(e,h);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Il(n,t,e,u),o}function _r(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Qk(n,e,t,s):xk(n,e,t,i,s,l)}function jf(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 ew={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):_r(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):_r(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 _r(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Bi(e,n);return jf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Bi(e,n);return jf(n,s,"y",t.intersect,i)}}};const ib=["left","top","right","bottom"];function Ws(n,e){return n.filter(t=>t.pos===e)}function Hf(n,e){return n.filter(t=>ib.indexOf(t.pos)===-1&&t.box.axis===e)}function Ys(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 tw(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 nw(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!ib.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 iw(n,e){const t=nw(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 sw(n){const e=tw(n),t=Ys(e.filter(u=>u.box.fullSize),!0),i=Ys(Ws(e,"left"),!0),s=Ys(Ws(e,"right")),l=Ys(Ws(e,"top"),!0),o=Ys(Ws(e,"bottom")),r=Hf(e,"x"),a=Hf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ws(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Vf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function sb(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 lw(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&&sb(o,l.getPadding());const r=Math.max(0,e.outerWidth-Vf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Vf(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 ow(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 rw(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 Qs(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,rw(r.horizontal,e));const{same:c,other:d}=lw(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&Qs(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 zf(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;In(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;In(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=Pn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=sw(n.boxes),a=r.vertical,u=r.horizontal;ut(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);sb(d,Pn(i));const m=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=iw(a.concat(u),c);Qs(r.fullSize,m,c,h),Qs(a,m,c,h),Qs(u,m,c,h)&&Qs(a,m,c,h),ow(m),zf(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,zf(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,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class lb{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 aw extends lb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",uw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bf=n=>n===null||n==="";function fw(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",Bf(s)){const l=kf(n,"width");l!==void 0&&(n.width=l)}if(Bf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=kf(n,"height");l!==void 0&&(n.height=l)}return n}const ob=U2?{passive:!0}:!1;function cw(n,e,t){n.addEventListener(e,t,ob)}function dw(n,e,t){n.canvas.removeEventListener(e,t,ob)}function pw(n,e){const t=uw[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 Oo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function mw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Oo(r.addedNodes,i),o=o&&!Oo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function hw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Oo(r.removedNodes,i),o=o&&!Oo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const gl=new Map;let Uf=0;function rb(){const n=window.devicePixelRatio;n!==Uf&&(Uf=n,gl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function gw(n,e){gl.size||window.addEventListener("resize",rb),gl.set(n,e)}function _w(n){gl.delete(n),gl.size||window.removeEventListener("resize",rb)}function bw(n,e,t){const i=n.canvas,s=i&&za(i);if(!s)return;const l=I_((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),gw(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&_w(n)}function vw(n,e,t){const i=n.canvas,s=I_(l=>{n.ctx!==null&&t(pw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return cw(i,e,s),s}class yw extends lb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(fw(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:mw,detach:hw,resize:bw}[t]||vw;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||dw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return B2(e,t,i,s)}isAttached(e){const t=za(e);return!!(t&&t.isConnected)}}function kw(n){return!K_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?aw:yw}class ww{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=Sw(i);return s===!1&&!t?[]:$w(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 Sw(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 Tw(n,e){return!e&&n===!1?null:n===!0?{}:n}function $w(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=Tw(i[a],s);u!==null&&l.push({plugin:r,options:Cw(n.config,{plugin:r,local:t[a]},u,o)})}return l}function Cw(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 ea(n,e){const t=Qe.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Mw(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function Dw(n,e){return n===e?"_index_":"_value_"}function Ow(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ta(n,e){return n==="x"||n==="y"?n:e.axis||Ow(e.position)||n.charAt(0).toLowerCase()}function Ew(n,e){const t=xi[n.type]||{scales:{}},i=e.scales||{},s=ea(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=ta(r,a),f=Dw(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=tl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||ea(a,e),c=(xi[a]||{}).scales||{};Object.keys(c).forEach(d=>{const m=Mw(d,u),h=r[m+"AxisID"]||l[m]||m;o[h]=o[h]||Object.create(null),tl(o[h],[{axis:m},i[h],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];tl(a,[Qe.scales[a.type],Qe.scale])}),o}function ab(n){const e=n.options||(n.options={});e.plugins=Xe(e.plugins,{}),e.scales=Ew(n,e)}function ub(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Aw(n){return n=n||{},n.data=ub(n.data),ab(n),n}const Wf=new Map,fb=new Set;function eo(n,e){let t=Wf.get(n);return t||(t=e(),Wf.set(n,t),fb.add(t)),t}const Ks=(n,e,t)=>{const i=$i(e,t);i!==void 0&&n.add(i)};class Iw{constructor(e){this._config=Aw(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=ub(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(),ab(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=>Ks(a,e,c))),f.forEach(c=>Ks(a,s,c)),f.forEach(c=>Ks(a,xi[l]||{},c)),f.forEach(c=>Ks(a,Qe,c)),f.forEach(c=>Ks(a,Xr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),fb.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}=Yf(this._resolverCache,e,s);let a=o;if(Lw(o,t)){l.$shared=!1,i=Ci(i)?i():i;const u=this.createResolver(e,i,r);a=Ms(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Yf(this._resolverCache,e,i);return Ke(t)?Ms(l,t,void 0,s):l}}function Yf(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:ja(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const Pw=n=>Ke(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Ci(n[t]),!1);function Lw(n,e){const{isScriptable:t,isIndexable:i}=V_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Ci(r)||Pw(r))||o&&gt(r))return!0}return!1}var Nw="3.9.1";const Fw=["top","bottom","left","right","chartArea"];function Kf(n,e){return n==="top"||n==="bottom"||Fw.indexOf(n)===-1&&e==="x"}function Jf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Zf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),yt(t&&t.onComplete,[n],e)}function Rw(n){const e=n.chart,t=e.options.animation;yt(t&&t.onProgress,[n],e)}function cb(n){return K_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Eo={},db=n=>{const e=cb(n);return Object.values(Eo).filter(t=>t.canvas===e).pop()};function qw(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 jw(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Ao{constructor(e,t){const i=this.config=new Iw(t),s=cb(e),l=db(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||kw(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=Sy(),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 ww,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=jy(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Eo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ii.listen(this,"complete",Zf),ii.listen(this,"progress",Rw),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():yf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return _f(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,yf(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=ta(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=ta(a,r),f=Xe(r.type,o.dtype);(r.position===void 0||Kf(r.position,u)!==Kf(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(Jf("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||ea(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(Jf("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);(!sf(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;qw(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(!sf(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(),Zf({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&&Fa(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&&Ra(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return hl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=ew.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);In(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(),_f(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Eo[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}});!ko(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=Oy(e),u=jw(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=!ko(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 Gf=()=>ut(Ao.instances,n=>n._plugins.invalidate()),hi=!0;Object.defineProperties(Ao,{defaults:{enumerable:hi,value:Qe},instances:{enumerable:hi,value:Eo},overrides:{enumerable:hi,value:xi},registry:{enumerable:hi,value:Zn},version:{enumerable:hi,value:Nw},getChart:{enumerable:hi,value:db},register:{enumerable:hi,value:(...n)=>{Zn.add(...n),Gf()}},unregister:{enumerable:hi,value:(...n)=>{Zn.remove(...n),Gf()}}});function pb(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 Hw(n){return qa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vw(n,e,t,i){const s=Hw(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 ps(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function na(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 se=f>0?f-i:0,W=c>0?c-i:0,G=(se+W)/2,te=G!==0?h*G/(G+i):h;m=(h-te)/2}const g=Math.max(.001,h*c-t/Tt)/c,b=(h-g)/2,k=a+b+m,y=s-b-m,{outerStart:T,outerEnd:$,innerStart:M,innerEnd:C}=Vw(e,d,c,y-k),D=c-T,E=c-$,P=k+T/D,L=y-$/E,N=d+M,F=d+C,R=k+M/N,X=y-C/F;if(n.beginPath(),l){if(n.arc(o,r,c,P,L),$>0){const G=ps(E,L,o,r);n.arc(G.x,G.y,$,L,y+kt)}const se=ps(F,y,o,r);if(n.lineTo(se.x,se.y),C>0){const G=ps(F,X,o,r);n.arc(G.x,G.y,C,y+kt,X+Math.PI)}if(n.arc(o,r,d,y-C/d,k+M/d,!0),M>0){const G=ps(N,R,o,r);n.arc(G.x,G.y,M,R+Math.PI,k-kt)}const W=ps(D,k,o,r);if(n.lineTo(W.x,W.y),T>0){const G=ps(D,P,o,r);n.arc(G.x,G.y,T,k-kt,P)}}else{n.moveTo(o,r);const se=Math.cos(P)*c+o,W=Math.sin(P)*c+r;n.lineTo(se,W);const G=Math.cos(L)*c+o,te=Math.sin(L)*c+r;n.lineTo(G,te)}n.closePath()}function zw(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){na(n,e,t,i,o+ct,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%ct,r%ct===0&&(a+=ct))}return na(n,e,t,i,a,s),n.fill(),a}function Bw(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&&pb(n,e,l+ct),n.beginPath(),n.arc(i,s,u,l+ct,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+ct),f=0;f<r;++f)n.stroke()}function Uw(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&&Bw(n,e,u),u&&pb(n,e,s),na(n,e,t,i,s,l),n.stroke())}class Ja 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}=D_(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)>=ct||pl(l,r,a),g=ml(o,u+d,f+d);return h&&g}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>ct?Math.floor(i/ct):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>=Tt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=zw(e,this,r,l,o);Uw(e,this,r,l,a,o),e.restore()}}Ja.id="arc";Ja.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ja.defaultRoutes={backgroundColor:"backgroundColor"};function mb(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 Ww(n,e,t){n.lineTo(t.x,t.y)}function Yw(n){return n.stepped?p2:n.tension||n.cubicInterpolationMode==="monotone"?m2:Ww}function hb(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 Kw(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=hb(s,t,i),f=Yw(l);let{move:c=!0,reverse:d}=i||{},m,h,g;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,g,h,d,l.stepped),g=h);return a&&(h=s[(r+(d?u:0))%o],f(n,g,h,d,l.stepped)),!!a}function Jw(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=hb(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,g,b,k;const y=$=>(o+(u?r-$:$))%l,T=()=>{g!==b&&(n.lineTo(f,b),n.lineTo(f,g),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 $=m.x,M=m.y,C=$|0;C===h?(M<g?g=M:M>b&&(b=M),f=(c*f+$)/++c):(T(),n.lineTo($,M),h=C,c=0,g=b=M),k=M}T()}function ia(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?Jw:Kw}function Zw(n){return n.stepped?W2:n.tension||n.cubicInterpolationMode==="monotone"?Y2:Ui}function Gw(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),mb(n,e.options),n.stroke(s)}function Xw(n,e,t,i){const{segments:s,options:l}=e,o=ia(e);for(const r of s)mb(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const Qw=typeof Path2D=="function";function xw(n,e,t,i){Qw&&!e.options.segment?Gw(n,e,t,i):Xw(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;R2(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=tk(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=G_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=Zw(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 g=Math.abs((s-m[t])/(h[t]-m[t])),b=a(m,h,g,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return ia(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=ia(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(),xw(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 Jo 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||!hl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Qr(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Jo.id="point";Jo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Jo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function gb(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 eS(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=H_(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 tS(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=vs(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 nS(n){const e=gb(n),t=e.right-e.left,i=e.bottom-e.top,s=eS(n,t/2,i/2),l=tS(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 vr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&gb(n,i);return r&&(s||ml(e,r.left,r.right))&&(l||ml(t,r.top,r.bottom))}function iS(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function sS(n,e){n.rect(e.x,e.y,e.w,e.h)}function yr(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 Za 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}=nS(this),r=iS(o.radius)?Mo:sS;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,yr(o,t,l)),e.clip(),r(e,yr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,yr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return vr(this,e,t,i)}inXRange(e,t){return vr(this,e,null,t)}inYRange(e,t){return vr(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}}Za.id="bar";Za.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Za.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function lS(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=Ga(a,u,s);const f=sa(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=G_(e,f);for(const d of c){const m=sa(t,l[d.start],l[d.end],d.loop),h=Z_(r,s,m);for(const g of h)o.push({source:g,target:d,start:{[t]:Qf(f,m,"start",Math.max)},end:{[t]:Qf(f,m,"end",Math.min)}})}}return o}function sa(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 oS(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Ga(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 Ga(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Qf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function _b(n,e){let t=[],i=!1;return gt(n)?(i=!0,t=n):t=oS(n,e),t.length?new Ei({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function xf(n){return n&&n.fill!==!1}function rS(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(!$t(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function aS(n,e,t){const i=dS(n);if(Ke(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return $t(s)&&Math.floor(s)===s?uS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function uS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function fS(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 cS(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 dS(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 pS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=mS(e,t);r.push(_b({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++)hS(s,o[f],r)}return new Ei({points:s,options:{}})}function mS(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 hS(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=gS(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function gS(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(ml(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class bb{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:ct},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 _S(n){const{chart:e,fill:t,line:i}=n;if($t(t))return bS(e,t);if(t==="stack")return pS(n);if(t==="shape")return!0;const s=vS(n);return s instanceof bb?s:_b(s,i)}function bS(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function vS(n){return(n.scale||{}).getPointPositionForValue?kS(n):yS(n)}function yS(n){const{scale:e={},fill:t}=n,i=fS(t,e);if($t(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function kS(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=cS(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new bb({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 kr(n,e,t){const i=_S(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&&(Fa(n,t),wS(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Ra(n))}function wS(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&&(ec(n,i,o.top),tc(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),ec(n,i,o.bottom)),tc(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function ec(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[Ga(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 tc(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=lS(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,SS(n,o,m&&sa(s,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(m){h?n.closePath():nc(n,i,c,s);const b=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&b,g||nc(n,i,f,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function SS(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 nc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var TS={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:aS(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=rS(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&&kr(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;xf(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!xf(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ll={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=Zr(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&&(gt(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 $S(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 ic(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=Pn(e.padding);let g=h.height,b=0,k=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=m*$+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let y=0;const T=function($){b=Math.max(b,t.measureText($).width+y)};return t.save(),t.font=u.string,ut(n.title,T),t.font=a.string,ut(n.beforeBody.concat(n.afterBody),T),y=e.displayColors?o+2+e.boxPadding:0,ut(i,$=>{ut($.before,T),ut($.lines,T),ut($.after,T)}),y=0,t.font=f.string,ut(n.footer,T),t.restore(),b+=h.width,{width:b,height:g}}function CS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function MS(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 DS(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"),MS(u,n,e,t)&&(u="center"),u}function sc(n,e,t){const i=t.yAlign||e.yAlign||CS(n,t);return{xAlign:t.xAlign||e.xAlign||DS(n,e,t,i),yAlign:i}}function OS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function ES(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function lc(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}=vs(o);let h=OS(e,r);const g=ES(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(g,0,i.height-e.height)}}function to(n,e,t){const i=Pn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function oc(n){return Kn([],si(n))}function AS(n,e,t){return Oi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function rc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class la 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 X_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=AS(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 oc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ut(e,l=>{const o={before:[],lines:[],after:[]},r=rc(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 oc(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($S(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=rc(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=ll[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=ic(this,i),u=Object.assign({},r,a),f=sc(this.chart,i,u),c=lc(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}=vs(r),{x:d,y:m}=e,{width:h,height:g}=t;let b,k,y,T,$,M;return l==="center"?($=m+g/2,s==="left"?(b=d,k=b-o,T=$+o,M=$-o):(b=d+h,k=b+o,T=$-o,M=$+o),y=b):(s==="left"?k=d+Math.max(a,f)+o:s==="right"?k=d+h-Math.max(u,c)-o:k=this.caretX,l==="top"?(T=m,$=T-o,b=k-o,y=k+o):(T=m+g,$=T+o,b=k+o,y=k-o),M=T),{x1:b,x2:k,x3:y,y1:T,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=dr(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,g=t.y+h;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},k=s.leftForLtr(m,u)+u/2,y=g+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,Qr(e,b,k,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Qr(e,b,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 b=s.leftForLtr(m,u-f),k=s.leftForLtr(s.xPlus(m,1),u-f-2),y=vs(o.borderRadius);Object.values(y).some(T=>T!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:g,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:k,y:g+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,g,u,a),e.strokeRect(b,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,g+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=dr(i.rtl,this.x,this.width),g=function(E){t.fillText(E,h.x(e.x+m),e.y+d/2),e.y+=d+l},b=h.textAlign(o);let k,y,T,$,M,C,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,b,i),t.fillStyle=i.bodyColor,ut(this.beforeBody,g),m=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,C=s.length;$<C;++$){for(k=s[$],y=this.labelTextColors[$],t.fillStyle=y,ut(k.before,g),T=k.lines,r&&T.length&&(this._drawColorBox(t,e,$,h,i),d=Math.max(c.lineHeight,a)),M=0,D=T.length;M<D;++M)g(T[M]),d=c.lineHeight;ut(k.after,g)}m=0,d=c.lineHeight,ut(this.afterBody,g),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=dr(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}=vs(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=ll[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=ic(this,e),a=Object.assign({},o,this._size),u=sc(t,e,a),f=lc(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=Pn(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),G2(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),X2(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=!ko(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||!ko(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=ll[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}la.positioners=ll;var IS={id:"tooltip",_element:la,positioners:ll,afterInit(n,e,t){t&&(n.tooltip=new la({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 PS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function LS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return PS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const NS=(n,e)=>n===null?null:Yt(Math.round(n),0,e);class oa 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:LS(i,e,Xe(t,e),this._addedLabels),NS(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}}oa.id="category";oa.defaults={ticks:{callback:oa.prototype.getLabelForValue}};function FS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=l||1,h=f-1,{min:g,max:b}=e,k=!at(o),y=!at(r),T=!at(u),$=(b-g)/(c+1);let M=of((b-g)/h/m)*m,C,D,E,P;if(M<1e-14&&!k&&!y)return[{value:g},{value:b}];P=Math.ceil(b/M)-Math.floor(g/M),P>h&&(M=of(P*M/h/m)*m),at(a)||(C=Math.pow(10,a),M=Math.ceil(M*C)/C),s==="ticks"?(D=Math.floor(g/M)*M,E=Math.ceil(b/M)*M):(D=g,E=b),k&&y&&l&&Py((r-o)/l,M/1e3)?(P=Math.round(Math.min((r-o)/M,f)),M=(r-o)/P,D=o,E=r):T?(D=k?o:D,E=y?r:E,P=u-1,M=(E-D)/P):(P=(E-D)/M,nl(P,Math.round(P),M/1e3)?P=Math.round(P):P=Math.ceil(P));const L=Math.max(rf(M),rf(D));C=Math.pow(10,at(a)?L:a),D=Math.round(D*C)/C,E=Math.round(E*C)/C;let N=0;for(k&&(d&&D!==o?(t.push({value:o}),D<o&&N++,nl(Math.round((D+N*M)*C)/C,o,ac(o,$,n))&&N++):D<o&&N++);N<P;++N)t.push({value:Math.round((D+N*M)*C)/C});return y&&d&&E!==r?t.length&&nl(t[t.length-1].value,r,ac(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!y||E===r)&&t.push({value:E}),t}function ac(n,e,{horizontal:t,minRotation:i}){const s=Hn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Io 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=FS(s,l);return e.bounds==="ticks"&&M_(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 Io{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=$t(e)?e:0,this.max=$t(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Hn(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:Ko.formatters.numeric}};function uc(n){return n/Math.pow(10,Math.floor(On(n)))===1}function RS(n,e){const t=Math.floor(On(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=$n(n.min,Math.pow(10,Math.floor(On(e.min)))),o=Math.floor(On(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:uc(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=$n(n.max,l);return s.push({value:u,major:uc(l)}),s}class vb 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=Io.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return $t(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=$t(e)?Math.max(0,e):null,this.max=$t(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(On(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=RS(t,this);return e.bounds==="ticks"&&M_(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=On(e),this._valueRange=On(this.max)-On(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(On(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}vb.id="logarithmic";vb.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function ra(n){const e=n.ticks;if(e.display&&n.display){const t=Pn(e.backdropPadding);return Xe(e.font&&e.font.size,Qe.font.size)+t.height}return 0}function qS(n,e,t){return t=gt(t)?t:[t],{w:c2(n,e.string,t),h:t.length*e.lineHeight}}function fc(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 jS(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?Tt/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=qS(n.ctx,c,n._pointLabels[a]);i[a]=d;const m=bn(n.getIndexAngle(a)+r),h=Math.round(Aa(m)),g=fc(h,f.x,d.w,0,180),b=fc(h,f.y,d.h,90,270);HS(t,e,m,g,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=VS(n,i,s)}function HS(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 VS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ra(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Tt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(Aa(bn(f.angle+kt))),d=e[u],m=US(f.y,d.h,c),h=zS(c),g=BS(f.x,d.w,h);i.push({x:f.x,y:m,textAlign:h,left:g,top:m,right:g+d.w,bottom:m+d.h})}return i}function zS(n){return n===0||n===180?"center":n<180?"left":"right"}function BS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function US(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function WS(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 g=vs(l.borderRadius),b=Pn(l.backdropPadding);t.fillStyle=h;const k=f-b.left,y=c-b.top,T=d-f+b.width,$=m-c+b.height;Object.values(g).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:k,y,w:T,h:$,radius:g}),t.fill()):t.fillRect(k,y,T,$)}Co(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function yb(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,ct);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 YS(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(),yb(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function KS(n,e,t){return Oi(n,{label:t,index:e,type:"pointLabel"})}class Zo extends Io{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=Pn(ra(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=$t(e)&&!isNaN(e)?e:0,this.max=$t(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ra(this.options))}generateTickLabels(e){Io.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?jS(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=ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return bn(e*t+Hn(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 KS(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(),yb(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&&WS(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));YS(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=Pn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Co(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={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(Go);function JS(n,e){return n-e}function cc(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)),$t(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Cs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function dc(n,e,t,i){const s=fn.length;for(let l=fn.indexOf(n);l<s-1;++l){const o=Go[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 ZS(n,e,t,i,s){for(let l=fn.length-1;l>=fn.indexOf(t);l--){const o=fn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return fn[t?fn.indexOf(t):0]}function GS(n){for(let e=fn.indexOf(n)+1,t=fn.length;e<t;++e)if(Go[fn[e]].common)return fn[e]}function pc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ia(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function XS(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 mc(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:XS(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 nb._date(e.adapters.date);s.init(t),tl(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:cc(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=$t(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=$t(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=Ry(s,l,o);return this._unit=t.unit||(i.autoSkip?dc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):ZS(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:GS(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),mc(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||dc(l.minUnit,t,i,this._getLabelCapacity(t)),r=Xe(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Cs(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++)pc(f,d,h);return(d===i||s.bounds==="ticks"||m===1)&&pc(f,d,h),Object.keys(f).sort((g,b)=>g-b).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_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=Hn(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,mc(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(cc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return E_(e.sort(JS))}}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 kb 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)}}kb.id="timeseries";kb.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 QS={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"}};nb._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 QS},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 hc(n){let e,t,i;return{c(){e=v("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 xS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=O(),s=B(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 e3(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function t3(n){let e,t,i,s,l,o=n[2]&&hc();function r(f,c){return f[2]?e3:xS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=O(),i=v("canvas"),s=O(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ir(i,"height","250px"),Ir(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),_(e,t),_(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&&A(o,1):(o=hc(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),I(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){A(o)},o(f){I(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function n3(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),pe.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),pe.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zt(()=>(Ao.register(Ei,Jo,Yo,Xa,Pl,TS,IS),t(6,o=new Ao(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){ie[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 i3 extends ye{constructor(e){super(),ve(this,e,n3,t3,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},aa={},s3={get exports(){return aa},set exports(n){aa=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(T){return T instanceof a?new a(T.type,y(T.content),T.alias):Array.isArray(T)?T.map(y):T.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,$){$=$||{};var M,C;switch(r.util.type(T)){case"Object":if(C=r.util.objId(T),$[C])return $[C];M={},$[C]=M;for(var D in T)T.hasOwnProperty(D)&&(M[D]=y(T[D],$));return M;case"Array":return C=r.util.objId(T),$[C]?$[C]:(M=[],$[C]=M,T.forEach(function(E,P){M[P]=y(E,$)}),M);default:return T}},getLanguage:function(y){for(;y;){var T=s.exec(y.className);if(T)return T[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,T){y.className=y.className.replace(RegExp(s,"gi"),""),y.classList.add("language-"+T)},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 T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==y)return T[$]}return null}},isActive:function(y,T,$){for(var M="no-"+T;y;){var C=y.classList;if(C.contains(T))return!0;if(C.contains(M))return!1;y=y.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(y,T){var $=r.util.clone(r.languages[y]);for(var M in T)$[M]=T[M];return $},insertBefore:function(y,T,$,M){M=M||r.languages;var C=M[y],D={};for(var E in C)if(C.hasOwnProperty(E)){if(E==T)for(var P in $)$.hasOwnProperty(P)&&(D[P]=$[P]);$.hasOwnProperty(E)||(D[E]=C[E])}var L=M[y];return M[y]=D,r.languages.DFS(r.languages,function(N,F){F===L&&N!=y&&(this[N]=D)}),D},DFS:function y(T,$,M,C){C=C||{};var D=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){$.call(T,E,T[E],M||E);var P=T[E],L=r.util.type(P);L==="Object"&&!C[D(P)]?(C[D(P)]=!0,y(P,$,null,C)):L==="Array"&&!C[D(P)]&&(C[D(P)]=!0,y(P,$,E,C))}}},plugins:{},highlightAll:function(y,T){r.highlightAllUnder(document,y,T)},highlightAllUnder:function(y,T,$){var M={callback:$,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,D;D=M.elements[C++];)r.highlightElement(D,T===!0,M.callback)},highlightElement:function(y,T,$){var M=r.util.getLanguage(y),C=r.languages[M];r.util.setLanguage(y,M);var D=y.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var E=y.textContent,P={element:y,language:M,grammar:C,code:E};function L(F){P.highlightedCode=F,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),$&&$.call(P.element)}if(r.hooks.run("before-sanity-check",P),D=P.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),$&&$.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){L(r.util.encode(P.code));return}if(T&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(F){L(F.data)},N.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(r.highlight(P.code,P.grammar,P.language))},highlight:function(y,T,$){var M={code:y,grammar:T,language:$};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,T){var $=T.rest;if($){for(var M in $)T[M]=$[M];delete T.rest}var C=new c;return d(C,C.head,y),f(y,C,T,C.head,0),h(C)},hooks:{all:{},add:function(y,T){var $=r.hooks.all;$[y]=$[y]||[],$[y].push(T)},run:function(y,T){var $=r.hooks.all[y];if(!(!$||!$.length))for(var M=0,C;C=$[M++];)C(T)}},Token:a};i.Prism=r;function a(y,T,$,M){this.type=y,this.content=T,this.alias=$,this.length=(M||"").length|0}a.stringify=function y(T,$){if(typeof T=="string")return T;if(Array.isArray(T)){var M="";return T.forEach(function(L){M+=y(L,$)}),M}var C={type:T.type,content:y(T.content,$),tag:"span",classes:["token",T.type],attributes:{},language:$},D=T.alias;D&&(Array.isArray(D)?Array.prototype.push.apply(C.classes,D):C.classes.push(D)),r.hooks.run("wrap",C);var E="";for(var P in C.attributes)E+=" "+P+'="'+(C.attributes[P]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+E+">"+C.content+"</"+C.tag+">"};function u(y,T,$,M){y.lastIndex=T;var C=y.exec($);if(C&&M&&C[1]){var D=C[1].length;C.index+=D,C[0]=C[0].slice(D)}return C}function f(y,T,$,M,C,D){for(var E in $)if(!(!$.hasOwnProperty(E)||!$[E])){var P=$[E];P=Array.isArray(P)?P:[P];for(var L=0;L<P.length;++L){if(D&&D.cause==E+","+L)return;var N=P[L],F=N.inside,R=!!N.lookbehind,X=!!N.greedy,se=N.alias;if(X&&!N.pattern.global){var W=N.pattern.toString().match(/[imsuy]*$/)[0];N.pattern=RegExp(N.pattern.source,W+"g")}for(var G=N.pattern||N,te=M.next,K=C;te!==T.tail&&!(D&&K>=D.reach);K+=te.value.length,te=te.next){var re=te.value;if(T.length>y.length)return;if(!(re instanceof a)){var J=1,de;if(X){if(de=u(G,K,y,R),!de||de.index>=y.length)break;var Re=de.index,_e=de.index+de[0].length,$e=K;for($e+=te.value.length;Re>=$e;)te=te.next,$e+=te.value.length;if($e-=te.value.length,K=$e,te.value instanceof a)continue;for(var Ne=te;Ne!==T.tail&&($e<_e||typeof Ne.value=="string");Ne=Ne.next)J++,$e+=Ne.value.length;J--,re=y.slice(K,$e),de.index-=K}else if(de=u(G,0,re,R),!de)continue;var Re=de.index,be=de[0],Se=re.slice(0,Re),We=re.slice(Re+be.length),lt=K+re.length;D&&lt>D.reach&&(D.reach=lt);var fe=te.prev;Se&&(fe=d(T,fe,Se),K+=Se.length),m(T,fe,J);var Ve=new a(E,F?r.tokenize(be,F):be,se,be);if(te=d(T,fe,Ve),We&&d(T,te,We),J>1){var ee={cause:E+","+L,reach:lt};f(y,T,$,te.prev,K,ee),D&&ee.reach>D.reach&&(D.reach=ee.reach)}}}}}}function c(){var y={value:null,prev:null,next:null},T={value:null,prev:y,next:null};y.next=T,this.head=y,this.tail=T,this.length=0}function d(y,T,$){var M=T.next,C={value:$,prev:T,next:M};return T.next=C,M.prev=C,y.length++,C}function m(y,T,$){for(var M=T.next,C=0;C<$&&M!==y.tail;C++)M=M.next;T.next=M,M.prev=T,y.length-=C}function h(y){for(var T=[],$=y.head.next;$!==y.tail;)T.push($.value),$=$.next;return T}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(y){var T=JSON.parse(y.data),$=T.language,M=T.code,C=T.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),C&&i.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var k=document.readyState;k==="loading"||k==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof gc<"u"&&(gc.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(g,b){return"✖ Error "+g+" while fetching file: "+b},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(g,b,k){var y=new XMLHttpRequest;y.open("GET",g,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?b(y.responseText):y.status>=400?k(s(y.status,y.statusText)):k(l))},y.send(null)}function m(g){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(b){var k=Number(b[1]),y=b[2],T=b[3];return y?T?[k,Number(T)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),t.hooks.add("before-sanity-check",function(g){var b=g.element;if(b.matches(c)){g.code="",b.setAttribute(r,a);var k=b.appendChild(document.createElement("CODE"));k.textContent=i;var y=b.getAttribute("data-src"),T=g.language;if(T==="none"){var $=(/\.(\w+)$/.exec(y)||[,"none"])[1];T=o[$]||$}t.util.setLanguage(k,T),t.util.setLanguage(b,T);var M=t.plugins.autoloader;M&&M.loadLanguages(T),d(y,function(C){b.setAttribute(r,u);var D=m(b.getAttribute("data-range"));if(D){var E=C.split(/\r\n?|\n/g),P=D[0],L=D[1]==null?E.length:D[1];P<0&&(P+=E.length),P=Math.max(0,Math.min(P-1,E.length)),L<0&&(L+=E.length),L=Math.max(0,Math.min(L,E.length)),C=E.slice(P,L).join(`
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}k.textContent=C,t.highlightElement(k)},function(C){b.setAttribute(r,f),k.textContent=C})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(c),y=0,T;T=k[y++];)t.highlightElement(T)}};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)}}()})(s3);const Js=aa;var _c={},l3={get exports(){return _c},set exports(n){_c=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="",g=!1,b=0;b<d.length;++b){var k=d[b];k==o.element?g=!0:k.nodeName==="#text"&&(g?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--b)}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}}}})})()})(l3);(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 o3(n){let e,t,i;return{c(){e=v("div"),t=v("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),_(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:Z,o:Z,d(s){s&&w(e)}}}function r3(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=Js.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Js.highlight(a,Js.languages[l]||Js.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 Js<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class wb extends ye{constructor(e){super(),ve(this,e,r3,o3,he,{class:0,content:2,language:3})}}const a3=n=>({}),bc=n=>({}),u3=n=>({}),vc=n=>({});function yc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T=n[4]&&!n[2]&&kc(n);const $=n[19].header,M=Nt($,n,n[18],vc);let C=n[4]&&n[2]&&wc(n);const D=n[19].default,E=Nt(D,n,n[18],null),P=n[19].footer,L=Nt(P,n,n[18],bc);return{c(){e=v("div"),t=v("div"),s=O(),l=v("div"),o=v("div"),T&&T.c(),r=O(),M&&M.c(),a=O(),C&&C.c(),u=O(),f=v("div"),E&&E.c(),c=O(),d=v("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),_(e,t),_(e,s),_(e,l),_(l,o),T&&T.m(o,null),_(o,r),M&&M.m(o,null),_(o,a),C&&C.m(o,null),_(l,u),_(l,f),E&&E.m(f,null),n[21](f),_(l,c),_(l,d),L&&L.m(d,null),b=!0,k||(y=[Y(t,"click",dt(n[20])),Y(f,"scroll",n[22])],k=!0)},p(N,F){n=N,n[4]&&!n[2]?T?T.p(n,F):(T=kc(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),M&&M.p&&(!b||F[0]&262144)&&Rt(M,$,n,n[18],b?Ft($,n[18],F,u3):qt(n[18]),vc),n[4]&&n[2]?C?C.p(n,F):(C=wc(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),E&&E.p&&(!b||F[0]&262144)&&Rt(E,D,n,n[18],b?Ft(D,n[18],F,null):qt(n[18]),null),L&&L.p&&(!b||F[0]&262144)&&Rt(L,P,n,n[18],b?Ft(P,n[18],F,a3):qt(n[18]),bc),(!b||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",m),(!b||F[0]&262)&&Q(l,"popup",n[2]),(!b||F[0]&4)&&Q(e,"padded",n[2]),(!b||F[0]&1)&&Q(e,"active",n[0])},i(N){b||(N&&xe(()=>{i||(i=je(t,yo,{duration:ms,opacity:0},!0)),i.run(1)}),A(M,N),A(E,N),A(L,N),xe(()=>{g&&g.end(1),h=mg(l,An,n[2]?{duration:ms,y:-10}:{duration:ms,x:50}),h.start()}),b=!0)},o(N){N&&(i||(i=je(t,yo,{duration:ms,opacity:0},!1)),i.run(0)),I(M,N),I(E,N),I(L,N),h&&h.invalidate(),g=hg(l,An,n[2]?{duration:ms,y:10}:{duration:ms,x:50}),b=!1},d(N){N&&w(e),N&&i&&i.end(),T&&T.d(),M&&M.d(N),C&&C.d(),E&&E.d(N),n[21](null),L&&L.d(N),N&&g&&g.end(),k=!1,Pe(y)}}}function kc(n){let e,t,i;return{c(){e=v("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",dt(n[5])),t=!0)},p:Z,d(s){s&&w(e),t=!1,i()}}}function wc(n){let e,t,i;return{c(){e=v("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",dt(n[5])),t=!0)},p:Z,d(s){s&&w(e),t=!1,i()}}}function f3(n){let e,t,i,s,l=n[0]&&yc(n);return{c(){e=v("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&&A(l,1)):(l=yc(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,Pe(s)}}}let Vi,wr=[];function Sb(){return Vi=Vi||document.querySelector(".overlays"),Vi||(Vi=document.createElement("div"),Vi.classList.add("overlays"),document.body.appendChild(Vi)),Vi}let ms=150;function Sc(){return 1e3+Sb().querySelectorAll(".overlay-panel-container.active").length}function c3(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=Ct(),h="op_"+z.randomString(10);let g,b,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 D(){return o}async function E(K){t(17,$=K),K?(k=document.activeElement,g==null||g.focus(),m("show")):(clearTimeout(y),k==null||k.focus(),m("hide")),await sn(),P()}function P(){g&&(o?t(6,g.style.zIndex=Sc(),g):t(6,g.style="",g))}function L(){z.pushUnique(wr,h),document.body.classList.add("overlay-active")}function N(){z.removeByValue(wr,h),wr.length||document.body.classList.remove("overlay-active")}function F(K){o&&f&&K.code=="Escape"&&!z.isInput(K.target)&&g&&g.style.zIndex==Sc()&&(K.preventDefault(),C())}function R(K){o&&X(b)}function X(K,re){re&&t(8,T=""),K&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!K)return;if(K.scrollHeight-K.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}K.scrollTop==0?t(8,T+=" scroll-top-reached"):K.scrollTop+K.offsetHeight==K.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}Zt(()=>(Sb().appendChild(g),()=>{var K;clearTimeout(y),N(),(K=g==null?void 0:g.classList)==null||K.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const se=()=>a?C():!0;function W(K){ie[K?"unshift":"push"](()=>{b=K,t(7,b)})}const G=K=>X(K.target);function te(K){ie[K?"unshift":"push"](()=>{g=K,t(6,g)})}return n.$$set=K=>{"class"in K&&t(1,l=K.class),"active"in K&&t(0,o=K.active),"popup"in K&&t(2,r=K.popup),"overlayClose"in K&&t(3,a=K.overlayClose),"btnClose"in K&&t(4,u=K.btnClose),"escClose"in K&&t(12,f=K.escClose),"beforeOpen"in K&&t(13,c=K.beforeOpen),"beforeHide"in K&&t(14,d=K.beforeHide),"$$scope"in K&&t(18,s=K.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&E(o),n.$$.dirty[0]&128&&X(b,!0),n.$$.dirty[0]&64&&g&&P(),n.$$.dirty[0]&1&&(o?L():N())},[o,l,r,a,u,C,g,b,T,F,R,X,f,c,d,M,D,$,s,i,se,W,G,te]}class Nn extends ye{constructor(e){super(),ve(this,e,c3,f3,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 d3(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function p3(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=B(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),_(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 m3(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function h3(n){let e,t;return e=new wb({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function g3(n){var Oe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,m,h,g=n[2].status+"",b,k,y,T,$,M,C=((Oe=n[2].method)==null?void 0:Oe.toUpperCase())+"",D,E,P,L,N,F,R=n[2].auth+"",X,se,W,G,te,K,re=n[2].url+"",J,de,_e,$e,Ne,Re,be,Se,We,lt,fe,Ve=n[2].remoteIp+"",ee,Fe,ot,Ht,Ae,ne,we=n[2].userIp+"",nt,et,bt,Gt,di,ft,Wn=n[2].userAgent+"",is,Ll,pi,ss,Nl,Pi,ls,rn,Ze,os,ti,rs,Li,Ni,Vt,Xt;function Fl(Ee,Ce){return Ee[2].referer?p3:d3}let V=Fl(n),U=V(n);const x=[h3,m3],oe=[];function Te(Ee,Ce){return Ce&4&&(ls=null),ls==null&&(ls=!z.isEmpty(Ee[2].meta)),ls?0:1}return rn=Te(n,-1),Ze=oe[rn]=x[rn](n),Vt=new ui({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=O(),o=v("td"),a=B(r),u=O(),f=v("tr"),c=v("td"),c.textContent="Status",d=O(),m=v("td"),h=v("span"),b=B(g),k=O(),y=v("tr"),T=v("td"),T.textContent="Method",$=O(),M=v("td"),D=B(C),E=O(),P=v("tr"),L=v("td"),L.textContent="Auth",N=O(),F=v("td"),X=B(R),se=O(),W=v("tr"),G=v("td"),G.textContent="URL",te=O(),K=v("td"),J=B(re),de=O(),_e=v("tr"),$e=v("td"),$e.textContent="Referer",Ne=O(),Re=v("td"),U.c(),be=O(),Se=v("tr"),We=v("td"),We.textContent="Remote IP",lt=O(),fe=v("td"),ee=B(Ve),Fe=O(),ot=v("tr"),Ht=v("td"),Ht.textContent="User IP",Ae=O(),ne=v("td"),nt=B(we),et=O(),bt=v("tr"),Gt=v("td"),Gt.textContent="UserAgent",di=O(),ft=v("td"),is=B(Wn),Ll=O(),pi=v("tr"),ss=v("td"),ss.textContent="Meta",Nl=O(),Pi=v("td"),Ze.c(),os=O(),ti=v("tr"),rs=v("td"),rs.textContent="Created",Li=O(),Ni=v("td"),H(Vt.$$.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(T,"class","min-width txt-hint txt-bold"),p(L,"class","min-width txt-hint txt-bold"),p(G,"class","min-width txt-hint txt-bold"),p($e,"class","min-width txt-hint txt-bold"),p(We,"class","min-width txt-hint txt-bold"),p(Ht,"class","min-width txt-hint txt-bold"),p(Gt,"class","min-width txt-hint txt-bold"),p(ss,"class","min-width txt-hint txt-bold"),p(rs,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Ee,Ce){S(Ee,e,Ce),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(o,a),_(t,u),_(t,f),_(f,c),_(f,d),_(f,m),_(m,h),_(h,b),_(t,k),_(t,y),_(y,T),_(y,$),_(y,M),_(M,D),_(t,E),_(t,P),_(P,L),_(P,N),_(P,F),_(F,X),_(t,se),_(t,W),_(W,G),_(W,te),_(W,K),_(K,J),_(t,de),_(t,_e),_(_e,$e),_(_e,Ne),_(_e,Re),U.m(Re,null),_(t,be),_(t,Se),_(Se,We),_(Se,lt),_(Se,fe),_(fe,ee),_(t,Fe),_(t,ot),_(ot,Ht),_(ot,Ae),_(ot,ne),_(ne,nt),_(t,et),_(t,bt),_(bt,Gt),_(bt,di),_(bt,ft),_(ft,is),_(t,Ll),_(t,pi),_(pi,ss),_(pi,Nl),_(pi,Pi),oe[rn].m(Pi,null),_(t,os),_(t,ti),_(ti,rs),_(ti,Li),_(ti,Ni),q(Vt,Ni,null),Xt=!0},p(Ee,Ce){var He;(!Xt||Ce&4)&&r!==(r=Ee[2].id+"")&&le(a,r),(!Xt||Ce&4)&&g!==(g=Ee[2].status+"")&&le(b,g),(!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(D,C),(!Xt||Ce&4)&&R!==(R=Ee[2].auth+"")&&le(X,R),(!Xt||Ce&4)&&re!==(re=Ee[2].url+"")&&le(J,re),V===(V=Fl(Ee))&&U?U.p(Ee,Ce):(U.d(1),U=V(Ee),U&&(U.c(),U.m(Re,null))),(!Xt||Ce&4)&&Ve!==(Ve=Ee[2].remoteIp+"")&&le(ee,Ve),(!Xt||Ce&4)&&we!==(we=Ee[2].userIp+"")&&le(nt,we),(!Xt||Ce&4)&&Wn!==(Wn=Ee[2].userAgent+"")&&le(is,Wn);let Ue=rn;rn=Te(Ee,Ce),rn===Ue?oe[rn].p(Ee,Ce):(ae(),I(oe[Ue],1,1,()=>{oe[Ue]=null}),ue(),Ze=oe[rn],Ze?Ze.p(Ee,Ce):(Ze=oe[rn]=x[rn](Ee),Ze.c()),A(Ze,1),Ze.m(Pi,null));const Le={};Ce&4&&(Le.date=Ee[2].created),Vt.$set(Le)},i(Ee){Xt||(A(Ze),A(Vt.$$.fragment,Ee),Xt=!0)},o(Ee){I(Ze),I(Vt.$$.fragment,Ee),Xt=!1},d(Ee){Ee&&w(e),U.d(),oe[rn].d(),j(Vt)}}}function _3(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function b3(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function v3(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[b3],header:[_3],default:[g3]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function y3(n,e,t){let i,s=new Rr;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){ie[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){ze.call(this,n,c)}function f(c){ze.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class k3 extends ye{constructor(e){super(),ve(this,e,y3,v3,he,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function w3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 Tc(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 i3({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $c(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 wy({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function S3(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y=n[3],T,$=n[3],M,C;r=new Da({}),r.$on("refresh",n[7]),d=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[w3,({uniqueId:P})=>({14:P}),({uniqueId:P})=>P?16384:0]},$$scope:{ctx:n}}}),h=new Uo({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 D=Tc(n),E=$c(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=B(n[5]),o=O(),H(r.$$.fragment),a=O(),u=v("div"),f=O(),c=v("div"),H(d.$$.fragment),m=O(),H(h.$$.fragment),g=O(),b=v("div"),k=O(),D.c(),T=O(),E.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(b,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(P,L){S(P,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(t,o),q(r,t,null),_(t,a),_(t,u),_(t,f),_(t,c),q(d,c,null),_(e,m),q(h,e,null),_(e,g),_(e,b),_(e,k),D.m(e,null),S(P,T,L),E.m(P,L),S(P,M,L),C=!0},p(P,L){(!C||L&32)&&le(l,P[5]);const N={};L&49153&&(N.$$scope={dirty:L,ctx:P}),d.$set(N);const F={};L&4&&(F.value=P[2]),h.$set(F),L&8&&he(y,y=P[3])?(ae(),I(D,1,1,Z),ue(),D=Tc(P),D.c(),A(D,1),D.m(e,null)):D.p(P,L),L&8&&he($,$=P[3])?(ae(),I(E,1,1,Z),ue(),E=$c(P),E.c(),A(E,1),E.m(M.parentNode,M)):E.p(P,L)},i(P){C||(A(r.$$.fragment,P),A(d.$$.fragment,P),A(h.$$.fragment,P),A(D),A(E),C=!0)},o(P){I(r.$$.fragment,P),I(d.$$.fragment,P),I(h.$$.fragment,P),I(D),I(E),C=!1},d(P){P&&w(e),j(r),j(d),j(h),D.d(P),P&&w(T),P&&w(M),E.d(P)}}}function T3(n){let e,t,i,s;e=new wn({props:{$$slots:{default:[S3]},$$scope:{ctx:n}}});let l={};return i=new k3({props:l}),n[13](i),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[13](null),j(i,o)}}}const Cc="includeAdminLogs";function $3(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(Cc))<<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 g=y=>l==null?void 0:l.show(y==null?void 0:y.detail);function b(y){ie[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(Cc,r<<0)},[r,l,o,a,i,s,u,f,c,d,m,h,g,b]}class C3 extends ye{constructor(e){super(),ve(this,e,$3,T3,he,{})}}const Ai=Ln([]),Mi=Ln({}),Po=Ln(!1);function M3(n){Ai.update(e=>{const t=z.findByKey(e,"id",n);return t?Mi.set(t):e.length&&Mi.set(e[0]),e})}function D3(n){Ai.update(e=>(z.removeByKey(e,"id",n.id),Mi.update(t=>t.id===n.id?e[0]:t),e))}async function Tb(n=null){Po.set(!0);try{let e=await pe.collections.getFullList(200,{sort:"+created"});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){pe.errorResponseHandler(e)}Po.set(!1)}const Qa=Ln({});function cn(n,e,t){Qa.set({text:n,yesCallback:e,noCallback:t})}function $b(){Qa.set({})}function Mc(n){let e,t,i,s;const l=n[14].default,o=Nt(l,n,n[13],null);return{c(){e=v("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||(A(o,r),r&&xe(()=>{i&&i.end(1),t=mg(e,An,{duration:150,y:-5}),t.start()}),s=!0)},o(r){I(o,r),t&&t.invalidate(),r&&(i=hg(e,An,{duration:150,y:2})),s=!1},d(r){r&&w(e),o&&o.d(r),r&&i&&i.end()}}}function O3(n){let e,t,i,s,l=n[0]&&Mc(n);return{c(){e=v("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&&A(l,1)):(l=Mc(o),l.c(),A(l,1),l.m(e,null)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&w(e),l&&l.d(),n[15](null),i=!1,Pe(s)}}}function E3(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=Ct();function m(){t(0,o=!1)}function h(){t(0,o=!0)}function g(){o?m():h()}function b(P){return!f||P.classList.contains(a)||(c==null?void 0:c.contains(P))&&!f.contains(P)||f.contains(P)&&P.closest&&P.closest("."+a)}function k(P){(!o||b(P.target))&&(P.preventDefault(),P.stopPropagation(),g())}function y(P){(P.code==="Enter"||P.code==="Space")&&(!o||b(P.target))&&(P.preventDefault(),P.stopPropagation(),g())}function T(P){o&&!(f!=null&&f.contains(P.target))&&!(c!=null&&c.contains(P.target))&&m()}function $(P){o&&r&&P.code==="Escape"&&(P.preventDefault(),m())}function M(P){return T(P)}function C(P){D(),t(12,c=P||(f==null?void 0:f.parentNode)),c&&(f==null||f.addEventListener("click",k),c.addEventListener("click",k),c.addEventListener("keydown",y))}function D(){c&&(f==null||f.removeEventListener("click",k),c.removeEventListener("click",k),c.removeEventListener("keydown",y))}Zt(()=>(C(),()=>D()));function E(P){ie[P?"unshift":"push"](()=>{f=P,t(2,f)})}return n.$$set=P=>{"trigger"in P&&t(6,l=P.trigger),"active"in P&&t(0,o=P.active),"escClose"in P&&t(7,r=P.escClose),"closableClass"in P&&t(8,a=P.closableClass),"class"in P&&t(1,u=P.class),"$$scope"in P&&t(13,s=P.$$scope)},n.$$.update=()=>{var P,L;n.$$.dirty&68&&f&&C(l),n.$$.dirty&4097&&(o?((P=c==null?void 0:c.classList)==null||P.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,g,c,s,i,E]}class ei extends ye{constructor(e){super(),ve(this,e,E3,O3,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 A3=n=>({active:n&1}),Dc=n=>({active:n[0]});function Oc(n){let e,t,i;const s=n[15].default,l=Nt(s,n,n[14],null);return{c(){e=v("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||(A(l,o),o&&xe(()=>{t||(t=je(e,At,{duration:150},!0)),t.run(1)}),i=!0)},o(o){I(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 I3(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Nt(a,n,n[14],Dc);let f=n[0]&&Oc(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=O(),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),_(e,t),u&&u.m(t,null),_(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",dt(n[17])),Y(t,"drop",dt(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",dt(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,A3):qt(c[14]),Dc),(!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&&A(f,1)):(f=Oc(c),f.c(),A(f,1),f.m(e,null)):f&&(ae(),I(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||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Pe(r)}}}function P3(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Ct();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function g(){y(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():g()}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 T(L){ze.call(this,n,L)}const $=()=>c&&k(),M=L=>{u&&(t(7,m=!1),y(),l("drop",L))},C=L=>u&&l("dragstart",L),D=L=>{u&&(t(7,m=!0),l("dragenter",L))},E=L=>{u&&(t(7,m=!1),l("dragleave",L))};function P(L){ie[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==null||o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&(o==null||o.scrollIntoView({behavior:"smooth",block:"nearest"}))},200)))},[f,a,u,c,k,y,o,m,l,d,h,g,b,r,s,i,T,$,M,C,D,E,P]}class ys extends ye{constructor(e){super(),ve(this,e,P3,I3,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 L3=n=>({}),Ec=n=>({});function Ac(n,e,t){const i=n.slice();return i[46]=e[t],i}const N3=n=>({}),Ic=n=>({});function Pc(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function Lc(n){let e,t,i;return{c(){e=v("div"),t=B(n[2]),i=O(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5])},m(s,l){S(s,e,l),_(e,t),_(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 F3(n){let e,t=n[46]+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:Z,o:Z,d(s){s&&w(e)}}}function R3(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=jt(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;I(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=jt(l,o()),H(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Nc(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=v("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(dt(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Pe(i)}}}function Fc(n){let e,t,i,s,l,o;const r=[R3,F3],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])&&Nc(n);return{c(){e=v("div"),i.c(),s=O(),f&&f.c(),l=O(),p(e,"class","option")},m(c,d){S(c,e,d),a[t].m(e,null),_(e,s),f&&f.m(e,null),_(e,l),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ae(),I(a[m],1,1,()=>{a[m]=null}),ue(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=Nc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&w(e),a[t].d(),f&&f.d()}}}function Rc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[H3]},$$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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[39](null),j(e,s)}}}function qc(n){let e,t,i,s,l,o,r,a,u=n[15].length&&jc(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='<i class="ri-search-line"></i>',s=O(),l=v("input"),o=O(),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),_(e,t),_(t,i),_(t,s),_(t,l),ce(l,n[15]),_(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]&&ce(l,f[15]),f[15].length?u?u.p(f,c):(u=jc(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 jc(n){let e,t,i,s;return{c(){e=v("div"),t=v("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),_(e,t),i||(s=Y(t,"click",kn(dt(n[21]))),i=!0)},p:Z,d(l){l&&w(e),i=!1,s()}}}function Hc(n){let e,t=n[1]&&Vc(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=Vc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Vc(n){let e,t;return{c(){e=v("div"),t=B(n[1]),p(e,"class","txt-missing")},m(i,s){S(i,e,s),_(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function q3(n){let e=n[46]+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:Z,o:Z,d(i){i&&w(t)}}}function j3(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=jt(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;I(f.$$.fragment,1,0,()=>{j(f,1)}),ue()}l?(e=jt(l,o()),H(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function zc(n){let e,t,i,s,l,o,r;const a=[j3,q3],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=v("div"),i.c(),s=O(),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),_(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(m,h){n=m;let g=t;t=f(n),t===g?u[t].p(n,h):(ae(),I(u[g],1,1,()=>{u[g]=null}),ue(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),A(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||(A(i),l=!0)},o(m){I(i),l=!1},d(m){m&&w(e),u[t].d(),o=!1,Pe(r)}}}function H3(n){let e,t,i,s,l,o=n[12]&&qc(n);const r=n[33].beforeOptions,a=Nt(r,n,n[42],Ic);let u=n[20],f=[];for(let g=0;g<u.length;g+=1)f[g]=zc(Ac(n,u,g));const c=g=>I(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=Hc(n));const m=n[33].afterOptions,h=Nt(m,n,n[42],Ec);return{c(){o&&o.c(),e=O(),a&&a.c(),t=O(),i=v("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),s=O(),h&&h.c(),p(i,"class","options-list")},m(g,b){o&&o.m(g,b),S(g,e,b),a&&a.m(g,b),S(g,t,b),S(g,i,b);for(let k=0;k<f.length;k+=1)f[k].m(i,null);d&&d.m(i,null),S(g,s,b),h&&h.m(g,b),l=!0},p(g,b){if(g[12]?o?o.p(g,b):(o=qc(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&2048)&&Rt(a,r,g,g[42],l?Ft(r,g[42],b,N3):qt(g[42]),Ic),b[0]&14158978){u=g[20];let k;for(k=0;k<u.length;k+=1){const y=Ac(g,u,k);f[k]?(f[k].p(y,b),A(f[k],1)):(f[k]=zc(y),f[k].c(),A(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(g,b):u.length?d&&(d.d(1),d=null):(d=Hc(g),d.c(),d.m(i,null))}h&&h.p&&(!l||b[1]&2048)&&Rt(h,m,g,g[42],l?Ft(m,g[42],b,L3):qt(g[42]),Ec)},i(g){if(!l){A(a,g);for(let b=0;b<u.length;b+=1)A(f[b]);A(h,g),l=!0}},o(g){I(a,g),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)I(f[b]);I(h,g),l=!1},d(g){o&&o.d(g),g&&w(e),a&&a.d(g),g&&w(t),g&&w(i),mt(f,g),d&&d.d(),g&&w(s),h&&h.d(g)}}}function V3(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]=Fc(Pc(n,r,d));const u=d=>I(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=Lc(n));let c=!n[5]&&Rc(n);return{c(){e=v("div"),t=v("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=O(),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),_(e,t);for(let h=0;h<a.length;h+=1)a[h].m(t,null);f&&f.m(t,null),n[35](t),_(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 g=Pc(d,r,h);a[h]?(a[h].p(g,m),A(a[h],1)):(a[h]=Fc(g),a[h].c(),A(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=Lc(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(),I(c,1,1,()=>{c=null}),ue()):c?(c.p(d,m),m[0]&32&&A(c,1)):(c=Rc(d),c.c(),A(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)A(a[m]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)I(a[m]);I(c),o=!1},d(d){d&&w(e),mt(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}function z3(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 B3(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:g=d}=e,{closable:b=!0}=e,{labelComponent:k=void 0}=e,{labelComponentProps:y={}}=e,{optionComponent:T=void 0}=e,{optionComponentProps:$={}}=e,{searchable:M=!1}=e,{searchFunc:C=void 0}=e,{class:D=""}=e,E,P="",L,N;function F(ee){if(z.isEmpty(h))return;let Fe=z.toArray(h);z.inArray(Fe,ee)&&(z.removeByValue(Fe,ee),t(0,h=Fe)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function R(ee){if(d){let Fe=z.toArray(h);z.inArray(Fe,ee)||t(0,h=[...Fe,ee])}else t(0,h=ee);L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function X(ee){return s(ee)?F(ee):R(ee)}function se(){t(0,h=d?[]:void 0)}function W(){E!=null&&E.show&&(E==null||E.show())}function G(){E!=null&&E.hide&&(E==null||E.hide())}function te(){if(z.isEmpty(h)||z.isEmpty(c))return;let ee=z.toArray(h),Fe=[];for(const ot of ee)z.inArray(c,ot)||Fe.push(ot);if(Fe.length){for(const ot of Fe)z.removeByValue(ee,ot);t(0,h=d?ee:ee[0])}}function K(){t(15,P="")}function re(ee,Fe){ee=ee||[];const ot=C||z3;return ee.filter(Ht=>ot(Ht,Fe))||[]}function J(ee,Fe){ee.preventDefault(),g&&d?X(Fe):R(Fe)}function de(ee,Fe){(ee.code==="Enter"||ee.code==="Space")&&J(ee,Fe)}function _e(){K(),setTimeout(()=>{const ee=L==null?void 0:L.querySelector(".dropdown-item.option.selected");ee&&(ee.focus(),ee.scrollIntoView({block:"nearest"}))},0)}function $e(ee){ee.stopPropagation(),!m&&(E==null||E.toggle())}Zt(()=>{const ee=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of ee)Fe.addEventListener("click",$e);return()=>{for(const Fe of ee)Fe.removeEventListener("click",$e)}});const Ne=ee=>F(ee);function Re(ee){ie[ee?"unshift":"push"](()=>{N=ee,t(18,N)})}function be(){P=this.value,t(15,P)}const Se=(ee,Fe)=>J(Fe,ee),We=(ee,Fe)=>de(Fe,ee);function lt(ee){ie[ee?"unshift":"push"](()=>{E=ee,t(16,E)})}function fe(ee){ze.call(this,n,ee)}function Ve(ee){ie[ee?"unshift":"push"](()=>{L=ee,t(17,L)})}return n.$$set=ee=>{"id"in ee&&t(25,r=ee.id),"noOptionsText"in ee&&t(1,a=ee.noOptionsText),"selectPlaceholder"in ee&&t(2,u=ee.selectPlaceholder),"searchPlaceholder"in ee&&t(3,f=ee.searchPlaceholder),"items"in ee&&t(26,c=ee.items),"multiple"in ee&&t(4,d=ee.multiple),"disabled"in ee&&t(5,m=ee.disabled),"selected"in ee&&t(0,h=ee.selected),"toggle"in ee&&t(6,g=ee.toggle),"closable"in ee&&t(7,b=ee.closable),"labelComponent"in ee&&t(8,k=ee.labelComponent),"labelComponentProps"in ee&&t(9,y=ee.labelComponentProps),"optionComponent"in ee&&t(10,T=ee.optionComponent),"optionComponentProps"in ee&&t(11,$=ee.optionComponentProps),"searchable"in ee&&t(12,M=ee.searchable),"searchFunc"in ee&&t(27,C=ee.searchFunc),"class"in ee&&t(13,D=ee.class),"$$scope"in ee&&t(42,o=ee.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&c&&(te(),K()),n.$$.dirty[0]&67141632&&t(20,i=re(c,P)),n.$$.dirty[0]&1&&t(19,s=function(ee){const Fe=z.toArray(h);return z.inArray(Fe,ee)})},[h,a,u,f,d,m,g,b,k,y,T,$,M,D,F,P,E,L,N,s,i,K,J,de,_e,r,c,C,R,X,se,W,G,l,Ne,Re,be,Se,We,lt,fe,Ve,o]}class xa extends ye{constructor(e){super(),ve(this,e,B3,V3,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 Bc(n){let e,t;return{c(){e=v("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 U3(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&&Bc(n);return{c(){l&&l.c(),e=O(),t=v("span"),s=B(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),_(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Bc(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:Z,o:Z,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function W3(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Uc extends ye{constructor(e){super(),ve(this,e,W3,U3,he,{item:0})}}const Y3=n=>({}),Wc=n=>({});function K3(n){let e;const t=n[8].afterOptions,i=Nt(t,n,n[12],Wc);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,Y3):qt(s[12]),Wc)},i(s){e||(A(i,s),e=!0)},o(s){I(i,s),e=!1},d(s){i&&i.d(s)}}}function J3(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:[K3]},$$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 xa({props:o}),ie.push(()=>ge(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||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function Z3(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=Uc}=e,{optionComponent:c=Uc}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=z.toArray(T,!0);let $=[];for(let M of T){const C=z.findByKey(r,d,M);C&&$.push(C)}T.length&&!$.length||t(0,u=a?$:$[0])}async function g(T){let $=z.toArray(T,!0).map(M=>M[d]);r.length&&t(6,m=a?$:$[0])}function b(T){u=T,t(0,u)}function k(T){ze.call(this,n,T)}function y(T){ze.call(this,n,T)}return n.$$set=T=>{e=Je(Je({},e),Qn(T)),t(5,s=Et(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&g(u)},[u,r,a,f,c,s,m,d,l,b,k,y,o]}class Ls extends ye{constructor(e){super(),ve(this,e,Z3,J3,he,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function G3(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 Ls({props:o}),ie.push(()=>ge(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||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function X3(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 Q3 extends ye{constructor(e){super(),ve(this,e,X3,G3,he,{value:0,class:1})}}function x3(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min length"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].min&&ce(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function eT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max length"),s=O(),l=v("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),_(e,t),S(f,s,c),S(f,l,c),ce(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&&ht(l.value)!==f[0].max&&ce(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function tT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Regex pattern"),s=O(),l=v("input"),r=O(),a=v("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),_(e,t),S(c,s,d),S(c,l,d),ce(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&&ce(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 nT(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[x3,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[eT,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[tT,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("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),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(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 g={};d&2&&(g.name="schema."+c[1]+".options.pattern"),d&97&&(g.$$scope={dirty:d,ctx:c}),u.$set(g)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(o.$$.fragment,c),I(u.$$.fragment,c),f=!1},d(c){c&&w(e),j(i),j(o),j(u)}}}function iT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=ht(this.value),t(0,s)}function o(){s.max=ht(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 sT extends ye{constructor(e){super(),ve(this,e,iT,nT,he,{key:1,options:0})}}function lT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min"),s=O(),l=v("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].min&&ce(l,u[0].min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function oT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max"),s=O(),l=v("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),_(e,t),S(f,s,c),S(f,l,c),ce(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&&ht(l.value)!==f[0].max&&ce(l,f[0].max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function rT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[lT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[oT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("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),_(e,t),q(i,t,null),_(e,s),_(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function aT(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=ht(this.value),t(0,s)}function o(){s.max=ht(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 uT extends ye{constructor(e){super(),ve(this,e,aT,rT,he,{key:1,options:0})}}function fT(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 cT extends ye{constructor(e){super(),ve(this,e,fT,null,he,{key:0,options:1})}}function dT(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=v("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:Z,o:Z,d(r){r&&w(e),i=!1,s()}}}function pT(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 Ns extends ye{constructor(e){super(),ve(this,e,pT,dT,he,{value:0,separator:1})}}function mT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(b){n[2](b)}let g={id:n[4],disabled:!z.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(g.value=n[0].exceptDomains),r=new Ns({props:g}),ie.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("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(b,k){S(b,e,k),_(e,t),_(e,i),_(e,s),S(b,o,k),q(r,b,k),S(b,u,k),S(b,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(b,k){(!c||k&16&&l!==(l=b[4]))&&p(e,"for",l);const y={};k&16&&(y.id=b[4]),k&1&&(y.disabled=!z.isEmpty(b[0].onlyDomains)),!a&&k&1&&(a=!0,y.value=b[0].exceptDomains,ke(()=>a=!1)),r.$set(y)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,m()}}}function hT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(b){n[3](b)}let g={id:n[4]+".options.onlyDomains",disabled:!z.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(g.value=n[0].onlyDomains),r=new Ns({props:g}),ie.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("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(b,k){S(b,e,k),_(e,t),_(e,i),_(e,s),S(b,o,k),q(r,b,k),S(b,u,k),S(b,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(b,k){(!c||k&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const y={};k&16&&(y.id=b[4]+".options.onlyDomains"),k&1&&(y.disabled=!z.isEmpty(b[0].exceptDomains)),!a&&k&1&&(a=!0,y.value=b[0].onlyDomains,ke(()=>a=!1)),r.$set(y)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,m()}}}function gT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[mT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[hT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("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),_(e,t),q(i,t,null),_(e,s),_(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function _T(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 Cb extends ye{constructor(e){super(),ve(this,e,_T,gT,he,{key:1,options:0})}}function bT(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 Cb({props:r}),ie.push(()=>ge(e,"key",l)),ie.push(()=>ge(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||(A(e.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),s=!1},d(a){j(e,a)}}}function vT(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 yT extends ye{constructor(e){super(),ve(this,e,vT,bT,he,{key:0,options:1})}}function kT(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 wT extends ye{constructor(e){super(),ve(this,e,kT,null,he,{key:0,options:1})}}var Sr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_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},_l={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)},Cn=function(n){return n===!0?1:0};function Yc(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 Mb(n,e){if(e(n))return n;if(n.parentNode)return Mb(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 gn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var $r=function(){},Lo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},ST={D:$r,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*Cn(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:$r,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:$r,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})"},ol={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ol.w(n,e,t)]},F:function(n,e,t){return Lo(ol.n(n,e,t)-1,!1,e)},G:function(n,e,t){return an(ol.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[Cn(n.getHours()>11)]},M:function(n,e){return Lo(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)}},Db=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?_l: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 ol[c]&&m[d-1]!=="\\"?ol[c](r,f,t):c!=="\\"?c:""}).join("")}},ua=function(n){var e=n.config,t=e===void 0?ks:e,i=n.l10n,s=i===void 0?_l: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||ks).dateFormat,m=String(l).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(l);else{for(var h=void 0,g=[],b=0,k=0,y="";b<d.length;b++){var T=d[b],$=T==="\\",M=d[b-1]==="\\"||$;if(Wi[T]&&!M){y+=Wi[T];var C=new RegExp(y).exec(l);C&&(h=!0)&&g[T!=="Y"?"push":"unshift"]({fn:ST[T],val:C[++k]})}else $||(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)),g.forEach(function(D){var E=D.fn,P=D.val;return f=E(f,P,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 _n(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 TT=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Cr=function(n,e,t){return n*3600+e*60+t},$T=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},CT={DAY:864e5};function Mr(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)},Kc=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},MT=300;function DT(n,e){var t={config:Ut(Ut({},ks),Ot.defaultConfig),l10n:_l};t.parseDate=ua({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=we,t.changeMonth=J,t.changeYear=be,t.clear=de,t.close=_e,t.onMouseOver=Ve,t._createElement=st,t.createDay=C,t.destroy=$e,t.isEnabled=Se,t.jumpToDate=y,t.updateValue=Vt,t.open=Fe,t.redraw=bt,t.set=Wn,t.setDate=Ll,t.toggle=rn;function i(){t.utils={getDaysInMonth:function(V,U){return V===void 0&&(V=t.currentMonth),U===void 0&&(U=t.currentYear),V===1&&(U%4===0&&U%100!==0||U%400===0)?29:t.l10n.daysInMonth[V]}}}function s(){t.element=t.input=n,t.isOpen=!1,Ht(),ne(),Nl(),ss(),i(),t.isMobile||M(),k(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Vt(!1)),r();var V=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&V&&we(),Ze("onReady")}function l(){var V;return((V=t.calendarContainer)===null||V===void 0?void 0:V.getRootNode()).activeElement||document.activeElement}function o(V){return V.bind(t)}function r(){var V=t.config;V.weekNumbers===!1&&V.showMonths===1||V.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 U=(t.days.offsetWidth+1)*V.showMonths;t.daysContainer.style.width=U+"px",t.calendarContainer.style.width=U+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(V){if(t.selectedDates.length===0){var U=t.config.minDate===void 0||_n(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),x=Mr(t.config);U.setHours(x.hours,x.minutes,x.seconds,U.getMilliseconds()),t.selectedDates=[U],t.latestSelectedDateObj=U}V!==void 0&&V.type!=="blur"&&Fl(V);var oe=t._input.value;c(),Vt(),t._input.value!==oe&&t._debouncedChange()}function u(V,U){return V%12+12*Cn(U===t.l10n.amPM[1])}function f(V){switch(V%24){case 0:case 12:return 12;default:return V%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var V=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,U=(parseInt(t.minuteElement.value,10)||0)%60,x=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(V=u(V,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&_n(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&_n(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=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ee=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ce=Cr(V,U,x);if(Ce>Ee&&Ce<Oe){var Ue=$T(Oe);V=Ue[0],U=Ue[1],x=Ue[2]}}else{if(Te){var Le=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;V=Math.min(V,Le.getHours()),V===Le.getHours()&&(U=Math.min(U,Le.getMinutes())),U===Le.getMinutes()&&(x=Math.min(x,Le.getSeconds()))}if(oe){var He=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;V=Math.max(V,He.getHours()),V===He.getHours()&&U<He.getMinutes()&&(U=He.getMinutes()),U===He.getMinutes()&&(x=Math.max(x,He.getSeconds()))}}m(V,U,x)}}function d(V){var U=V||t.latestSelectedDateObj;U&&U instanceof Date&&m(U.getHours(),U.getMinutes(),U.getSeconds())}function m(V,U,x){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(V%24,U,x||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=an(t.config.time_24hr?V:(12+V)%12+12*Cn(V%12===0)),t.minuteElement.value=an(U),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Cn(V>=12)]),t.secondElement!==void 0&&(t.secondElement.value=an(x)))}function h(V){var U=gn(V),x=parseInt(U.value)+(V.delta||0);(x/1e3>1||V.key==="Enter"&&!/[^\d]/.test(x.toString()))&&be(x)}function g(V,U,x,oe){if(U instanceof Array)return U.forEach(function(Te){return g(V,Te,x,oe)});if(V instanceof Array)return V.forEach(function(Te){return g(Te,U,x,oe)});V.addEventListener(U,x,oe),t._handlers.push({remove:function(){return V.removeEventListener(U,x,oe)}})}function b(){Ze("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(x){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+x+"]"),function(oe){return g(oe,"click",t[x])})}),t.isMobile){ls();return}var V=Yc(ee,50);if(t._debouncedChange=Yc(b,MT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(x){t.config.mode==="range"&&Ve(gn(x))}),g(t._input,"keydown",fe),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",fe),!t.config.inline&&!t.config.static&&g(window,"resize",V),window.ontouchstart!==void 0?g(window.document,"touchstart",Re):g(window.document,"mousedown",Re),g(window.document,"focus",Re,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Xt),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",di)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var U=function(x){return gn(x).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],U),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(x){a(x)})}t.config.allowInput&&g(t._input,"blur",lt)}function y(V,U){var x=V!==void 0?t.parseDate(V):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,Te=t.currentMonth;try{x!==void 0&&(t.currentYear=x.getFullYear(),t.currentMonth=x.getMonth())}catch(Oe){Oe.message="Invalid date supplied: "+x,t.config.errorHandler(Oe)}U&&t.currentYear!==oe&&(Ze("onYearChange"),R()),U&&(t.currentYear!==oe||t.currentMonth!==Te)&&Ze("onMonthChange"),t.redraw()}function T(V){var U=gn(V);~U.className.indexOf("arrow")&&$(V,U.classList.contains("arrowUp")?1:-1)}function $(V,U,x){var oe=V&&gn(V),Te=x||oe&&oe.parentNode&&oe.parentNode.firstChild,Oe=os("increment");Oe.delta=U,Te&&Te.dispatchEvent(Oe)}function M(){var V=window.document.createDocumentFragment();if(t.calendarContainer=st("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(V.appendChild(W()),t.innerContainer=st("div","flatpickr-innerContainer"),t.config.weekNumbers){var U=re(),x=U.weekWrapper,oe=U.weekNumbers;t.innerContainer.appendChild(x),t.weekNumbers=oe,t.weekWrapper=x}t.rContainer=st("div","flatpickr-rContainer"),t.rContainer.appendChild(te()),t.daysContainer||(t.daysContainer=st("div","flatpickr-days"),t.daysContainer.tabIndex=-1),F(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),V.appendChild(t.innerContainer)}t.config.enableTime&&V.appendChild(G()),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(V);var Te=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&&(!Te&&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(V,U,x,oe){var Te=Se(U,!0),Oe=st("span",V,U.getDate().toString());return Oe.dateObj=U,Oe.$i=oe,Oe.setAttribute("aria-label",t.formatDate(U,t.config.ariaDateFormat)),V.indexOf("hidden")===-1&&_n(U,t.now)===0&&(t.todayDateElem=Oe,Oe.classList.add("today"),Oe.setAttribute("aria-current","date")),Te?(Oe.tabIndex=-1,ti(U)&&(Oe.classList.add("selected"),t.selectedDateElem=Oe,t.config.mode==="range"&&(Qt(Oe,"startRange",t.selectedDates[0]&&_n(U,t.selectedDates[0],!0)===0),Qt(Oe,"endRange",t.selectedDates[1]&&_n(U,t.selectedDates[1],!0)===0),V==="nextMonthDay"&&Oe.classList.add("inRange")))):Oe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&rs(U)&&!ti(U)&&Oe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&V!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(U)+"</span>"),Ze("onDayCreate",Oe),Oe}function D(V){V.focus(),t.config.mode==="range"&&Ve(V)}function E(V){for(var U=V>0?0:t.config.showMonths-1,x=V>0?t.config.showMonths:-1,oe=U;oe!=x;oe+=V)for(var Te=t.daysContainer.children[oe],Oe=V>0?0:Te.children.length-1,Ee=V>0?Te.children.length:-1,Ce=Oe;Ce!=Ee;Ce+=V){var Ue=Te.children[Ce];if(Ue.className.indexOf("hidden")===-1&&Se(Ue.dateObj))return Ue}}function P(V,U){for(var x=V.className.indexOf("Month")===-1?V.dateObj.getMonth():t.currentMonth,oe=U>0?t.config.showMonths:-1,Te=U>0?1:-1,Oe=x-t.currentMonth;Oe!=oe;Oe+=Te)for(var Ee=t.daysContainer.children[Oe],Ce=x-t.currentMonth===Oe?V.$i+U:U<0?Ee.children.length-1:0,Ue=Ee.children.length,Le=Ce;Le>=0&&Le<Ue&&Le!=(U>0?Ue:-1);Le+=Te){var He=Ee.children[Le];if(He.className.indexOf("hidden")===-1&&Se(He.dateObj)&&Math.abs(V.$i-Le)>=Math.abs(U))return D(He)}t.changeMonth(Te),L(E(Te),0)}function L(V,U){var x=l(),oe=We(x||document.body),Te=V!==void 0?V:oe?x:t.selectedDateElem!==void 0&&We(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&We(t.todayDateElem)?t.todayDateElem:E(U>0?1:-1);Te===void 0?t._input.focus():oe?P(Te,U):D(Te)}function N(V,U){for(var x=(new Date(V,U,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((U-1+12)%12,V),Te=t.utils.getDaysInMonth(U,V),Oe=window.document.createDocumentFragment(),Ee=t.config.showMonths>1,Ce=Ee?"prevMonthDay hidden":"prevMonthDay",Ue=Ee?"nextMonthDay hidden":"nextMonthDay",Le=oe+1-x,He=0;Le<=oe;Le++,He++)Oe.appendChild(C("flatpickr-day "+Ce,new Date(V,U-1,Le),Le,He));for(Le=1;Le<=Te;Le++,He++)Oe.appendChild(C("flatpickr-day",new Date(V,U,Le),Le,He));for(var pt=Te+1;pt<=42-x&&(t.config.showMonths===1||He%7!==0);pt++,He++)Oe.appendChild(C("flatpickr-day "+Ue,new Date(V,U+1,pt%Te),pt,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 V=document.createDocumentFragment(),U=0;U<t.config.showMonths;U++){var x=new Date(t.currentYear,t.currentMonth,1);x.setMonth(t.currentMonth+U),V.appendChild(N(x.getFullYear(),x.getMonth()))}t.daysContainer.appendChild(V),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ve()}}function R(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var V=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 U=0;U<12;U++)if(V(U)){var x=st("option","flatpickr-monthDropdown-month");x.value=new Date(t.currentYear,U).getMonth().toString(),x.textContent=Lo(U,t.config.shorthandCurrentMonth,t.l10n),x.tabIndex=-1,t.currentMonth===U&&(x.selected=!0),t.monthsDropdownContainer.appendChild(x)}}}function X(){var V=st("div","flatpickr-month"),U=window.document.createDocumentFragment(),x;t.config.showMonths>1||t.config.monthSelectorType==="static"?x=st("span","cur-month"):(t.monthsDropdownContainer=st("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Ee){var Ce=gn(Ee),Ue=parseInt(Ce.value,10);t.changeMonth(Ue-t.currentMonth),Ze("onMonthChange")}),R(),x=t.monthsDropdownContainer);var oe=so("cur-year",{tabindex:"-1"}),Te=oe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Oe=st("div","flatpickr-current-month");return Oe.appendChild(x),Oe.appendChild(oe),U.appendChild(Oe),V.appendChild(U),{container:V,yearElement:Te,monthElement:x}}function se(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var V=t.config.showMonths;V--;){var U=X();t.yearElements.push(U.yearElement),t.monthElements.push(U.monthElement),t.monthNav.appendChild(U.container)}t.monthNav.appendChild(t.nextMonthNav)}function W(){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,se(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(V){t.__hidePrevMonthArrow!==V&&(Qt(t.prevMonthNav,"flatpickr-disabled",V),t.__hidePrevMonthArrow=V)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(V){t.__hideNextMonthArrow!==V&&(Qt(t.nextMonthNav,"flatpickr-disabled",V),t.__hideNextMonthArrow=V)}}),t.currentYearElement=t.yearElements[0],Li(),t.monthNav}function G(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var V=Mr(t.config);t.timeContainer=st("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var U=st("span","flatpickr-time-separator",":"),x=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=x.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?V.hours:f(V.hours)),t.minuteElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():V.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(x),t.timeContainer.appendChild(U),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=so("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=an(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():V.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(Te)}return t.config.time_24hr||(t.amPM=st("span","flatpickr-am-pm",t.l10n.amPM[Cn((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 te(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=st("div","flatpickr-weekdays");for(var V=t.config.showMonths;V--;){var U=st("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(U)}return K(),t.weekdayContainer}function K(){if(t.weekdayContainer){var V=t.l10n.firstDayOfWeek,U=Kc(t.l10n.weekdays.shorthand);V>0&&V<U.length&&(U=Kc(U.splice(V,U.length),U.splice(0,V)));for(var x=t.config.showMonths;x--;)t.weekdayContainer.children[x].innerHTML=`
<span class='flatpickr-weekday'>
`+U.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function re(){t.calendarContainer.classList.add("hasWeeks");var V=st("div","flatpickr-weekwrapper");V.appendChild(st("span","flatpickr-weekday",t.l10n.weekAbbreviation));var U=st("div","flatpickr-weeks");return V.appendChild(U),{weekWrapper:V,weekNumbers:U}}function J(V,U){U===void 0&&(U=!0);var x=U?V:V-t.currentMonth;x<0&&t._hidePrevMonthArrow===!0||x>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=x,(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(V,U){if(V===void 0&&(V=!0),U===void 0&&(U=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,U===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var x=Mr(t.config),oe=x.hours,Te=x.minutes,Oe=x.seconds;m(oe,Te,Oe)}t.redraw(),V&&Ze("onChange")}function _e(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ze("onClose")}function $e(){t.config!==void 0&&Ze("onDestroy");for(var V=t._handlers.length;V--;)t._handlers[V].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 U=t.calendarContainer.parentNode;if(U.lastChild&&U.removeChild(U.lastChild),U.parentNode){for(;U.firstChild;)U.parentNode.insertBefore(U.firstChild,U);U.parentNode.removeChild(U)}}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(x){try{delete t[x]}catch{}})}function Ne(V){return t.calendarContainer.contains(V)}function Re(V){if(t.isOpen&&!t.config.inline){var U=gn(V),x=Ne(U),oe=U===t.input||U===t.altInput||t.element.contains(U)||V.path&&V.path.indexOf&&(~V.path.indexOf(t.input)||~V.path.indexOf(t.altInput)),Te=!oe&&!x&&!Ne(V.relatedTarget),Oe=!t.config.ignoredFocusElements.some(function(Ee){return Ee.contains(U)});Te&&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 be(V){if(!(!V||t.config.minDate&&V<t.config.minDate.getFullYear()||t.config.maxDate&&V>t.config.maxDate.getFullYear())){var U=V,x=t.currentYear!==U;t.currentYear=U||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)),x&&(t.redraw(),Ze("onYearChange"),R())}}function Se(V,U){var x;U===void 0&&(U=!0);var oe=t.parseDate(V,void 0,U);if(t.config.minDate&&oe&&_n(oe,t.config.minDate,U!==void 0?U:!t.minDateHasTime)<0||t.config.maxDate&&oe&&_n(oe,t.config.maxDate,U!==void 0?U:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Oe=(x=t.config.enable)!==null&&x!==void 0?x:t.config.disable,Ee=0,Ce=void 0;Ee<Oe.length;Ee++){if(Ce=Oe[Ee],typeof Ce=="function"&&Ce(oe))return Te;if(Ce instanceof Date&&oe!==void 0&&Ce.getTime()===oe.getTime())return Te;if(typeof Ce=="string"){var Ue=t.parseDate(Ce,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?Te:!Te}else if(typeof Ce=="object"&&oe!==void 0&&Ce.from&&Ce.to&&oe.getTime()>=Ce.from.getTime()&&oe.getTime()<=Ce.to.getTime())return Te}return!Te}function We(V){return t.daysContainer!==void 0?V.className.indexOf("hidden")===-1&&V.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(V):!1}function lt(V){var U=V.target===t._input,x=t._input.value.trimEnd()!==Ni();U&&x&&!(V.relatedTarget&&Ne(V.relatedTarget))&&t.setDate(t._input.value,!0,V.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function fe(V){var U=gn(V),x=t.config.wrap?n.contains(U):U===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!x),Oe=t.config.inline&&x&&!oe;if(V.keyCode===13&&x){if(oe)return t.setDate(t._input.value,!0,U===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),U.blur();t.open()}else if(Ne(U)||Te||Oe){var Ee=!!t.timeContainer&&t.timeContainer.contains(U);switch(V.keyCode){case 13:Ee?(V.preventDefault(),a(),Gt()):di(V);break;case 27:V.preventDefault(),Gt();break;case 8:case 46:x&&!t.config.allowInput&&(V.preventDefault(),t.clear());break;case 37:case 39:if(!Ee&&!x){V.preventDefault();var Ce=l();if(t.daysContainer!==void 0&&(oe===!1||Ce&&We(Ce))){var Ue=V.keyCode===39?1:-1;V.ctrlKey?(V.stopPropagation(),J(Ue),L(E(1),0)):L(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:V.preventDefault();var Le=V.keyCode===40?1:-1;t.daysContainer&&U.$i!==void 0||U===t.input||U===t.altInput?V.ctrlKey?(V.stopPropagation(),be(t.currentYear-Le),L(E(1),0)):Ee||L(void 0,Le*7):U===t.currentYearElement?be(t.currentYear-Le):t.config.enableTime&&(!Ee&&t.hourElement&&t.hourElement.focus(),a(V),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}),pt=He.indexOf(U);if(pt!==-1){var Yn=He[pt+(V.shiftKey?-1:1)];V.preventDefault(),(Yn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(U)&&V.shiftKey&&(V.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&U===t.amPM)switch(V.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Vt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Vt();break}(x||Ne(U))&&Ze("onKeyDown",V)}function Ve(V,U){if(U===void 0&&(U="flatpickr-day"),!(t.selectedDates.length!==1||V&&(!V.classList.contains(U)||V.classList.contains("flatpickr-disabled")))){for(var x=V?V.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(x,t.selectedDates[0].getTime()),Oe=Math.max(x,t.selectedDates[0].getTime()),Ee=!1,Ce=0,Ue=0,Le=Te;Le<Oe;Le+=CT.DAY)Se(new Date(Le),!0)||(Ee=Ee||Le>Te&&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+") > ."+U));He.forEach(function(pt){var Yn=pt.dateObj,hn=Yn.getTime(),Fs=Ce>0&&hn<Ce||Ue>0&&hn>Ue;if(Fs){pt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(as){pt.classList.remove(as)});return}else if(Ee&&!Fs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(as){pt.classList.remove(as)}),V!==void 0&&(V.classList.add(x<=t.selectedDates[0].getTime()?"startRange":"endRange"),oe<x&&hn===oe?pt.classList.add("startRange"):oe>x&&hn===oe&&pt.classList.add("endRange"),hn>=Ce&&(Ue===0||hn<=Ue)&&TT(hn,oe,x)&&pt.classList.add("inRange"))})}}function ee(){t.isOpen&&!t.config.static&&!t.config.inline&&we()}function Fe(V,U){if(U===void 0&&(U=t._positionElement),t.isMobile===!0){if(V){V.preventDefault();var x=gn(V);x&&x.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(U)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(V===void 0||!t.timeContainer.contains(V.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ot(V){return function(U){var x=t.config["_"+V+"Date"]=t.parseDate(U,t.config.dateFormat),oe=t.config["_"+(V==="min"?"max":"min")+"Date"];x!==void 0&&(t[V==="min"?"minDateHasTime":"maxDateHasTime"]=x.getHours()>0||x.getMinutes()>0||x.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return Se(Te)}),!t.selectedDates.length&&V==="min"&&d(x),Vt()),t.daysContainer&&(bt(),x!==void 0?t.currentYearElement[V]=x.getFullYear().toString():t.currentYearElement.removeAttribute(V),t.currentYearElement.disabled=!!oe&&x!==void 0&&oe.getFullYear()===x.getFullYear())}}function Ht(){var V=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],U=Ut(Ut({},JSON.parse(JSON.stringify(n.dataset||{}))),e),x={};t.config.parseDate=U.parseDate,t.config.formatDate=U.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=U.mode==="time";if(!U.dateFormat&&(U.enableTime||oe)){var Te=Ot.defaultConfig.dateFormat||ks.dateFormat;x.dateFormat=U.noCalendar||oe?"H:i"+(U.enableSeconds?":S":""):Te+" H:i"+(U.enableSeconds?":S":"")}if(U.altInput&&(U.enableTime||oe)&&!U.altFormat){var Oe=Ot.defaultConfig.altFormat||ks.altFormat;x.altFormat=U.noCalendar||oe?"h:i"+(U.enableSeconds?":S K":" K"):Oe+(" h:i"+(U.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(pt){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(pt,"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")}),U.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,x,U);for(var Ce=0;Ce<V.length;Ce++)t.config[V[Ce]]=t.config[V[Ce]]===!0||t.config[V[Ce]]==="true";Sr.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)Sr.indexOf(Le)>-1?t.config[Le]=Tr(Ue[Le]).map(o).concat(t.config[Le]):typeof U[Le]>"u"&&(t.config[Le]=Ue[Le])}U.altInputClass||(t.config.altInputClass=Ae().className+" "+t.config.altInputClass),Ze("onParseConfig")}function Ae(){return t.config.wrap?n.querySelector("[data-input]"):n}function ne(){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 V=Ut(Ut({},e),JSON.parse(JSON.stringify(n.dataset||{})));V.time_24hr===void 0&&Ot.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Db(t),t.parseDate=ua({config:t.config,l10n:t.l10n})}function we(V){if(typeof t.config.position=="function")return void t.config.position(t,V);if(t.calendarContainer!==void 0){Ze("onPreCalendarPosition");var U=V||t._positionElement,x=Array.prototype.reduce.call(t.calendarContainer.children,function(Hb,Vb){return Hb+Vb.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Oe=Te[0],Ee=Te.length>1?Te[1]:null,Ce=U.getBoundingClientRect(),Ue=window.innerHeight-Ce.bottom,Le=Oe==="above"||Oe!=="below"&&Ue<x&&Ce.top>x,He=window.pageYOffset+Ce.top+(Le?-x-2:U.offsetHeight+2);if(Qt(t.calendarContainer,"arrowTop",!Le),Qt(t.calendarContainer,"arrowBottom",Le),!t.config.inline){var pt=window.pageXOffset+Ce.left,Yn=!1,hn=!1;Ee==="center"?(pt-=(oe-Ce.width)/2,Yn=!0):Ee==="right"&&(pt-=oe-Ce.width,hn=!0),Qt(t.calendarContainer,"arrowLeft",!Yn&&!hn),Qt(t.calendarContainer,"arrowCenter",Yn),Qt(t.calendarContainer,"arrowRight",hn);var Fs=window.document.body.offsetWidth-(window.pageXOffset+Ce.right),as=pt+oe>window.document.body.offsetWidth,Pb=Fs+oe>window.document.body.offsetWidth;if(Qt(t.calendarContainer,"rightMost",as),!t.config.static)if(t.calendarContainer.style.top=He+"px",!as)t.calendarContainer.style.left=pt+"px",t.calendarContainer.style.right="auto";else if(!Pb)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Fs+"px";else{var Qo=nt();if(Qo===void 0)return;var Lb=window.document.body.offsetWidth,Nb=Math.max(0,Lb/2-oe/2),Fb=".flatpickr-calendar.centerMost:before",Rb=".flatpickr-calendar.centerMost:after",qb=Qo.cssRules.length,jb="{left:"+Ce.left+"px;right:auto;}";Qt(t.calendarContainer,"rightMost",!1),Qt(t.calendarContainer,"centerMost",!0),Qo.insertRule(Fb+","+Rb+jb,qb),t.calendarContainer.style.left=Nb+"px",t.calendarContainer.style.right="auto"}}}}function nt(){for(var V=null,U=0;U<document.styleSheets.length;U++){var x=document.styleSheets[U];if(x.cssRules){try{x.cssRules}catch{continue}V=x;break}}return V??et()}function et(){var V=document.createElement("style");return document.head.appendChild(V),V.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(V){V.preventDefault(),V.stopPropagation();var U=function(He){return He.classList&&He.classList.contains("flatpickr-day")&&!He.classList.contains("flatpickr-disabled")&&!He.classList.contains("notAllowed")},x=Mb(gn(V),U);if(x!==void 0){var oe=x,Te=t.latestSelectedDateObj=new Date(oe.dateObj.getTime()),Oe=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Ee=ti(Te);Ee?t.selectedDates.splice(parseInt(Ee),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),_n(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(He,pt){return He.getTime()-pt.getTime()}));if(c(),Oe){var Ce=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Ce&&(Ze("onYearChange"),R()),Ze("onMonthChange")}if(Li(),F(),Vt(),!Oe&&t.config.mode!=="range"&&t.config.showMonths===1?D(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()}b()}}var ft={locale:[ne,K],showMonths:[se,r,te],minDate:[y],maxDate:[y],positionElement:[Pi],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Wn(V,U){if(V!==null&&typeof V=="object"){Object.assign(t.config,V);for(var x in V)ft[x]!==void 0&&ft[x].forEach(function(oe){return oe()})}else t.config[V]=U,ft[V]!==void 0?ft[V].forEach(function(oe){return oe()}):Sr.indexOf(V)>-1&&(t.config[V]=Tr(U));t.redraw(),Vt(!0)}function is(V,U){var x=[];if(V instanceof Array)x=V.map(function(oe){return t.parseDate(oe,U)});else if(V instanceof Date||typeof V=="number")x=[t.parseDate(V,U)];else if(typeof V=="string")switch(t.config.mode){case"single":case"time":x=[t.parseDate(V,U)];break;case"multiple":x=V.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,U)});break;case"range":x=V.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,U)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(V)));t.selectedDates=t.config.allowInvalidPreload?x:x.filter(function(oe){return oe instanceof Date&&Se(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function Ll(V,U,x){if(U===void 0&&(U=!1),x===void 0&&(x=t.config.dateFormat),V!==0&&!V||V instanceof Array&&V.length===0)return t.clear(U);is(V,x),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),y(void 0,U),d(),t.selectedDates.length===0&&t.clear(!1),Vt(U),U&&Ze("onChange")}function pi(V){return V.slice().map(function(U){return typeof U=="string"||typeof U=="number"||U instanceof Date?t.parseDate(U,void 0,!0):U&&typeof U=="object"&&U.from&&U.to?{from:t.parseDate(U.from,void 0),to:t.parseDate(U.to,void 0)}:U}).filter(function(U){return U})}function ss(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var V=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);V&&is(V,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 ls(){var V=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=V,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=V==="datetime-local"?"Y-m-d\\TH:i:S":V==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(U){t.setDate(gn(U).value,!1,t.mobileFormatStr),Ze("onChange"),Ze("onClose")})}function rn(V){if(t.isOpen===!0)return t.close();t.open(V)}function Ze(V,U){if(t.config!==void 0){var x=t.config[V];if(x!==void 0&&x.length>0)for(var oe=0;x[oe]&&oe<x.length;oe++)x[oe](t.selectedDates,t.input.value,t,U);V==="onChange"&&(t.input.dispatchEvent(os("change")),t.input.dispatchEvent(os("input")))}}function os(V){var U=document.createEvent("Event");return U.initEvent(V,!0,!0),U}function ti(V){for(var U=0;U<t.selectedDates.length;U++){var x=t.selectedDates[U];if(x instanceof Date&&_n(x,V)===0)return""+U}return!1}function rs(V){return t.config.mode!=="range"||t.selectedDates.length<2?!1:_n(V,t.selectedDates[0])>=0&&_n(V,t.selectedDates[1])<=0}function Li(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(V,U){var x=new Date(t.currentYear,t.currentMonth,1);x.setMonth(t.currentMonth+U),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[U].textContent=Lo(x.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=x.getMonth().toString(),V.value=x.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(V){var U=V||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(x){return t.formatDate(x,U)}).filter(function(x,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(x)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Vt(V){V===void 0&&(V=!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)),V!==!1&&Ze("onValueUpdate")}function Xt(V){var U=gn(V),x=t.prevMonthNav.contains(U),oe=t.nextMonthNav.contains(U);x||oe?J(x?-1:1):t.yearElements.indexOf(U)>=0?U.select():U.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):U.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Fl(V){V.preventDefault();var U=V.type==="keydown",x=gn(V),oe=x;t.amPM!==void 0&&x===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Cn(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Oe=parseFloat(oe.getAttribute("max")),Ee=parseFloat(oe.getAttribute("step")),Ce=parseInt(oe.value,10),Ue=V.delta||(U?V.which===38?1:-1:0),Le=Ce+Ee*Ue;if(typeof oe.value<"u"&&oe.value.length===2){var He=oe===t.hourElement,pt=oe===t.minuteElement;Le<Te?(Le=Oe+Le+Cn(!He)+(Cn(He)&&Cn(!t.amPM)),pt&&$(void 0,-1,t.hourElement)):Le>Oe&&(Le=oe===t.hourElement?Le-Oe-Cn(!t.amPM):Te,pt&&$(void 0,1,t.hourElement)),t.amPM&&He&&(Ee===1?Le+Ce===23:Math.abs(Le-Ce)>Ee)&&(t.amPM.textContent=t.l10n.amPM[Cn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=an(Le)}}return s(),t}function ws(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=DT(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 ws(this,n)},HTMLElement.prototype.flatpickr=function(n){return ws([this],n)});var Ot=function(n,e){return typeof n=="string"?ws(window.document.querySelectorAll(n),e):n instanceof Node?ws([n],e):ws(n,e)};Ot.defaultConfig={};Ot.l10ns={en:Ut({},_l),default:Ut({},_l)};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=ua({});Ot.formatDate=Db({});Ot.compareDates=_n;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ws(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 OT(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=Je(i,t[s]);return{c(){e=v("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 ET(n){let e;const t=n[10].default,i=Nt(t,n,n[9],null),s=i||OT(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||(A(s,l),e=!0)},o(l){I(s,l),e=!1},d(l){s&&s.d(l)}}}function AT(n){return n.charAt(2).toLowerCase()+n.substring(3)}function Jc(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function Zc(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 IT(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:g=void 0}=e;Zt(()=>{const $=f??h,M=k(d);return M.onReady.push((C,D,E)=>{a===void 0&&y(C,D,E),sn().then(()=>{t(8,m=!0)})}),t(3,g=Ot($,Object.assign(M,f?{wrap:!0}:{}))),()=>{g.destroy()}});const b=Ct();function k($={}){$=Object.assign({},$);for(const M of r){const C=(D,E,P)=>{b(AT(M),[D,E,P])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(C)):$[M]=[C]}return $.onChange&&!$.onChange.includes(y)&&$.onChange.push(y),$}function y($,M,C){const D=Jc(C,$);!Zc(a,D)&&(a||D)&&t(2,a=D),t(4,u=M)}function T($){ie[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Je(Je({},e),Qn($)),t(1,s=Et(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,g=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&m&&(Zc(a,Jc(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&m)for(const[$,M]of Object.entries(k(d)))g.set($,M)},[h,s,a,g,u,f,c,d,m,o,l,T]}class eu extends ye{constructor(e){super(),ve(this,e,IT,ET,he,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function PT(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 eu({props:u}),ie.push(()=>ge(l,"formattedValue",a)),{c(){e=v("label"),t=B("Min date (UTC)"),s=O(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function LT(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 eu({props:u}),ie.push(()=>ge(l,"formattedValue",a)),{c(){e=v("label"),t=B("Max date (UTC)"),s=O(),H(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function NT(n){let e,t,i,s,l,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[PT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[LT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("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),_(e,t),q(i,t,null),_(e,s),_(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function FT(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 RT extends ye{constructor(e){super(),ve(this,e,FT,NT,he,{key:1,options:0})}}function qT(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 Ns({props:c}),ie.push(()=>ge(l,"value",f)),{c(){e=v("label"),t=B("Choices"),s=O(),H(l.$$.fragment),r=O(),a=v("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),_(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||(A(l.$$.fragment,d),u=!0)},o(d){I(l.$$.fragment,d),u=!1},d(d){d&&w(e),d&&w(s),j(l,d),d&&w(r),d&&w(a)}}}function jT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max select"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].maxSelect&&ce(l,u[0].maxSelect)},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;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[qT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[jT,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("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),_(e,t),q(i,t,null),_(e,s),_(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function VT(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=ht(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 zT extends ye{constructor(e){super(),ve(this,e,VT,HT,he,{key:1,options:0})}}function BT(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function UT(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D='"{"a":1,"b":2}"',E,P,L,N,F,R,X,se,W,G,te,K,re;return{c(){e=v("div"),t=v("div"),i=v("div"),s=B("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=B(` and
`),r=v("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=B(` field is a
`),c=v("strong"),c.textContent="plain string",d=B(`:
`),m=v("ul"),h=v("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=O(),b=v("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=O(),y=v("li"),y.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=O(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=O(),C=v("li"),E=B(D),P=B(" is converted to the json "),L=v("code"),L.textContent='{"a":1,"b":2}',N=O(),F=v("li"),F.textContent="numeric strings are converted to json number",R=O(),X=v("li"),X.textContent="double quoted strings are left as they are (aka. without normalizations)",se=O(),W=v("li"),W.textContent="any other string (empty string too) is double quoted",G=B(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your data inside
an object, eg.`),te=v("code"),te.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(J,de){S(J,e,de),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(i,r),_(i,a),_(i,u),_(i,f),_(i,c),_(i,d),_(i,m),_(m,h),_(m,g),_(m,b),_(m,k),_(m,y),_(m,T),_(m,$),_(m,M),_(m,C),_(C,E),_(C,P),_(C,L),_(m,N),_(m,F),_(m,R),_(m,X),_(m,se),_(m,W),_(i,G),_(i,te),re=!0},i(J){re||(J&&xe(()=>{K||(K=je(e,At,{duration:150},!0)),K.run(1)}),re=!0)},o(J){J&&(K||(K=je(e,At,{duration:150},!1)),K.run(0)),re=!1},d(J){J&&w(e),J&&K&&K.end()}}}function WT(n){let e,t,i,s,l,o,r;function a(d,m){return d[0]?UT:BT}let u=a(n),f=u(n),c=n[0]&&Gc();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=O(),f.c(),s=O(),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),_(e,t),_(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&&A(c,1):(c=Gc(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){A(c)},o(d){I(c)},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function YT(n,e,t){const i="",s={};let l=!1;return[l,i,s,()=>{t(0,l=!l)}]}class KT extends ye{constructor(e){super(),ve(this,e,YT,WT,he,{key:1,options:2})}get key(){return this.$$.ctx[1]}get options(){return this.$$.ctx[2]}}function JT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=B(t),s=O(),l=v("small"),r=B(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){S(a,e,u),_(e,i),S(a,s,u),S(a,l,u),_(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:Z,o:Z,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function ZT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Xc extends ye{constructor(e){super(),ve(this,e,ZT,JT,he,{item:0})}}const GT=[{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 XT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max file size (bytes)"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].maxSize&&ce(l,u[0].maxSize)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max files"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].maxSelect&&ce(l,u[0].maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function xT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=O(),i=v("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=O(),l=v("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=O(),r=v("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:Z,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 e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T;function $(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 Ls({props:M}),ie.push(()=>ge(r,"keyOfSelected",$)),b=new ei({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[xT]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",m=O(),h=v("i"),g=O(),H(b.$$.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,D){S(C,e,D),_(e,t),_(e,i),_(e,s),S(C,o,D),q(r,C,D),S(C,u,D),S(C,f,D),_(f,c),_(c,d),_(c,m),_(c,h),_(c,g),q(b,c,null),k=!0,y||(T=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,D){(!k||D&4096&&l!==(l=C[12]))&&p(e,"for",l);const E={};D&4096&&(E.id=C[12]),D&4&&(E.items=C[2]),!a&&D&1&&(a=!0,E.keyOfSelected=C[0].mimeTypes,ke(()=>a=!1)),r.$set(E);const P={};D&8193&&(P.$$scope={dirty:D,ctx:C}),b.$set(P)},i(C){k||(A(r.$$.fragment,C),A(b.$$.fragment,C),k=!0)},o(C){I(r.$$.fragment,C),I(b.$$.fragment,C),k=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(b),y=!1,T()}}}function t$(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e)}}}function n$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M;function C(E){n[10](E)}let D={id:n[12],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(D.value=n[0].thumbs),r=new Ns({props:D}),ie.push(()=>ge(r,"value",C)),y=new ei({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[t$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=O(),m=v("button"),h=v("span"),h.textContent="Supported formats",g=O(),b=v("i"),k=O(),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(b,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,P){S(E,e,P),_(e,t),_(e,i),_(e,s),S(E,o,P),q(r,E,P),S(E,u,P),S(E,f,P),_(f,c),_(f,d),_(f,m),_(m,h),_(m,g),_(m,b),_(m,k),q(y,m,null),T=!0,$||(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"})),$=!0)},p(E,P){(!T||P&4096&&l!==(l=E[12]))&&p(e,"for",l);const L={};P&4096&&(L.id=E[12]),!a&&P&1&&(a=!0,L.value=E[0].thumbs,ke(()=>a=!1)),r.$set(L);const N={};P&8192&&(N.$$scope={dirty:P,ctx:E}),y.$set(N)},i(E){T||(A(r.$$.fragment,E),A(y.$$.fragment,E),T=!0)},o(E){I(r.$$.fragment,E),I(y.$$.fragment,E),T=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(y),$=!1,M()}}}function i$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[XT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[QT,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[e$,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[n$,({uniqueId:h})=>({12:h}),({uniqueId:h})=>h?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),H(u.$$.fragment),f=O(),c=v("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,g){S(h,e,g),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),m=!0},p(h,[g]){const b={};g&2&&(b.name="schema."+h[1]+".options.maxSize"),g&12289&&(b.$$scope={dirty:g,ctx:h}),i.$set(b);const k={};g&2&&(k.name="schema."+h[1]+".options.maxSelect"),g&12289&&(k.$$scope={dirty:g,ctx:h}),o.$set(k);const y={};g&2&&(y.name="schema."+h[1]+".options.mimeTypes"),g&12293&&(y.$$scope={dirty:g,ctx:h}),u.$set(y);const T={};g&2&&(T.name="schema."+h[1]+".options.thumbs"),g&12289&&(T.$$scope={dirty:g,ctx:h}),d.$set(T)},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),A(d.$$.fragment,h),m=!0)},o(h){I(i.$$.fragment,h),I(o.$$.fragment,h),I(u.$$.fragment,h),I(d.$$.fragment,h),m=!1},d(h){h&&w(e),j(i),j(o),j(u),j(d)}}}function s$(n,e,t){let{key:i=""}=e,{options:s={}}=e,l=GT.slice();function o(){if(z.isEmpty(s.mimeTypes))return;const g=[];for(const b of s.mimeTypes)l.find(k=>k.mimeType===b)||g.push({mimeType:b});g.length&&t(2,l=l.concat(g))}function r(){s.maxSize=ht(this.value),t(0,s)}function a(){s.maxSelect=ht(this.value),t(0,s)}function u(g){n.$$.not_equal(s.mimeTypes,g)&&(s.mimeTypes=g,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(g){n.$$.not_equal(s.thumbs,g)&&(s.thumbs=g,t(0,s))}return n.$$set=g=>{"key"in g&&t(1,i=g.key),"options"in g&&t(0,s=g.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 l$ extends ye{constructor(e){super(),ve(this,e,s$,i$,he,{key:1,options:0})}}function o$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=O(),i=v("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[7]),s=!0)},p:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function r$(n){let e,t,i,s,l,o,r;function a(f){n[8](f)}let u={searchable:n[2].length>5,selectPlaceholder:"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[2],$$slots:{afterOptions:[o$]},$$scope:{ctx:n}};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new Ls({props:u}),ie.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("Collection"),s=O(),H(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&4&&(d.searchable=f[2].length>5),c&4&&(d.items=f[2]),c&524296&&(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function a$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Max select",i=O(),s=v("i"),o=O(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18]),p(r,"type","number"),p(r,"id",a=n[18]),p(r,"step","1"),p(r,"min","1")},m(c,d){S(c,e,d),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(r,n[0].maxSelect),u||(f=[Ie(Be.call(null,s,{text:"Leave empty for no limit.",position:"top"})),Y(r,"input",n[9])],u=!0)},p(c,d){d&262144&&l!==(l=c[18])&&p(e,"for",l),d&262144&&a!==(a=c[18])&&p(r,"id",a),d&1&&ht(r.value)!==c[0].maxSelect&&ce(r,c[0].maxSelect)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Pe(f)}}}function u$(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[10](h)}let m={multiple:!0,searchable:!0,id:n[18],selectPlaceholder:"Auto",items:n[4]};return n[0].displayFields!==void 0&&(m.selected=n[0].displayFields),r=new xa({props:m}),ie.push(()=>ge(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=O(),s=v("i"),o=O(),H(r.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[18])},m(h,g){S(h,e,g),_(e,t),_(e,i),_(e,s),S(h,o,g),q(r,h,g),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,g){(!u||g&262144&&l!==(l=h[18]))&&p(e,"for",l);const b={};g&262144&&(b.id=h[18]),g&16&&(b.items=h[4]),!a&&g&1&&(a=!0,b.selected=h[0].displayFields,ke(()=>a=!1)),r.$set(b)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){I(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function f$(n){let e,t,i,s,l,o,r;function a(f){n[11](f)}let u={id:n[18],items:n[5]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new Ls({props:u}),ie.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("Cascade delete"),s=O(),H(l.$$.fragment),p(e,"for",i=n[18])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&262144&&i!==(i=f[18]))&&p(e,"for",i);const d={};c&262144&&(d.id=f[18]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function c$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;i=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[r$,({uniqueId:k})=>({18:k}),({uniqueId:k})=>k?262144:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[a$,({uniqueId:k})=>({18:k}),({uniqueId:k})=>k?262144:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[u$,({uniqueId:k})=>({18:k}),({uniqueId:k})=>k?262144:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[f$,({uniqueId:k})=>({18:k}),({uniqueId:k})=>k?262144:0]},$$scope:{ctx:n}}});let b={};return h=new tu({props:b}),n[12](h),h.$on("save",n[13]),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),H(u.$$.fragment),f=O(),c=v("div"),H(d.$$.fragment),m=O(),H(h.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-9"),p(c,"class","col-sm-3"),p(e,"class","grid")},m(k,y){S(k,e,y),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),S(k,m,y),q(h,k,y),g=!0},p(k,[y]){const T={};y&2&&(T.name="schema."+k[1]+".options.collectionId"),y&786445&&(T.$$scope={dirty:y,ctx:k}),i.$set(T);const $={};y&2&&($.name="schema."+k[1]+".options.maxSelect"),y&786433&&($.$$scope={dirty:y,ctx:k}),o.$set($);const M={};y&2&&(M.name="schema."+k[1]+".options.displayFields"),y&786449&&(M.$$scope={dirty:y,ctx:k}),u.$set(M);const C={};y&2&&(C.name="schema."+k[1]+".options.cascadeDelete"),y&786433&&(C.$$scope={dirty:y,ctx:k}),d.$set(C);const D={};h.$set(D)},i(k){g||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(u.$$.fragment,k),A(d.$$.fragment,k),A(h.$$.fragment,k),g=!0)},o(k){I(i.$$.fragment,k),I(o.$$.fragment,k),I(u.$$.fragment,k),I(d.$$.fragment,k),I(h.$$.fragment,k),g=!1},d(k){k&&w(e),j(i),j(o),j(u),j(d),k&&w(m),n[12](null),j(h,k)}}}function d$(n,e,t){let i,s;Ye(n,Ai,M=>t(2,s=M));let{key:l=""}=e,{options:o={}}=e;const r=[{label:"False",value:!1},{label:"True",value:!0}],a=["id","created","updated"],u=["username","email","emailVisibility","verified"];let f=null,c=[],d=null;function m(){var M;if(t(4,c=a.slice(0)),!!i){i.isAuth&&t(4,c=c.concat(u));for(const C of i.schema)c.push(C.name);if(((M=o==null?void 0:o.displayFields)==null?void 0:M.length)>0)for(let C=o.displayFields.length-1;C>=0;C--)c.includes(o.displayFields[C])||o.displayFields.splice(C,1)}}const h=()=>f==null?void 0:f.show();function g(M){n.$$.not_equal(o.collectionId,M)&&(o.collectionId=M,t(0,o))}function b(){o.maxSelect=ht(this.value),t(0,o)}function k(M){n.$$.not_equal(o.displayFields,M)&&(o.displayFields=M,t(0,o))}function y(M){n.$$.not_equal(o.cascadeDelete,M)&&(o.cascadeDelete=M,t(0,o))}function T(M){ie[M?"unshift":"push"](()=>{f=M,t(3,f)})}const $=M=>{var C,D;(D=(C=M==null?void 0:M.detail)==null?void 0:C.collection)!=null&&D.id&&t(0,o.collectionId=M.detail.collection.id,o)};return n.$$set=M=>{"key"in M&&t(1,l=M.key),"options"in M&&t(0,o=M.options)},n.$$.update=()=>{n.$$.dirty&1&&z.isEmpty(o)&&t(0,o={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]}),n.$$.dirty&5&&(i=s.find(M=>M.id==o.collectionId)||null),n.$$.dirty&65&&d!=o.collectionId&&(t(6,d=o.collectionId),m())},[o,l,s,f,c,r,d,h,g,b,k,y,T,$]}class p$ extends ye{constructor(e){super(),ve(this,e,d$,c$,he,{key:1,options:0})}}function m$(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 Q3({props:u}),ie.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Type"),s=O(),H(l.$$.fragment),p(e,"for",i=n[43])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function Qc(n){let e,t,i;return{c(){e=v("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,An,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=je(e,An,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function h$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[5]&&Qc();return{c(){e=v("label"),t=v("span"),t.textContent="Name",i=O(),h&&h.c(),l=O(),o=v("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(g,b){S(g,e,b),_(e,t),_(e,i),h&&h.m(e,null),S(g,l,b),S(g,o,b),c=!0,n[0].id||o.focus(),d||(m=Y(o,"input",n[18]),d=!0)},p(g,b){g[5]?h&&(ae(),I(h,1,1,()=>{h=null}),ue()):h?b[0]&32&&A(h,1):(h=Qc(),h.c(),A(h,1),h.m(e,null)),(!c||b[1]&4096&&s!==(s=g[43]))&&p(e,"for",s),(!c||b[1]&4096&&r!==(r=g[43]))&&p(o,"id",r),(!c||b[0]&1&&a!==(a=g[0].id&&g[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!g[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=g[0].name)&&o.value!==f)&&(o.value=f)},i(g){c||(A(h),c=!0)},o(g){I(h),c=!1},d(g){g&&w(e),h&&h.d(),g&&w(l),g&&w(o),d=!1,m()}}}function g$(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 p$({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function _$(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 l$({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function b$(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 KT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function v$(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 zT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function y$(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 RT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function k$(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 wT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function w$(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 yT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function S$(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 Cb({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function T$(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 cT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $$(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 uT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function C$(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 sT({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function M$(n){let e,t,i,s,l,o=gs(n[0])+"",r,a,u,f,c,d,m;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),r=B(o),a=O(),u=v("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,g){S(h,e,g),e.checked=n[0].required,S(h,i,g),S(h,s,g),_(s,l),_(l,r),_(s,a),_(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,g){g[1]&4096&&t!==(t=h[43])&&p(e,"id",t),g[0]&1&&(e.checked=h[0].required),g[0]&1&&o!==(o=gs(h[0])+"")&&le(r,o),f&&Bt(f.update)&&g[0]&1&&f.update.call(null,{text:`Requires the field value to be ${gs(h[0])}
(aka. not ${z.zeroDefaultStr(h[0])}).`,position:"right"}),g[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 xc(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[D$,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function D$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 ed(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:[O$]},$$scope:{ctx:n}}});let c=n[8]&&td(n);return{c(){e=v("div"),t=v("div"),i=O(),s=v("div"),l=v("button"),o=v("i"),r=O(),H(a.$$.fragment),u=O(),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),_(e,t),_(e,i),_(e,s),_(s,l),_(l,o),_(l,r),q(a,l,null),_(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=td(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){I(a.$$.fragment,d),f=!1},d(d){d&&w(e),j(a),c&&c.d()}}}function O$(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function td(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function E$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C;s=new me({props:{class:"form-field required "+(n[0].id?"readonly":""),name:"schema."+n[1]+".type",$$slots:{default:[m$,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[h$,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});const D=[C$,$$,T$,S$,w$,k$,y$,v$,b$,_$,g$],E=[];function P(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=P(n))&&(c=E[f]=D[f](n)),h=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[M$,({uniqueId:F})=>({43:F}),({uniqueId:F})=>[0,F?4096:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&xc(n),N=!n[0].toDelete&&ed(n);return{c(){e=v("form"),t=v("div"),i=v("div"),H(s.$$.fragment),l=O(),o=v("div"),H(r.$$.fragment),a=O(),u=v("div"),c&&c.c(),d=O(),m=v("div"),H(h.$$.fragment),g=O(),b=v("div"),L&&L.c(),k=O(),N&&N.c(),y=O(),T=v("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(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(T,"type","submit"),p(T,"class","hidden"),p(T,"tabindex","-1"),p(e,"class","field-form")},m(F,R){S(F,e,R),_(e,t),_(t,i),q(s,i,null),_(t,l),_(t,o),q(r,o,null),_(t,a),_(t,u),~f&&E[f].m(u,null),_(t,d),_(t,m),q(h,m,null),_(t,g),_(t,b),L&&L.m(b,null),_(t,k),N&&N.m(t,null),_(e,y),_(e,T),$=!0,M||(C=[Y(e,"dragstart",P$),Y(e,"submit",dt(n[32]))],M=!0)},p(F,R){const X={};R[0]&1&&(X.class="form-field required "+(F[0].id?"readonly":"")),R[0]&2&&(X.name="schema."+F[1]+".type"),R[0]&1|R[1]&12288&&(X.$$scope={dirty:R,ctx:F}),s.$set(X);const se={};R[0]&33&&(se.class=`
form-field
required
`+(F[5]?"":"invalid")+`
`+(F[0].id&&F[0].system?"disabled":"")+`
`),R[0]&2&&(se.name="schema."+F[1]+".name"),R[0]&33|R[1]&12288&&(se.$$scope={dirty:R,ctx:F}),r.$set(se);let W=f;f=P(F),f===W?~f&&E[f].p(F,R):(c&&(ae(),I(E[W],1,1,()=>{E[W]=null}),ue()),~f?(c=E[f],c?c.p(F,R):(c=E[f]=D[f](F),c.c()),A(c,1),c.m(u,null)):c=null);const G={};R[0]&1|R[1]&12288&&(G.$$scope={dirty:R,ctx:F}),h.$set(G),F[0].type!=="file"?L?(L.p(F,R),R[0]&1&&A(L,1)):(L=xc(F),L.c(),A(L,1),L.m(b,null)):L&&(ae(),I(L,1,1,()=>{L=null}),ue()),F[0].toDelete?N&&(ae(),I(N,1,1,()=>{N=null}),ue()):N?(N.p(F,R),R[0]&1&&A(N,1)):(N=ed(F),N.c(),A(N,1),N.m(t,null))},i(F){$||(A(s.$$.fragment,F),A(r.$$.fragment,F),A(c),A(h.$$.fragment,F),A(L),A(N),$=!0)},o(F){I(s.$$.fragment,F),I(r.$$.fragment,F),I(c),I(h.$$.fragment,F),I(L),I(N),$=!1},d(F){F&&w(e),j(s),j(r),~f&&E[f].d(),j(h),L&&L.d(),N&&N.d(),M=!1,Pe(C)}}}function nd(n){let e,t,i,s,l=n[0].system&&id(),o=!n[0].id&&sd(n),r=n[0].required&&ld(n),a=n[0].unique&&od();return{c(){e=v("div"),l&&l.c(),t=O(),o&&o.c(),i=O(),r&&r.c(),s=O(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){S(u,e,f),l&&l.m(e,null),_(e,t),o&&o.m(e,null),_(e,i),r&&r.m(e,null),_(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=id(),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=sd(u),o.c(),o.m(e,i)),u[0].required?r?r.p(u,f):(r=ld(u),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=od(),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 id(n){let e;return{c(){e=v("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function sd(n){let e;return{c(){e=v("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 ld(n){let e,t=gs(n[0])+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","label label-success")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l[0]&1&&t!==(t=gs(s[0])+"")&&le(i,t)},d(s){s&&w(e)}}}function od(n){let e;return{c(){e=v("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function rd(n){let e,t,i,s,l;return{c(){e=v("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 ad(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function A$(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,h,g,b,k=!n[0].toDelete&&nd(n),y=n[7]&&!n[0].system&&rd(),T=n[0].toDelete&&ad(n);return{c(){e=v("div"),t=v("span"),i=v("i"),l=O(),o=v("strong"),a=B(r),f=O(),k&&k.c(),c=O(),d=v("div"),m=O(),y&&y.c(),h=O(),T&&T.c(),g=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($,M){S($,e,M),_(e,t),_(t,i),_(e,l),_(e,o),_(o,a),S($,f,M),k&&k.m($,M),S($,c,M),S($,d,M),S($,m,M),y&&y.m($,M),S($,h,M),T&&T.m($,M),S($,g,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Si(z.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&le(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),(!b||M[0]&1)&&Q(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?k&&(k.d(1),k=null):k?k.p($,M):(k=nd($),k.c(),k.m(c.parentNode,c)),$[7]&&!$[0].system?y?M[0]&129&&A(y,1):(y=rd(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(ae(),I(y,1,1,()=>{y=null}),ue()),$[0].toDelete?T?T.p($,M):(T=ad($),T.c(),T.m(g.parentNode,g)):T&&(T.d(1),T=null)},i($){b||(A(y),b=!0)},o($){I(y),b=!1},d($){$&&w(e),$&&w(f),k&&k.d($),$&&w(c),$&&w(d),$&&w(m),y&&y.d($),$&&w(h),T&&T.d($),$&&w(g)}}}function I$(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:[A$],default:[E$]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ys({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||(A(e.$$.fragment,l),t=!0)},o(l){I(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 P$=n=>{n.stopPropagation(),n.preventDefault(),n.stopImmediatePropagation()};function L$(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,fe=>t(15,u=fe));const f=Ct();let{key:c="0"}=e,{field:d=new mn}=e,{disabled:m=!1}=e,{excludeNames:h=[]}=e,g,b=d.type;function k(){g==null||g.expand()}function y(){g==null||g.collapse()}function T(){d.id?t(0,d.toDelete=!0,d):(y(),f("remove"))}function $(fe){if(fe=(""+fe).toLowerCase(),!fe)return!1;for(const Ve of h)if(Ve.toLowerCase()===fe)return!1;return!0}function M(fe){return z.slugify(fe)}Zt(()=>{d!=null&&d.onMountExpand&&(t(0,d.onMountExpand=!1,d),k())});const C=()=>{t(0,d.toDelete=!1,d)};function D(fe){n.$$.not_equal(d.type,fe)&&(d.type=fe,t(0,d),t(14,b),t(4,g))}const E=fe=>{t(0,d.name=M(fe.target.value),d),fe.target.value=d.name};function P(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function L(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function N(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function F(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function R(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function X(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function se(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function W(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function G(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function te(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function K(fe){n.$$.not_equal(d.options,fe)&&(d.options=fe,t(0,d),t(14,b),t(4,g))}function re(){d.required=this.checked,t(0,d),t(14,b),t(4,g)}function J(){d.unique=this.checked,t(0,d),t(14,b),t(4,g)}const de=()=>{i&&y()};function _e(fe){ie[fe?"unshift":"push"](()=>{g=fe,t(4,g)})}function $e(fe){ze.call(this,n,fe)}function Ne(fe){ze.call(this,n,fe)}function Re(fe){ze.call(this,n,fe)}function be(fe){ze.call(this,n,fe)}function Se(fe){ze.call(this,n,fe)}function We(fe){ze.call(this,n,fe)}function lt(fe){ze.call(this,n,fe)}return n.$$set=fe=>{e=Je(Je({},e),Qn(fe)),t(11,a=Et(e,r)),"key"in fe&&t(1,c=fe.key),"field"in fe&&t(0,d=fe.field),"disabled"in fe&&t(2,m=fe.disabled),"excludeNames"in fe&&t(12,h=fe.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&16385&&b!=d.type&&(t(14,b=d.type),t(0,d.options={},d),t(0,d.unique=!1,d)),n.$$.dirty[0]&17&&d.toDelete&&(g&&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||g&&k()),n.$$.dirty[0]&69&&t(8,s=!m&&!d.system&&!d.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=$(d.name)),n.$$.dirty[0]&32802&&t(7,o=!l||!z.isEmpty(z.getNestedVal(u,`schema.${c}`)))},[d,c,m,y,g,l,i,o,s,T,M,a,h,k,b,u,C,D,E,P,L,N,F,R,X,se,W,G,te,K,re,J,de,_e,$e,Ne,Re,be,Se,We,lt]}class N$ extends ye{constructor(e){super(),ve(this,e,L$,I$,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 ud(n,e,t){const i=n.slice();return i[13]=e[t],i[14]=e,i[15]=t,i}function fd(n){let e,t,i,s,l,o,r,a;return{c(){e=B(`,
`),t=v("code"),t.textContent="username",i=B(` ,
`),s=v("code"),s.textContent="email",l=B(` ,
`),o=v("code"),o.textContent="emailVisibility",r=B(` ,
`),a=v("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 cd(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 N$({props:f}),ie.push(()=>ge(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||(A(i.$$.fragment,c),l=!0)},o(c){I(i.$$.fragment,c),l=!1},d(c){c&&w(t),j(i,c)}}}function F$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],h=new Map,g,b,k,y,T,$,M,C,D,E,P,L=n[0].isAuth&&fd(),N=n[0].schema;const F=R=>R[13];for(let R=0;R<N.length;R+=1){let X=ud(n,N,R),se=F(X);h.set(se,m[R]=cd(se,X))}return{c(){e=v("div"),t=v("p"),i=B(`System fields:
`),s=v("code"),s.textContent="id",l=B(` ,
`),o=v("code"),o.textContent="created",r=B(` ,
`),a=v("code"),a.textContent="updated",u=O(),L&&L.c(),f=B(`
.`),c=O(),d=v("div");for(let R=0;R<m.length;R+=1)m[R].c();g=O(),b=v("div"),k=O(),y=v("button"),T=v("i"),$=O(),M=v("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(b,"class","clearfix m-t-xs"),p(T,"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,X){S(R,e,X),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),L&&L.m(t,null),_(t,f),S(R,c,X),S(R,d,X);for(let se=0;se<m.length;se+=1)m[se].m(d,null);S(R,g,X),S(R,b,X),S(R,k,X),S(R,y,X),_(y,T),_(y,$),_(y,M),D=!0,E||(P=Y(y,"click",n[3]),E=!0)},p(R,[X]){R[0].isAuth?L||(L=fd(),L.c(),L.m(t,f)):L&&(L.d(1),L=null),X&55&&(N=R[0].schema,ae(),m=wt(m,X,F,1,R,N,h,d,ln,cd,null,ud),ue()),(!D||X&1&&C!==(C="btn btn-block "+(R[0].schema.length?"btn-transparent":"btn-secondary")))&&p(y,"class",C)},i(R){if(!D){for(let X=0;X<N.length;X+=1)A(m[X]);D=!0}},o(R){for(let X=0;X<m.length;X+=1)I(m[X]);D=!1},d(R){R&&w(e),L&&L.d(),R&&w(c),R&&w(d);for(let X=0;X<m.length;X+=1)m[X].d();R&&w(g),R&&w(b),R&&w(k),R&&w(y),E=!1,P()}}}function R$(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function q$(n,e,t){let{collection:i=new pn}=e;const s=["id","created","updated","collectionId","collectionName","expand","true","false","null"];let l=[];function o(b){i.schema[b]&&(i.schema.splice(b,1),t(0,i))}function r(){const b=new mn({name:a()});b.onMountExpand=!0,i.schema.push(b),t(0,i)}function a(b="field"){let k="";for(;u(b+k);)++k;return b+k}function u(b){return!!i.schema.find(k=>k.name===b)}function f(b){let k=[];if(b.toDelete)return k;for(let y of i.schema)y===b||y.toDelete||k.push(y.name);return k}function c(b,k){if(!b)return;b.dataTransfer.dropEffect="move";const y=parseInt(b.dataTransfer.getData("text/plain")),T=i.schema;y<k?(T.splice(k+1,0,T[y]),T.splice(y,1)):(T.splice(k,0,T[y]),T.splice(y+1,1)),t(0,i.schema=T,i)}function d(b,k,y,T){y[T]=b,t(0,i)}const m=b=>o(b),h=(b,k)=>R$(k==null?void 0:k.detail,b),g=(b,k)=>c(k==null?void 0:k.detail,b);return n.$$set=b=>{"collection"in b&&t(0,i=b.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,g]}class j$ extends ye{constructor(e){super(),ve(this,e,q$,F$,he,{collection:0})}}const H$=n=>({isAdminOnly:n&256}),dd=n=>({isAdminOnly:n[8]});function V$(n){let e,t;return e=new me({props:{class:"form-field rule-field m-0 "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[J$,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function z$(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function B$(n){let e,t,i;return{c(){e=v("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-i0txfh")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[10]),t=!0)},p:Z,d(s){s&&w(e),t=!1,i()}}}function U$(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Set custom rule</span>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-i0txfh")},m(s,l){S(s,e,l),t||(i=Y(e,"click",n[9]),t=!0)},p:Z,d(s){s&&w(e),t=!1,i()}}}function W$(n){let e;return{c(){e=B("Leave empty to grant everyone access.")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Y$(n){let e,t,i,s,l;return{c(){e=B(`Only admins will be able to perform this action (
`),t=v("button"),t.textContent="unlock to change",i=B(`
).`),p(t,"type","button"),p(t,"class","link-hint")},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:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function K$(n){let e;function t(l,o){return l[8]?Y$:W$}let i=t(n),s=i(n);return{c(){e=v("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 J$(n){let e,t,i,s,l=n[8]?"Admins only":"Custom rule",o,r,a,u,f,c,d,m,h;function g(E,P){return E[8]?U$:B$}let b=g(n),k=b(n);function y(E){n[13](E)}var T=n[6];function $(E){let P={id:E[17],baseCollection:E[1],disabled:E[8]};return E[0]!==void 0&&(P.value=E[0]),{props:P}}T&&(f=jt(T,$(n)),n[12](f),ie.push(()=>ge(f,"value",y)));const M=n[11].default,C=Nt(M,n,n[14],dd),D=C||K$(n);return{c(){e=v("label"),t=v("span"),i=B(n[2]),s=B(" - "),o=B(l),r=O(),k.c(),u=O(),f&&H(f.$$.fragment),d=O(),m=v("div"),D&&D.c(),p(t,"class","txt"),p(e,"for",a=n[17]),p(m,"class","help-block")},m(E,P){S(E,e,P),_(e,t),_(t,i),_(t,s),_(t,o),_(e,r),k.m(e,null),S(E,u,P),f&&q(f,E,P),S(E,d,P),S(E,m,P),D&&D.m(m,null),h=!0},p(E,P){(!h||P&4)&&le(i,E[2]),(!h||P&256)&&l!==(l=E[8]?"Admins only":"Custom rule")&&le(o,l),b===(b=g(E))&&k?k.p(E,P):(k.d(1),k=b(E),k&&(k.c(),k.m(e,null))),(!h||P&131072&&a!==(a=E[17]))&&p(e,"for",a);const L={};if(P&131072&&(L.id=E[17]),P&2&&(L.baseCollection=E[1]),P&256&&(L.disabled=E[8]),!c&&P&1&&(c=!0,L.value=E[0],ke(()=>c=!1)),T!==(T=E[6])){if(f){ae();const N=f;I(N.$$.fragment,1,0,()=>{j(N,1)}),ue()}T?(f=jt(T,$(E)),E[12](f),ie.push(()=>ge(f,"value",y)),H(f.$$.fragment),A(f.$$.fragment,1),q(f,d.parentNode,d)):f=null}else T&&f.$set(L);C?C.p&&(!h||P&16640)&&Rt(C,M,E,E[14],h?Ft(M,E[14],P,H$):qt(E[14]),dd):D&&D.p&&(!h||P&256)&&D.p(E,h?P:-1)},i(E){h||(f&&A(f.$$.fragment,E),A(D,E),h=!0)},o(E){f&&I(f.$$.fragment,E),I(D,E),h=!1},d(E){E&&w(e),k.d(),E&&w(u),n[12](null),f&&j(f,E),E&&w(d),E&&w(m),D&&D.d(E)}}}function Z$(n){let e,t,i,s;const l=[z$,V$],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(),I(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let pd;function G$(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=pd,h=!1;g();async function g(){m||h||(t(7,h=!0),t(6,m=(await rt(()=>import("./FilterAutocompleteInput-80716b22.js"),["./FilterAutocompleteInput-80716b22.js","./index-a6ccb683.js"],import.meta.url)).default),pd=m,t(7,h=!1))}async function b(){t(0,r=d||""),await sn(),c==null||c.focus()}async function k(){d=r,t(0,r=null)}function y($){ie[$?"unshift":"push"](()=>{c=$,t(5,c)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"$$scope"in $&&t(14,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,m,h,i,b,k,s,y,T,l]}class Ss extends ye{constructor(e){super(),ve(this,e,G$,Z$,he,{collection:1,rule:0,label:2,formKey:3,required:4})}}function md(n,e,t){const i=n.slice();return i[10]=e[t],i}function hd(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D,E,P=n[2],L=[];for(let N=0;N<P.length;N+=1)L[N]=gd(md(n,P,N));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=O(),o=v("div");for(let N=0;N<L.length;N+=1)L[N].c();r=O(),a=v("hr"),u=O(),f=v("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=O(),d=v("div"),d.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,m=O(),h=v("hr"),g=O(),b=v("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=O(),y=v("div"),y.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=O(),$=v("hr"),M=O(),C=v("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(b,"class","m-b-0"),p(y,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(N,F){S(N,e,F),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o);for(let R=0;R<L.length;R+=1)L[R].m(o,null);_(i,r),_(i,a),_(i,u),_(i,f),_(i,c),_(i,d),_(i,m),_(i,h),_(i,g),_(i,b),_(i,k),_(i,y),_(i,T),_(i,$),_(i,M),_(i,C),E=!0},p(N,F){if(F&4){P=N[2];let R;for(R=0;R<P.length;R+=1){const X=md(N,P,R);L[R]?L[R].p(X,F):(L[R]=gd(X),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=P.length}},i(N){E||(N&&xe(()=>{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),E=!0)},o(N){N&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),E=!1},d(N){N&&w(e),mt(L,N),N&&D&&D.end()}}}function gd(n){let e,t=n[10]+"",i;return{c(){e=v("code"),i=B(t)},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function _d(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;function b(C){n[6](C)}let k={label:"Create action",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(k.rule=n[0].createRule),i=new Ss({props:k}),ie.push(()=>ge(i,"rule",b));function y(C){n[7](C)}let T={label:"Update action",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(T.rule=n[0].updateRule),a=new Ss({props:T}),ie.push(()=>ge(a,"rule",y));function $(C){n[8](C)}let M={label:"Delete action",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(M.rule=n[0].deleteRule),m=new Ss({props:M}),ie.push(()=>ge(m,"rule",$)),{c(){e=v("hr"),t=O(),H(i.$$.fragment),l=O(),o=v("hr"),r=O(),H(a.$$.fragment),f=O(),c=v("hr"),d=O(),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,D){S(C,e,D),S(C,t,D),q(i,C,D),S(C,l,D),S(C,o,D),S(C,r,D),q(a,C,D),S(C,f,D),S(C,c,D),S(C,d,D),q(m,C,D),g=!0},p(C,D){const E={};D&1&&(E.collection=C[0]),!s&&D&1&&(s=!0,E.rule=C[0].createRule,ke(()=>s=!1)),i.$set(E);const P={};D&1&&(P.collection=C[0]),!u&&D&1&&(u=!0,P.rule=C[0].updateRule,ke(()=>u=!1)),a.$set(P);const L={};D&1&&(L.collection=C[0]),!h&&D&1&&(h=!0,L.rule=C[0].deleteRule,ke(()=>h=!1)),m.$set(L)},i(C){g||(A(i.$$.fragment,C),A(a.$$.fragment,C),A(m.$$.fragment,C),g=!0)},o(C){I(i.$$.fragment,C),I(a.$$.fragment,C),I(m.$$.fragment,C),g=!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 bd(n){let e,t,i,s,l;function o(a){n[9](a)}let r={label:"Manage action",formKey:"options.manageRule",collection:n[0],$$slots:{default:[X$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(r.rule=n[0].options.manageRule),i=new Ss({props:r}),ie.push(()=>ge(i,"rule",o)),{c(){e=v("hr"),t=O(),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||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),j(i,a)}}}function X$(n){let e,t,i;return{c(){e=v("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=O(),i=v("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:Z,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function Q$(n){var X,se;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D=n[1]&&hd(n);function E(W){n[4](W)}let P={label:"List/Search action",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(P.rule=n[0].listRule),f=new Ss({props:P}),ie.push(()=>ge(f,"rule",E));function L(W){n[5](W)}let N={label:"View action",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),g=new Ss({props:N}),ie.push(()=>ge(g,"rule",L));let F=!((X=n[0])!=null&&X.isView)&&_d(n),R=((se=n[0])==null?void 0:se.isAuth)&&bd(n);return{c(){e=v("div"),t=v("div"),i=v("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=O(),l=v("button"),r=B(o),a=O(),D&&D.c(),u=O(),H(f.$$.fragment),d=O(),m=v("hr"),h=O(),H(g.$$.fragment),k=O(),F&&F.c(),y=O(),R&&R.c(),T=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"),p(m,"class","m-t-sm m-b-sm")},m(W,G){S(W,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),D&&D.m(e,null),S(W,u,G),q(f,W,G),S(W,d,G),S(W,m,G),S(W,h,G),q(g,W,G),S(W,k,G),F&&F.m(W,G),S(W,y,G),R&&R.m(W,G),S(W,T,G),$=!0,M||(C=Y(l,"click",n[3]),M=!0)},p(W,[G]){var re,J;(!$||G&2)&&o!==(o=W[1]?"Hide available fields":"Show available fields")&&le(r,o),W[1]?D?(D.p(W,G),G&2&&A(D,1)):(D=hd(W),D.c(),A(D,1),D.m(e,null)):D&&(ae(),I(D,1,1,()=>{D=null}),ue());const te={};G&1&&(te.collection=W[0]),!c&&G&1&&(c=!0,te.rule=W[0].listRule,ke(()=>c=!1)),f.$set(te);const K={};G&1&&(K.collection=W[0]),!b&&G&1&&(b=!0,K.rule=W[0].viewRule,ke(()=>b=!1)),g.$set(K),(re=W[0])!=null&&re.isView?F&&(ae(),I(F,1,1,()=>{F=null}),ue()):F?(F.p(W,G),G&1&&A(F,1)):(F=_d(W),F.c(),A(F,1),F.m(y.parentNode,y)),(J=W[0])!=null&&J.isAuth?R?(R.p(W,G),G&1&&A(R,1)):(R=bd(W),R.c(),A(R,1),R.m(T.parentNode,T)):R&&(ae(),I(R,1,1,()=>{R=null}),ue())},i(W){$||(A(D),A(f.$$.fragment,W),A(g.$$.fragment,W),A(F),A(R),$=!0)},o(W){I(D),I(f.$$.fragment,W),I(g.$$.fragment,W),I(F),I(R),$=!1},d(W){W&&w(e),D&&D.d(),W&&w(u),j(f,W),W&&w(d),W&&w(m),W&&w(h),j(g,W),W&&w(k),F&&F.d(W),W&&w(y),R&&R.d(W),W&&w(T),M=!1,C()}}}function x$(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 eC extends ye{constructor(e){super(),ve(this,e,x$,Q$,he,{collection:0})}}function vd(n,e,t){const i=n.slice();return i[9]=e[t],i}function tC(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=jt(o,r(n)),ie.push(()=>ge(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;I(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>ge(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function nC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function yd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=kd(vd(n,i,l));return{c(){e=v("div"),t=v("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),_(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=vd(l,i,r);s[r]?s[r].p(a,o):(s[r]=kd(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),mt(s,l)}}}function kd(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=B(t)},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function iC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[nC,tC],m=[];function h(b,k){return b[2]?0:1}l=h(n),o=m[l]=d[l](n);let g=n[3].length&&yd(n);return{c(){e=v("label"),t=B("Select query"),s=O(),o.c(),r=O(),a=v("div"),a.innerHTML=`<ul><li>Wildcard (<code>*</code>) columns 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
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=O(),g&&g.c(),f=Me(),p(e,"for",i=n[8]),p(a,"class","help-block")},m(b,k){S(b,e,k),_(e,t),S(b,s,k),m[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),g&&g.m(b,k),S(b,f,k),c=!0},p(b,k){(!c||k&256&&i!==(i=b[8]))&&p(e,"for",i);let y=l;l=h(b),l===y?m[l].p(b,k):(ae(),I(m[y],1,1,()=>{m[y]=null}),ue(),o=m[l],o?o.p(b,k):(o=m[l]=d[l](b),o.c()),A(o,1),o.m(r.parentNode,r)),b[3].length?g?g.p(b,k):(g=yd(b),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(b){c||(A(o),c=!0)},o(b){I(o),c=!1},d(b){b&&w(e),b&&w(s),m[l].d(b),b&&w(r),b&&w(a),b&&w(u),g&&g.d(b),b&&w(f)}}}function sC(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[iC,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function lC(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 g in d)for(let b in d[g]){const k=d[g][b].message,y=m[g]||g;r.push(z.sentenize(y+": "+k))}}Zt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-4caff52a.js"),["./CodeEditor-4caff52a.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 oC extends ye{constructor(e){super(),ve(this,e,lC,sC,he,{collection:0})}}function rC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 aC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[rC,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function uC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function fC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function wd(n){let e,t,i,s,l;return{c(){e=v("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 cC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowUsernameAuth?fC:uC}let u=a(n),f=u(n),c=n[3]&&wd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=O(),i=v("div"),s=O(),f.c(),l=O(),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&&A(c,1):(c=wd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(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 dC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 Sd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[pC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[mC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("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),_(e,t),q(i,t,null),_(e,s),_(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||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&xe(()=>{r||(r=je(e,At,{duration:150},!0)),r.run(1)}),a=!0)},o(u){I(i.$$.fragment,u),I(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 pC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(b){n[7](b)}let g={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Ns({props:g}),ie.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("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(b,k){S(b,e,k),_(e,t),_(e,i),_(e,s),S(b,o,k),q(r,b,k),S(b,u,k),S(b,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(b,k){(!c||k&4096&&l!==(l=b[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=b[12]),k&1&&(y.disabled=!z.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,y.value=b[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(y)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,m()}}}function mC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function h(b){n[8](b)}let g={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Ns({props:g}),ie.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=O(),s=v("i"),o=O(),H(r.$$.fragment),u=O(),f=v("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(b,k){S(b,e,k),_(e,t),_(e,i),_(e,s),S(b,o,k),q(r,b,k),S(b,u,k),S(b,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(b,k){(!c||k&4096&&l!==(l=b[12]))&&p(e,"for",l);const y={};k&4096&&(y.id=b[12]),k&1&&(y.disabled=!z.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,y.value=b[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(y)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){I(r.$$.fragment,b),c=!1},d(b){b&&w(e),b&&w(o),j(r,b),b&&w(u),b&&w(f),d=!1,m()}}}function hC(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[dC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Sd(n);return{c(){H(e.$$.fragment),t=O(),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&&A(l,1)):(l=Sd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function gC(n){let e;return{c(){e=v("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=v("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=v("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.allowEmailAuth?_C:gC}let u=a(n),f=u(n),c=n[2]&&Td();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=O(),i=v("div"),s=O(),f.c(),l=O(),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&&A(c,1):(c=Td(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(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=v("input"),i=O(),s=v("label"),l=B("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),_(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 $d(n){let e,t,i;return{c(){e=v("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 yC(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[vC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&$d();return{c(){H(e.$$.fragment),t=O(),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&&A(l,1):(l=$d(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function kC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function wC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Cd(n){let e,t,i,s,l;return{c(){e=v("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 SC(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].options.allowOAuth2Auth?wC:kC}let u=a(n),f=u(n),c=n[1]&&Cd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=O(),i=v("div"),s=O(),f.c(),l=O(),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&&A(c,1):(c=Cd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue())},i(d){r||(A(c),r=!0)},o(d){I(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 TC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Minimum password length"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].options.minPasswordLength&&ce(l,u[0].options.minPasswordLength)},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,f;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Always require email",o=O(),r=v("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),_(s,l),_(s,o),_(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 CC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k;return s=new ys({props:{single:!0,$$slots:{header:[cC],default:[aC]},$$scope:{ctx:n}}}),o=new ys({props:{single:!0,$$slots:{header:[bC],default:[hC]},$$scope:{ctx:n}}}),a=new ys({props:{single:!0,$$slots:{header:[SC],default:[yC]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[TC,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),b=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[$C,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=O(),i=v("div"),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),f=v("hr"),c=O(),d=v("h4"),d.textContent="General",m=O(),H(h.$$.fragment),g=O(),H(b.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(y,T){S(y,e,T),S(y,t,T),S(y,i,T),q(s,i,null),_(i,l),q(o,i,null),_(i,r),q(a,i,null),S(y,u,T),S(y,f,T),S(y,c,T),S(y,d,T),S(y,m,T),q(h,y,T),S(y,g,T),q(b,y,T),k=!0},p(y,[T]){const $={};T&8201&&($.$$scope={dirty:T,ctx:y}),s.$set($);const M={};T&8197&&(M.$$scope={dirty:T,ctx:y}),o.$set(M);const C={};T&8195&&(C.$$scope={dirty:T,ctx:y}),a.$set(C);const D={};T&12289&&(D.$$scope={dirty:T,ctx:y}),h.$set(D);const E={};T&12289&&(E.$$scope={dirty:T,ctx:y}),b.$set(E)},i(y){k||(A(s.$$.fragment,y),A(o.$$.fragment,y),A(a.$$.fragment,y),A(h.$$.fragment,y),A(b.$$.fragment,y),k=!0)},o(y){I(s.$$.fragment,y),I(o.$$.fragment,y),I(a.$$.fragment,y),I(h.$$.fragment,y),I(b.$$.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(g),j(b,y)}}}function MC(n,e,t){let i,s,l,o;Ye(n,fi,g=>t(4,o=g));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(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ht(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,b,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((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!z.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.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 DC extends ye{constructor(e){super(),ve(this,e,MC,CC,he,{collection:0})}}function Md(n,e,t){const i=n.slice();return i[15]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Od(n){let e;return{c(){e=v("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 Ed(n){var r;let e,t,i,s,l=n[2]&&Ad(n),o=!((r=n[1])!=null&&r.isView)&&Id(n);return{c(){e=v("h6"),e.textContent="Changes:",t=O(),i=v("ul"),l&&l.c(),s=O(),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),_(i,s),o&&o.m(i,null)},p(a,u){var f;a[2]?l?l.p(a,u):(l=Ad(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=Id(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 Ad(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed collection
`),s=v("strong"),o=B(l),r=O(),a=v("i"),u=O(),f=v("strong"),d=B(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),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(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 Id(n){let e,t,i=n[5],s=[];for(let r=0;r<i.length;r+=1)s[r]=Pd(Dd(n,i,r));let l=n[4],o=[];for(let r=0;r<l.length;r+=1)o[r]=Ld(Md(n,l,r));return{c(){for(let r=0;r<s.length;r+=1)s[r].c();e=O();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=Dd(r,i,u);s[u]?s[u].p(f,a):(s[u]=Pd(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=Md(r,l,u);o[u]?o[u].p(f,a):(o[u]=Ld(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){mt(s,r),r&&w(e),mt(o,r),r&&w(t)}}}function Pd(n){let e,t,i,s,l=n[15].originalName+"",o,r,a,u,f,c=n[15].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed field
`),s=v("strong"),o=B(l),r=O(),a=v("i"),u=O(),f=v("strong"),d=B(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),_(e,t),_(t,i),_(t,s),_(s,o),_(t,r),_(t,a),_(t,u),_(t,f),_(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 Ld(n){let e,t,i,s=n[15].name+"",l,o;return{c(){e=v("li"),t=B("Removed field "),i=v("span"),l=B(s),o=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(i,l),_(e,o)},p(r,a){a&16&&s!==(s=r[15].name+"")&&le(l,s)},d(r){r&&w(e)}}}function OC(n){let e,t,i,s,l,o,r,a,u=n[4].length&&Od(),f=n[6]&&Ed(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=v("div"),l=v("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=O(),u&&u.c(),r=O(),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),_(e,t),_(e,i),_(e,s),_(s,l),_(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=Od(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[6]?f?f.p(c,d):(f=Ed(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 EC(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function AC(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=v("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:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function IC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[AC],header:[EC],default:[OC]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function PC(n,e,t){let i,s,l,o;const r=Ct();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 g(y){ie[y?"unshift":"push"](()=>{a=y,t(3,a)})}function b(y){ze.call(this,n,y)}function k(y){ze.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,g,b,k]}class LC extends ye{constructor(e){super(),ve(this,e,PC,IC,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Nd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function NC(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new j$({props:l}),ie.push(()=>ge(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function FC(n){let e,t,i;function s(o){n[31](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new oC({props:l}),ie.push(()=>ge(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Fd(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 eC({props:o}),ie.push(()=>ge(t,"collection",l)),{c(){e=v("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||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Rd(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 DC({props:o}),ie.push(()=>ge(t,"collection",l)),{c(){e=v("div"),H(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Os)},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]===Os)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function RC(n){let e,t,i,s,l,o,r;const a=[FC,NC],u=[];function f(m,h){return m[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===bl&&Fd(n),d=n[2].isAuth&&Rd(n);return{c(){e=v("div"),t=v("div"),s.c(),l=O(),c&&c.c(),o=O(),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),_(e,t),u[i].m(t,null),_(e,l),c&&c.m(e,null),_(e,o),d&&d.m(e,null),r=!0},p(m,h){let g=i;i=f(m),i===g?u[i].p(m,h):(ae(),I(u[g],1,1,()=>{u[g]=null}),ue(),s=u[i],s?s.p(m,h):(s=u[i]=a[i](m),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",m[3]===yi),m[3]===bl?c?(c.p(m,h),h[0]&8&&A(c,1)):(c=Fd(m),c.c(),A(c,1),c.m(e,o)):c&&(ae(),I(c,1,1,()=>{c=null}),ue()),m[2].isAuth?d?(d.p(m,h),h[0]&4&&A(d,1)):(d=Rd(m),d.c(),A(d,1),d.m(e,null)):d&&(ae(),I(d,1,1,()=>{d=null}),ue())},i(m){r||(A(s),A(c),A(d),r=!0)},o(m){I(s),I(c),I(d),r=!1},d(m){m&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function qd(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[qC]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),i=v("button"),s=v("i"),l=O(),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),_(i,s),_(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||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function qC(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,t=O(),i=v("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(dt(n[24])))],s=!0)},p:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function jd(n){let e,t,i,s;return i=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[jC]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=O(),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||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function Hd(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=v("button"),t=v("i"),s=O(),l=v("span"),r=B(o),a=B(" collection"),u=O(),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),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),_(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 jC(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Hd(Nd(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=Nd(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hd(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){mt(i,s),s&&w(e)}}}function Vd(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k=(n[6][n[2].type]||"N/A")+"",y,T,$,M,C,D,E,P,L,N=n[2].isNew&&jd(n),F=n[2].system&&Vd();return{c(){e=v("label"),t=B("Name"),s=O(),l=v("input"),f=O(),c=v("div"),d=v("button"),m=v("span"),h=O(),g=v("span"),b=B("Type: "),y=B(k),T=O(),N&&N.c(),C=O(),F&&F.c(),D=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(g,"class","txt"),p(d,"type","button"),p(d,"class",$="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,X){S(R,e,X),_(e,t),S(R,s,X),S(R,l,X),S(R,f,X),S(R,c,X),_(c,d),_(d,m),_(d,h),_(d,g),_(g,b),_(g,y),_(d,T),N&&N.m(d,null),S(R,C,X),F&&F.m(R,X),S(R,D,X),E=!0,n[2].isNew&&l.focus(),P||(L=Y(l,"input",n[25]),P=!0)},p(R,X){(!E||X[1]&32768&&i!==(i=R[46]))&&p(e,"for",i),(!E||X[1]&32768&&o!==(o=R[46]))&&p(l,"id",o),(!E||X[0]&8192)&&(l.disabled=R[13]),(!E||X[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||X[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!E||X[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||X[0]&68)&&k!==(k=(R[6][R[2].type]||"N/A")+"")&&le(y,k),R[2].isNew?N?(N.p(R,X),X[0]&4&&A(N,1)):(N=jd(R),N.c(),A(N,1),N.m(d,null)):N&&(ae(),I(N,1,1,()=>{N=null}),ue()),(!E||X[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&p(d,"class",$),(!E||X[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?F||(F=Vd(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(R){E||(A(N),E=!0)},o(R){I(N),E=!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(D),P=!1,L()}}}function zd(n){let e,t,i,s,l,o;return{c(){e=v("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 Bd(n){let e,t,i,s,l;return{c(){e=v("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 Ud(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&&Wd();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=O(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Os)},m(c,d){S(c,e,d),_(e,t),_(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[30]),l=!0)},p(c,d){var m,h,g;d[0]&32&&(s=!z.isEmpty((m=c[5])==null?void 0:m.options)&&!((g=(h=c[5])==null?void 0:h.options)!=null&&g.manageRule)),s?r?d[0]&32&&A(r,1):(r=Wd(),r.c(),A(r,1),r.m(e,null)):r&&(ae(),I(r,1,1,()=>{r=null}),ue()),d[0]&8&&Q(e,"active",c[3]===Os)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function Wd(n){let e,t,i,s,l;return{c(){e=v("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 VC(n){var se,W,G,te,K,re,J,de;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,m,h=(se=n[2])!=null&&se.isView?"Query":"Fields",g,b,k=!z.isEmpty(n[11]),y,T,$,M,C=!z.isEmpty((W=n[5])==null?void 0:W.listRule)||!z.isEmpty((G=n[5])==null?void 0:G.viewRule)||!z.isEmpty((te=n[5])==null?void 0:te.createRule)||!z.isEmpty((K=n[5])==null?void 0:K.updateRule)||!z.isEmpty((re=n[5])==null?void 0:re.deleteRule)||!z.isEmpty((de=(J=n[5])==null?void 0:J.options)==null?void 0:de.manageRule),D,E,P,L,N=!n[2].isNew&&!n[2].system&&qd(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[HC,({uniqueId:_e})=>({46:_e}),({uniqueId:_e})=>[0,_e?32768:0]]},$$scope:{ctx:n}}});let F=k&&zd(n),R=C&&Bd(),X=n[2].isAuth&&Ud(n);return{c(){e=v("h4"),i=B(t),s=O(),N&&N.c(),l=O(),o=v("form"),H(r.$$.fragment),a=O(),u=v("input"),f=O(),c=v("div"),d=v("button"),m=v("span"),g=B(h),b=O(),F&&F.c(),y=O(),T=v("button"),$=v("span"),$.textContent="API Rules",M=O(),R&&R.c(),D=O(),X&&X.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($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),Q(T,"active",n[3]===bl),p(c,"class","tabs-header stretched")},m(_e,$e){S(_e,e,$e),_(e,i),S(_e,s,$e),N&&N.m(_e,$e),S(_e,l,$e),S(_e,o,$e),q(r,o,null),_(o,a),_(o,u),S(_e,f,$e),S(_e,c,$e),_(c,d),_(d,m),_(m,g),_(d,b),F&&F.m(d,null),_(c,y),_(c,T),_(T,$),_(T,M),R&&R.m(T,null),_(c,D),X&&X.m(c,null),E=!0,P||(L=[Y(o,"submit",dt(n[27])),Y(d,"click",n[28]),Y(T,"click",n[29])],P=!0)},p(_e,$e){var Re,be,Se,We,lt,fe,Ve,ee;(!E||$e[0]&4)&&t!==(t=_e[2].isNew?"New collection":"Edit collection")&&le(i,t),!_e[2].isNew&&!_e[2].system?N?(N.p(_e,$e),$e[0]&4&&A(N,1)):(N=qd(_e),N.c(),A(N,1),N.m(l.parentNode,l)):N&&(ae(),I(N,1,1,()=>{N=null}),ue());const Ne={};$e[0]&8192&&(Ne.class="form-field collection-field-name required m-b-0 "+(_e[13]?"disabled":"")),$e[0]&8260|$e[1]&1081344&&(Ne.$$scope={dirty:$e,ctx:_e}),r.$set(Ne),(!E||$e[0]&4)&&h!==(h=(Re=_e[2])!=null&&Re.isView?"Query":"Fields")&&le(g,h),$e[0]&2048&&(k=!z.isEmpty(_e[11])),k?F?(F.p(_e,$e),$e[0]&2048&&A(F,1)):(F=zd(_e),F.c(),A(F,1),F.m(d,null)):F&&(ae(),I(F,1,1,()=>{F=null}),ue()),(!E||$e[0]&8)&&Q(d,"active",_e[3]===yi),$e[0]&32&&(C=!z.isEmpty((be=_e[5])==null?void 0:be.listRule)||!z.isEmpty((Se=_e[5])==null?void 0:Se.viewRule)||!z.isEmpty((We=_e[5])==null?void 0:We.createRule)||!z.isEmpty((lt=_e[5])==null?void 0:lt.updateRule)||!z.isEmpty((fe=_e[5])==null?void 0:fe.deleteRule)||!z.isEmpty((ee=(Ve=_e[5])==null?void 0:Ve.options)==null?void 0:ee.manageRule)),C?R?$e[0]&32&&A(R,1):(R=Bd(),R.c(),A(R,1),R.m(T,null)):R&&(ae(),I(R,1,1,()=>{R=null}),ue()),(!E||$e[0]&8)&&Q(T,"active",_e[3]===bl),_e[2].isAuth?X?X.p(_e,$e):(X=Ud(_e),X.c(),X.m(c,null)):X&&(X.d(1),X=null)},i(_e){E||(A(N),A(r.$$.fragment,_e),A(F),A(R),E=!0)},o(_e){I(N),I(r.$$.fragment,_e),I(F),I(R),E=!1},d(_e){_e&&w(e),_e&&w(s),N&&N.d(_e),_e&&w(l),_e&&w(o),j(r),_e&&w(f),_e&&w(c),F&&F.d(),R&&R.d(),X&&X.d(),P=!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=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),r=B(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),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(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 BC(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",beforeHide:n[35],$$slots:{footer:[zC],header:[VC],default:[RC]},$$scope:{ctx:n}};e=new Nn({props:l}),n[36](e),e.$on("hide",n[37]),e.$on("show",n[38]);let o={};return i=new LC({props:o}),n[39](i),i.$on("confirm",n[40]),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(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",bl="api_rules",Os="options",UC="base",Yd="auth",WC="view";function Dr(n){return JSON.stringify(n)}function YC(n,e,t){let i,s,l,o;Ye(n,fi,ee=>t(5,o=ee));const r={};r[UC]="Base",r[WC]="View",r[Yd]="Auth";const a=Ct();let u,f,c=null,d=new pn,m=!1,h=!1,g=yi,b=Dr(d),k="";function y(ee){t(3,g=ee)}function T(ee){return M(ee),t(10,h=!0),y(yi),u==null?void 0:u.show()}function $(){return u==null?void 0:u.hide()}async function M(ee){Bn({}),typeof ee<"u"?(c=ee,t(2,d=ee==null?void 0:ee.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,b=Dr(d))}function C(){if(d.isNew)return D();f==null||f.show(d)}function D(){if(m)return;t(9,m=!0);const ee=E();let Fe;d.isNew?Fe=pe.collections.create(ee):Fe=pe.collections.update(d.id,ee),Fe.then(ot=>{$a(),Tb(ot.id),t(10,h=!1),$(),zt(d.isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:d.isNew,collection:ot})}).catch(ot=>{pe.errorResponseHandler(ot)}).finally(()=>{t(9,m=!1)})}function E(){const ee=d.export();ee.schema=ee.schema.slice(0);for(let Fe=ee.schema.length-1;Fe>=0;Fe--)ee.schema[Fe].toDelete&&ee.schema.splice(Fe,1);return ee}function P(){c!=null&&c.id&&cn(`Do you really want to delete collection "${c==null?void 0:c.name}" and all its records?`,()=>pe.collections.delete(c==null?void 0:c.id).then(()=>{$(),zt(`Successfully deleted collection "${c==null?void 0:c.name}".`),a("delete",c),D3(c)}).catch(ee=>{pe.errorResponseHandler(ee)}))}function L(ee){t(2,d.type=ee,d),Qi("schema")}function N(){s?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ee=c==null?void 0:c.clone();if(ee&&(ee.id="",ee.created="",ee.updated="",ee.name+="_duplicate",!z.isEmpty(ee.schema)))for(const Fe of ee.schema)Fe.id="";T(ee),await sn(),t(20,b="")}const R=()=>$(),X=()=>C(),se=()=>N(),W=()=>P(),G=ee=>{t(2,d.name=z.slugify(ee.target.value),d),ee.target.value=d.name},te=ee=>L(ee),K=()=>{l&&C()},re=()=>y(yi),J=()=>y(bl),de=()=>y(Os);function _e(ee){d=ee,t(2,d)}function $e(ee){d=ee,t(2,d)}function Ne(ee){d=ee,t(2,d)}function Re(ee){d=ee,t(2,d)}const be=()=>s&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,h=!1),$()}),!1):!0;function Se(ee){ie[ee?"unshift":"push"](()=>{u=ee,t(7,u)})}function We(ee){ze.call(this,n,ee)}function lt(ee){ze.call(this,n,ee)}function fe(ee){ie[ee?"unshift":"push"](()=>{f=ee,t(8,f)})}const Ve=()=>D();return n.$$.update=()=>{var ee;n.$$.dirty[0]&32&&(o.schema||(ee=o.options)!=null&&ee.query?t(11,k=z.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&t(13,i=!d.isNew&&d.system),n.$$.dirty[0]&1048580&&t(4,s=b!=Dr(d)),n.$$.dirty[0]&20&&t(12,l=d.isNew||s),n.$$.dirty[0]&12&&g===Os&&d.type!==Yd&&y(yi)},[y,$,d,g,s,o,r,u,f,m,h,k,l,i,C,D,P,L,N,T,b,R,X,se,W,G,te,K,re,J,de,_e,$e,Ne,Re,be,Se,We,lt,fe,Ve]}class tu extends ye{constructor(e){super(),ve(this,e,YC,BC,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 Kd(n,e,t){const i=n.slice();return i[15]=e[t],i}function Jd(n){let e,t=n[1].length&&Zd();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=Zd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Zd(n){let e;return{c(){e=v("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 Gd(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=v("a"),i=v("i"),l=O(),o=v("span"),a=B(r),u=O(),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),_(t,i),_(t,l),_(t,o),_(o,a),_(t,u),c||(d=Ie(xt.call(null,t)),c=!0)},p(m,h){var g;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",((g=e[5])==null?void 0:g.id)===e[15].id)},d(m){m&&w(t),c=!1,d()}}}function Xd(n){let e,t,i,s;return{c(){e=v("footer"),t=v("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),_(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:Z,d(l){l&&w(e),i=!1,s()}}}function KC(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,h,g,b,k,y,T,$=n[3];const M=P=>P[15].id;for(let P=0;P<$.length;P+=1){let L=Kd(n,$,P),N=M(L);m.set(N,d[P]=Gd(N,L))}let C=null;$.length||(C=Jd(n));let D=!n[7]&&Xd(n),E={};return b=new tu({props:E}),n[13](b),b.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=O(),r=v("input"),a=O(),u=v("hr"),f=O(),c=v("div");for(let P=0;P<d.length;P+=1)d[P].c();C&&C.c(),h=O(),D&&D.c(),g=O(),H(b.$$.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(P,L){S(P,e,L),_(e,t),_(t,i),_(i,s),_(s,l),_(i,o),_(i,r),ce(r,n[0]),_(e,a),_(e,u),_(e,f),_(e,c);for(let N=0;N<d.length;N+=1)d[N].m(c,null);C&&C.m(c,null),_(e,h),D&&D.m(e,null),S(P,g,L),q(b,P,L),k=!0,y||(T=[Y(l,"click",n[10]),Y(r,"input",n[11])],y=!0)},p(P,[L]){(!k||L&16)&&Q(l,"hidden",!P[4]),L&1&&r.value!==P[0]&&ce(r,P[0]),(!k||L&16)&&Q(i,"active",P[4]),L&42&&($=P[3],d=wt(d,L,M,1,P,$,m,c,es,Gd,null,Kd),!$.length&&C?C.p(P,L):$.length?C&&(C.d(1),C=null):(C=Jd(P),C.c(),C.m(c,null))),(!k||L&64)&&Q(c,"fade",P[6]),(!k||L&8)&&Q(c,"sidebar-content-compact",P[3].length>20),P[7]?D&&(D.d(1),D=null):D?D.p(P,L):(D=Xd(P),D.c(),D.m(e,null));const N={};b.$set(N)},i(P){k||(A(b.$$.fragment,P),k=!0)},o(P){I(b.$$.fragment,P),k=!1},d(P){P&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),D&&D.d(),P&&w(g),n[13](null),j(b,P),y=!1,Pe(T)}}}function JC(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function ZC(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,Po,y=>t(6,a=y)),Ye(n,$s,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 g=()=>f==null?void 0:f.show();function b(y){ie[y?"unshift":"push"](()=>{f=y,t(2,f)})}const k=y=>{var T;(T=y.detail)!=null&&T.isNew&&y.detail.collection&&d(y.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&JC(),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,g,b,k]}class GC extends ye{constructor(e){super(),ve(this,e,ZC,KC,he,{})}}function Qd(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function xd(n){n[18]=n[19].default}function ep(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function tp(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function np(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&tp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=Me(),c&&c.c(),s=O(),l=v("button"),r=B(o),a=O(),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),_(l,r),_(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=tp(),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 ip(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:xC,then:QC,catch:XC,value:19,blocks:[,,,]};return ou(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)&&ou(t,s)||e1(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];I(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function XC(n){return{c:Z,m:Z,p:Z,i:Z,o:Z,d:Z}}function QC(n){xd(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){H(e.$$.fragment),t=O()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){xd(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function xC(n){return{c:Z,m:Z,p:Z,i:Z,o:Z,d:Z}}function sp(n,e){let t,i,s,l=e[5]===e[14]&&ip(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&&A(l,1)):(l=ip(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),I(l,1,1,()=>{l=null}),ue())},i(o){s||(A(l),s=!0)},o(o){I(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function e4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=g=>g[14];for(let g=0;g<c.length;g+=1){let b=ep(n,c,g),k=d(b);l.set(k,s[g]=np(k,b))}let m=Object.entries(n[3]);const h=g=>g[14];for(let g=0;g<m.length;g+=1){let b=Qd(n,m,g),k=h(b);u.set(k,a[g]=sp(k,b))}return{c(){var g;e=v("div"),t=v("aside"),i=v("nav");for(let b=0;b<s.length;b+=1)s[b].c();o=O(),r=v("div");for(let b=0;b<a.length;b+=1)a[b].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),Q(t,"compact",(g=n[2])==null?void 0:g.isAuth),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(g,b){S(g,e,b),_(e,t),_(t,i);for(let k=0;k<s.length;k+=1)s[k].m(i,null);_(e,o),_(e,r);for(let k=0;k<a.length;k+=1)a[k].m(r,null);f=!0},p(g,b){var k;b&106&&(c=Object.entries(g[3]),s=wt(s,b,d,1,g,c,l,i,es,np,null,ep)),(!f||b&4)&&Q(t,"compact",(k=g[2])==null?void 0:k.isAuth),b&44&&(m=Object.entries(g[3]),ae(),a=wt(a,b,h,1,g,m,u,r,ln,sp,null,Qd),ue())},i(g){if(!f){for(let b=0;b<m.length;b+=1)A(a[b]);f=!0}},o(g){for(let b=0;b<a.length;b+=1)I(a[b]);f=!1},d(g){g&&w(e);for(let b=0;b<s.length;b+=1)s[b].d();for(let b=0;b<a.length;b+=1)a[b].d()}}}function t4(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function n4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[t4],default:[e4]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function i4(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-d17d7325.js"),["./ListApiDocs-d17d7325.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-da1553a5.js"),["./ViewApiDocs-da1553a5.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-32d5a929.js"),["./CreateApiDocs-32d5a929.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-66c52be5.js"),["./UpdateApiDocs-66c52be5.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-3a858be4.js"),["./DeleteApiDocs-3a858be4.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-bab3bf58.js"),["./RealtimeApiDocs-bab3bf58.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-f5651e67.js"),["./AuthWithPasswordDocs-f5651e67.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-08a04f0f.js"),["./AuthWithOAuth2Docs-08a04f0f.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-82bf2d4d.js"),["./AuthRefreshDocs-82bf2d4d.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-fa3c623a.js"),["./RequestVerificationDocs-fa3c623a.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-4f3afd09.js"),["./ConfirmVerificationDocs-4f3afd09.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-aa324f13.js"),["./RequestPasswordResetDocs-aa324f13.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-d848311f.js"),["./ConfirmPasswordResetDocs-d848311f.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-327245a0.js"),["./RequestEmailChangeDocs-327245a0.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-d42af417.js"),["./ConfirmEmailChangeDocs-d42af417.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-97cd7d05.js"),["./AuthMethodsDocs-97cd7d05.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-d4af9a48.js"),["./ListExternalAuthsDocs-d4af9a48.js","./SdkTabs-5b973c0d.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-6ceca8bb.js"),["./UnlinkExternalAuthDocs-6ceca8bb.js","./SdkTabs-5b973c0d.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){ie[k?"unshift":"push"](()=>{l=k,t(4,l)})}function g(k){ze.call(this,n,k)}function b(k){ze.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,g,b]}class s4 extends ye{constructor(e){super(),ve(this,e,i4,n4,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 l4(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Username",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(m,o,h),S(m,r,h),ce(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&&ce(r,m[0].username)},d(m){m&&w(e),m&&w(o),m&&w(r),c=!1,d()}}}function o4(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,g,b,k,y,T,$;return{c(){var M;e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Email",o=O(),r=v("div"),a=v("button"),u=v("span"),f=B("Public: "),d=B(c),h=O(),g=v("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(g,"type","email"),g.autofocus=b=n[0].isNew,p(g,"autocomplete","off"),p(g,"id",k=n[12]),g.required=y=(M=n[1].options)==null?void 0:M.requireEmail,p(g,"class","svelte-1751a4d")},m(M,C){S(M,e,C),_(e,t),_(e,i),_(e,s),S(M,o,C),S(M,r,C),_(r,a),_(a,u),_(u,f),_(u,d),S(M,h,C),S(M,g,C),ce(g,n[0].email),n[0].isNew&&g.focus(),T||($=[Ie(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",n[5]),Y(g,"input",n[6])],T=!0)},p(M,C){var D;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&&b!==(b=M[0].isNew)&&(g.autofocus=b),C&4096&&k!==(k=M[12])&&p(g,"id",k),C&2&&y!==(y=(D=M[1].options)==null?void 0:D.requireEmail)&&(g.required=y),C&1&&g.value!==M[0].email&&ce(g,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(h),M&&w(g),T=!1,Pe($)}}}function lp(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[r4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function r4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 op(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[a4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[u4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),H(s.$$.fragment),l=O(),o=v("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),_(e,t),_(t,i),q(s,i,null),_(t,l),_(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||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{a||(a=je(e,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){I(s.$$.fragment,f),I(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 a4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(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&&ce(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function u4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password confirm",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(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&&ce(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function f4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(s,l),r||(a=[Y(e,"change",n[10]),Y(e,"change",dt(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 c4(n){var b;let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[l4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[o4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}});let h=!n[0].isNew&&lp(n),g=(n[0].isNew||n[2])&&op(n);return d=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[f4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),h&&h.c(),u=O(),g&&g.c(),f=O(),c=v("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),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),h&&h.m(a,null),_(a,u),g&&g.m(a,null),_(e,f),_(e,c),q(d,c,null),m=!0},p(k,[y]){var C;const T={};y&1&&(T.class="form-field "+(k[0].isNew?"":"required")),y&12289&&(T.$$scope={dirty:y,ctx:k}),i.$set(T);const $={};y&2&&($.class="form-field "+((C=k[1].options)!=null&&C.requireEmail?"required":"")),y&12291&&($.$$scope={dirty:y,ctx:k}),o.$set($),k[0].isNew?h&&(ae(),I(h,1,1,()=>{h=null}),ue()):h?(h.p(k,y),y&1&&A(h,1)):(h=lp(k),h.c(),A(h,1),h.m(a,u)),k[0].isNew||k[2]?g?(g.p(k,y),y&5&&A(g,1)):(g=op(k),g.c(),A(g,1),g.m(a,null)):g&&(ae(),I(g,1,1,()=>{g=null}),ue());const M={};y&12289&&(M.$$scope={dirty:y,ctx:k}),d.$set(M)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(h),A(g),A(d.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),I(o.$$.fragment,k),I(h),I(g),I(d.$$.fragment,k),m=!1},d(k){k&&w(e),j(i),j(o),h&&h.d(),g&&g.d(),j(d)}}}function d4(n,e,t){let{collection:i=new pn}=e,{record:s=new Ti}=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=g=>{s.isNew||cn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!g.target.checked,s)})};return n.$$set=g=>{"collection"in g&&t(1,i=g.collection),"record"in g&&t(0,s=g.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 p4 extends ye{constructor(e){super(),ve(this,e,d4,c4,he,{collection:1,record:0})}}function m4(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=v("textarea"),Xn(e,l),Q(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),ce(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&&ce(e,o[0]),Q(e,"svelte-1x1pbts",!0)},i:Z,o:Z,d(o){o&&w(e),n[5](null),t=!1,Pe(i)}}}function h4(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){ie[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 g4 extends ye{constructor(e){super(),ve(this,e,h4,m4,he,{value:0,maxHeight:4})}}function _4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(g){n[2](g)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new g4({props:h}),ie.push(()=>ge(f,"value",m)),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),H(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),q(f,g,b),d=!0},p(g,b){(!d||b&2&&i!==(i=z.getFieldTypeIcon(g[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!d||b&8&&a!==(a=g[3]))&&p(e,"for",a);const k={};b&8&&(k.id=g[3]),b&2&&(k.required=g[1].required),!c&&b&1&&(c=!0,k.value=g[0],ke(()=>c=!1)),f.$set(k)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){I(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function b4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[_4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(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(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 y4 extends ye{constructor(e){super(),ve(this,e,v4,b4,he,{field:1,value:0})}}function k4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,g,b;return{c(){var k,y;e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("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),_(e,t),_(e,s),_(e,l),_(l,r),S(k,u,y),S(k,f,y),ce(f,n[0]),g||(b=Y(f,"input",n[2]),g=!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=(T=k[1].options)==null?void 0:T.min)&&p(f,"min",m),y&2&&h!==(h=($=k[1].options)==null?void 0:$.max)&&p(f,"max",h),y&1&&ht(f.value)!==k[0]&&ce(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),g=!1,b()}}}function w4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[k4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S4(n,e,t){let{field:i=new mn}=e,{value:s=void 0}=e;function l(){s=ht(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 T4 extends ye{constructor(e){super(),ve(this,e,S4,w4,he,{field:1,value:0})}}function $4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=O(),s=v("label"),o=B(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),_(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 C4(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function M4(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 D4 extends ye{constructor(e){super(),ve(this,e,M4,C4,he,{field:1,value:0})}}function O4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("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(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),ce(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=z.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&p(e,"for",a),b&8&&c!==(c=g[3])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&1&&f.value!==g[0]&&ce(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,h()}}}function E4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[O4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function A4(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 I4 extends ye{constructor(e){super(),ve(this,e,A4,E4,he,{field:1,value:0})}}function P4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("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(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),ce(f,n[0]),m||(h=Y(f,"input",n[2]),m=!0)},p(g,b){b&2&&i!==(i=z.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&8&&a!==(a=g[3])&&p(e,"for",a),b&8&&c!==(c=g[3])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&1&&ce(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,h()}}}function L4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[P4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function N4(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 F4 extends ye{constructor(e){super(),ve(this,e,N4,L4,he,{field:1,value:0})}}function rp(n){let e,t,i,s;return{c(){e=v("div"),t=v("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),_(e,t),i||(s=[Ie(Be.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:Z,d(l){l&&w(e),i=!1,Pe(s)}}}function R4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h,g,b=n[0]&&!n[1].required&&rp(n);function k($){n[6]($)}function y($){n[7]($)}let T={id:n[8],options:z.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new eu({props:T}),ie.push(()=>ge(d,"value",k)),ie.push(()=>ge(d,"formattedValue",y)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),a=B(" (UTC)"),f=O(),b&&b.c(),c=O(),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($,M){S($,e,M),_(e,t),_(e,s),_(e,l),_(l,r),_(l,a),S($,f,M),b&&b.m($,M),S($,c,M),q(d,$,M),g=!0},p($,M){(!g||M&2&&i!==(i=Si(z.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!g||M&2)&&o!==(o=$[1].name+"")&&le(r,o),(!g||M&256&&u!==(u=$[8]))&&p(e,"for",u),$[0]&&!$[1].required?b?b.p($,M):(b=rp($),b.c(),b.m(c.parentNode,c)):b&&(b.d(1),b=null);const C={};M&256&&(C.id=$[8]),!m&&M&4&&(m=!0,C.value=$[2],ke(()=>m=!1)),!h&&M&1&&(h=!0,C.formattedValue=$[0],ke(()=>h=!1)),d.$set(C)},i($){g||(A(d.$$.fragment,$),g=!0)},o($){I(d.$$.fragment,$),g=!1},d($){$&&w(e),$&&w(f),b&&b.d($),$&&w(c),j(d,$)}}}function q4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[R4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function j4(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 H4 extends ye{constructor(e){super(),ve(this,e,j4,q4,he,{field:1,value:0})}}function ap(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=B("Select up to "),s=B(i),l=B(" items."),p(e,"class","help-block")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function V4(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 g(D){n[3](D)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((y=n[0])==null?void 0:y.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((M=n[1].options)==null?void 0:M.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new xa({props:b}),ie.push(()=>ge(f,"selected",g));let k=((C=n[1].options)==null?void 0:C.maxSelect)>1&&ap(n);return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),H(f.$$.fragment),d=O(),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(D,E){S(D,e,E),_(e,t),_(e,s),_(e,l),_(l,r),S(D,u,E),q(f,D,E),S(D,d,E),k&&k.m(D,E),S(D,m,E),h=!0},p(D,E){var L,N,F,R,X;(!h||E&2&&i!==(i=z.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!h||E&2)&&o!==(o=D[1].name+"")&&le(r,o),(!h||E&16&&a!==(a=D[4]))&&p(e,"for",a);const P={};E&16&&(P.id=D[4]),E&6&&(P.toggle=!D[1].required||D[2]),E&4&&(P.multiple=D[2]),E&7&&(P.closable=!D[2]||((L=D[0])==null?void 0:L.length)>=((N=D[1].options)==null?void 0:N.maxSelect)),E&2&&(P.items=(F=D[1].options)==null?void 0:F.values),E&2&&(P.searchable=((R=D[1].options)==null?void 0:R.values)>5),!c&&E&1&&(c=!0,P.selected=D[0],ke(()=>c=!1)),f.$set(P),((X=D[1].options)==null?void 0:X.maxSelect)>1?k?k.p(D,E):(k=ap(D),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(D){h||(A(f.$$.fragment,D),h=!0)},o(D){I(f.$$.fragment,D),h=!1},d(D){D&&w(e),D&&w(u),j(f,D),D&&w(d),k&&k.d(D),D&&w(m)}}}function z4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[V4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function B4(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 U4 extends ye{constructor(e){super(),ve(this,e,B4,z4,he,{field:1,value:0})}}function W4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("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(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),S(g,f,b),m||(h=Y(f,"input",n[3]),m=!0)},p(g,b){b&2&&i!==(i=z.getFieldTypeIcon(g[1].type))&&p(t,"class",i),b&2&&o!==(o=g[1].name+"")&&le(r,o),b&16&&a!==(a=g[4])&&p(e,"for",a),b&16&&c!==(c=g[4])&&p(f,"id",c),b&2&&d!==(d=g[1].required)&&(f.required=d),b&4&&(f.value=g[2])},d(g){g&&w(e),g&&w(u),g&&w(f),m=!1,h()}}}function Y4(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[W4,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function K4(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 J4 extends ye{constructor(e){super(),ve(this,e,K4,Y4,he,{field:1,value:0})}}function Z4(n){let e,t;return{c(){e=v("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 G4(n){let e,t,i;return{c(){e=v("img"),Vn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!Vn(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 X4(n){let e;function t(l,o){return l[2]?G4:Z4}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:Z,o:Z,d(l){s.d(l),l&&w(e)}}}function Q4(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 x4 extends ye{constructor(e){super(),ve(this,e,Q4,X4,he,{file:0,size:1})}}function up(n){let e;function t(l,o){return l[4]==="image"?tM:eM}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 eM(n){let e,t;return{c(){e=v("object"),t=B("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){S(i,e,s),_(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 tM(n){let e,t,i;return{c(){e=v("img"),Vn(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&&!Vn(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 nM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&up(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=up(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function iM(n){let e,t,i;return{c(){e=v("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",dt(n[0])),t=!0)},p:Z,d(s){s&&w(e),t=!1,i()}}}function sM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=B(n[2]),i=O(),s=v("i"),l=O(),o=v("div"),r=O(),a=v("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),_(e,t),_(e,i),_(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 lM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[sM],header:[iM],default:[nM]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function oM(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){ie[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){ze.call(this,n,d)}function c(d){ze.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 rM extends ye{constructor(e){super(),ve(this,e,oM,lM,he,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function aM(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function uM(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function fM(n){let e,t,i,s,l;return{c(){e=v("img"),Vn(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&&!Vn(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 cM(n){let e,t,i,s,l,o,r,a;function u(m,h){return m[2]==="image"?fM:m[2]==="video"||m[2]==="audio"?uM:aM}let f=u(n),c=f(n),d={};return l=new rM({props:d}),n[10](l),{c(){e=v("a"),c.c(),s=O(),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 g={};l.$set(g)},i(m){o||(A(l.$$.fragment,m),o=!0)},o(m){I(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 dM(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=pe.getFileUrl(l,o);function c(){t(4,u="")}const d=h=>{s&&(h.preventDefault(),a==null||a.show(f))};function m(h){ie[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 nu extends ye{constructor(e){super(),ve(this,e,dM,cM,he,{record:8,filename:0,size:1})}}function fp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function cp(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 pM(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=v("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 mM(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=v("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 dp(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,m,h,g;s=new nu({props:{record:e[2],filename:e[25]}});function b(T,$){return $&18&&(h=null),h==null&&(h=!!T[1].includes(T[24])),h?mM:pM}let k=b(e,-1),y=k(e);return{key:n,first:null,c(){t=v("div"),i=v("div"),H(s.$$.fragment),l=O(),o=v("div"),r=v("a"),u=B(a),d=O(),m=v("div"),y.c(),Q(i,"fade",e[1].includes(e[24])),p(r,"href",f=pe.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,$),_(t,i),q(s,i,null),_(t,l),_(t,o),_(o,r),_(r,u),_(t,d),_(t,m),y.m(m,null),g=!0},p(T,$){e=T;const M={};$&4&&(M.record=e[2]),$&16&&(M.filename=e[25]),s.$set(M),(!g||$&18)&&Q(i,"fade",e[1].includes(e[24])),(!g||$&16)&&a!==(a=e[25]+"")&&le(u,a),(!g||$&20&&f!==(f=pe.getFileUrl(e[2],e[25])))&&p(r,"href",f),(!g||$&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&p(r,"class",c),k===(k=b(e,$))&&y?y.p(e,$):(y.d(1),y=k(e),y&&(y.c(),y.m(m,null)))},i(T){g||(A(s.$$.fragment,T),g=!0)},o(T){I(s.$$.fragment,T),g=!1},d(T){T&&w(t),j(s),y.d()}}}function pp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,m,h,g,b;i=new x4({props:{file:n[22]}});function k(){return n[15](n[24])}return{c(){e=v("div"),t=v("figure"),H(i.$$.fragment),s=O(),l=v("div"),o=v("small"),o.textContent="New",r=O(),a=v("span"),f=B(u),d=O(),m=v("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"),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,T){S(y,e,T),_(e,t),q(i,t,null),_(e,s),_(e,l),_(l,o),_(l,r),_(l,a),_(a,f),_(e,d),_(e,m),h=!0,g||(b=[Ie(Be.call(null,m,"Remove file")),Y(m,"click",k)],g=!0)},p(y,T){n=y;const $={};T&1&&($.file=n[22]),i.$set($),(!h||T&1)&&u!==(u=n[22].name+"")&&le(f,u),(!h||T&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){I(i.$$.fragment,y),h=!1},d(y){y&&w(e),j(i),g=!1,Pe(b)}}}function mp(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("input"),i=O(),s=v("button"),s.innerHTML=`<i class="ri-upload-cloud-line"></i>
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-transparent btn-sm btn-block"),p(e,"class","list-item list-item-btn")},m(r,a){S(r,e,a),_(e,t),n[16](t),_(e,i),_(e,s),l||(o=[Y(t,"change",n[17]),Y(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&w(e),n[16](null),l=!1,Pe(o)}}}function hM(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,h,g,b=n[4];const k=C=>C[25]+C[2].id;for(let C=0;C<b.length;C+=1){let D=cp(n,b,C),E=k(D);d.set(E,c[C]=dp(E,D))}let y=n[0],T=[];for(let C=0;C<y.length;C+=1)T[C]=pp(fp(n,y,C));const $=C=>I(T[C],1,1,()=>{T[C]=null});let M=!n[8]&&mp(n);return{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("div");for(let C=0;C<c.length;C+=1)c[C].c();m=O();for(let C=0;C<T.length;C+=1)T[C].c();h=O(),M&&M.c(),p(t,"class",i=z.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","list")},m(C,D){S(C,e,D),_(e,t),_(e,s),_(e,l),_(l,r),S(C,u,D),S(C,f,D);for(let E=0;E<c.length;E+=1)c[E].m(f,null);_(f,m);for(let E=0;E<T.length;E+=1)T[E].m(f,null);_(f,h),M&&M.m(f,null),n[19](f),g=!0},p(C,D){if((!g||D&8&&i!==(i=z.getFieldTypeIcon(C[3].type)))&&p(t,"class",i),(!g||D&8)&&o!==(o=C[3].name+"")&&le(r,o),(!g||D&2097152&&a!==(a=C[21]))&&p(e,"for",a),D&1558&&(b=C[4],ae(),c=wt(c,D,k,1,C,b,d,f,ln,dp,m,cp),ue()),D&2049){y=C[0];let E;for(E=0;E<y.length;E+=1){const P=fp(C,y,E);T[E]?(T[E].p(P,D),A(T[E],1)):(T[E]=pp(P),T[E].c(),A(T[E],1),T[E].m(f,h))}for(ae(),E=y.length;E<T.length;E+=1)$(E);ue()}C[8]?M&&(M.d(1),M=null):M?M.p(C,D):(M=mp(C),M.c(),M.m(f,null))},i(C){if(!g){for(let D=0;D<b.length;D+=1)A(c[D]);for(let D=0;D<y.length;D+=1)A(T[D]);g=!0}},o(C){for(let D=0;D<c.length;D+=1)I(c[D]);T=T.filter(Boolean);for(let D=0;D<T.length;D+=1)I(T[D]);g=!1},d(C){C&&w(e),C&&w(u),C&&w(f);for(let D=0;D<c.length;D+=1)c[D].d();mt(T,C),M&&M.d(),n[19](null)}}}function gM(n){let e,t;return e=new me({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[hM,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function _M(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(E){z.removeByValue(u,E),t(1,u)}function h(E){z.pushUnique(u,E),t(1,u)}function g(E){z.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const k=E=>m(E),y=E=>h(E),T=E=>g(E);function $(E){ie[E?"unshift":"push"](()=>{c=E,t(6,c)})}const M=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},C=()=>c==null?void 0:c.click();function D(E){ie[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;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=((E=f.options)==null?void 0:E.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)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,m,h,g,r,k,y,T,$,M,C,D]}class bM extends ye{constructor(e){super(),ve(this,e,_M,gM,he,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function hp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function vM(n,e){e=hp(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=hp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const yM=n=>({dragging:n&2,dragover:n&4}),gp=n=>({dragging:n[1],dragover:n[2]});function kM(n){let e,t,i,s;const l=n[8].default,o=Nt(l,n,n[7],gp);return{c(){e=v("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",dt(n[9])),Y(e,"dragleave",dt(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,yM):qt(r[7]),gp),(!t||a&2)&&Q(e,"dragging",r[1]),(!t||a&4)&&Q(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){I(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Pe(s)}}}function wM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Ct();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(y,T){!y&&!a||(t(1,u=!0),y.dataTransfer.effectAllowed="move",y.dataTransfer.dropEffect="move",y.dataTransfer.setData("text/plain",T))}function d(y,T){if(!y&&!a)return;t(2,f=!1),t(1,u=!1),y.dataTransfer.dropEffect="move";const $=parseInt(y.dataTransfer.getData("text/plain"));$<T?(r.splice(T+1,0,r[$]),r.splice($,1)):(r.splice(T,0,r[$]),r.splice($+1,1)),t(5,r),l("sort",r)}const m=()=>{t(2,f=!0)},h=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},b=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,g,b,k]}class SM extends ye{constructor(e){super(),ve(this,e,wM,kM,he,{index:0,list:5,disabled:6})}}function _p(n,e,t){const i=n.slice();return i[6]=e[t],i}function bp(n){let e,t;return e=new nu({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function vp(n){let e,t,i=n[0][n[6]]&&bp(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&&A(i,1)):(i=bp(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),I(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function TM(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 g=0;g<d.length;g+=1)m[g]=vp(_p(n,d,g));const h=g=>I(m[g],1,1,()=>{m[g]=null});return{c(){e=v("div"),t=v("i"),s=O();for(let g=0;g<m.length;g+=1)m[g].c();l=O(),o=v("span"),a=B(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(g,b){S(g,e,b),_(e,t),_(e,s);for(let k=0;k<m.length;k+=1)m[k].m(e,null);_(e,l),_(e,o),_(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(g,[b]){if(i&&Bt(i.update)&&b&1&&i.update.call(null,{text:z.truncate(JSON.stringify(z.truncateObject(g[0]),null,2),800,!0),class:"code",position:"left"}),b&3){d=g[1];let k;for(k=0;k<d.length;k+=1){const y=_p(g,d,k);m[k]?(m[k].p(y,b),A(m[k],1)):(m[k]=vp(y),m[k].c(),A(m[k],1),m[k].m(e,l))}for(ae(),k=d.length;k<m.length;k+=1)h(k);ue()}(!u||b&5)&&r!==(r=z.truncate(z.displayValue(g[0],g[2]),70)+"")&&le(a,r)},i(g){if(!u){for(let b=0;b<d.length;b+=1)A(m[b]);u=!0}},o(g){m=m.filter(Boolean);for(let b=0;b<m.length;b+=1)I(m[b]);u=!1},d(g){g&&w(e),mt(m,g),f=!1,c()}}}function $M(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 Xo extends ye{constructor(e){super(),ve(this,e,$M,TM,he,{record:0,displayFields:3})}}function yp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function kp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function wp(n){let e,t;function i(o,r){return o[11]?MM:CM}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=O(),p(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),_(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 CM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Sp(n);return{c(){e=v("span"),e.textContent="No records found.",t=O(),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=Sp(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 MM(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Sp(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function DM(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function OM(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Tp(n,e){let t,i,s,l,o,r,a,u,f,c,d;function m(T,$){return T[6]?OM:DM}let h=m(e),g=h(e);l=new Xo({props:{record:e[49],displayFields:e[13]}});function b(){return e[32](e[49])}function k(){return e[33](e[49])}function y(...T){return e[34](e[49],...T)}return{key:n,first:null,c(){t=v("div"),g.c(),i=O(),s=v("div"),H(l.$$.fragment),o=O(),r=v("div"),a=v("button"),a.innerHTML='<i class="ri-pencil-line"></i>',u=O(),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,$),g.m(t,null),_(t,i),_(t,s),q(l,s,null),_(t,o),_(t,r),_(r,a),_(t,u),f=!0,c||(d=[Ie(Be.call(null,a,"Edit")),Y(a,"keydown",kn(e[27])),Y(a,"click",kn(b)),Y(t,"click",k),Y(t,"keydown",y)],c=!0)},p(T,$){e=T,h!==(h=m(e))&&(g.d(1),g=h(e),g&&(g.c(),g.m(t,i)));const M={};$[0]&8&&(M.record=e[49]),$[0]&8192&&(M.displayFields=e[13]),l.$set(M),(!f||$[0]&264)&&Q(t,"selected",e[6]),(!f||$[0]&808)&&Q(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i(T){f||(A(l.$$.fragment,T),f=!0)},o(T){I(l.$$.fragment,T),f=!1},d(T){T&&w(t),g.d(),j(l),c=!1,Pe(d)}}}function $p(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=B("("),i=B(t),s=B(" of MAX "),l=B(n[5]),o=B(")")},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 EM(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function AM(n){let e,t,i=n[6],s=[];for(let o=0;o<i.length;o+=1)s[o]=Cp(yp(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){e=v("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=yp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Cp(u),s[a].c(),A(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)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){o&&w(e),mt(s,o)}}}function IM(n){let e,t,i,s,l,o,r,a;t=new Xo({props:{record:n[49],displayFields:n[13]}});function u(){return n[37](n[49])}return{c(){e=v("span"),H(t.$$.fragment),i=O(),s=v("button"),s.innerHTML='<i class="ri-close-line"></i>',l=O(),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),_(e,i),_(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||(A(t.$$.fragment,f),o=!0)},o(f){I(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function Cp(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[IM,({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 SM({props:l}),ie.push(()=>ge(e,"list",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PM(n){let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,m,h,g,b,k,y,T;t=new Uo({props:{value:n[2],autocompleteCollection:n[12]}}),t.$on("submit",n[30]);let $=n[3];const M=N=>N[49].id;for(let N=0;N<$.length;N+=1){let F=kp(n,$,N),R=M(F);a.set(R,r[N]=Tp(R,F))}let C=null;$.length||(C=wp(n));let D=n[5]>1&&$p(n);const E=[AM,EM],P=[];function L(N,F){return N[6].length?0:1}return h=L(n),g=P[h]=E[h](n),{c(){e=v("div"),H(t.$$.fragment),i=O(),s=v("button"),s.innerHTML='<div class="txt">New record</div>',l=O(),o=v("div");for(let N=0;N<r.length;N+=1)r[N].c();C&&C.c(),f=O(),c=v("h5"),d=B(`Selected
`),D&&D.c(),m=O(),g.c(),b=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),_(e,i),_(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),_(c,d),D&&D.m(c,null),S(N,m,F),P[h].m(N,F),S(N,b,F),k=!0,y||(T=[Y(s,"click",n[31]),Ie(u=vM.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&&($=N[3],ae(),r=wt(r,F,M,1,N,$,a,o,ln,Tp,null,kp),ue(),!$.length&&C?C.p(N,F):$.length?C&&(C.d(1),C=null):(C=wp(N),C.c(),C.m(o,null))),u&&Bt(u.update)&&F[0]&1040&&u.update.call(null,N[36]),N[5]>1?D?D.p(N,F):(D=$p(N),D.c(),D.m(c,null)):D&&(D.d(1),D=null);let X=h;h=L(N),h===X?P[h].p(N,F):(ae(),I(P[X],1,1,()=>{P[X]=null}),ue(),g=P[h],g?g.p(N,F):(g=P[h]=E[h](N),g.c()),A(g,1),g.m(b.parentNode,b))},i(N){if(!k){A(t.$$.fragment,N);for(let F=0;F<$.length;F+=1)A(r[F]);A(g),k=!0}},o(N){I(t.$$.fragment,N);for(let F=0;F<r.length;F+=1)I(r[F]);I(g),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),D&&D.d(),N&&w(m),P[h].d(N),N&&w(b),y=!1,Pe(T)}}}function LM(n){var r;let e,t,i,s=(((r=n[12])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=B("Select "),i=v("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),_(e,t),_(e,i),_(i,l),_(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 NM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=v("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:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Pe(l)}}}function FM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[NM],header:[LM],default:[PM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Je(o,l[a]);e=new Nn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[12]};return i=new Ab({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Or=100;function RM(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=Ct(),g="picker_"+z.randomString(5);let{value:b}=e,{field:k}=e,y,T,$="",M=[],C=[],D=1,E=0,P=!1,L=!1;function N(){return t(2,$=""),t(3,M=[]),t(6,C=[]),R(),X(!0),y==null?void 0:y.show()}function F(){return y==null?void 0:y.hide()}async function R(){const Ae=z.toArray(b);if(!s||!Ae.length)return;t(24,L=!0);let ne=[];const we=Ae.slice(),nt=[];for(;we.length>0;){const et=[];for(const bt of we.splice(0,Or))et.push(`id="${bt}"`);nt.push(pe.collection(s).getFullList(Or,{filter:et.join("||"),$autoCancel:!1}))}try{await Promise.all(nt).then(et=>{ne=ne.concat(...et)}),t(6,C=[]);for(const et of Ae){const bt=z.findByKey(ne,"id",et);bt&&C.push(bt)}$.trim()||t(3,M=z.filterDuplicatesByKey(C.concat(M)))}catch(et){pe.errorResponseHandler(et)}t(24,L=!1)}async function X(Ae=!1){if(s){t(4,P=!0),Ae&&($.trim()?t(3,M=[]):t(3,M=z.toArray(C).slice()));try{const ne=Ae?1:D+1,we=await pe.collection(s).getList(ne,Or,{filter:$,sort:"-created",$cancelKey:g+"loadList"});t(3,M=z.filterDuplicatesByKey(M.concat(we.items))),D=we.page,t(23,E=we.totalItems)}catch(ne){pe.errorResponseHandler(ne)}t(4,P=!1)}}function se(Ae){i==1?t(6,C=[Ae]):u&&(z.pushOrReplaceByKey(C,Ae),t(6,C))}function W(Ae){z.removeByKey(C,"id",Ae.id),t(6,C)}function G(Ae){f(Ae)?W(Ae):se(Ae)}function te(){var Ae;i!=1?t(20,b=C.map(ne=>ne.id)):t(20,b=((Ae=C==null?void 0:C[0])==null?void 0:Ae.id)||""),h("save",C),F()}function K(Ae){ze.call(this,n,Ae)}const re=()=>F(),J=()=>te(),de=Ae=>t(2,$=Ae.detail),_e=()=>T==null?void 0:T.show(),$e=Ae=>T==null?void 0:T.show(Ae),Ne=Ae=>G(Ae),Re=(Ae,ne)=>{(ne.code==="Enter"||ne.code==="Space")&&(ne.preventDefault(),ne.stopPropagation(),G(Ae))},be=()=>t(2,$=""),Se=()=>{a&&!P&&X()},We=Ae=>W(Ae);function lt(Ae){C=Ae,t(6,C)}function fe(Ae){ie[Ae?"unshift":"push"](()=>{y=Ae,t(1,y)})}function Ve(Ae){ze.call(this,n,Ae)}function ee(Ae){ze.call(this,n,Ae)}function Fe(Ae){ie[Ae?"unshift":"push"](()=>{T=Ae,t(7,T)})}const ot=Ae=>{z.removeByKey(M,"id",Ae.detail.id),M.unshift(Ae.detail),t(3,M),se(Ae.detail)},Ht=Ae=>{z.removeByKey(M,"id",Ae.detail.id),t(3,M),W(Ae.detail)};return n.$$set=Ae=>{e=Je(Je({},e),Qn(Ae)),t(19,d=Et(e,c)),"value"in Ae&&t(20,b=Ae.value),"field"in Ae&&t(21,k=Ae.field)},n.$$.update=()=>{var Ae,ne,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=(ne=k==null?void 0:k.options)==null?void 0:ne.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 $<"u"&&!L&&y!=null&&y.isActive()&&X(!0),n.$$.dirty[0]&16777232&&t(11,r=P||L),n.$$.dirty[0]&8388616&&t(10,a=E>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,$,M,P,i,C,T,f,u,a,r,o,l,X,se,W,G,te,d,b,k,N,E,L,s,m,K,re,J,de,_e,$e,Ne,Re,be,Se,We,lt,fe,Ve,ee,Fe,ot,Ht]}class qM extends ye{constructor(e){super(),ve(this,e,RM,FM,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 Mp(n,e,t){const i=n.slice();return i[13]=e[t],i}function Dp(n,e,t){const i=n.slice();return i[16]=e[t],i}function Op(n){let e,t=n[4]&&Ep(n);return{c(){t&&t.c(),e=Me()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[4]?t?t.p(i,s):(t=Ep(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Ep(n){let e,t=z.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=Ap(Dp(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=Dp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Ap(),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){mt(i,s),s&&w(e)}}}function Ap(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,p(e,"class","list-item")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Ip(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Xo({props:{record:n[13],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[7](n[13])}return{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=O(),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),_(e,t),q(i,t,null),_(e,s),_(e,l),_(l,o),_(e,r),a=!0,u||(f=[Ie(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,h){var b;n=m;const g={};h&8&&(g.record=n[13]),h&4&&(g.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(g)},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){I(i.$$.fragment,m),a=!1},d(m){m&&w(e),j(i),u=!1,Pe(f)}}}function jM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,g,b,k,y=n[3],T=[];for(let C=0;C<y.length;C+=1)T[C]=Ip(Mp(n,y,C));const $=C=>I(T[C],1,1,()=>{T[C]=null});let M=null;return y.length||(M=Op(n)),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),f=v("div"),c=v("div");for(let C=0;C<T.length;C+=1)T[C].c();M&&M.c(),d=O(),m=v("div"),h=v("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[12]),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,D){S(C,e,D),_(e,t),_(e,s),_(e,l),_(l,r),S(C,u,D),S(C,f,D),_(f,c);for(let E=0;E<T.length;E+=1)T[E].m(c,null);M&&M.m(c,null),_(f,d),_(f,m),_(m,h),g=!0,b||(k=Y(h,"click",n[8]),b=!0)},p(C,D){if((!g||D&4&&i!==(i=Si(z.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!g||D&4)&&o!==(o=C[2].name+"")&&le(r,o),(!g||D&4096&&a!==(a=C[12]))&&p(e,"for",a),D&93){y=C[3];let E;for(E=0;E<y.length;E+=1){const P=Mp(C,y,E);T[E]?(T[E].p(P,D),A(T[E],1)):(T[E]=Ip(P),T[E].c(),A(T[E],1),T[E].m(c,null))}for(ae(),E=y.length;E<T.length;E+=1)$(E);ue(),!y.length&&M?M.p(C,D):y.length?M&&(M.d(1),M=null):(M=Op(C),M.c(),M.m(c,null))}},i(C){if(!g){for(let D=0;D<y.length;D+=1)A(T[D]);g=!0}},o(C){T=T.filter(Boolean);for(let D=0;D<T.length;D+=1)I(T[D]);g=!1},d(C){C&&w(e),C&&w(u),C&&w(f),mt(T,C),M&&M.d(),b=!1,k()}}}function HM(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[jM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l={value:n[0],field:n[2]};return i=new qM({props:l}),n[9](i),i.$on("save",n[10]),{c(){H(e.$$.fragment),t=O(),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&4&&(a.class="form-field form-field-list "+(o[2].required?"required":"")),r&4&&(a.name=o[2].name),r&528415&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};r&1&&(u.value=o[0]),r&4&&(u.field=o[2]),i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[9](null),j(i,o)}}}const Pp=100;function VM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new mn}=e,r=[],a=!1;u();async function u(){var y,T;const g=z.toArray(s);if(!((y=o==null?void 0:o.options)!=null&&y.collectionId)||!g.length){t(3,r=[]),t(4,a=!1);return}t(4,a=!0);const b=g.slice(),k=[];for(;b.length>0;){const $=[];for(const M of b.splice(0,Pp))$.push(`id="${M}"`);k.push(pe.collection((T=o==null?void 0:o.options)==null?void 0:T.collectionId).getFullList(Pp,{filter:$.join("||"),$autoCancel:!1}))}try{let $=[];await Promise.all(k).then(M=>{$=$.concat(...M)});for(const M of g){const C=z.findByKey($,"id",M);C&&r.push(C)}t(3,r)}catch($){pe.errorResponseHandler($)}t(4,a=!1)}function f(g){var b;z.removeByKey(r,"id",g.id),t(3,r),i?t(0,s=r.map(k=>k.id)):t(0,s=((b=r[0])==null?void 0:b.id)||"")}const c=g=>f(g),d=()=>l==null?void 0:l.show();function m(g){ie[g?"unshift":"push"](()=>{l=g,t(1,l)})}const h=g=>{var b;t(3,r=g.detail||[]),t(0,s=i?r.map(k=>k.id):((b=r[0])==null?void 0:b.id)||"")};return n.$$set=g=>{"value"in g&&t(0,s=g.value),"picker"in g&&t(1,l=g.picker),"field"in g&&t(2,o=g.field)},n.$$.update=()=>{var g;n.$$.dirty&4&&t(5,i=((g=o.options)==null?void 0:g.maxSelect)!=1)},[s,l,o,r,a,i,f,c,d,m,h]}class zM extends ye{constructor(e){super(),ve(this,e,VM,HM,he,{value:0,picker:1,field:2})}}const BM=["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"],UM=(n,e)=>{BM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function WM(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),Ir(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 YM(n){let e;return{c(){e=v("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 KM(n){let e;function t(l,o){return l[1]?YM:WM}let i=t(n),s=i(n);return{c(){e=v("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:Z,o:Z,d(l){l&&w(e),s.d(),n[19](null)}}}const Ob=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),JM=()=>{let n={listeners:[],scriptId:Ob("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 ZM=JM();function GM(n,e,t){var i;let{id:s=Ob("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,g,b,k,y="",T=o;const $=Ct(),M=()=>{const N=(()=>typeof window<"u"?window:global)();return N&&N.tinymce?N.tinymce:null},C=()=>{const L=Object.assign(Object.assign({},f),{target:b,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"})))})}),UM(N,$),typeof f.setup=="function"&&f.setup(N)}});t(4,b.style.visibility="",b),M().init(L)};Zt(()=>{if(M()!==null)C();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;ZM.load(g.ownerDocument,L,()=>{C()})}}),cg(()=>{var L;k&&((L=M())===null||L===void 0||L.remove(k))});function D(L){ie[L?"unshift":"push"](()=>{b=L,t(4,b)})}function E(L){ie[L?"unshift":"push"](()=>{b=L,t(4,b)})}function P(L){ie[L?"unshift":"push"](()=>{g=L,t(3,g)})}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&&(t(16,T=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,g,b,d,m,o,r,a,u,f,c,i,k,y,T,D,E,P]}class Eb extends ye{constructor(e){super(),ve(this,e,GM,KM,he,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function XM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function m(g){n[2](g)}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 Eb({props:h}),ie.push(()=>ge(f,"value",m)),{c(){e=v("label"),t=v("i"),s=O(),l=v("span"),r=B(o),u=O(),H(f.$$.fragment),p(t,"class",i=z.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(g,b){S(g,e,b),_(e,t),_(e,s),_(e,l),_(l,r),S(g,u,b),q(f,g,b),d=!0},p(g,b){(!d||b&2&&i!==(i=z.getFieldTypeIcon(g[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=g[1].name+"")&&le(r,o),(!d||b&8&&a!==(a=g[3]))&&p(e,"for",a);const k={};b&8&&(k.id=g[3]),!c&&b&1&&(c=!0,k.value=g[0],ke(()=>c=!1)),f.$set(k)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){I(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function QM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[XM,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function xM(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 e5 extends ye{constructor(e){super(),ve(this,e,xM,QM,he,{field:1,value:0})}}function t5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Auth URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function n5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Token URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(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&&l.value!==u[0].tokenUrl&&ce(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function i5(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("User API URL"),s=O(),l=v("input"),p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(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&&l.value!==u[0].userApiUrl&&ce(l,u[0].userApiUrl)},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,u,f,c,d;return l=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[t5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[n5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[i5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=O(),i=v("div"),s=v("div"),H(l.$$.fragment),o=O(),r=v("div"),H(a.$$.fragment),u=O(),f=v("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),_(i,s),q(l,s,null),_(i,o),_(i,r),q(a,r,null),_(i,u),_(i,f),q(c,f,null),d=!0},p(m,[h]){const g={};h&2&&(g.name=m[1]+".authUrl"),h&97&&(g.$$scope={dirty:h,ctx:m}),l.$set(g);const b={};h&2&&(b.name=m[1]+".tokenUrl"),h&97&&(b.$$scope={dirty:h,ctx:m}),a.$set(b);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(A(l.$$.fragment,m),A(a.$$.fragment,m),A(c.$$.fragment,m),d=!0)},o(m){I(l.$$.fragment,m),I(a.$$.fragment,m),I(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}function l5(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 Lp extends ye{constructor(e){super(),ve(this,e,l5,s5,he,{key:1,config:0})}}function o5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Auth URL"),s=O(),l=v("input"),r=O(),a=v("div"),a.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=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),ce(l,n[0].authUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[2]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(l,"id",o),d&1&&ce(l,c[0].authUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function r5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Token URL"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","text"),p(l,"id",o=n[4]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),ce(l,n[0].tokenUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[3]),u=!0)},p(c,d){d&16&&i!==(i=c[4])&&p(e,"for",i),d&16&&o!==(o=c[4])&&p(l,"id",o),d&1&&l.value!==c[0].tokenUrl&&ce(l,c[0].tokenUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function a5(n){let e,t,i,s,l,o,r,a,u;return l=new me({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[o5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[r5,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=O(),i=v("div"),s=v("div"),H(l.$$.fragment),o=O(),r=v("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),_(i,s),q(l,s,null),_(i,o),_(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&2&&(m.name=f[1]+".tokenUrl"),c&49&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(A(l.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(l.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function u5(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 f5 extends ye{constructor(e){super(),ve(this,e,u5,a5,he,{key:1,config:0})}}function c5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Auth URL"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/authorize/",p(e,"for",i=n[5]),p(l,"type","url"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),ce(l,n[0].authUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[2]),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&&ce(l,c[0].authUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function d5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Token URL"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/token/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),ce(l,n[0].tokenUrl),S(c,r,d),S(c,a,d),u||(f=Y(l,"input",n[3]),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].tokenUrl&&ce(l,c[0].tokenUrl)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function p5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("User API URL"),s=O(),l=v("input"),r=O(),a=v("div"),a.textContent="Eg. https://YOUR_AUTHENTIK_URL/application/o/userinfo/",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),l.required=!0,p(a,"class","help-block")},m(c,d){S(c,e,d),_(e,t),S(c,s,d),S(c,l,d),ce(l,n[0].userApiUrl),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].userApiUrl&&ce(l,c[0].userApiUrl)},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;return l=new me({props:{class:"form-field required",name:n[1]+".authUrl",$$slots:{default:[c5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:n[1]+".tokenUrl",$$slots:{default:[d5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),c=new me({props:{class:"form-field required",name:n[1]+".userApiUrl",$$slots:{default:[p5,({uniqueId:m})=>({5:m}),({uniqueId:m})=>m?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Authentik endpoints",t=O(),i=v("div"),s=v("div"),H(l.$$.fragment),o=O(),r=v("div"),H(a.$$.fragment),u=O(),f=v("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),_(i,s),q(l,s,null),_(i,o),_(i,r),q(a,r,null),_(i,u),_(i,f),q(c,f,null),d=!0},p(m,[h]){const g={};h&2&&(g.name=m[1]+".authUrl"),h&97&&(g.$$scope={dirty:h,ctx:m}),l.$set(g);const b={};h&2&&(b.name=m[1]+".tokenUrl"),h&97&&(b.$$scope={dirty:h,ctx:m}),a.$set(b);const k={};h&2&&(k.name=m[1]+".userApiUrl"),h&97&&(k.$$scope={dirty:h,ctx:m}),c.$set(k)},i(m){d||(A(l.$$.fragment,m),A(a.$$.fragment,m),A(c.$$.fragment,m),d=!0)},o(m){I(l.$$.fragment,m),I(a.$$.fragment,m),I(c.$$.fragment,m),d=!1},d(m){m&&w(e),m&&w(t),m&&w(i),j(l),j(a),j(c)}}}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)}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 g5 extends ye{constructor(e){super(),ve(this,e,h5,m5,he,{key:1,config:0})}}const vl={googleAuth:{title:"Google",icon:"ri-google-fill"},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:Lp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:f5},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Lp},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},authentikAuth:{title:"Authentik",icon:"ri-lock-fill",optionsComponent:g5}};function Np(n,e,t){const i=n.slice();return i[9]=e[t],i}function _5(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e)}}}function b5(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=Fp(Np(n,t,s));return{c(){e=v("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=Np(s,t,o);i[o]?i[o].p(r,l):(i[o]=Fp(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),mt(i,s)}}}function v5(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Fp(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,m,h,g,b,k;function y(){return n[6](n[9])}return{c(){e=v("div"),t=v("i"),s=O(),l=v("span"),r=B(o),a=O(),u=v("div"),f=B("ID: "),d=B(c),m=O(),h=v("button"),h.innerHTML='<i class="ri-close-line"></i>',g=O(),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(T,e,$),_(e,t),_(e,s),_(e,l),_(l,r),_(e,a),_(e,u),_(u,f),_(u,d),_(e,m),_(e,h),_(e,g),b||(k=Y(h,"click",y),b=!0)},p(T,$){n=T,$&2&&i!==(i=n[4](n[9].provider))&&p(t,"class",i),$&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),$&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d(T){T&&w(e),b=!1,k()}}}function y5(n){let e;function t(l,o){var r;return l[2]?v5:(r=l[0])!=null&&r.id&&l[1].length?b5:_5}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:Z,o:Z,d(l){s.d(l),l&&w(e)}}}function k5(n,e,t){const i=Ct();let{record:s}=e,l=[],o=!1;function r(d){var m;return((m=vl[d+"Auth"])==null?void 0:m.title)||z.sentenize(d,!1)}function a(d){var m;return((m=vl[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 pe.collection(s.collectionId).listExternalAuths(s.id))}catch(d){pe.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?`,()=>pe.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(m=>{pe.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 w5 extends ye{constructor(e){super(),ve(this,e,k5,y5,he,{record:0})}}function Rp(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function qp(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[S5,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S5(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="id",l=O(),o=v("span"),a=O(),u=v("div"),f=v("i"),d=O(),m=v("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=g=n[2].id,m.readOnly=!0},m(y,T){S(y,e,T),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),S(y,a,T),S(y,u,T),_(u,f),S(y,d,T),S(y,m,T),b||(k=Ie(c=Be.call(null,f,{text:`Created: ${n[2].created}
Updated: ${n[2].updated}`,position:"left"})),b=!0)},p(y,T){T[1]&8388608&&r!==(r=y[54])&&p(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${y[2].created}
Updated: ${y[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=y[54])&&p(m,"id",h),T[0]&4&&g!==(g=y[2].id)&&m.value!==g&&(m.value=g)},d(y){y&&w(e),y&&w(a),y&&w(u),y&&w(d),y&&w(m),b=!1,k()}}}function jp(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 p4({props:r}),ie.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Hp();return{c(){H(e.$$.fragment),i=O(),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,g;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),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=Hp(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function Hp(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function T5(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 zM({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $5(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 bM({props:u}),ie.push(()=>ge(e,"value",o)),ie.push(()=>ge(e,"uploadedFiles",r)),ie.push(()=>ge(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||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function C5(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 J4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function M5(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 U4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function D5(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 H4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function O5(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 e5({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function E5(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 F4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function A5(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 I4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function I5(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 D4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function P5(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 T4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function L5(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 y4({props:l}),ie.push(()=>ge(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Vp(n,e){let t,i,s,l,o;const r=[L5,P5,I5,A5,E5,O5,D5,M5,C5,$5,T5],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(),I(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()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){I(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function zp(n){let e,t,i;return t=new w5({props:{record:n[2]}}),{c(){e=v("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||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function N5(n){var b,k;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&qp(n),d=((b=n[0])==null?void 0:b.isAuth)&&jp(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 T=Rp(n,m,y),$=h(T);o.set($,l[y]=Vp($,T))}let g=n[0].isAuth&&!n[2].isNew&&zp(n);return{c(){e=v("div"),t=v("form"),c&&c.c(),i=O(),d&&d.c(),s=O();for(let y=0;y<l.length;y+=1)l[y].c();r=O(),g&&g.c(),p(t,"id",n[13]),p(t,"class","tab-item"),Q(t,"active",n[10]===Gi),p(e,"class","tabs-content")},m(y,T){S(y,e,T),_(e,t),c&&c.m(t,null),_(t,i),d&&d.m(t,null),_(t,s);for(let $=0;$<l.length;$+=1)l[$].m(t,null);_(e,r),g&&g.m(e,null),a=!0,u||(f=Y(t,"submit",dt(n[14])),u=!0)},p(y,T){var $,M;y[2].isNew?c&&(ae(),I(c,1,1,()=>{c=null}),ue()):c?(c.p(y,T),T[0]&4&&A(c,1)):(c=qp(y),c.c(),A(c,1),c.m(t,i)),($=y[0])!=null&&$.isAuth?d?(d.p(y,T),T[0]&1&&A(d,1)):(d=jp(y),d.c(),A(d,1),d.m(t,s)):d&&(ae(),I(d,1,1,()=>{d=null}),ue()),T[0]&29&&(m=((M=y[0])==null?void 0:M.schema)||[],ae(),l=wt(l,T,h,1,y,m,o,t,ln,Vp,null,Rp),ue()),(!a||T[0]&1024)&&Q(t,"active",y[10]===Gi),y[0].isAuth&&!y[2].isNew?g?(g.p(y,T),T[0]&5&&A(g,1)):(g=zp(y),g.c(),A(g,1),g.m(e,null)):g&&(ae(),I(g,1,1,()=>{g=null}),ue())},i(y){if(!a){A(c),A(d);for(let T=0;T<m.length;T+=1)A(l[T]);A(g),a=!0}},o(y){I(c),I(d);for(let T=0;T<l.length;T+=1)I(l[T]);I(g),a=!1},d(y){y&&w(e),c&&c.d(),d&&d.d();for(let T=0;T<l.length;T+=1)l[T].d();g&&g.d(),u=!1,f()}}}function Bp(n){let e,t,i,s,l,o,r;return o=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[F5]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=O(),i=v("button"),s=v("i"),l=O(),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),_(i,s),_(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||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function Up(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function Wp(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function F5(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&Up(n),u=n[0].isAuth&&n[7].email&&Wp(n);return{c(){a&&a.c(),e=O(),u&&u.c(),t=O(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=O(),l=v("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(dt(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=Up(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=Wp(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 Yp(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=O(),s=v("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),_(e,t),_(e,i),_(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 R5(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,m=!n[2].isNew&&Bp(n),h=n[0].isAuth&&!n[2].isNew&&Yp(n);return{c(){e=v("h4"),i=B(t),s=O(),l=v("strong"),r=B(o),a=B(" record"),u=O(),m&&m.c(),f=O(),h&&h.c(),c=Me()},m(b,k){S(b,e,k),_(e,i),_(e,s),_(e,l),_(l,r),_(e,a),S(b,u,k),m&&m.m(b,k),S(b,f,k),h&&h.m(b,k),S(b,c,k),d=!0},p(b,k){var y;(!d||k[0]&4)&&t!==(t=b[2].isNew?"New":"Edit")&&le(i,t),(!d||k[0]&1)&&o!==(o=((y=b[0])==null?void 0:y.name)+"")&&le(r,o),b[2].isNew?m&&(ae(),I(m,1,1,()=>{m=null}),ue()):m?(m.p(b,k),k[0]&4&&A(m,1)):(m=Bp(b),m.c(),A(m,1),m.m(f.parentNode,f)),b[0].isAuth&&!b[2].isNew?h?h.p(b,k):(h=Yp(b),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(b){d||(A(m),d=!0)},o(b){I(m),d=!1},d(b){b&&w(e),b&&w(u),m&&m.d(b),b&&w(f),h&&h.d(b),b&&w(c)}}}function q5(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("span"),r=B(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),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(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 j5(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:[q5],header:[R5],default:[N5]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const Gi="form",yl="providers";function Kp(n){return JSON.stringify(n)}function H5(n,e,t){let i,s,l,o;const r=Ct(),a="record_"+z.randomString(5);let{collection:u}=e,f,c=null,d=new Ti,m=!1,h=!1,g={},b={},k="",y=Gi;function T(ne){return M(ne),t(9,h=!0),t(10,y=Gi),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(ne){Bn({}),t(7,c=ne||{}),ne!=null&&ne.clone?t(2,d=ne.clone()):t(2,d=new Ti),t(3,g={}),t(4,b={}),await sn(),t(20,k=Kp(d))}function C(){if(m||!o||!(u!=null&&u.id))return;t(8,m=!0);const ne=E();let we;d.isNew?we=pe.collection(u.id).create(ne):we=pe.collection(u.id).update(d.id,ne),we.then(nt=>{zt(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),r("save",nt)}).catch(nt=>{pe.errorResponseHandler(nt)}).finally(()=>{t(8,m=!1)})}function D(){c!=null&&c.id&&cn("Do you really want to delete the selected record?",()=>pe.collection(c.collectionId).delete(c.id).then(()=>{$(),zt("Successfully deleted record."),r("delete",c)}).catch(ne=>{pe.errorResponseHandler(ne)}))}function E(){const ne=(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 ne)nt[et]&&(typeof ne[et]>"u"&&(ne[et]=null),z.addValueToFormData(we,et,ne[et]));for(const et in g){const bt=z.toArray(g[et]);for(const Gt of bt)we.append(et,Gt)}for(const et in b){const bt=z.toArray(b[et]);for(const Gt of bt)we.append(et+"."+Gt,"")}return we}function P(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent verification email to ${c.email}?`,()=>pe.collection(u.id).requestVerification(c.email).then(()=>{zt(`Successfully sent verification email to ${c.email}.`)}).catch(ne=>{pe.errorResponseHandler(ne)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||cn(`Do you really want to sent password reset email to ${c.email}?`,()=>pe.collection(u.id).requestPasswordReset(c.email).then(()=>{zt(`Successfully sent password reset email to ${c.email}.`)}).catch(ne=>{pe.errorResponseHandler(ne)}))}function N(){l?cn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const ne=c==null?void 0:c.clone();if(ne){ne.id="",ne.created="",ne.updated="";const we=(u==null?void 0:u.schema)||[];for(const nt of we)nt.type==="file"&&delete ne[nt.name]}T(ne),await sn(),t(20,k="")}const R=()=>$(),X=()=>P(),se=()=>L(),W=()=>N(),G=()=>D(),te=()=>t(10,y=Gi),K=()=>t(10,y=yl);function re(ne){d=ne,t(2,d)}function J(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function de(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function _e(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function $e(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function Ne(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function Re(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function be(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function Se(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function We(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function lt(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}function fe(ne,we){n.$$.not_equal(g[we.name],ne)&&(g[we.name]=ne,t(3,g))}function Ve(ne,we){n.$$.not_equal(b[we.name],ne)&&(b[we.name]=ne,t(4,b))}function ee(ne,we){n.$$.not_equal(d[we.name],ne)&&(d[we.name]=ne,t(2,d))}const Fe=()=>l&&h?(cn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),$()}),!1):(Bn({}),!0);function ot(ne){ie[ne?"unshift":"push"](()=>{f=ne,t(6,f)})}function Ht(ne){ze.call(this,n,ne)}function Ae(ne){ze.call(this,n,ne)}return n.$$set=ne=>{"collection"in ne&&t(0,u=ne.collection)},n.$$.update=()=>{var ne;n.$$.dirty[0]&1&&t(12,i=!!((ne=u==null?void 0:u.schema)!=null&&ne.find(we=>we.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=z.hasNonEmptyProps(g)||z.hasNonEmptyProps(b)),n.$$.dirty[0]&3145732&&t(5,l=s||k!=Kp(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,$,d,g,b,l,f,c,m,h,y,o,i,a,C,D,P,L,N,T,k,s,R,X,se,W,G,te,K,re,J,de,_e,$e,Ne,Re,be,Se,We,lt,fe,Ve,ee,Fe,ot,Ht,Ae]}class Ab extends ye{constructor(e){super(),ve(this,e,H5,j5,he,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function Jp(n,e,t){const i=n.slice();return i[15]=e[t],i[7]=t,i}function Zp(n,e,t){const i=n.slice();return i[12]=e[t],i}function Gp(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function Xp(n,e,t){const i=n.slice();return i[5]=e[t],i[7]=t,i}function V5(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 z5(n){let e,t=z.truncate(n[3],2e3)+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","block txt-break")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&8&&t!==(t=z.truncate(s[3],2e3)+"")&&le(i,t)},i:Z,o:Z,d(s){s&&w(e)}}}function B5(n){let e,t=z.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=z.truncate(n[3]))},m(l,o){S(l,e,o),_(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:Z,o:Z,d(l){l&&w(e)}}}function U5(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=Jp(n,l,r),u=o(a);i.set(u,t[r]=Qp(u,a))}return{c(){e=v("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,Qp,null,Jp),ue())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)I(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function W5(n){let e,t,i,s,l;const o=[tD,eD],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]&&tm();return{c(){e=v("div"),i.c(),s=O(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),_(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(),I(r[d],1,1,()=>{r[d]=null}),ue(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[8].length>f[10]?u||(u=tm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function Y5(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=Xp(n,s,o),a=l(r);i.set(a,t[o]=nm(a,r))}return{c(){e=v("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,nm,null,Xp))},i:Z,o:Z,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function K5(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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function J5(n){let e,t,i,s;const l=[iD,nD],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(),I(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function Z5(n){let e,t=z.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=B(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),_(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:Z,o:Z,d(o){o&&w(e),s=!1,Pe(l)}}}function G5(n){let e,t;return{c(){e=v("span"),t=B(n[3]),p(e,"class","txt")},m(i,s){S(i,e,s),_(e,t)},p(i,s){s&8&&le(t,i[3])},i:Z,o:Z,d(i){i&&w(e)}}}function X5(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:Z,o:Z,d(s){s&&w(e)}}}function Q5(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function x5(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=v("span"),i=B(t),p(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),_(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:Z,o:Z,d(s){s&&w(e)}}}function Qp(n,e){let t,i,s;return i=new nu({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||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function eD(n){let e,t=n[8].slice(0,n[10]),i=[];for(let s=0;s<t.length;s+=1)i[s]=xp(Zp(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=Zp(s,t,o);i[o]?i[o].p(r,l):(i[o]=xp(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:Z,o:Z,d(s){mt(i,s),s&&w(e)}}}function tD(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=Gp(n,l,r),u=o(a);t.set(u,e[r]=em(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,em,i,Gp),ue())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)I(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function xp(n){let e,t=n[12]+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","label")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&12&&t!==(t=s[12]+"")&&le(i,t)},d(s){s&&w(e)}}}function em(n,e){var o;let t,i,s,l;return i=new Xo({props:{record:e[5],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=v("span"),H(i.$$.fragment),s=O(),p(t,"class","label"),this.first=t},m(r,a){S(r,t,a),q(i,t,null),_(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||(A(i.$$.fragment,r),l=!0)},o(r){I(i.$$.fragment,r),l=!1},d(r){r&&w(t),j(i)}}}function tm(n){let e;return{c(){e=B("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nm(n,e){let t,i=e[5]+"",s;return{key:n,first:null,c(){t=v("span"),s=B(i),p(t,"class","label"),this.first=t},m(l,o){S(l,t,o),_(t,s)},p(l,o){e=l,o&8&&i!==(i=e[5]+"")&&le(s,i)},d(l){l&&w(t)}}}function nD(n){let e,t;return e=new Eb({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function iD(n){let e,t=z.truncate(z.plainText(n[3]),250)+"",i;return{c(){e=v("span"),i=B(t),p(e,"class","txt")},m(s,l){S(s,e,l),_(e,i)},p(s,l){l&8&&t!==(t=z.truncate(z.plainText(s[3]),250)+"")&&le(i,t)},i:Z,o:Z,d(s){s&&w(e)}}}function sD(n){let e,t,i,s,l;const o=[x5,Q5,X5,G5,Z5,J5,K5,Y5,W5,U5,B5,z5],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?V5(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(),I(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()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function lD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){ze.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 Ib extends ye{constructor(e){super(),ve(this,e,lD,sD,he,{record:0,field:1,short:2})}}function oD(n){let e,t,i,s,l;return{c(){e=v("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:Z,o:Z,d(o){o&&w(e),s=!1,Pe(l)}}}function rD(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 iu extends ye{constructor(e){super(),ve(this,e,rD,oD,he,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function im(n,e,t){const i=n.slice();return i[10]=e[t],i}function sm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new Ib({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=B(i),l=O(),o=v("td"),H(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(u,f){S(u,e,f),_(e,t),_(t,s),_(e,l),_(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||(A(r.$$.fragment,u),a=!0)},o(u){I(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function lm(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=O(),s=v("td"),H(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(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||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function om(n){let e,t,i,s,l,o;return l=new ui({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=O(),s=v("td"),H(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold")},m(r,a){S(r,e,a),_(e,t),_(e,i),_(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||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function aD(n){var C;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,m,h,g,b;a=new iu({props:{value:n[3].id}});let k=(C=n[0])==null?void 0:C.schema,y=[];for(let D=0;D<k.length;D+=1)y[D]=sm(im(n,k,D));const T=D=>I(y[D],1,1,()=>{y[D]=null});let $=n[3].created&&lm(n),M=n[3].updated&&om(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=O(),o=v("td"),r=v("div"),H(a.$$.fragment),u=O(),f=v("span"),d=B(c),m=O();for(let D=0;D<y.length;D+=1)y[D].c();h=O(),$&&$.c(),g=O(),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(D,E){S(D,e,E),_(e,t),_(t,i),_(i,s),_(i,l),_(i,o),_(o,r),q(a,r,null),_(r,u),_(r,f),_(f,d),_(t,m);for(let P=0;P<y.length;P+=1)y[P].m(t,null);_(t,h),$&&$.m(t,null),_(t,g),M&&M.m(t,null),b=!0},p(D,E){var L;const P={};if(E&8&&(P.value=D[3].id),a.$set(P),(!b||E&8)&&c!==(c=D[3].id+"")&&le(d,c),E&9){k=(L=D[0])==null?void 0:L.schema;let N;for(N=0;N<k.length;N+=1){const F=im(D,k,N);y[N]?(y[N].p(F,E),A(y[N],1)):(y[N]=sm(F),y[N].c(),A(y[N],1),y[N].m(t,h))}for(ae(),N=k.length;N<y.length;N+=1)T(N);ue()}D[3].created?$?($.p(D,E),E&8&&A($,1)):($=lm(D),$.c(),A($,1),$.m(t,g)):$&&(ae(),I($,1,1,()=>{$=null}),ue()),D[3].updated?M?(M.p(D,E),E&8&&A(M,1)):(M=om(D),M.c(),A(M,1),M.m(t,null)):M&&(ae(),I(M,1,1,()=>{M=null}),ue())},i(D){if(!b){A(a.$$.fragment,D);for(let E=0;E<k.length;E+=1)A(y[E]);A($),A(M),b=!0}},o(D){I(a.$$.fragment,D),y=y.filter(Boolean);for(let E=0;E<y.length;E+=1)I(y[E]);I($),I(M),b=!1},d(D){D&&w(e),j(a),mt(y,D),$&&$.d(),M&&M.d()}}}function uD(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",s,l;return{c(){e=v("h4"),t=v("strong"),s=B(i),l=B(" record preview")},m(r,a){S(r,e,a),_(e,t),_(t,s),_(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 fD(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function cD(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[fD],header:[uD],default:[aD]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function dD(n,e,t){let i,{collection:s}=e,l,o=new Ti;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){ie[m?"unshift":"push"](()=>{l=m,t(2,l)})}function c(m){ze.call(this,n,m)}function d(m){ze.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 pD extends ye{constructor(e){super(),ve(this,e,dD,cD,he,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function rm(n,e,t){const i=n.slice();return i[55]=e[t],i}function am(n,e,t){const i=n.slice();return i[58]=e[t],i}function um(n,e,t){const i=n.slice();return i[58]=e[t],i}function fm(n,e,t){const i=n.slice();return i[51]=e[t],i}function cm(n){let e;function t(l,o){return l[12]?hD:mD}let i=t(n),s=i(n);return{c(){e=v("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 mD(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=O(),l=v("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),_(e,t),_(e,s),_(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 hD(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function dm(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[gD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function gD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function pm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&mm(n),r=i&&hm(n);return{c(){o&&o.c(),t=O(),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&&A(o,1)):(o=mm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(ae(),I(o,1,1,()=>{o=null}),ue()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&A(r,1)):(r=hm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(ae(),I(r,1,1,()=>{r=null}),ue())},i(a){l||(A(o),A(r),l=!0)},o(a){I(o),I(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function mm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[_D]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function _D(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function hm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[bD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function bD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function vD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=v("div"),t=v("i"),s=O(),l=v("span"),r=B(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),_(e,t),_(e,s),_(e,l),_(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 gm(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:[vD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Wt({props:r}),ie.push(()=>ge(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||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function _m(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[yD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function bm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[kD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Wt({props:l}),ie.push(()=>ge(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||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function kD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function vm(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e),n[35](null)}}}function ym(n){let e;function t(l,o){return l[12]?SD: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?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 wD(n){let e,t,i,s,l;function o(u,f){var c;return(c=u[1])!=null&&c.length?$D:TD}let r=o(n),a=r(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=O(),a.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),_(e,t),_(t,i),_(t,s),a.m(t,null),_(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a.d()}}}function SD(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function TD(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function $D(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function km(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=O(),r=v("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),_(e,t),_(t,i),_(t,o),_(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 wm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new iu({props:{value:n[55].id}});let c=n[2].isAuth&&Sm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),H(s.$$.fragment),l=O(),o=v("div"),a=B(r),u=O(),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),_(e,t),_(t,i),q(s,i,null),_(i,l),_(i,o),_(o,a),_(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=Sm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function Sm(n){let e;function t(l,o){return l[55].verified?MD:CD}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 CD(n){let e,t,i;return{c(){e=v("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 MD(n){let e,t,i;return{c(){e=v("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 Tm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&$m(n),o=i&&Cm(n);return{c(){l&&l.c(),t=O(),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=$m(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=Cm(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 $m(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].username)),t?OD:DD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("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 DD(n){let e,t=n[55].username+"",i,s;return{c(){e=v("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].username)},m(l,o){S(l,e,o),_(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 OD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Cm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!z.isEmpty(o[55].email)),t?AD:ED}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("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 ED(n){let e,t=n[55].email+"",i,s;return{c(){e=v("span"),i=B(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[55].email)},m(l,o){S(l,e,o),_(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 AD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Mm(n,e){let t,i,s,l;return i=new Ib({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=v("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||(A(i.$$.fragment,o),l=!0)},o(o){I(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Dm(n){let e,t,i;return t=new ui({props:{date:n[55].created}}),{c(){e=v("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||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Om(n){let e,t,i;return t=new ui({props:{date:n[55].updated}}),{c(){e=v("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||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Em(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,g,b,k,y,T=!e[2].isView&&km(e),$=s&&wm(e),M=e[2].isAuth&&Tm(e),C=e[18];const D=F=>F[58].name;for(let F=0;F<C.length;F+=1){let R=am(e,C,F),X=D(R);a.set(X,r[F]=Mm(X,R))}let E=f&&Dm(e),P=d&&Om(e);function L(){return e[37](e[55])}function N(...F){return e[38](e[55],...F)}return{key:n,first:null,c(){t=v("tr"),T&&T.c(),i=O(),$&&$.c(),l=O(),M&&M.c(),o=O();for(let F=0;F<r.length;F+=1)r[F].c();u=O(),E&&E.c(),c=O(),P&&P.c(),m=O(),h=v("td"),h.innerHTML='<i class="ri-arrow-right-line"></i>',g=O(),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),T&&T.m(t,null),_(t,i),$&&$.m(t,null),_(t,l),M&&M.m(t,null),_(t,o);for(let X=0;X<r.length;X+=1)r[X].m(t,null);_(t,u),E&&E.m(t,null),_(t,c),P&&P.m(t,null),_(t,m),_(t,h),_(t,g),b=!0,k||(y=[Y(t,"click",L),Y(t,"keydown",N)],k=!0)},p(F,R){e=F,e[2].isView?T&&(T.d(1),T=null):T?T.p(e,R):(T=km(e),T.c(),T.m(t,i)),R[0]&128&&(s=!e[7].includes("@id")),s?$?($.p(e,R),R[0]&128&&A($,1)):($=wm(e),$.c(),A($,1),$.m(t,l)):$&&(ae(),I($,1,1,()=>{$=null}),ue()),e[2].isAuth?M?M.p(e,R):(M=Tm(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&(C=e[18],ae(),r=wt(r,R,D,1,e,C,a,t,ln,Mm,u,am),ue()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?E?(E.p(e,R),R[0]&1152&&A(E,1)):(E=Dm(e),E.c(),A(E,1),E.m(t,c)):E&&(ae(),I(E,1,1,()=>{E=null}),ue()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?P?(P.p(e,R),R[0]&640&&A(P,1)):(P=Om(e),P.c(),A(P,1),P.m(t,m)):P&&(ae(),I(P,1,1,()=>{P=null}),ue())},i(F){if(!b){A($);for(let R=0;R<C.length;R+=1)A(r[R]);A(E),A(P),b=!0}},o(F){I($);for(let R=0;R<r.length;R+=1)I(r[R]);I(E),I(P),b=!1},d(F){F&&w(t),T&&T.d(),$&&$.d(),M&&M.d();for(let R=0;R<r.length;R+=1)r[R].d();E&&E.d(),P&&P.d(),k=!1,Pe(y)}}}function ID(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,g,b,k,y=[],T=new Map,$,M=!n[2].isView&&cm(n),C=l&&dm(n),D=n[2].isAuth&&pm(n),E=n[18];const P=W=>W[58].name;for(let W=0;W<E.length;W+=1){let G=um(n,E,W),te=P(G);u.set(te,a[W]=gm(te,G))}let L=c&&_m(n),N=m&&bm(n),F=n[15].length&&vm(n),R=n[4];const X=W=>W[2].isView?W[55]:W[55].id;for(let W=0;W<R.length;W+=1){let G=rm(n,R,W),te=X(G);T.set(te,y[W]=Em(te,G))}let se=null;return R.length||(se=ym(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),M&&M.c(),s=O(),C&&C.c(),o=O(),D&&D.c(),r=O();for(let W=0;W<a.length;W+=1)a[W].c();f=O(),L&&L.c(),d=O(),N&&N.c(),h=O(),g=v("th"),F&&F.c(),b=O(),k=v("tbody");for(let W=0;W<y.length;W+=1)y[W].c();se&&se.c(),p(g,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[12])},m(W,G){S(W,e,G),_(e,t),_(t,i),M&&M.m(i,null),_(i,s),C&&C.m(i,null),_(i,o),D&&D.m(i,null),_(i,r);for(let te=0;te<a.length;te+=1)a[te].m(i,null);_(i,f),L&&L.m(i,null),_(i,d),N&&N.m(i,null),_(i,h),_(i,g),F&&F.m(g,null),_(e,b),_(e,k);for(let te=0;te<y.length;te+=1)y[te].m(k,null);se&&se.m(k,null),$=!0},p(W,G){W[2].isView?M&&(M.d(1),M=null):M?M.p(W,G):(M=cm(W),M.c(),M.m(i,s)),G[0]&128&&(l=!W[7].includes("@id")),l?C?(C.p(W,G),G[0]&128&&A(C,1)):(C=dm(W),C.c(),A(C,1),C.m(i,o)):C&&(ae(),I(C,1,1,()=>{C=null}),ue()),W[2].isAuth?D?(D.p(W,G),G[0]&4&&A(D,1)):(D=pm(W),D.c(),A(D,1),D.m(i,r)):D&&(ae(),I(D,1,1,()=>{D=null}),ue()),G[0]&262145&&(E=W[18],ae(),a=wt(a,G,P,1,W,E,u,i,ln,gm,f,um),ue()),G[0]&1152&&(c=W[10]&&!W[7].includes("@created")),c?L?(L.p(W,G),G[0]&1152&&A(L,1)):(L=_m(W),L.c(),A(L,1),L.m(i,d)):L&&(ae(),I(L,1,1,()=>{L=null}),ue()),G[0]&640&&(m=W[9]&&!W[7].includes("@updated")),m?N?(N.p(W,G),G[0]&640&&A(N,1)):(N=bm(W),N.c(),A(N,1),N.m(i,h)):N&&(ae(),I(N,1,1,()=>{N=null}),ue()),W[15].length?F?F.p(W,G):(F=vm(W),F.c(),F.m(g,null)):F&&(F.d(1),F=null),G[0]&4986582&&(R=W[4],ae(),y=wt(y,G,X,1,W,R,T,k,ln,Em,null,rm),ue(),!R.length&&se?se.p(W,G):R.length?se&&(se.d(1),se=null):(se=ym(W),se.c(),se.m(k,null))),(!$||G[0]&4096)&&Q(e,"table-loading",W[12])},i(W){if(!$){A(C),A(D);for(let G=0;G<E.length;G+=1)A(a[G]);A(L),A(N);for(let G=0;G<R.length;G+=1)A(y[G]);$=!0}},o(W){I(C),I(D);for(let G=0;G<a.length;G+=1)I(a[G]);I(L),I(N);for(let G=0;G<y.length;G+=1)I(y[G]);$=!1},d(W){W&&w(e),M&&M.d(),C&&C.d(),D&&D.d();for(let G=0;G<a.length;G+=1)a[G].d();L&&L.d(),N&&N.d(),F&&F.d();for(let G=0;G<y.length;G+=1)y[G].d();se&&se.d()}}}function Am(n){let e,t;return e=new ei({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[14],$$slots:{default:[LD]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function PD(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=v("input"),s=O(),l=v("label"),r=B(o),u=O(),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),_(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 Im(n,e){let t,i,s;return i=new me({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[PD,({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||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function LD(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=fm(n,r,u),c=a(f);s.set(c,i[u]=Im(c,f))}return{c(){e=v("div"),e.textContent="Toggle columns",t=O();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,Im,l,fm),ue())},i(u){if(!o){for(let f=0;f<r.length;f+=1)A(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)I(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 ND(n){let e,t,i=n[14]&&Am(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&&A(i,1)):(i=Am(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),I(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Pm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[5]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),_(e,t),_(e,s),_(e,l),_(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 Lm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=B("Load more ("),o=B(l),r=B(")"),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),_(e,t),_(t,i),_(i,s),_(i,o),_(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 Nm(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,m,h,g,b,k,y;return{c(){e=v("div"),t=v("div"),i=B("Selected "),s=v("strong"),l=B(n[8]),o=O(),a=B(r),u=O(),f=v("button"),f.innerHTML='<span class="txt">Reset</span>',c=O(),d=v("div"),m=O(),h=v("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(T,e,$),_(e,t),_(t,i),_(t,s),_(s,l),_(t,o),_(t,a),_(e,u),_(e,f),_(e,c),_(e,d),_(e,m),_(e,h),b=!0,k||(y=[Y(f,"click",n[42]),Y(h,"click",n[43])],k=!0)},p(T,$){(!b||$[0]&256)&&le(l,T[8]),(!b||$[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!b||$[0]&8192)&&Q(f,"btn-disabled",T[13]),(!b||$[0]&8192)&&Q(h,"btn-loading",T[13]),(!b||$[0]&8192)&&Q(h,"btn-disabled",T[13])},i(T){b||(T&&xe(()=>{g||(g=je(e,An,{duration:150,y:5},!0)),g.run(1)}),b=!0)},o(T){T&&(g||(g=je(e,An,{duration:150,y:5},!1)),g.run(0)),b=!1},d(T){T&&w(e),T&&g&&g.end(),k=!1,Pe(y)}}}function FD(n){let e,t,i,s,l,o;e=new Oa({props:{class:"table-wrapper",$$slots:{before:[ND],default:[ID]},$$scope:{ctx:n}}});let r=n[4].length&&Pm(n),a=n[4].length&&n[17]&&Lm(n),u=n[8]&&Nm(n);return{c(){H(e.$$.fragment),t=O(),r&&r.c(),i=O(),a&&a.c(),s=O(),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=Pm(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=Lm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&A(u,1)):(u=Nm(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(ae(),I(u,1,1,()=>{u=null}),ue())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){I(e.$$.fragment,f),I(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 RD=/^([\+\-])?(\w+)$/;function qD(n,e,t){let i,s,l,o,r,a,u,f;const c=Ct();let{collection:d}=e,{sort:m=""}=e,{filter:h=""}=e,g=[],b=1,k=0,y={},T=!0,$=!1,M=0,C,D=[],E=[];function P(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(D))}function L(){if(t(7,D=[]),!!(d!=null&&d.id))try{const ne=localStorage.getItem(d.id+"@hiddenCollumns");ne&&t(7,D=JSON.parse(ne)||[])}catch{}}async function N(){const ne=b;for(let we=1;we<=ne;we++)(we===1||o)&&await F(we,!1)}async function F(ne=1,we=!0){var Gt,di;if(!(d!=null&&d.id))return;t(12,T=!0);let nt=m;const et=nt.match(RD),bt=et?s.find(ft=>ft.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 ft=[];for(const Wn of bt.options.displayFields)ft.push((et[1]||"")+et[2]+"."+Wn);nt=ft.join(",")}return pe.collection(d.id).getList(ne,30,{sort:nt,filter:h,expand:s.map(ft=>ft.name).join(",")}).then(async ft=>{if(ne<=1&&R(),t(12,T=!1),t(11,b=ft.page),t(5,k=ft.totalItems),c("load",g.concat(ft.items)),we){const Wn=++M;for(;ft.items.length&&M==Wn;)t(4,g=g.concat(ft.items.splice(0,15))),await z.yieldToMain()}else t(4,g=g.concat(ft.items))}).catch(ft=>{ft!=null&&ft.isAbort||(t(12,T=!1),console.warn(ft),R(),pe.errorResponseHandler(ft,!1))})}function R(){t(4,g=[]),t(11,b=1),t(5,k=0),t(6,y={})}function X(){a?se():W()}function se(){t(6,y={})}function W(){for(const ne of g)t(6,y[ne.id]=ne,y);t(6,y)}function G(ne){y[ne.id]?delete y[ne.id]:t(6,y[ne.id]=ne,y),t(6,y)}function te(){cn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,K)}async function K(){if($||!r||!(d!=null&&d.id))return;let ne=[];for(const we of Object.keys(y))ne.push(pe.collection(d.id).delete(we));return t(13,$=!0),Promise.all(ne).then(()=>{zt(`Successfully deleted the selected ${r===1?"record":"records"}.`),se()}).catch(we=>{pe.errorResponseHandler(we)}).finally(()=>(t(13,$=!1),N()))}function re(ne){ze.call(this,n,ne)}const J=(ne,we)=>{we.target.checked?z.removeByValue(D,ne.id):z.pushUnique(D,ne.id),t(7,D)},de=()=>X();function _e(ne){m=ne,t(0,m)}function $e(ne){m=ne,t(0,m)}function Ne(ne){m=ne,t(0,m)}function Re(ne){m=ne,t(0,m)}function be(ne){m=ne,t(0,m)}function Se(ne){m=ne,t(0,m)}function We(ne){ie[ne?"unshift":"push"](()=>{C=ne,t(14,C)})}const lt=ne=>G(ne),fe=ne=>c("select",ne),Ve=(ne,we)=>{we.code==="Enter"&&(we.preventDefault(),c("select",ne))},ee=()=>t(1,h=""),Fe=()=>c("new"),ot=()=>F(b+1),Ht=()=>se(),Ae=()=>te();return n.$$set=ne=>{"collection"in ne&&t(2,d=ne.collection),"sort"in ne&&t(0,m=ne.sort),"filter"in ne&&t(1,h=ne.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(ne=>ne.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ne=>!D.includes(ne.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&m!==-1&&h!==-1&&F(1),n.$$.dirty[0]&48&&t(17,o=k>g.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(y).length),n.$$.dirty[0]&272&&t(16,a=g.length&&r===g.length),n.$$.dirty[0]&128&&D!==-1&&P(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||g.length>0&&g[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||g.length>0&&g[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,E=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ne=>({id:ne.id,name:ne.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[m,h,d,F,g,k,y,D,r,f,u,b,T,$,C,E,a,o,l,c,X,se,G,te,N,i,re,J,de,_e,$e,Ne,Re,be,Se,We,lt,fe,Ve,ee,Fe,ot,Ht,Ae]}class jD extends ye{constructor(e){super(),ve(this,e,qD,FD,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 HD(n){let e,t,i,s;return e=new GC({}),i=new wn({props:{$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function VD(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[YD]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zD(n){let e,t;return e=new wn({props:{center:!0,$$slots:{default:[KD]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Fm(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,Pe(i)}}}function Rm(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D,E,P,L,N=!n[10]&&Fm(n);c=new Da({}),c.$on("refresh",n[16]);let F=!n[2].isView&&Rm(n);k=new Uo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function R(W){n[21](W)}function X(W){n[22](W)}let se={collection:n[2]};return n[0]!==void 0&&(se.filter=n[0]),n[1]!==void 0&&(se.sort=n[1]),M=new jD({props:se}),n[20](M),ie.push(()=>ge(M,"filter",R)),ie.push(()=>ge(M,"sort",X)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=O(),l=v("div"),r=B(o),a=O(),u=v("div"),N&&N.c(),f=O(),H(c.$$.fragment),d=O(),m=v("div"),h=v("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=O(),F&&F.c(),b=O(),H(k.$$.fragment),y=O(),T=v("div"),$=O(),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(T,"class","clearfix m-b-base")},m(W,G){S(W,e,G),_(e,t),_(t,i),_(t,s),_(t,l),_(l,r),_(e,a),_(e,u),N&&N.m(u,null),_(u,f),q(c,u,null),_(e,d),_(e,m),_(m,h),_(m,g),F&&F.m(m,null),S(W,b,G),q(k,W,G),S(W,y,G),S(W,T,G),S(W,$,G),q(M,W,G),E=!0,P||(L=Y(h,"click",n[17]),P=!0)},p(W,G){(!E||G[0]&4)&&o!==(o=W[2].name+"")&&le(r,o),W[10]?N&&(N.d(1),N=null):N?N.p(W,G):(N=Fm(W),N.c(),N.m(u,f)),W[2].isView?F&&(F.d(1),F=null):F?F.p(W,G):(F=Rm(W),F.c(),F.m(m,null));const te={};G[0]&1&&(te.value=W[0]),G[0]&4&&(te.autocompleteCollection=W[2]),k.$set(te);const K={};G[0]&4&&(K.collection=W[2]),!C&&G[0]&1&&(C=!0,K.filter=W[0],ke(()=>C=!1)),!D&&G[0]&2&&(D=!0,K.sort=W[1],ke(()=>D=!1)),M.$set(K)},i(W){E||(A(c.$$.fragment,W),A(k.$$.fragment,W),A(M.$$.fragment,W),E=!0)},o(W){I(c.$$.fragment,W),I(k.$$.fragment,W),I(M.$$.fragment,W),E=!1},d(W){W&&w(e),N&&N.d(),j(c),F&&F.d(),W&&w(b),j(k,W),W&&w(y),W&&w(T),W&&w($),n[20](null),j(M,W),P=!1,L()}}}function UD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=O(),i=v("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:Z,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function WD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function YD(n){let e,t,i;function s(r,a){return r[10]?WD:UD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),_(e,t),_(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 KD(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[zD,VD,HD],m=[];function h(T,$){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=m[e]=d[e](n);let g={};s=new tu({props:g}),n[25](s);let b={};o=new s4({props:b}),n[26](o);let k={collection:n[2]};a=new Ab({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let y={collection:n[2]};return f=new pD({props:y}),n[30](f),{c(){t.c(),i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment)},m(T,$){m[e].m(T,$),S(T,i,$),q(s,T,$),S(T,l,$),q(o,T,$),S(T,r,$),q(a,T,$),S(T,u,$),q(f,T,$),c=!0},p(T,$){let M=e;e=h(T),e===M?m[e].p(T,$):(ae(),I(m[M],1,1,()=>{m[M]=null}),ue(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const D={};o.$set(D);const E={};$[0]&4&&(E.collection=T[2]),a.$set(E);const P={};$[0]&4&&(P.collection=T[2]),f.$set(P)},i(T){c||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),c=!0)},o(T){I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),c=!1},d(T){m[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function ZD(n,e,t){let i,s,l,o,r,a,u;Ye(n,Mi,J=>t(2,s=J)),Ye(n,St,J=>t(31,l=J)),Ye(n,Po,J=>t(3,o=J)),Ye(n,ma,J=>t(13,r=J)),Ye(n,Ai,J=>t(9,a=J)),Ye(n,$s,J=>t(10,u=J));const f=new URLSearchParams(r);let c,d,m,h,g,b=f.get("filter")||"",k=f.get("sort")||"",y=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,y=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.isView&&!z.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Tb(y);const $=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>g==null?void 0:g.load(),D=()=>d==null?void 0:d.show(s),E=()=>m==null?void 0:m.show(),P=J=>t(0,b=J.detail);function L(J){ie[J?"unshift":"push"](()=>{g=J,t(8,g)})}function N(J){b=J,t(0,b)}function F(J){k=J,t(1,k)}const R=J=>{s.isView?h.show(J==null?void 0:J.detail):m==null||m.show(J==null?void 0:J.detail)},X=()=>m==null?void 0:m.show();function se(J){ie[J?"unshift":"push"](()=>{c=J,t(4,c)})}function W(J){ie[J?"unshift":"push"](()=>{d=J,t(5,d)})}function G(J){ie[J?"unshift":"push"](()=>{m=J,t(6,m)})}const te=()=>g==null?void 0:g.reloadLoadedPages(),K=()=>g==null?void 0:g.reloadLoadedPages();function re(J){ie[J?"unshift":"push"](()=>{h=J,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&&M3(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&y!=s.id&&T(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const J=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Di("/collections?"+J)}n.$$.dirty[0]&4&&Kt(St,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,c,d,m,h,g,a,u,y,i,r,$,M,C,D,E,P,L,N,F,R,X,se,W,G,te,K,re]}class GD extends ye{constructor(e){super(),ve(this,e,ZD,JD,he,{},null,[-1,-1])}}function XD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D,E,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=O(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=O(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=O(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=O(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=O(),m=v("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=O(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=O(),k=v("div"),k.textContent="Authentication",y=O(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=O(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=O(),D=v("a"),D.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(g,"href","/settings/import-collections"),p(g,"class","sidebar-list-item"),p(k,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,N){S(L,e,N),_(e,t),_(t,i),_(t,s),_(t,l),_(t,o),_(t,r),_(t,a),_(t,u),_(t,f),_(t,c),_(t,d),_(t,m),_(t,h),_(t,g),_(t,b),_(t,k),_(t,y),_(t,T),_(t,$),_(t,M),_(t,C),_(t,D),E||(P=[Ie(qn.call(null,l,{path:"/settings"})),Ie(xt.call(null,l)),Ie(qn.call(null,r,{path:"/settings/mail/?.*"})),Ie(xt.call(null,r)),Ie(qn.call(null,u,{path:"/settings/storage/?.*"})),Ie(xt.call(null,u)),Ie(qn.call(null,m,{path:"/settings/export-collections/?.*"})),Ie(xt.call(null,m)),Ie(qn.call(null,g,{path:"/settings/import-collections/?.*"})),Ie(xt.call(null,g)),Ie(qn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ie(xt.call(null,T)),Ie(qn.call(null,M,{path:"/settings/tokens/?.*"})),Ie(xt.call(null,M)),Ie(qn.call(null,D,{path:"/settings/admins/?.*"})),Ie(xt.call(null,D))],E=!0)},p:Z,i:Z,o:Z,d(L){L&&w(e),E=!1,Pe(P)}}}class Ii extends ye{constructor(e){super(),ve(this,e,null,XD,he,{})}}function qm(n,e,t){const i=n.slice();return i[30]=e[t],i}function jm(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[QD,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="id",o=O(),r=v("div"),a=v("i"),f=O(),c=v("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(b,k){S(b,e,k),_(e,t),_(e,i),_(e,s),S(b,o,k),S(b,r,k),_(r,a),S(b,f,k),S(b,c,k),h||(g=Ie(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&p(e,"for",l),u&&Bt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&d!==(d=b[29])&&p(c,"id",d),k[0]&2&&m!==(m=b[1].id)&&c.value!==m&&(c.value=m)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(c),h=!1,g()}}}function Hm(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=O(),Vn(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),_(e,t),_(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 xD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Email",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(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]&&ce(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function Vm(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[eO,({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 zm(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[tO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nO,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),H(s.$$.fragment),l=O(),o=v("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),_(e,t),_(t,i),q(s,i,null),_(t,l),_(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||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{a||(a=je(t,At,{duration:150},!0)),a.run(1)}),u=!0)},o(f){I(s.$$.fragment,f),I(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 tO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(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]&&ce(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function nO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=O(),s=v("span"),s.textContent="Password confirm",o=O(),r=v("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),_(e,t),_(e,i),_(e,s),S(c,o,d),S(c,r,d),ce(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]&&ce(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function iO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h=!n[1].isNew&&jm(n),g=[0,1,2,3,4,5,6,7,8,9],b=[];for(let T=0;T<10;T+=1)b[T]=Hm(qm(n,g,T));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[xD,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].isNew&&Vm(n),y=(n[1].isNew||n[4])&&zm(n);return{c(){e=v("form"),h&&h.c(),t=O(),i=v("div"),s=v("p"),s.textContent="Avatar",l=O(),o=v("div");for(let T=0;T<10;T+=1)b[T].c();r=O(),H(a.$$.fragment),u=O(),k&&k.c(),f=O(),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(T,e,$),h&&h.m(e,null),_(e,t),_(e,i),_(i,s),_(i,l),_(i,o);for(let M=0;M<10;M+=1)b[M].m(o,null);_(e,r),q(a,e,null),_(e,u),k&&k.m(e,null),_(e,f),y&&y.m(e,null),c=!0,d||(m=Y(e,"submit",dt(n[12])),d=!0)},p(T,$){if(T[1].isNew?h&&(ae(),I(h,1,1,()=>{h=null}),ue()):h?(h.p(T,$),$[0]&2&&A(h,1)):(h=jm(T),h.c(),A(h,1),h.m(e,t)),$[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let C;for(C=0;C<10;C+=1){const D=qm(T,g,C);b[C]?b[C].p(D,$):(b[C]=Hm(D),b[C].c(),b[C].m(o,null))}for(;C<10;C+=1)b[C].d(1)}const M={};$[0]&536870920|$[1]&4&&(M.$$scope={dirty:$,ctx:T}),a.$set(M),T[1].isNew?k&&(ae(),I(k,1,1,()=>{k=null}),ue()):k?(k.p(T,$),$[0]&2&&A(k,1)):(k=Vm(T),k.c(),A(k,1),k.m(e,f)),T[1].isNew||T[4]?y?(y.p(T,$),$[0]&18&&A(y,1)):(y=zm(T),y.c(),A(y,1),y.m(e,null)):y&&(ae(),I(y,1,1,()=>{y=null}),ue())},i(T){c||(A(h),A(a.$$.fragment,T),A(k),A(y),c=!0)},o(T){I(h),I(a.$$.fragment,T),I(k),I(y),c=!1},d(T){T&&w(e),h&&h.d(),mt(b,T),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=v("h4"),i=B(t)},m(s,l){S(s,e,l),_(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 Bm(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:[lO]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=O(),s=v("i"),l=O(),H(o.$$.fragment),r=O(),a=v("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),_(e,t),_(e,i),_(e,s),_(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||(A(o.$$.fragment,f),u=!0)},o(f){I(o.$$.fragment,f),u=!1},d(f){f&&w(e),j(o),f&&w(r),f&&w(a)}}}function lO(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function oO(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Bm(n);return{c(){m&&m.c(),e=O(),t=v("button"),i=v("span"),i.textContent="Cancel",s=O(),l=v("button"),o=v("span"),a=B(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,g){m&&m.m(h,g),S(h,e,g),S(h,t,g),_(t,i),S(h,s,g),S(h,l,g),_(l,o),_(o,a),f=!0,c||(d=Y(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?m&&(ae(),I(m,1,1,()=>{m=null}),ue()):m?(m.p(h,g),g[0]&2&&A(m,1)):(m=Bm(h),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(m),f=!0)},o(h){I(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 rO(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[oO],header:[sO],default:[iO]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function aO(n,e,t){let i;const s=Ct(),l="admin_"+z.randomString(5);let o,r=new Xi,a=!1,u=!1,f=0,c="",d="",m="",h=!1;function g(W){return k(W),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(W){t(1,r=W!=null&&W.clone?W.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=""),Bn({})}function T(){if(a||!i)return;t(6,a=!0);const W={email:c,avatar:f};(r.isNew||h)&&(W.password=d,W.passwordConfirm=m);let G;r.isNew?G=pe.admins.create(W):G=pe.admins.update(r.id,W),G.then(async te=>{var K;t(7,u=!1),b(),zt(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",te),((K=pe.authStore.model)==null?void 0:K.id)===te.id&&pe.authStore.save(pe.authStore.token,te)}).catch(te=>{pe.errorResponseHandler(te)}).finally(()=>{t(6,a=!1)})}function $(){r!=null&&r.id&&cn("Do you really want to delete the selected admin?",()=>pe.admins.delete(r.id).then(()=>{t(7,u=!1),b(),zt("Successfully deleted admin."),s("delete",r)}).catch(W=>{pe.errorResponseHandler(W)}))}const M=()=>$(),C=()=>b(),D=W=>t(2,f=W);function E(){c=this.value,t(3,c)}function P(){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),b()}),!1):!0;function R(W){ie[W?"unshift":"push"](()=>{o=W,t(5,o)})}function X(W){ze.call(this,n,W)}function se(W){ze.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[b,r,f,c,h,o,a,u,d,m,i,l,T,$,g,M,C,D,E,P,L,N,F,R,X,se]}class uO extends ye{constructor(e){super(),ve(this,e,aO,rO,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Um(n,e,t){const i=n.slice();return i[24]=e[t],i}function fO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function cO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function dO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function pO(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=O(),s=v("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),_(e,t),_(e,i),_(e,s)},p:Z,d(l){l&&w(e)}}}function Wm(n){let e;function t(l,o){return l[5]?hO:mO}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 mO(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Ym(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=O(),o&&o.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),_(e,t),_(t,i),_(t,s),o&&o.m(t,null),_(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Ym(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function hO(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function Ym(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function Km(n){let e;return{c(){e=v("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 Jm(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",h,g,b,k,y,T=e[24].email+"",$,M,C,D,E,P,L,N,F,R,X,se,W,G;f=new iu({props:{value:e[24].id}});let te=e[24].id===e[7].id&&Km();E=new ui({props:{date:e[24].created}}),N=new ui({props:{date:e[24].updated}});function K(){return e[15](e[24])}function re(...J){return e[16](e[24],...J)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=O(),a=v("td"),u=v("div"),H(f.$$.fragment),c=O(),d=v("span"),h=B(m),g=O(),te&&te.c(),b=O(),k=v("td"),y=v("span"),$=B(T),C=O(),D=v("td"),H(E.$$.fragment),P=O(),L=v("td"),H(N.$$.fragment),F=O(),R=v("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',X=O(),Vn(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(D,"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(J,de){S(J,t,de),_(t,i),_(i,s),_(s,l),_(t,r),_(t,a),_(a,u),q(f,u,null),_(u,c),_(u,d),_(d,h),_(a,g),te&&te.m(a,null),_(t,b),_(t,k),_(k,y),_(y,$),_(t,C),_(t,D),q(E,D,null),_(t,P),_(t,L),q(N,L,null),_(t,F),_(t,R),_(t,X),se=!0,W||(G=[Y(t,"click",K),Y(t,"keydown",re)],W=!0)},p(J,de){e=J,(!se||de&16&&!Vn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const _e={};de&16&&(_e.value=e[24].id),f.$set(_e),(!se||de&16)&&m!==(m=e[24].id+"")&&le(h,m),e[24].id===e[7].id?te||(te=Km(),te.c(),te.m(a,null)):te&&(te.d(1),te=null),(!se||de&16)&&T!==(T=e[24].email+"")&&le($,T),(!se||de&16&&M!==(M=e[24].email))&&p(y,"title",M);const $e={};de&16&&($e.date=e[24].created),E.$set($e);const Ne={};de&16&&(Ne.date=e[24].updated),N.$set(Ne)},i(J){se||(A(f.$$.fragment,J),A(E.$$.fragment,J),A(N.$$.fragment,J),se=!0)},o(J){I(f.$$.fragment,J),I(E.$$.fragment,J),I(N.$$.fragment,J),se=!1},d(J){J&&w(t),j(f),te&&te.d(),j(E),j(N),W=!1,Pe(G)}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M=[],C=new Map,D;function E(K){n[11](K)}let P={class:"col-type-text",name:"id",$$slots:{default:[fO]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new Wt({props:P}),ie.push(()=>ge(o,"sort",E));function L(K){n[12](K)}let N={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cO]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),u=new Wt({props:N}),ie.push(()=>ge(u,"sort",L));function F(K){n[13](K)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dO]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Wt({props:R}),ie.push(()=>ge(d,"sort",F));function X(K){n[14](K)}let se={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pO]},$$scope:{ctx:n}};n[2]!==void 0&&(se.sort=n[2]),g=new Wt({props:se}),ie.push(()=>ge(g,"sort",X));let W=n[4];const G=K=>K[24].id;for(let K=0;K<W.length;K+=1){let re=Um(n,W,K),J=G(re);C.set(J,M[K]=Jm(J,re))}let te=null;return W.length||(te=Wm(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=O(),H(o.$$.fragment),a=O(),H(u.$$.fragment),c=O(),H(d.$$.fragment),h=O(),H(g.$$.fragment),k=O(),y=v("th"),T=O(),$=v("tbody");for(let K=0;K<M.length;K+=1)M[K].c();te&&te.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(K,re){S(K,e,re),_(e,t),_(t,i),_(i,s),_(i,l),q(o,i,null),_(i,a),q(u,i,null),_(i,c),q(d,i,null),_(i,h),q(g,i,null),_(i,k),_(i,y),_(e,T),_(e,$);for(let J=0;J<M.length;J+=1)M[J].m($,null);te&&te.m($,null),D=!0},p(K,re){const J={};re&134217728&&(J.$$scope={dirty:re,ctx:K}),!r&&re&4&&(r=!0,J.sort=K[2],ke(()=>r=!1)),o.$set(J);const de={};re&134217728&&(de.$$scope={dirty:re,ctx:K}),!f&&re&4&&(f=!0,de.sort=K[2],ke(()=>f=!1)),u.$set(de);const _e={};re&134217728&&(_e.$$scope={dirty:re,ctx:K}),!m&&re&4&&(m=!0,_e.sort=K[2],ke(()=>m=!1)),d.$set(_e);const $e={};re&134217728&&($e.$$scope={dirty:re,ctx:K}),!b&&re&4&&(b=!0,$e.sort=K[2],ke(()=>b=!1)),g.$set($e),re&186&&(W=K[4],ae(),M=wt(M,re,G,1,K,W,C,$,ln,Jm,null,Um),ue(),!W.length&&te?te.p(K,re):W.length?te&&(te.d(1),te=null):(te=Wm(K),te.c(),te.m($,null))),(!D||re&32)&&Q(e,"table-loading",K[5])},i(K){if(!D){A(o.$$.fragment,K),A(u.$$.fragment,K),A(d.$$.fragment,K),A(g.$$.fragment,K);for(let re=0;re<W.length;re+=1)A(M[re]);D=!0}},o(K){I(o.$$.fragment,K),I(u.$$.fragment,K),I(d.$$.fragment,K),I(g.$$.fragment,K);for(let re=0;re<M.length;re+=1)I(M[re]);D=!1},d(K){K&&w(e),j(o),j(u),j(d),j(g);for(let re=0;re<M.length;re+=1)M[re].d();te&&te.d()}}}function Zm(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),r=B(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),_(e,t),_(e,s),_(e,l),_(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 _O(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D;a=new Da({}),a.$on("refresh",n[8]),h=new Uo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),h.$on("submit",n[10]),y=new Oa({props:{class:"table-wrapper",$$slots:{default:[gO]},$$scope:{ctx:n}}});let E=n[4].length&&Zm(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[6]),r=O(),H(a.$$.fragment),u=O(),f=v("div"),c=O(),d=v("button"),d.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,m=O(),H(h.$$.fragment),g=O(),b=v("div"),k=O(),H(y.$$.fragment),T=O(),E&&E.c(),$=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(b,"class","clearfix m-b-base")},m(P,L){S(P,e,L),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(e,r),q(a,e,null),_(e,u),_(e,f),_(e,c),_(e,d),S(P,m,L),q(h,P,L),S(P,g,L),S(P,b,L),S(P,k,L),q(y,P,L),S(P,T,L),E&&E.m(P,L),S(P,$,L),M=!0,C||(D=Y(d,"click",n[9]),C=!0)},p(P,L){(!M||L&64)&&le(o,P[6]);const N={};L&2&&(N.value=P[1]),h.$set(N);const F={};L&134217918&&(F.$$scope={dirty:L,ctx:P}),y.$set(F),P[4].length?E?E.p(P,L):(E=Zm(P),E.c(),E.m($.parentNode,$)):E&&(E.d(1),E=null)},i(P){M||(A(a.$$.fragment,P),A(h.$$.fragment,P),A(y.$$.fragment,P),M=!0)},o(P){I(a.$$.fragment,P),I(h.$$.fragment,P),I(y.$$.fragment,P),M=!1},d(P){P&&w(e),j(a),P&&w(m),j(h,P),P&&w(g),P&&w(b),P&&w(k),j(y,P),P&&w(T),E&&E.d(P),P&&w($),C=!1,D()}}}function bO(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[_O]},$$scope:{ctx:n}}});let r={};return l=new uO({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),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||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(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 vO(n,e,t){let i,s,l;Ye(n,ma,N=>t(21,i=N)),Ye(n,St,N=>t(6,s=N)),Ye(n,Ma,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=[]),pe.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(),pe.errorResponseHandler(N,!1))})}function m(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function k(N){c=N,t(2,c)}function y(N){c=N,t(2,c)}function T(N){c=N,t(2,c)}function $(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))},D=()=>t(1,f="");function E(N){ie[N?"unshift":"push"](()=>{r=N,t(3,r)})}const P=()=>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,g,b,k,y,T,$,M,C,D,E,P,L]}class yO extends ye{constructor(e){super(),ve(this,e,vO,bO,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function kO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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]&&ce(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Password"),s=O(),l=v("input"),r=O(),a=v("div"),u=v("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),_(e,t),S(d,s,m),S(d,l,m),ce(l,n[1]),S(d,r,m),S(d,a,m),_(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]&&ce(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 SO(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[kO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[wO,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),H(s.$$.fragment),l=O(),H(o.$$.fragment),r=O(),a=v("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),_(e,t),_(e,i),q(s,e,null),_(e,l),q(o,e,null),_(e,r),_(e,a),u=!0,f||(c=Y(e,"submit",dt(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),s.$set(h);const g={};m&770&&(g.$$scope={dirty:m,ctx:d}),o.$set(g),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function TO(n){let e,t;return e=new S_({props:{$$slots:{default:[SO]},$$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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $O(n,e,t){let i;Ye(n,ma,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),pe.admins.authWithPassword(l,o).then(()=>{$a(),Di("/")}).catch(()=>{cl("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 CO extends ye{constructor(e){super(),ve(this,e,$O,TO,he,{})}}function MO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[OO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[EO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[AO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[IO,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&Gm(n);return{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),c=O(),d=v("div"),m=v("div"),h=O(),C&&C.c(),g=O(),b=v("button"),k=v("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(b,"type","submit"),p(b,"class","btn btn-expanded"),b.disabled=y=!n[3]||n[2],Q(b,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(D,E){S(D,e,E),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),q(a,e,null),_(e,u),q(f,e,null),_(e,c),_(e,d),_(d,m),_(d,h),C&&C.m(d,null),_(d,g),_(d,b),_(b,k),T=!0,$||(M=Y(b,"click",n[13]),$=!0)},p(D,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:D}),i.$set(P);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:D}),a.$set(N);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:D}),f.$set(F),D[3]?C?C.p(D,E):(C=Gm(D),C.c(),C.m(d,g)):C&&(C.d(1),C=null),(!T||E&12&&y!==(y=!D[3]||D[2]))&&(b.disabled=y),(!T||E&4)&&Q(b,"btn-loading",D[2])},i(D){T||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(a.$$.fragment,D),A(f.$$.fragment,D),T=!0)},o(D){I(i.$$.fragment,D),I(o.$$.fragment,D),I(a.$$.fragment,D),I(f.$$.fragment,D),T=!1},d(D){D&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),$=!1,M()}}}function DO(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function OO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application name"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application url"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Logs max days retention"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].logs.maxDays&&ce(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=O(),r=v("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),_(s,l),_(s,o),_(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 Gm(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),_(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 PO(n){let e,t,i,s,l,o,r,a,u;const f=[DO,MO],c=[];function d(m,h){return m[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=O(),i=v("div"),s=v("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),_(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",dt(n[4])),a=!0)},p(m,h){let g=l;l=d(m),l===g?c[l].p(m,h):(ae(),I(c[g],1,1,()=>{c[g]=null}),ue(),o=c[l],o?o.p(m,h):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){I(o),r=!1},d(m){m&&w(e),m&&w(t),m&&w(i),c[l].d(),a=!1,u()}}}function LO(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[PO]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function NO(n,e,t){let i,s,l,o;Ye(n,$s,C=>t(14,s=C)),Ye(n,vo,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 pe.settings.getAll()||{};h(C)}catch(C){pe.errorResponseHandler(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await pe.settings.update(z.filterRedactedProps(a));h(C),zt("Successfully saved application settings.")}catch(C){pe.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var D,E;Kt(vo,l=(D=C==null?void 0:C.meta)==null?void 0:D.appName,l),Kt($s,s=!!((E=C==null?void 0:C.meta)!=null&&E.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 g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function b(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function y(){a.logs.maxDays=ht(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>g(),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,g,r,c,b,k,y,T,$,M]}class FO extends ye{constructor(e){super(),ve(this,e,NO,LO,he,{})}}function RO(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=v("input"),Xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ce(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]&&ce(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function qO(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=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=v("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),_(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 jO(n){let e;function t(l,o){return l[3]?qO:RO}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:Z,o:Z,d(l){s.d(l),l&&w(e)}}}function HO(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){ie[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&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class su extends ye{constructor(e){super(),ve(this,e,HO,jO,he,{value:0,mask:1})}}function VO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;return{c(){e=v("label"),t=B("Subject"),s=O(),l=v("input"),r=O(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B("."),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(b,k){S(b,e,k),_(e,t),S(b,s,k),S(b,l,k),ce(l,n[0].subject),S(b,r,k),S(b,a,k),_(a,u),_(a,f),_(a,c),_(a,d),_(a,m),h||(g=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],h=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&p(e,"for",i),k[1]&1&&o!==(o=b[31])&&p(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ce(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),h=!1,Pe(g)}}}function zO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k;return{c(){e=v("label"),t=B("Action URL"),s=O(),l=v("input"),r=O(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B("."),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,T){S(y,e,T),_(e,t),S(y,s,T),S(y,l,T),ce(l,n[0].actionUrl),S(y,r,T),S(y,a,T),_(a,u),_(a,f),_(a,c),_(a,d),_(a,m),_(a,h),_(a,g),b||(k=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(h,"click",n[19])],b=!0)},p(y,T){T[1]&1&&i!==(i=y[31])&&p(e,"for",i),T[1]&1&&o!==(o=y[31])&&p(l,"id",o),T[0]&1&&l.value!==y[0].actionUrl&&ce(l,y[0].actionUrl)},d(y){y&&w(e),y&&w(s),y&&w(l),y&&w(r),y&&w(a),b=!1,Pe(k)}}}function BO(n){let e,t,i,s;return{c(){e=v("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),ce(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&&ce(e,l[0].body)},i:Z,o:Z,d(l){l&&w(e),i=!1,s()}}}function UO(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=jt(o,r(n)),ie.push(()=>ge(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;I(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(e=jt(o,r(a)),ie.push(()=>ge(e,"value",l)),H(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function WO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$;const M=[UO,BO],C=[];function D(E,P){return E[4]&&!E[5]?0:1}return l=D(n),o=C[l]=M[l](n),{c(){e=v("label"),t=B("Body (HTML)"),s=O(),o.c(),r=O(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,m=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),b=v("button"),b.textContent=`{ACTION_URL}
`,k=B("."),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(b,"type","button"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(E,P){S(E,e,P),_(e,t),S(E,s,P),C[l].m(E,P),S(E,r,P),S(E,a,P),_(a,u),_(a,f),_(a,c),_(a,d),_(a,m),_(a,h),_(a,g),_(a,b),_(a,k),y=!0,T||($=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(h,"click",n[24]),Y(b,"click",n[25])],T=!0)},p(E,P){(!y||P[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let L=l;l=D(E),l===L?C[l].p(E,P):(ae(),I(C[L],1,1,()=>{C[L]=null}),ue(),o=C[l],o?o.p(E,P):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){y||(A(o),y=!0)},o(E){I(o),y=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),T=!1,Pe($)}}}function YO(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[VO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[zO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[WO,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),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||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function Xm(n){let e,t,i,s,l;return{c(){e=v("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 KO(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Xm();return{c(){e=v("div"),t=v("i"),i=O(),s=v("span"),l=B(n[2]),o=O(),r=v("div"),a=O(),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),_(e,t),_(e,i),_(e,s),_(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&&A(f,1):(f=Xm(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),I(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 JO(n){let e,t;const i=[n[8]];let s={$$slots:{header:[KO],default:[YO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ys({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||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let Qm;function ZO(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Et(e,s),o;Ye(n,fi,K=>t(12,o=K));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Qm,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-4caff52a.js"),["./CodeEditor-4caff52a.js","./index-a6ccb683.js"],import.meta.url)).default),Qm=c,t(5,d=!1))}function k(K){z.copyToClipboard(K),k_(`Copied ${K} to clipboard`,2e3)}b();function y(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),$=()=>k("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),D=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function P(K){n.$$.not_equal(u.body,K)&&(u.body=K,t(0,u))}function L(){u.body=this.value,t(0,u)}const N=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),R=()=>k("{TOKEN}"),X=()=>k("{ACTION_URL}");function se(K){ie[K?"unshift":"push"](()=>{f=K,t(3,f)})}function W(K){ze.call(this,n,K)}function G(K){ze.call(this,n,K)}function te(K){ze.call(this,n,K)}return n.$$set=K=>{e=Je(Je({},e),Qn(K)),t(8,l=Et(e,s)),"key"in K&&t(1,r=K.key),"title"in K&&t(2,a=K.title),"config"in K&&t(0,u=K.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,g,o,y,T,$,M,C,D,E,P,L,N,F,R,X,se,W,G,te]}class Er extends ye{constructor(e){super(),ve(this,e,ZO,JO,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 xm(n,e,t){const i=n.slice();return i[22]=e[t],i}function eh(n,e){let t,i,s,l,o,r=e[22].label+"",a,u,f,c,d;return{key:n,first:null,c(){t=v("div"),i=v("input"),l=O(),o=v("label"),a=B(r),f=O(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[21]+e[22].value),i.__value=e[22].value,i.value=i.__value,e[12][0].push(i),p(o,"for",u=e[21]+e[22].value),p(t,"class","form-field-block"),this.first=t},m(m,h){S(m,t,h),_(t,i),i.checked=i.__value===e[2],_(t,l),_(t,o),_(o,a),_(t,f),c||(d=Y(i,"change",e[11]),c=!0)},p(m,h){e=m,h&2097152&&s!==(s=e[21]+e[22].value)&&p(i,"id",s),h&4&&(i.checked=i.__value===e[2]),h&2097152&&u!==(u=e[21]+e[22].value)&&p(o,"for",u)},d(m){m&&w(t),e[12][0].splice(e[12][0].indexOf(i),1),c=!1,d()}}}function GO(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[22].value;for(let o=0;o<s.length;o+=1){let r=xm(n,s,o),a=l(r);t.set(a,e[o]=eh(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&2097284&&(s=o[7],e=wt(e,r,l,1,o,s,t,i.parentNode,es,eh,i,xm))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function XO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("To email address"),s=O(),l=v("input"),p(e,"for",i=n[21]),p(l,"type","email"),p(l,"id",o=n[21]),l.autofocus=!0,l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(l,n[1]),l.focus(),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1]&&ce(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QO(n){let e,t,i,s,l,o,r;return t=new me({props:{class:"form-field required",name:"template",$$slots:{default:[GO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[XO,({uniqueId:a})=>({21:a}),({uniqueId:a})=>a?2097152:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),H(t.$$.fragment),i=O(),H(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),_(e,i),q(s,e,null),l=!0,o||(r=Y(e,"submit",dt(n[14])),o=!0)},p(a,u){const f={};u&35651588&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&35651586&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){I(t.$$.fragment,a),I(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function xO(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function eE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=B("Close"),i=O(),s=v("button"),l=v("i"),o=O(),r=v("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),_(e,t),S(c,i,d),S(c,s,d),_(s,l),_(s,o),_(s,r),u||(f=[Y(e,"click",n[0]),Y(s,"click",n[10])],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,Pe(f)}}}function tE(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[15],popup:!0,$$slots:{footer:[eE],header:[xO],default:[QO]},$$scope:{ctx:n}};return e=new Nn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){H(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[15]),l&33554486&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[16](null),j(e,s)}}}const Ar="last_email_test",th="email_test_request";function nE(n,e,t){let i;const s=Ct(),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(Ar),u=o[0].value,f=!1,c=null;function d(E="",P=""){t(1,a=E||localStorage.getItem(Ar)),t(2,u=P||o[0].value),Bn({}),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(Ar,a),clearTimeout(c),c=setTimeout(()=>{pe.cancelRequest(th),cl("Test email send timeout.")},3e4);try{await pe.settings.testEmail(a,u,{$cancelKey:th}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await sn(),m()}catch(E){t(4,f=!1),pe.errorResponseHandler(E)}clearTimeout(c)}}const g=[[]],b=()=>h();function k(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const T=()=>h(),$=()=>!f;function M(E){ie[E?"unshift":"push"](()=>{r=E,t(3,r)})}function C(E){ze.call(this,n,E)}function D(E){ze.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,l,o,h,d,b,k,g,y,T,$,M,C,D]}class iE extends ye{constructor(e){super(),ve(this,e,nE,tE,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,g,b,k,y,T,$,M,C,D,E,P,L;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[oE,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[rE,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});function N(J){n[14](J)}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 Er({props:F}),ie.push(()=>ge(u,"config",N));function R(J){n[15](J)}let X={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(X.config=n[0].meta.resetPasswordTemplate),d=new Er({props:X}),ie.push(()=>ge(d,"config",R));function se(J){n[16](J)}let W={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(W.config=n[0].meta.confirmEmailChangeTemplate),g=new Er({props:W}),ie.push(()=>ge(g,"config",se)),$=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[aE,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let G=n[0].smtp.enabled&&nh(n);function te(J,de){return J[4]?gE:hE}let K=te(n),re=K(n);return{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),H(u.$$.fragment),c=O(),H(d.$$.fragment),h=O(),H(g.$$.fragment),k=O(),y=v("hr"),T=O(),H($.$$.fragment),M=O(),G&&G.c(),C=O(),D=v("div"),E=v("div"),P=O(),re.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(E,"class","flex-fill"),p(D,"class","flex")},m(J,de){S(J,e,de),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),S(J,r,de),S(J,a,de),q(u,a,null),_(a,c),q(d,a,null),_(a,h),q(g,a,null),S(J,k,de),S(J,y,de),S(J,T,de),q($,J,de),S(J,M,de),G&&G.m(J,de),S(J,C,de),S(J,D,de),_(D,E),_(D,P),re.m(D,null),L=!0},p(J,de){const _e={};de[0]&1|de[1]&3&&(_e.$$scope={dirty:de,ctx:J}),i.$set(_e);const $e={};de[0]&1|de[1]&3&&($e.$$scope={dirty:de,ctx:J}),o.$set($e);const Ne={};!f&&de[0]&1&&(f=!0,Ne.config=J[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Ne);const Re={};!m&&de[0]&1&&(m=!0,Re.config=J[0].meta.resetPasswordTemplate,ke(()=>m=!1)),d.$set(Re);const be={};!b&&de[0]&1&&(b=!0,be.config=J[0].meta.confirmEmailChangeTemplate,ke(()=>b=!1)),g.$set(be);const Se={};de[0]&1|de[1]&3&&(Se.$$scope={dirty:de,ctx:J}),$.$set(Se),J[0].smtp.enabled?G?(G.p(J,de),de[0]&1&&A(G,1)):(G=nh(J),G.c(),A(G,1),G.m(C.parentNode,C)):G&&(ae(),I(G,1,1,()=>{G=null}),ue()),K===(K=te(J))&&re?re.p(J,de):(re.d(1),re=K(J),re&&(re.c(),re.m(D,null)))},i(J){L||(A(i.$$.fragment,J),A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J),A(g.$$.fragment,J),A($.$$.fragment,J),A(G),L=!0)},o(J){I(i.$$.fragment,J),I(o.$$.fragment,J),I(u.$$.fragment,J),I(d.$$.fragment,J),I(g.$$.fragment,J),I($.$$.fragment,J),I(G),L=!1},d(J){J&&w(e),j(i),j(o),J&&w(r),J&&w(a),j(u),j(d),j(g),J&&w(k),J&&w(y),J&&w(T),j($,J),J&&w(M),G&&G.d(J),J&&w(C),J&&w(D),re.d()}}}function lE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function oE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Sender name"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function rE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Sender address"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function aE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=O(),r=v("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),_(s,l),_(s,o),_(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 nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[uE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[fE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[cE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[dE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[pE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[mE,({uniqueId:D})=>({31:D}),({uniqueId:D})=>[0,D?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),H(u.$$.fragment),f=O(),c=v("div"),H(d.$$.fragment),m=O(),h=v("div"),H(g.$$.fragment),b=O(),k=v("div"),H(y.$$.fragment),T=O(),$=v("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($,"class","col-lg-12"),p(e,"class","grid")},m(D,E){S(D,e,E),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),_(e,m),_(e,h),q(g,h,null),_(e,b),_(e,k),q(y,k,null),_(e,T),_(e,$),C=!0},p(D,E){const P={};E[0]&1|E[1]&3&&(P.$$scope={dirty:E,ctx:D}),i.$set(P);const L={};E[0]&1|E[1]&3&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E[0]&1|E[1]&3&&(N.$$scope={dirty:E,ctx:D}),u.$set(N);const F={};E[0]&1|E[1]&3&&(F.$$scope={dirty:E,ctx:D}),d.$set(F);const R={};E[0]&1|E[1]&3&&(R.$$scope={dirty:E,ctx:D}),g.$set(R);const X={};E[0]&1|E[1]&3&&(X.$$scope={dirty:E,ctx:D}),y.$set(X)},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(g.$$.fragment,D),A(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),C=!0)},o(D){I(i.$$.fragment,D),I(o.$$.fragment,D),I(u.$$.fragment,D),I(d.$$.fragment,D),I(g.$$.fragment,D),I(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),C=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(g),j(y),D&&M&&M.end()}}}function uE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("SMTP server host"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function fE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Port"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ht(l.value)!==u[0].smtp.port&&ce(l,u[0].smtp.port)},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;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 Ls({props:u}),ie.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("TLS encryption"),s=O(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function dE(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 Ls({props:u}),ie.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("AUTH method"),s=O(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function pE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Username"),s=O(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31])},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[0].smtp.username)},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;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 su({props:u}),ie.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Password"),s=O(),H(l.$$.fragment),p(e,"for",i=n[31])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function hE(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function gE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=O(),s=v("button"),l=v("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),_(e,t),S(u,i,f),S(u,s,f),_(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 _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b;const k=[lE,sE],y=[];function T($,M){return $[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[5]),r=O(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=O(),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($,M){S($,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S($,r,M),S($,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(b=Y(u,"submit",dt(n[27])),g=!0)},p($,M){(!h||M[0]&32)&&le(o,$[5]);let C=d;d=T($),d===C?y[d].p($,M):(ae(),I(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p($,M):(m=y[d]=k[d]($),m.c()),A(m,1),m.m(u,null))},i($){h||(A(m),h=!0)},o($){I(m),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),y[d].d(),g=!1,b()}}}function bE(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[_E]},$$scope:{ctx:n}}});let r={};return l=new iE({props:r}),n[28](l),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),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||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(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 vE(n,e,t){let i,s,l;Ye(n,St,te=>t(5,l=te));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 te=await pe.settings.getAll()||{};g(te)}catch(te){pe.errorResponseHandler(te)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const te=await pe.settings.update(z.filterRedactedProps(f));g(te),Bn({}),zt("Successfully saved mail settings.")}catch(te){pe.errorResponseHandler(te)}t(3,d=!1)}}function g(te={}){t(0,f={meta:(te==null?void 0:te.meta)||{},smtp:(te==null?void 0:te.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function b(){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 T(te){n.$$.not_equal(f.meta.verificationTemplate,te)&&(f.meta.verificationTemplate=te,t(0,f))}function $(te){n.$$.not_equal(f.meta.resetPasswordTemplate,te)&&(f.meta.resetPasswordTemplate=te,t(0,f))}function M(te){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,te)&&(f.meta.confirmEmailChangeTemplate=te,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=ht(this.value),t(0,f)}function P(te){n.$$.not_equal(f.smtp.tls,te)&&(f.smtp.tls=te,t(0,f))}function L(te){n.$$.not_equal(f.smtp.authMethod,te)&&(f.smtp.authMethod=te,t(0,f))}function N(){f.smtp.username=this.value,t(0,f)}function F(te){n.$$.not_equal(f.smtp.password,te)&&(f.smtp.password=te,t(0,f))}const R=()=>b(),X=()=>h(),se=()=>a==null?void 0:a.show(),W=()=>h();function G(te){ie[te?"unshift":"push"](()=>{a=te,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,b,u,i,k,y,T,$,M,C,D,E,P,L,N,F,R,X,se,W,G]}class yE extends ye{constructor(e){super(),ve(this,e,vE,bE,he,{},null,[-1,-1])}}function kE(n){var $,M;let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[SE,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let b=(($=n[0].s3)==null?void 0:$.enabled)!=n[1].s3.enabled&&ih(n),k=n[1].s3.enabled&&sh(n),y=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&lh(n),T=n[6]&&oh(n);return{c(){H(e.$$.fragment),t=O(),b&&b.c(),i=O(),k&&k.c(),s=O(),l=v("div"),o=v("div"),r=O(),y&&y.c(),a=O(),T&&T.c(),u=O(),f=v("button"),c=v("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,D){q(e,C,D),S(C,t,D),b&&b.m(C,D),S(C,i,D),k&&k.m(C,D),S(C,s,D),S(C,l,D),_(l,o),_(l,r),y&&y.m(l,null),_(l,a),T&&T.m(l,null),_(l,u),_(l,f),_(f,c),m=!0,h||(g=Y(f,"click",n[19]),h=!0)},p(C,D){var P,L;const E={};D&100663298&&(E.$$scope={dirty:D,ctx:C}),e.$set(E),((P=C[0].s3)==null?void 0:P.enabled)!=C[1].s3.enabled?b?(b.p(C,D),D&3&&A(b,1)):(b=ih(C),b.c(),A(b,1),b.m(i.parentNode,i)):b&&(ae(),I(b,1,1,()=>{b=null}),ue()),C[1].s3.enabled?k?(k.p(C,D),D&2&&A(k,1)):(k=sh(C),k.c(),A(k,1),k.m(s.parentNode,s)):k&&(ae(),I(k,1,1,()=>{k=null}),ue()),(L=C[1].s3)!=null&&L.enabled&&!C[6]&&!C[3]?y?y.p(C,D):(y=lh(C),y.c(),y.m(l,a)):y&&(y.d(1),y=null),C[6]?T?T.p(C,D):(T=oh(C),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!m||D&72&&d!==(d=!C[6]||C[3]))&&(f.disabled=d),(!m||D&8)&&Q(f,"btn-loading",C[3])},i(C){m||(A(e.$$.fragment,C),A(b),A(k),m=!0)},o(C){I(e.$$.fragment,C),I(b),I(k),m=!1},d(C){j(e,C),C&&w(t),b&&b.d(C),C&&w(i),k&&k.d(C),C&&w(s),C&&w(l),y&&y.d(),T&&T.d(),h=!1,g()}}}function wE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function SE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("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),_(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 ih(n){var P;let e,t,i,s,l,o,r,a=(P=n[0].s3)!=null&&P.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,h,g,b,k,y,T,$,M,C,D,E;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=O(),l=v("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=v("strong"),u=B(a),f=B(`
to the
`),c=v("strong"),m=B(d),h=B(`.
`),g=v("br"),b=B(`
There are numerous command line tools that can help you, such as:
`),k=v("a"),k.textContent=`rclone
`,y=B(`,
`),T=v("a"),T.textContent=`s5cmd
`,$=B(", etc."),M=O(),C=v("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(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"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),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),_(l,r),_(r,u),_(l,f),_(l,c),_(c,m),_(l,h),_(l,g),_(l,b),_(l,k),_(l,y),_(l,T),_(l,$),_(e,M),_(e,C),E=!0},p(L,N){var F;(!E||N&1)&&a!==(a=(F=L[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!E||N&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(L){E||(L&&xe(()=>{D||(D=je(e,At,{duration:150},!0)),D.run(1)}),E=!0)},o(L){L&&(D||(D=je(e,At,{duration:150},!1)),D.run(0)),E=!1},d(L){L&&w(e),L&&D&&D.end()}}}function sh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C;return i=new me({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[TE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[$E,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"s3.region",$$slots:{default:[CE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),d=new me({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[ME,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[DE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),y=new me({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[OE,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),H(i.$$.fragment),s=O(),l=v("div"),H(o.$$.fragment),r=O(),a=v("div"),H(u.$$.fragment),f=O(),c=v("div"),H(d.$$.fragment),m=O(),h=v("div"),H(g.$$.fragment),b=O(),k=v("div"),H(y.$$.fragment),T=O(),$=v("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($,"class","col-lg-12"),p(e,"class","grid")},m(D,E){S(D,e,E),_(e,t),q(i,t,null),_(e,s),_(e,l),q(o,l,null),_(e,r),_(e,a),q(u,a,null),_(e,f),_(e,c),q(d,c,null),_(e,m),_(e,h),q(g,h,null),_(e,b),_(e,k),q(y,k,null),_(e,T),_(e,$),C=!0},p(D,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:D}),i.$set(P);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:D}),o.$set(L);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:D}),u.$set(N);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:D}),d.$set(F);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:D}),g.$set(R);const X={};E&100663298&&(X.$$scope={dirty:E,ctx:D}),y.$set(X)},i(D){C||(A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(g.$$.fragment,D),A(y.$$.fragment,D),D&&xe(()=>{M||(M=je(e,At,{duration:150},!0)),M.run(1)}),C=!0)},o(D){I(i.$$.fragment,D),I(o.$$.fragment,D),I(u.$$.fragment,D),I(d.$$.fragment,D),I(g.$$.fragment,D),I(y.$$.fragment,D),D&&(M||(M=je(e,At,{duration:150},!1)),M.run(0)),C=!1},d(D){D&&w(e),j(i),j(o),j(u),j(d),j(g),j(y),D&&M&&M.end()}}}function TE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Endpoint"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $E(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Bucket"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[1].s3.bucket)},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=v("label"),t=B("Region"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[1].s3.region)},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;return{c(){e=v("label"),t=B("Access key"),s=O(),l=v("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),_(e,t),S(u,s,f),S(u,l,f),ce(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&&ce(l,u[1].s3.accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function DE(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 su({props:u}),ie.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Secret"),s=O(),H(l.$$.fragment),p(e,"for",i=n[25])},m(f,c){S(f,e,c),_(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||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function OE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=O(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=O(),r=v("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),_(s,l),_(s,o),_(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 lh(n){let e;function t(l,o){return l[4]?IE:l[5]?AE:EE}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 EE(n){let e;return{c(){e=v("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:Z,d(t){t&&w(e)}}}function AE(n){let e,t,i,s;return{c(){e=v("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 IE(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function oh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),_(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 PE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b;const k=[wE,kE],y=[];function T($,M){return $[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[7]),r=O(),a=v("div"),u=v("form"),f=v("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=O(),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($,M){S($,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S($,r,M),S($,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(b=Y(u,"submit",dt(n[20])),g=!0)},p($,M){(!h||M&128)&&le(o,$[7]);let C=d;d=T($),d===C?y[d].p($,M):(ae(),I(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p($,M):(m=y[d]=k[d]($),m.c()),A(m,1),m.m(u,null))},i($){h||(A(m),h=!0)},o($){I(m),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),y[d].d(),g=!1,b()}}}function LE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[PE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const lo="s3_test_request";function NE(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 pe.settings.getAll()||{};g(F)}catch(F){pe.errorResponseHandler(F)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{pe.cancelRequest(lo);const F=await pe.settings.update(z.filterRedactedProps(r));Bn({}),await g(F),$a(),c?Cv("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(F){pe.errorResponseHandler(F)}t(3,u=!1)}}async function g(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function b(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,c=null),!!r.s3.enabled){pe.cancelRequest(lo),clearTimeout(d),d=setTimeout(()=>{pe.cancelRequest(lo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await pe.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 T(){r.s3.endpoint=this.value,t(1,r)}function $(){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 D(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>b(),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,b,i,y,T,$,M,C,D,E,P,L,N]}class FE extends ye{constructor(e){super(),ve(this,e,NE,LE,he,{})}}function RE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=O(),s=v("label"),l=B("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),_(s,l),r||(a=Y(e,"change",n[12]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function qE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Client ID"),s=O(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),_(e,t),S(u,s,f),S(u,l,f),ce(l,n[0].clientId),r||(a=Y(l,"input",n[13]),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&1&&l.value!==u[0].clientId&&ce(l,u[0].clientId)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function jE(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[20],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new su({props:u}),ie.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Client Secret"),s=O(),H(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){S(f,e,c),_(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function rh(n){let e,t,i,s;function l(a){n[15](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=jt(o,r(n)),ie.push(()=>ge(t,"config",l))),{c(){e=v("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;I(c.$$.fragment,1,0,()=>{j(c,1)}),ue()}o?(t=jt(o,r(a)),ie.push(()=>ge(t,"config",l)),H(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&I(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c,d;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[RE,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[qE,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[jE,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let m=n[4]&&rh(n);return{c(){H(e.$$.fragment),t=O(),i=v("div"),s=v("div"),l=O(),o=v("div"),H(r.$$.fragment),a=O(),u=v("div"),H(f.$$.fragment),c=O(),m&&m.c(),p(s,"class","col-12 spacing"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(i,"class","grid")},m(h,g){q(e,h,g),S(h,t,g),S(h,i,g),_(i,s),_(i,l),_(i,o),q(r,o,null),_(i,a),_(i,u),q(f,u,null),_(i,c),m&&m.m(i,null),d=!0},p(h,g){const b={};g&2&&(b.name=h[1]+".enabled"),g&3145729&&(b.$$scope={dirty:g,ctx:h}),e.$set(b);const k={};g&2&&(k.name=h[1]+".clientId"),g&3145729&&(k.$$scope={dirty:g,ctx:h}),r.$set(k);const y={};g&2&&(y.name=h[1]+".clientSecret"),g&3145729&&(y.$$scope={dirty:g,ctx:h}),f.$set(y),h[4]?m?(m.p(h,g),g&16&&A(m,1)):(m=rh(h),m.c(),A(m,1),m.m(i,null)):m&&(ae(),I(m,1,1,()=>{m=null}),ue())},i(h){d||(A(e.$$.fragment,h),A(r.$$.fragment,h),A(f.$$.fragment,h),A(m),d=!0)},o(h){I(e.$$.fragment,h),I(r.$$.fragment,h),I(f.$$.fragment,h),I(m),d=!1},d(h){j(e,h),h&&w(t),h&&w(i),j(r),j(f),m&&m.d()}}}function ah(n){let e;return{c(){e=v("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 uh(n){let e,t,i,s,l;return{c(){e=v("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 VE(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function zE(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function BE(n){let e,t,i,s,l,o,r,a,u,f=n[3]&&ah(n),c=n[6]&&uh();function d(g,b){return g[0].enabled?zE:VE}let m=d(n),h=m(n);return{c(){e=v("div"),f&&f.c(),t=O(),i=v("span"),s=B(n[2]),l=O(),o=v("div"),r=O(),c&&c.c(),a=O(),h.c(),u=Me(),p(i,"class","txt"),p(e,"class","inline-flex"),p(o,"class","flex-fill")},m(g,b){S(g,e,b),f&&f.m(e,null),_(e,t),_(e,i),_(i,s),S(g,l,b),S(g,o,b),S(g,r,b),c&&c.m(g,b),S(g,a,b),h.m(g,b),S(g,u,b)},p(g,b){g[3]?f?f.p(g,b):(f=ah(g),f.c(),f.m(e,t)):f&&(f.d(1),f=null),b&4&&le(s,g[2]),g[6]?c?b&64&&A(c,1):(c=uh(),c.c(),A(c,1),c.m(a.parentNode,a)):c&&(ae(),I(c,1,1,()=>{c=null}),ue()),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(u.parentNode,u)))},d(g){g&&w(e),f&&f.d(),g&&w(l),g&&w(o),g&&w(r),c&&c.d(g),g&&w(a),h.d(g),g&&w(u)}}}function UE(n){let e,t;const i=[n[7]];let s={$$slots:{header:[BE],default:[HE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Je(s,i[l]);return e=new ys({props:s}),n[16](e),e.$on("expand",n[17]),e.$on("collapse",n[18]),e.$on("toggle",n[19]),{c(){H(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&128?on(i,[xn(l[7])]):{};o&2097247&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[16](null),j(e,l)}}}function WE(n,e,t){let i;const s=["key","title","icon","config","optionsComponent","expand","collapse","collapseSiblings"];let l=Et(e,s),o;Ye(n,fi,E=>t(11,o=E));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 g(){d==null||d.collapseSiblings()}function b(){f.enabled=this.checked,t(0,f)}function k(){f.clientId=this.value,t(0,f)}function y(E){n.$$.not_equal(f.clientSecret,E)&&(f.clientSecret=E,t(0,f))}function T(E){f=E,t(0,f)}function $(E){ie[E?"unshift":"push"](()=>{d=E,t(5,d)})}function M(E){ze.call(this,n,E)}function C(E){ze.call(this,n,E)}function D(E){ze.call(this,n,E)}return n.$$set=E=>{e=Je(Je({},e),Qn(E)),t(7,l=Et(e,s)),"key"in E&&t(1,r=E.key),"title"in E&&t(2,a=E.title),"icon"in E&&t(3,u=E.icon),"config"in E&&t(0,f=E.config),"optionsComponent"in E&&t(4,c=E.optionsComponent)},n.$$.update=()=>{n.$$.dirty&2050&&t(6,i=!z.isEmpty(z.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||Qi(r))},[f,r,a,u,c,d,i,l,m,h,g,o,b,k,y,T,$,M,C,D]}class YE extends ye{constructor(e){super(),ve(this,e,WE,UE,he,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:8,collapse:9,collapseSiblings:10})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}get collapseSiblings(){return this.$$.ctx[10]}}function fh(n,e,t){const i=n.slice();return i[15]=e[t][0],i[16]=e[t][1],i[17]=e,i[18]=t,i}function KE(n){let e,t,i,s,l,o,r,a,u,f,c=Object.entries(vl),d=[];for(let g=0;g<c.length;g+=1)d[g]=ch(fh(n,c,g));const m=g=>I(d[g],1,1,()=>{d[g]=null});let h=n[4]&&dh(n);return{c(){e=v("div");for(let g=0;g<d.length;g+=1)d[g].c();t=O(),i=v("div"),s=v("div"),l=O(),h&&h.c(),o=O(),r=v("button"),a=v("span"),a.textContent="Save changes",p(e,"class","accordions"),p(s,"class","flex-fill"),p(a,"class","txt"),p(r,"type","submit"),p(r,"class","btn btn-expanded"),r.disabled=u=!n[4]||n[3],Q(r,"btn-loading",n[3]),p(i,"class","flex m-t-base")},m(g,b){S(g,e,b);for(let k=0;k<d.length;k+=1)d[k].m(e,null);S(g,t,b),S(g,i,b),_(i,s),_(i,l),h&&h.m(i,null),_(i,o),_(i,r),_(r,a),f=!0},p(g,b){if(b&3){c=Object.entries(vl);let k;for(k=0;k<c.length;k+=1){const y=fh(g,c,k);d[k]?(d[k].p(y,b),A(d[k],1)):(d[k]=ch(y),d[k].c(),A(d[k],1),d[k].m(e,null))}for(ae(),k=c.length;k<d.length;k+=1)m(k);ue()}g[4]?h?h.p(g,b):(h=dh(g),h.c(),h.m(i,o)):h&&(h.d(1),h=null),(!f||b&24&&u!==(u=!g[4]||g[3]))&&(r.disabled=u),(!f||b&8)&&Q(r,"btn-loading",g[3])},i(g){if(!f){for(let b=0;b<c.length;b+=1)A(d[b]);f=!0}},o(g){d=d.filter(Boolean);for(let b=0;b<d.length;b+=1)I(d[b]);f=!1},d(g){g&&w(e),mt(d,g),g&&w(t),g&&w(i),h&&h.d()}}}function JE(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function ch(n){let e,t=n[15],i,s;const l=()=>n[10](e,t),o=()=>n[10](null,t);function r(u){n[11](u,n[15])}let a={single:!0,key:n[15],title:n[16].title,icon:n[16].icon||"ri-fingerprint-line",optionsComponent:n[16].optionsComponent};return n[0][n[15]]!==void 0&&(a.config=n[0][n[15]]),e=new YE({props:a}),l(),ie.push(()=>ge(e,"config",r)),{c(){H(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,f){n=u,t!==n[15]&&(o(),t=n[15],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[15]],ke(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){I(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function dh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),_(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function ZE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b;const k=[JE,KE],y=[];function T($,M){return $[2]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[5]),r=O(),a=v("div"),u=v("form"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=O(),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($,M){S($,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S($,r,M),S($,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(b=Y(u,"submit",dt(n[6])),g=!0)},p($,M){(!h||M&32)&&le(o,$[5]);let C=d;d=T($),d===C?y[d].p($,M):(ae(),I(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p($,M):(m=y[d]=k[d]($),m.c()),A(m,1),m.m(u,null))},i($){h||(A(m),h=!0)},o($){I(m),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),y[d].d(),g=!1,b()}}}function GE(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[ZE]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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&524351&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function XE(n,e,t){let i,s,l;Ye(n,St,y=>t(5,l=y)),Kt(St,l="Auth providers",l);let o={},r={},a={},u=!1,f=!1;c();async function c(){t(2,u=!0);try{const y=await pe.settings.getAll()||{};m(y)}catch(y){pe.errorResponseHandler(y)}t(2,u=!1)}async function d(){var y;if(!(f||!s)){t(3,f=!0);try{const T=await pe.settings.update(z.filterRedactedProps(a));m(T),Bn({}),(y=o[Object.keys(o)[0]])==null||y.collapseSiblings(),zt("Successfully updated auth providers.")}catch(T){pe.errorResponseHandler(T)}t(3,f=!1)}}function m(y){y=y||{},t(0,a={});for(const T in vl)t(0,a[T]=Object.assign({enabled:!1},y[T]),a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(y,T){ie[y?"unshift":"push"](()=>{o[T]=y,t(1,o)})}function b(y,T){n.$$.not_equal(a[T],y)&&(a[T]=y,t(0,a))}const k=()=>h();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(4,s=i!=JSON.stringify(a))},[a,o,u,f,s,l,d,h,r,i,g,b,k]}class QE extends ye{constructor(e){super(),ve(this,e,XE,GE,he,{})}}function ph(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function xE(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,m,h=n[5];const g=k=>k[16].key;for(let k=0;k<h.length;k+=1){let y=ph(n,h,k),T=g(y);t.set(T,e[k]=mh(T,y))}let b=n[3]&&hh(n);return{c(){for(let k=0;k<e.length;k+=1)e[k].c();i=O(),s=v("div"),l=v("div"),o=O(),b&&b.c(),r=O(),a=v("button"),u=v("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 T=0;T<e.length;T+=1)e[T].m(k,y);S(k,i,y),S(k,s,y),_(s,l),_(s,o),b&&b.m(s,null),_(s,r),_(s,a),_(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,g,1,k,h,t,i.parentNode,ln,mh,i,ph),ue()),k[3]?b?b.p(k,y):(b=hh(k),b.c(),b.m(s,r)):b&&(b.d(1),b=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)A(e[y]);c=!0}},o(k){for(let y=0;y<e.length;y+=1)I(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),b&&b.d(),d=!1,m()}}}function eA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function tA(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 g(){return n[11](n[16])}return{c(){e=v("label"),i=B(t),s=B(" duration (in seconds)"),o=O(),r=v("input"),u=O(),f=v("div"),c=v("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(b,k){S(b,e,k),_(e,i),_(e,s),S(b,o,k),S(b,r,k),ce(r,n[0][n[16].key].duration),S(b,u,k),S(b,f,k),_(f,c),d||(m=[Y(r,"input",h),Y(c,"click",g)],d=!0)},p(b,k){n=b,k&524288&&l!==(l=n[19])&&p(e,"for",l),k&524288&&a!==(a=n[19])&&p(r,"id",a),k&33&&ht(r.value)!==n[0][n[16].key].duration&&ce(r,n[0][n[16].key].duration),k&33&&Q(c,"txt-success",n[0][n[16].key].secret)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(u),b&&w(f),d=!1,Pe(m)}}}function mh(n,e){let t,i,s;return i=new me({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[tA,({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||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function hh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),_(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 nA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b;const k=[eA,xE],y=[];function T($,M){return $[1]?0:1}return d=T(n),m=y[d]=k[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[4]),r=O(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Adjust common token options.</p>",c=O(),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($,M){S($,e,M),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S($,r,M),S($,a,M),_(a,u),_(u,f),_(u,c),y[d].m(u,null),h=!0,g||(b=Y(u,"submit",dt(n[6])),g=!0)},p($,M){(!h||M&16)&&le(o,$[4]);let C=d;d=T($),d===C?y[d].p($,M):(ae(),I(y[C],1,1,()=>{y[C]=null}),ue(),m=y[d],m?m.p($,M):(m=y[d]=k[d]($),m.c()),A(m,1),m.m(u,null))},i($){h||(A(m),h=!0)},o($){I(m),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),y[d].d(),g=!1,b()}}}function iA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[nA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(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=>t(4,l=T));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 T=await pe.settings.getAll()||{};m(T)}catch(T){pe.errorResponseHandler(T)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const T=await pe.settings.update(z.filterRedactedProps(a));m(T),zt("Successfully saved tokens options.")}catch(T){pe.errorResponseHandler(T)}t(2,f=!1)}}function m(T){var $;T=T||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:(($=T[M.key])==null?void 0:$.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(T){a[T.key].duration=ht(this.value),t(0,a)}const b=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.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,g,b,k,y]}class lA extends ye{constructor(e){super(),ve(this,e,sA,iA,he,{})}}function oA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h;return o=new wb({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=O(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=O(),H(o.$$.fragment),r=O(),a=v("div"),u=v("div"),f=O(),c=v("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(g,b){S(g,e,b),S(g,t,b),S(g,i,b),_(i,s),_(i,l),q(o,i,null),n[8](i),S(g,r,b),S(g,a,b),_(a,u),_(a,f),_(a,c),d=!0,m||(h=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(g,b){const k={};b&4&&(k.content=g[2]),o.$set(k)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){I(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),m=!1,Pe(h)}}}function rA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function aA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[rA,oA],h=[];function g(b,k){return b[1]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[3]),r=O(),a=v("div"),u=v("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(b,k){S(b,e,k),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,k),S(b,a,k),_(a,u),h[f].m(u,null),d=!0},p(b,k){(!d||k&8)&&le(o,b[3]);let y=f;f=g(b),f===y?h[f].p(b,k):(ae(),I(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(b,k):(c=h[f]=m[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){I(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),h[f].d()}}}function uA(n){let e,t,i,s;return e=new Ii({}),i=new wn({props:{$$slots:{default:[aA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=O(),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||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function fA(n,e,t){let i,s;Ye(n,St,b=>t(3,s=b)),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 pe.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){pe.errorResponseHandler(b)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),k_("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(b){ie[b?"unshift":"push"](()=>{o=b,t(0,o)})}const h=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),y=document.createRange();y.selectNodeContents(o),k.removeAllRanges(),k.addRange(y)}},g=()=>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,g]}class cA extends ye{constructor(e){super(),ve(this,e,fA,uA,he,{})}}function gh(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[18]=e[t][1],i}function bh(n,e,t){const i=n.slice();return i[14]=e[t],i}function vh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function yh(n,e,t){const i=n.slice();return i[14]=e[t],i}function kh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function wh(n,e,t){const i=n.slice();return i[30]=e[t],i}function dA(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Sh(),a=n[0].name!==n[1].name&&Th(n);return{c(){e=v("div"),r&&r.c(),t=O(),a&&a.c(),i=O(),s=v("strong"),o=B(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),_(e,t),a&&a.m(e,null),_(e,i),_(e,s),_(s,o)},p(u,f){u[9]?r||(r=Sh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Th(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 pA(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=O(),i=v("strong"),l=B(s),p(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),_(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 mA(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=O(),i=v("strong"),l=B(s),p(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),_(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 Sh(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Th(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=O(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),_(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 $h(n){var b,k;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,c,d,m,h=n[12]((k=n[1])==null?void 0:k[n[30]])+"",g;return{c(){var y,T,$,M,C,D;e=v("tr"),t=v("td"),i=v("span"),l=B(s),o=O(),r=v("td"),a=v("pre"),f=B(u),c=O(),d=v("td"),m=v("pre"),g=B(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]],(T=n[1])==null?void 0:T[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(($=n[0])==null?void 0:$[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]],(D=n[1])==null?void 0:D[n[30]]))},m(y,T){S(y,e,T),_(e,t),_(t,i),_(i,l),_(e,o),_(e,r),_(r,a),_(a,f),_(e,c),_(e,d),_(d,m),_(m,g)},p(y,T){var $,M,C,D,E,P,L,N;T[0]&1&&u!==(u=y[12](($=y[0])==null?void 0:$[y[30]])+"")&&le(f,u),T[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]])),T[0]&1024&&Q(r,"changed-none-col",y[10]),T[0]&2&&h!==(h=y[12]((D=y[1])==null?void 0:D[y[30]])+"")&&le(g,h),T[0]&2083&&Q(d,"changed-new-col",!y[5]&&un((E=y[0])==null?void 0:E[y[30]],(P=y[1])==null?void 0:P[y[30]])),T[0]&32&&Q(d,"changed-none-col",y[5]),T[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 Ch(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=Dh(yh(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=yh(s,t,o);i[o]?i[o].p(r,l):(i[o]=Dh(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){mt(i,s),s&&w(e)}}}function Mh(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=v("tr"),t=v("td"),s=B(i),l=O(),o=v("td"),r=v("pre"),u=B(a),f=O(),c=v("td"),d=O(),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),_(e,t),_(t,s),_(e,l),_(e,o),_(o,r),_(r,u),_(e,f),_(e,c),_(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 Dh(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,m=n[14].name+"",h,g,b,k,y=Object.entries(n[14]),T=[];for(let $=0;$<y.length;$+=1)T[$]=Mh(kh(n,y,$));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=O(),a=v("span"),u=B("Deleted - "),f=v("small"),c=B("All stored data related to "),d=v("strong"),h=B(m),g=B(" will be deleted!"),b=O();for(let $=0;$<T.length;$+=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($,M){S($,e,M),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),_(t,a),_(a,u),_(a,f),_(f,c),_(f,d),_(d,h),_(f,g),S($,b,M);for(let C=0;C<T.length;C+=1)T[C].m($,M);S($,k,M)},p($,M){if(M[0]&64&&l!==(l=$[14].name+"")&&le(o,l),M[0]&64&&m!==(m=$[14].name+"")&&le(h,m),M[0]&4160){y=Object.entries($[14]);let C;for(C=0;C<y.length;C+=1){const D=kh($,y,C);T[C]?T[C].p(D,M):(T[C]=Mh(D),T[C].c(),T[C].m(k.parentNode,k))}for(;C<T.length;C+=1)T[C].d(1);T.length=y.length}},d($){$&&w(e),$&&w(b),mt(T,$),$&&w(k)}}}function Oh(n){let e;return{c(){e=v("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 Eh(n){var g;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((g=Mn(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,c,d,m=n[12](n[23])+"",h;return{c(){var b,k,y;e=v("tr"),t=v("td"),s=B(i),l=O(),o=v("td"),r=v("pre"),u=B(a),f=O(),c=v("td"),d=v("pre"),h=B(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((b=Mn(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),Q(c,"changed-new-col",un((k=Mn(n[3],n[14].id))==null?void 0:k[n[17]],n[23])),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",un((y=Mn(n[3],n[14].id))==null?void 0:y[n[17]],n[23]))},m(b,k){S(b,e,k),_(e,t),_(t,s),_(e,l),_(e,o),_(o,r),_(r,u),_(e,f),_(e,c),_(c,d),_(d,h)},p(b,k){var y,T,$,M;k[0]&128&&i!==(i=b[17]+"")&&le(s,i),k[0]&136&&a!==(a=b[12]((y=Mn(b[3],b[14].id))==null?void 0:y[b[17]])+"")&&le(u,a),k[0]&136&&Q(o,"changed-old-col",un((T=Mn(b[3],b[14].id))==null?void 0:T[b[17]],b[23])),k[0]&128&&m!==(m=b[12](b[23])+"")&&le(h,m),k[0]&136&&Q(c,"changed-new-col",un(($=Mn(b[3],b[14].id))==null?void 0:$[b[17]],b[23])),k[0]&136&&Q(e,"txt-primary",un((M=Mn(b[3],b[14].id))==null?void 0:M[b[17]],b[23]))},d(b){b&&w(e)}}}function Ah(n){let e,t,i,s,l=n[14].name+"",o,r,a=un(Mn(n[3],n[14].id),Mn(n[4],n[14].id)),u,f,c=a&&Oh(),d=Object.entries(n[14]),m=[];for(let h=0;h<d.length;h+=1)m[h]=Eh(vh(n,d,h));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=O(),c&&c.c(),u=O();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,g){S(h,e,g),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),c&&c.m(t,null),S(h,u,g);for(let b=0;b<m.length;b+=1)m[b].m(h,g);S(h,f,g)},p(h,g){if(g[0]&128&&l!==(l=h[14].name+"")&&le(o,l),g[0]&152&&(a=un(Mn(h[3],h[14].id),Mn(h[4],h[14].id))),a?c||(c=Oh(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),g[0]&4232){d=Object.entries(h[14]);let b;for(b=0;b<d.length;b+=1){const k=vh(h,d,b);m[b]?m[b].p(k,g):(m[b]=Eh(k),m[b].c(),m[b].m(f.parentNode,f))}for(;b<m.length;b+=1)m[b].d(1);m.length=d.length}},d(h){h&&w(e),c&&c.d(),h&&w(u),mt(m,h),h&&w(f)}}}function Ih(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=v("tr"),t=v("td"),s=B(i),l=O(),o=v("td"),r=O(),a=v("td"),u=v("pre"),c=B(f),d=O(),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),_(e,t),_(t,s),_(e,l),_(e,o),_(e,r),_(e,a),_(a,u),_(u,c),_(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 Ph(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]=Ih(_h(n,c,m));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=O(),a=v("span"),a.textContent="Added",u=O();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),_(e,t),_(t,i),_(i,s),_(i,o),_(t,r),_(t,a),S(m,u,h);for(let g=0;g<d.length;g+=1)d[g].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 g;for(g=0;g<c.length;g+=1){const b=_h(m,c,g);d[g]?d[g].p(b,h):(d[g]=Ih(b),d[g].c(),d[g].m(f.parentNode,f))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(m){m&&w(e),m&&w(u),mt(d,m),m&&w(f)}}}function hA(n){let e,t,i,s,l,o,r,a,u;function f($,M){var C,D;return(C=$[0])!=null&&C.id?(D=$[1])!=null&&D.id?dA:pA:mA}let c=f(n),d=c(n),m=n[11],h=[];for(let $=0;$<m.length;$+=1)h[$]=$h(wh(n,m,$));let g=(n[2]||n[5])&&Ch(n),b=n[7],k=[];for(let $=0;$<b.length;$+=1)k[$]=Ah(bh(n,b,$));let y=n[8],T=[];for(let $=0;$<y.length;$+=1)T[$]=Ph(gh(n,y,$));return{c(){e=v("div"),d.c(),t=O(),i=v("table"),s=v("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=O(),o=v("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=O(),g&&g.c(),a=O();for(let $=0;$<k.length;$+=1)k[$].c();u=O();for(let $=0;$<T.length;$+=1)T[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){S($,e,M),d.m(e,null),S($,t,M),S($,i,M),_(i,s),_(i,l),_(i,o);for(let C=0;C<h.length;C+=1)h[C].m(o,null);_(o,r),g&&g.m(o,null),_(o,a);for(let C=0;C<k.length;C+=1)k[C].m(o,null);_(o,u);for(let C=0;C<T.length;C+=1)T[C].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){m=$[11];let C;for(C=0;C<m.length;C+=1){const D=wh($,m,C);h[C]?h[C].p(D,M):(h[C]=$h(D),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=m.length}if($[2]||$[5]?g?g.p($,M):(g=Ch($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){b=$[7];let C;for(C=0;C<b.length;C+=1){const D=bh($,b,C);k[C]?k[C].p(D,M):(k[C]=Ah(D),k[C].c(),k[C].m(o,u))}for(;C<k.length;C+=1)k[C].d(1);k.length=b.length}if(M[0]&4352){y=$[8];let C;for(C=0;C<y.length;C+=1){const D=gh($,y,C);T[C]?T[C].p(D,M):(T[C]=Ph(D),T[C].c(),T[C].m(o,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=y.length}},i:Z,o:Z,d($){$&&w(e),d.d(),$&&w(t),$&&w(i),mt(h,$),g&&g.d(),mt(k,$),mt(T,$)}}}function Mn(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 gA(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 g(){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 b(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")&&g(),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,b]}class _A extends ye{constructor(e){super(),ve(this,e,gA,hA,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Lh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Nh(n){let e,t;return e=new _A({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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function bA(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Nh(Lh(n,i,o));const l=o=>I(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=Lh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Nh(u),s[a].c(),A(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)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){mt(s,o),o&&w(e)}}}function vA(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:Z,d(t){t&&w(e)}}}function yA(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=B("Close"),i=O(),s=v("button"),l=v("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),_(e,t),S(a,i,u),S(a,s,u),_(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 kA(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[yA],header:[vA],default:[bA]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function wA(n,e,t){const i=Ct();let s,l=[],o=[],r=[],a=!1,u=!1;function f($,M,C=!1){t(7,l=$),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 $ of l){const M=z.findByKey(o,"id",$.id)||null;(a&&!(M!=null&&M.id)||M!=null&&M.id&&z.hasCollectionChanges($,M,a))&&r.push({old:$,new:M})}for(const $ of o){const M=z.findByKey(l,"id",$.id)||null;M!=null&&M.id||r.push({old:M,new:$})}}function m(){const $=[];if(a)for(const M of l){const C=z.findByKey(o,"id",M.id);if(!C)$.push(M.name+".*");else{const D=Array.isArray(M.schema)?M.schema:[];for(const E of D)z.findByKey(C.schema,"id",E.id)||$.push(`${M.name}.${E.name} (${E.id})`)}}$.length?cn(`Do you really want to delete the following collection fields and their related records data:
- ${$.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await pe.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch($){pe.errorResponseHandler($)}t(4,u=!1),c()}}const g=()=>m(),b=()=>!u;function k($){ie[$?"unshift":"push"](()=>{s=$,t(1,s)})}function y($){ze.call(this,n,$)}function T($){ze.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,g,b,k,y,T]}class SA extends ye{constructor(e){super(),ve(this,e,wA,kA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Fh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Rh(n,e,t){const i=n.slice();return i[35]=e[t],i}function qh(n,e,t){const i=n.slice();return i[32]=e[t],i}function TA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y,T,$,M,C,D;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[CA,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&Hh(),L=n[6]&&n[1].length&&n[7]&&Vh(n),N=n[13].length&&Qh(n),F=!!n[0]&&xh(n);return{c(){e=v("input"),t=O(),i=v("div"),s=v("p"),l=B(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=O(),H(a.$$.fragment),u=O(),f=O(),P&&P.c(),c=O(),L&&L.c(),d=O(),N&&N.c(),m=O(),h=v("div"),F&&F.c(),g=O(),b=v("div"),k=O(),y=v("button"),T=v("span"),T.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(T,"class","txt"),p(y,"type","button"),p(y,"class","btn btn-expanded btn-warning m-l-auto"),y.disabled=$=!n[14],p(h,"class","flex m-t-base")},m(R,X){S(R,e,X),n[19](e),S(R,t,X),S(R,i,X),_(i,s),_(s,l),_(s,o),S(R,r,X),q(a,R,X),S(R,u,X),S(R,f,X),P&&P.m(R,X),S(R,c,X),L&&L.m(R,X),S(R,d,X),N&&N.m(R,X),S(R,m,X),S(R,h,X),F&&F.m(h,null),_(h,g),_(h,b),_(h,k),_(h,y),_(y,T),M=!0,C||(D=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(y,"click",n[26])],C=!0)},p(R,X){(!M||X[0]&4096)&&Q(o,"btn-loading",R[12]);const se={};X[0]&64&&(se.class="form-field "+(R[6]?"":"field-error")),X[0]&65|X[1]&1536&&(se.$$scope={dirty:X,ctx:R}),a.$set(se),R[6]&&R[1].length&&!R[7]?P||(P=Hh(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),R[6]&&R[1].length&&R[7]?L?L.p(R,X):(L=Vh(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?N?N.p(R,X):(N=Qh(R),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),R[0]?F?F.p(R,X):(F=xh(R),F.c(),F.m(h,g)):F&&(F.d(1),F=null),(!M||X[0]&16384&&$!==($=!R[14]))&&(y.disabled=$)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){I(a.$$.fragment,R),I(E),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),P&&P.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(D)}}}function $A(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:Z,i:Z,o:Z,d(t){t&&w(e)}}}function jh(n){let e;return{c(){e=v("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 CA(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&jh();return{c(){e=v("label"),t=B("Collections"),s=O(),l=v("textarea"),r=O(),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),_(e,t),S(d,s,m),S(d,l,m),ce(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&&ce(l,d[0]),d[0]&&!d[6]?c||(c=jh(),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 Hh(n){let e;return{c(){e=v("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 Vh(n){let e,t,i,s,l,o=n[9].length&&zh(n),r=n[4].length&&Wh(n),a=n[8].length&&Zh(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=O(),i=v("div"),o&&o.c(),s=O(),r&&r.c(),l=O(),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),_(i,s),r&&r.m(i,null),_(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=zh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Wh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Zh(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 zh(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=qh(n,s,o),a=l(r);t.set(a,e[o]=Uh(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,Uh,i,qh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Bh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Uh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Bh(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=O(),l=v("strong"),r=B(o),a=O(),f&&f.c(),u=O(),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),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(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=Bh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Wh(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=Rh(n,s,o),a=l(r);t.set(a,e[o]=Jh(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,Jh,i,Rh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Yh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=O(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),_(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 Kh(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function Jh(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&&Yh(e),m=e[35].new.id&&Kh(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=O(),l=v("div"),d&&d.c(),o=O(),r=v("strong"),u=B(a),f=O(),m&&m.c(),c=O(),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,g){S(h,t,g),_(t,i),_(t,s),_(t,l),d&&d.m(l,null),_(l,o),_(l,r),_(r,u),_(l,f),m&&m.m(l,null),_(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=Yh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,g):(m=Kh(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 Zh(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=Fh(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]&256&&(s=o[8],e=wt(e,r,l,1,o,s,t,i.parentNode,es,Xh,i,Fh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function Gh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),p(e,"class","txt-hint")},m(o,r){S(o,e,r),_(e,t),_(e,s),_(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function Xh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Gh(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Added",s=O(),l=v("strong"),r=B(o),a=O(),f&&f.c(),u=O(),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),_(t,i),_(t,s),_(t,l),_(l,r),_(t,a),f&&f.m(t,null),_(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=Gh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function Qh(n){let e,t,i,s,l,o,r,a;return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=v("div"),s.innerHTML=`<string>Some of the imported collections shares 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=O(),o=v("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),_(e,t),_(e,i),_(e,s),_(e,l),_(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:Z,d(u){u&&w(e),r=!1,a()}}}function xh(n){let e,t,i;return{c(){e=v("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:Z,d(s){s&&w(e),t=!1,i()}}}function MA(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[$A,TA],h=[];function g(b,k){return b[5]?0:1}return f=g(n),c=h[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=O(),l=v("div"),o=B(n[15]),r=O(),a=v("div"),u=v("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(b,k){S(b,e,k),_(e,t),_(t,i),_(t,s),_(t,l),_(l,o),S(b,r,k),S(b,a,k),_(a,u),h[f].m(u,null),d=!0},p(b,k){(!d||k[0]&32768)&&le(o,b[15]);let y=f;f=g(b),f===y?h[f].p(b,k):(ae(),I(h[y],1,1,()=>{h[y]=null}),ue(),c=h[f],c?c.p(b,k):(c=h[f]=m[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){I(c),d=!1},d(b){b&&w(e),b&&w(r),b&&w(a),h[f].d()}}}function DA(n){let e,t,i,s,l,o;e=new Ii({}),i=new wn({props:{$$slots:{default:[MA]},$$scope:{ctx:n}}});let r={};return l=new SA({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=O(),H(i.$$.fragment),s=O(),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||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(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 OA(n,e,t){let i,s,l,o,r,a,u;Ye(n,St,K=>t(15,u=K)),Kt(St,u="Import collections",u);let f,c,d="",m=!1,h=[],g=[],b=!0,k=[],y=!1;T();async function T(){t(5,y=!0);try{t(2,g=await pe.collections.getFullList(200));for(let K of g)delete K.created,delete K.updated}catch(K){pe.errorResponseHandler(K)}t(5,y=!1)}function $(){if(t(4,k=[]),!!i)for(let K of h){const re=z.findByKey(g,"id",K.id);!(re!=null&&re.id)||!z.hasCollectionChanges(re,K,b)||k.push({new:K,old:re})}}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 K of h)delete K.created,delete K.updated,K.schema=z.filterDuplicatesByKey(K.schema)}function C(){var K,re;for(let J of h){const de=z.findByKey(g,"name",J.name)||z.findByKey(g,"id",J.id);if(!de)continue;const _e=J.id,$e=de.id;J.id=$e;const Ne=Array.isArray(de.schema)?de.schema:[],Re=Array.isArray(J.schema)?J.schema:[];for(const be of Re){const Se=z.findByKey(Ne,"name",be.name);Se&&Se.id&&(be.id=Se.id)}for(let be of h)if(Array.isArray(be.schema))for(let Se of be.schema)(K=Se.options)!=null&&K.collectionId&&((re=Se.options)==null?void 0:re.collectionId)===_e&&(Se.options.collectionId=$e)}t(0,d=JSON.stringify(h,null,4))}function D(K){t(12,m=!0);const re=new FileReader;re.onload=async J=>{t(12,m=!1),t(10,f.value="",f),t(0,d=J.target.result),await sn(),h.length||(cl("Invalid collections configuration."),E())},re.onerror=J=>{console.warn(J),cl("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},re.readAsText(K)}function E(){t(0,d=""),t(10,f.value="",f),Bn({})}function P(K){ie[K?"unshift":"push"](()=>{f=K,t(10,f)})}const L=()=>{f.files.length&&D(f.files[0])},N=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){b=this.checked,t(3,b)}const X=()=>C(),se=()=>E(),W=()=>c==null?void 0:c.show(g,h,b);function G(K){ie[K?"unshift":"push"](()=>{c=K,t(11,c)})}const te=()=>E();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(K=>!!K.id&&!!K.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(K=>i&&b&&!z.findByKey(h,"id",K.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(K=>i&&!z.findByKey(g,"id",K.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof b<"u")&&$(),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(K=>{let re=z.findByKey(g,"name",K.name)||z.findByKey(g,"id",K.id);if(!re)return!1;if(re.id!=K.id)return!0;const J=Array.isArray(re.schema)?re.schema:[],de=Array.isArray(K.schema)?K.schema:[];for(const _e of de){if(z.findByKey(J,"id",_e.id))continue;const Ne=z.findByKey(J,"name",_e.name);if(Ne&&_e.id!=Ne.id)return!0}return!1}))},[d,h,g,b,k,y,i,o,l,s,f,c,m,a,r,u,C,D,E,P,L,N,F,R,X,se,W,G,te]}class EA extends ye{constructor(e){super(),ve(this,e,OA,DA,he,{},null,[-1,-1])}}const Pt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Di("/"):!0}],AA={"/login":Mt({component:CO,conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Mt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-e202dd28.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-18b0e4d7.js"),[],import.meta.url),conditions:Pt.concat([n=>!pe.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Mt({component:GD,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Mt({component:C3,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Mt({component:FO,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Mt({component:yO,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Mt({component:yE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Mt({component:FE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Mt({component:QE,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Mt({component:lA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Mt({component:cA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Mt({component:EA,conditions:Pt.concat([n=>pe.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-d3cfe2c2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-d3cfe2c2.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-3f096be7.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-3f096be7.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-ec412fef.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Mt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-ec412fef.js"),[],import.meta.url),conditions:Pt,userData:{showAppSidebar:!1}}),"*":Mt({component:Kv,userData:{showAppSidebar:!1}})};function IA(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=Bo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const g=h*a,b=h*u,k=m+h*e.width/t.width,y=m+h*e.height/t.height;return`transform: ${l} translate(${g}px, ${b}px) scale(${k}, ${y});`}}}function eg(n,e,t){const i=n.slice();return i[2]=e[t],i}function PA(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function LA(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function NA(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function FA(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function tg(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,m=Z,h,g,b;function k(M,C){return M[2].type==="info"?FA:M[2].type==="success"?NA:M[2].type==="warning"?LA:PA}let y=k(e),T=y(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=O(),l=v("div"),r=B(o),a=O(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=O(),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),_(t,i),T.m(i,null),_(t,s),_(t,l),_(l,r),_(t,a),_(t,u),_(t,f),h=!0,g||(b=Y(u,"click",dt($)),g=!0)},p(M,C){e=M,y!==(y=k(e))&&(T.d(1),T=y(e),T&&(T.c(),T.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(){Xb(t),m(),fg(t,d)},a(){m(),m=Gb(t,d,IA,{duration:150})},i(M){h||(xe(()=>{c||(c=je(t,yo,{duration:150},!0)),c.run(1)}),h=!0)},o(M){c||(c=je(t,yo,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),T.d(),M&&c&&c.end(),g=!1,b()}}}function RA(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=eg(n,l,r),u=o(a);i.set(u,t[r]=tg(u,a))}return{c(){e=v("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,t1,tg,null,eg);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)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)I(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function qA(n,e,t){let i;return Ye(n,Vo,l=>t(0,i=l)),[i,l=>w_(l)]}class jA extends ye{constructor(e){super(),ve(this,e,qA,RA,he,{})}}function HA(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=B(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){S(l,e,o),_(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 VA(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=O(),s=v("button"),l=v("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),_(e,t),S(a,i,u),S(a,s,u),_(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 zA(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:[VA],header:[HA]},$$scope:{ctx:n}};return e=new Nn({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||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function BA(n,e,t){let i;Ye(n,Qa,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){ie[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await sn(),t(3,o=!1),$b()};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 UA extends ye{constructor(e){super(),ve(this,e,BA,zA,he,{})}}function ng(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,h,g,b,k,y;return g=new ei({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[WA]},$$scope:{ctx:n}}}),{c(){var T;e=v("aside"),t=v("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=O(),s=v("nav"),l=v("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=O(),r=v("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=O(),u=v("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=O(),c=v("figure"),d=v("img"),h=O(),H(g.$$.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"),Vn(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.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(T,e,$),_(e,t),_(e,i),_(e,s),_(s,l),_(s,o),_(s,r),_(s,a),_(s,u),_(e,f),_(e,c),_(c,d),_(c,h),q(g,c,null),b=!0,k||(y=[Ie(xt.call(null,t)),Ie(xt.call(null,l)),Ie(qn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ie(Be.call(null,l,{text:"Collections",position:"right"})),Ie(xt.call(null,r)),Ie(qn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ie(Be.call(null,r,{text:"Logs",position:"right"})),Ie(xt.call(null,u)),Ie(qn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ie(Be.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(T,$){var C;(!b||$&1&&!Vn(d.src,m="./images/avatars/avatar"+(((C=T[0])==null?void 0:C.avatar)||0)+".svg"))&&p(d,"src",m);const M={};$&1024&&(M.$$scope={dirty:$,ctx:T}),g.$set(M)},i(T){b||(A(g.$$.fragment,T),b=!0)},o(T){I(g.$$.fragment,T),b=!1},d(T){T&&w(e),j(g),k=!1,Pe(y)}}}function WA(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=O(),i=v("hr"),s=O(),l=v("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:Z,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Pe(r)}}}function YA(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]&&ng(n);return o=new u1({props:{routes:AA}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new jA({}),f=new UA({}),{c(){t=O(),i=v("div"),d&&d.c(),s=O(),l=v("div"),H(o.$$.fragment),r=O(),H(a.$$.fragment),u=O(),H(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(h,g){S(h,t,g),S(h,i,g),d&&d.m(i,null),_(i,s),_(i,l),q(o,l,null),_(l,r),q(a,l,null),S(h,u,g),q(f,h,g),c=!0},p(h,[g]){var b;(!c||g&12)&&e!==(e=z.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(b=h[0])!=null&&b.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=ng(h),d.c(),A(d,1),d.m(i,s)):d&&(ae(),I(d,1,1,()=>{d=null}),ue())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){I(d),I(o.$$.fragment,h),I(a.$$.fragment,h),I(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 KA(n,e,t){let i,s,l,o;Ye(n,$s,m=>t(8,i=m)),Ye(n,vo,m=>t(2,s=m)),Ye(n,Ma,m=>t(0,l=m)),Ye(n,St,m=>t(3,o=m));let r,a=!1;function u(m){var h,g,b,k;((h=m==null?void 0:m.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((b=(g=m==null?void 0:m.detail)==null?void 0:g.userData)!=null&&b.showAppSidebar)),r=(k=m==null?void 0:m.detail)==null?void 0:k.location,Kt(St,o="",o),Bn({}),$b())}function f(){Di("/")}async function c(){var m,h;if(l!=null&&l.id)try{const g=await pe.settings.getAll({$cancelKey:"initialAppSettings"});Kt(vo,s=((m=g==null?void 0:g.meta)==null?void 0:m.appName)||"",s),Kt($s,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){pe.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class JA extends ye{constructor(e){super(),ve(this,e,KA,YA,he,{})}}new JA({target:document.getElementById("app")});export{Pe as A,zt as B,z as C,Di as D,Me as E,S_ as F,ga as G,mu as H,Ye as I,Ai as J,Ct as K,Zt as L,ie as M,wb as N,wt as O,es as P,ln as Q,pn as R,ye as S,Ir as T,I as a,O as b,H as c,j as d,v as e,p as f,S as g,_ as h,ve as i,Ie as j,ae as k,xt as l,q as m,ue as n,w as o,pe as p,me as q,Q as r,he as s,A as t,Y as u,dt as v,B as w,le as x,Z as y,ce as z};