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

227 lines
969 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 te(){}const $l=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function j1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function x_(n){return n()}function _u(){return Object.create(null)}function De(n){n.forEach(x_)}function jt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function _n(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function V1(n){return Object.keys(n).length===0}function ya(n,...e){if(n==null)return te;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function z1(n){let e;return ya(n,t=>e=t)(),e}function Ze(n,e,t){n.$$.on_destroy.push(ya(e,t))}function kt(n,e,t,i){if(n){const s=eg(n,e,t,i);return n[0](s)}}function eg(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(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 St(n,e,t,i,s,l){if(s){const o=eg(e,t,i,l);n.p(o,s)}}function $t(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 Gt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function tt(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 os(n){return n??""}function ln(n,e,t){return n.set(t),e}function Ee(n){return n&&jt(n.destroy)?n.destroy:te}function gu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const tg=typeof window<"u";let Ro=tg?()=>window.performance.now():()=>Date.now(),ka=tg?n=>requestAnimationFrame(n):te;const Ss=new Set;function ng(n){Ss.forEach(e=>{e.c(n)||(Ss.delete(e),e.f())}),Ss.size!==0&&ka(ng)}function qo(n){let e;return Ss.size===0&&ka(ng),{promise:new Promise(t=>{Ss.add(e={c:n,f:t})}),abort(){Ss.delete(e)}}}const H1=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;"WeakMap"in H1;function v(n,e){n.appendChild(e)}function ig(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function B1(n){const e=y("style");return U1(ig(n),e),e.sheet}function U1(n,e){return v(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function Y(n){return document.createTextNode(n)}function D(){return Y(" ")}function we(){return Y("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function xe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function In(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function m(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const W1=["width","height"];function ai(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&&W1.indexOf(i)===-1?n[i]=e[i]:m(n,i,e[i])}function Y1(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function pt(n){return n===""?null:+n}function K1(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function ae(n,e){n.value=e??""}function Hr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList[t?"add":"remove"](e)}function sg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function Rt(n,e){return new n(e)}const ho=new Map;let _o=0;function J1(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Z1(n,e){const t={stylesheet:B1(e),rules:{}};return ho.set(n,t),t}function pl(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)}}
}`,d=`__svelte_${J1(f)}_${r}`,p=ig(n),{stylesheet:h,rules:g}=ho.get(p)||Z1(p,n);g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${f}`,h.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function ml(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(", "),_o-=s,_o||G1())}function G1(){ka(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ho.clear())})}function X1(n,e,t,i){if(!e)return te;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return te;const{delay:l=0,duration:o=300,easing:r=$l,start:a=Ro()+l,end:u=a+o,tick:f=te,css:d}=t(n,{from:e,to:s},i);let p=!0,h=!1,g;function _(){d&&(g=pl(n,0,1,o,l,r,d)),l||(h=!0)}function b(){d&&ml(n,g),p=!1}return qo(k=>{if(!h&&k>=a&&(h=!0),h&&k>=u&&(f(1,0),b()),!p)return!1;if(h){const $=k-a,C=0+1*r($/o);f(C,1-C)}return!0}),_(),f(0,1),b}function Q1(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,lg(n,s)}}function lg(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 hl;function vi(n){hl=n}function Tl(){if(!hl)throw new Error("Function called outside component initialization");return hl}function Xt(n){Tl().$$.on_mount.push(n)}function x1(n){Tl().$$.after_update.push(n)}function jo(n){Tl().$$.on_destroy.push(n)}function Tt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=sg(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function he(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ws=[],ne=[];let $s=[];const Br=[],og=Promise.resolve();let Ur=!1;function rg(){Ur||(Ur=!0,og.then(wa))}function cn(){return rg(),og}function et(n){$s.push(n)}function ge(n){Br.push(n)}const lr=new Set;let _s=0;function wa(){if(_s!==0)return;const n=hl;do{try{for(;_s<ws.length;){const e=ws[_s];_s++,vi(e),e0(e.$$)}}catch(e){throw ws.length=0,_s=0,e}for(vi(null),ws.length=0,_s=0;ne.length;)ne.pop()();for(let e=0;e<$s.length;e+=1){const t=$s[e];lr.has(t)||(lr.add(t),t())}$s.length=0}while(ws.length);for(;Br.length;)Br.pop()();Ur=!1,lr.clear(),vi(n)}function e0(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(et)}}function t0(n){const e=[],t=[];$s.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),$s=e}let Bs;function Sa(){return Bs||(Bs=Promise.resolve(),Bs.then(()=>{Bs=null})),Bs}function ns(n,e,t){n.dispatchEvent(sg(`${e?"intro":"outro"}${t}`))}const oo=new Set;let li;function ue(){li={r:0,c:[],p:li}}function fe(){li.r||De(li.c),li=li.p}function I(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),li.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const $a={duration:0};function ag(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ml(n,o)}function f(){const{delay:p=0,duration:h=300,easing:g=$l,tick:_=te,css:b}=s||$a;b&&(o=pl(n,0,1,h,p,g,b,a++)),_(0,1);const k=Ro()+p,$=k+h;r&&r.abort(),l=!0,et(()=>ns(n,!0,"start")),r=qo(C=>{if(l){if(C>=$)return _(1,0),ns(n,!0,"end"),u(),l=!1;if(C>=k){const T=g((C-k)/h);_(T,1-T)}}return l})}let d=!1;return{start(){d||(d=!0,ml(n),jt(s)?(s=s(i),Sa().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Ta(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=li;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=$l,tick:p=te,css:h}=s||$a;h&&(o=pl(n,1,0,f,u,d,h));const g=Ro()+u,_=g+f;et(()=>ns(n,!1,"start")),qo(b=>{if(l){if(b>=_)return p(0,1),ns(n,!1,"end"),--r.r||De(r.c),!1;if(b>=g){const k=d((b-g)/f);p(1-k,k)}}return l})}return jt(s)?Sa().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&ml(n,o),l=!1)}}}function Ve(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&&ml(n,u)}function d(h,g){const _=h.b-o;return g*=Math.abs(_),{a:o,b:h.b,d:_,duration:g,start:h.start,end:h.start+g,group:h.group}}function p(h){const{delay:g=0,duration:_=300,easing:b=$l,tick:k=te,css:$}=l||$a,C={start:Ro()+g,b:h};h||(C.group=li,li.r+=1),r||a?a=C:($&&(f(),u=pl(n,o,h,_,g,b,$)),h&&k(0,1),r=d(C,_),et(()=>ns(n,h,"start")),qo(T=>{if(a&&T>a.start&&(r=d(a,_),a=null,ns(n,r.b,"start"),$&&(f(),u=pl(n,o,r.b,r.duration,0,b,l.css))),r){if(T>=r.end)k(o=r.b,1-o),ns(n,r.b,"end"),a||(r.b?f():--r.group.r||De(r.group.c)),r=null;else if(T>=r.start){const O=T-r.start;o=r.a+r.d*b(O/r.duration),k(o,1-o)}}return!!(r||a)}))}return{run(h){jt(l)?Sa().then(()=>{l=l(s),p(h)}):p(h)},end(){f(),r=a=null}}}function bu(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((d,p)=>{p!==l&&d&&(ue(),P(d,1,1,()=>{e.blocks[p]===d&&(e.blocks[p]=null)}),fe())}):e.block.d(1),u.c(),I(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&wa()}if(j1(n)){const s=Tl();if(n.then(l=>{vi(s),i(e.then,1,e.value,l),vi(null)},l=>{if(vi(s),i(e.catch,2,e.error,l),vi(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 n0(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 us(n,e){n.d(1),e.delete(n.key)}function Ut(n,e){P(n,1,1,()=>{e.delete(n.key)})}function i0(n,e){n.f(),Ut(n,e)}function vt(n,e,t,i,s,l,o,r,a,u,f,d){let p=n.length,h=l.length,g=p;const _={};for(;g--;)_[n[g].key]=g;const b=[],k=new Map,$=new Map,C=[];for(g=h;g--;){const E=d(s,l,g),A=t(E);let L=o.get(A);L?i&&C.push(()=>L.p(E,e)):(L=u(A,E),L.c()),k.set(A,b[g]=L),A in _&&$.set(A,Math.abs(g-_[A]))}const T=new Set,O=new Set;function M(E){I(E,1),E.m(r,f),o.set(E.key,E),f=E.first,h--}for(;p&&h;){const E=b[h-1],A=n[p-1],L=E.key,N=A.key;E===A?(f=E.first,p--,h--):k.has(N)?!o.has(L)||T.has(L)?M(E):O.has(N)?p--:$.get(L)>$.get(N)?(O.add(L),M(E)):(T.add(N),p--):(a(A,o),p--)}for(;p--;){const E=n[p];k.has(E.key)||a(E,o)}for(;h;)M(b[h-1]);return De(C),b}function Ot(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 Qt(n){return typeof n=="object"&&n!==null?n:{}}const s0=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"];[...s0];function pe(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||et(()=>{const o=n.$$.on_mount.map(x_).filter(jt);n.$$.on_destroy?n.$$.on_destroy.push(...o):De(o),n.$$.on_mount=[]}),l.forEach(et)}function H(n,e){const t=n.$$;t.fragment!==null&&(t0(t.after_update),De(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function l0(n,e){n.$$.dirty[0]===-1&&(ws.push(n),rg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function be(n,e,t,i,s,l,o,r=[-1]){const a=hl;vi(n);const u=n.$$={fragment:null,ctx:[],props:l,update:te,not_equal:s,bound:_u(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:_u(),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||{},(d,p,...h)=>{const g=h.length?h[0]:p;return u.ctx&&s(u.ctx[d],u.ctx[d]=g)&&(!u.skip_bound&&u.bound[d]&&u.bound[d](g),f&&l0(n,d)),p}):[],u.update(),f=!0,De(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const d=K1(e.target);u.fragment&&u.fragment.l(d),d.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&I(n.$$.fragment),z(n,e.target,e.anchor,e.customElement),wa()}vi(a)}class ve{$destroy(){H(this,1),this.$destroy=te}$on(e,t){if(!jt(t))return te;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!V1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Lt(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 gs=[];function ug(n,e){return{subscribe:Ln(n,e).subscribe}}function Ln(n,e=te){let t;const i=new Set;function s(r){if(_e(n,r)&&(n=r,t)){const a=!gs.length;for(const u of i)u[1](),gs.push(u,n);if(a){for(let u=0;u<gs.length;u+=2)gs[u][0](gs[u+1]);gs.length=0}}}function l(r){s(r(n))}function o(r,a=te){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||te),r(n),()=>{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function fg(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return ug(t,o=>{let r=!1;const a=[];let u=0,f=te;const d=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=jt(h)?h:te},p=s.map((h,g)=>ya(h,_=>{a[g]=_,u&=~(1<<g),r&&d()},()=>{u|=1<<g}));return r=!0,d(),function(){De(p),f(),r=!1}})}function cg(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 o0(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=Rt(l,o()),e.$on("routeEvent",n[7])),{c(){e&&B(e.$$.fragment),t=we()},m(r,a){e&&z(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&4?Ot(s,[Qt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){ue();const f=e;P(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}l?(e=Rt(l,o()),e.$on("routeEvent",r[7]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function r0(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=Rt(l,o()),e.$on("routeEvent",n[6])),{c(){e&&B(e.$$.fragment),t=we()},m(r,a){e&&z(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&6?Ot(s,[a&2&&{params:r[1]},a&4&&Qt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){ue();const f=e;P(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}l?(e=Rt(l,o()),e.$on("routeEvent",r[6]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function a0(n){let e,t,i,s;const l=[r0,o0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},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):(ue(),P(o[f],1,1,()=>{o[f]=null}),fe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function vu(){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 Vo=ug(null,function(e){e(vu());const t=()=>{e(vu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});fg(Vo,n=>n.location);const Ca=fg(Vo,n=>n.querystring),yu=Ln(void 0);async function Vi(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await cn();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 rn(n,e){if(e=wu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return ku(n,e),{update(t){t=wu(t),ku(n,t)}}}function u0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ku(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||f0(i.currentTarget.getAttribute("href"))})}function wu(n){return n&&typeof n=="string"?{href:n}:n||{}}function f0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function c0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(O,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!O||typeof O=="string"&&(O.length<1||O.charAt(0)!="/"&&O.charAt(0)!="*")||typeof O=="object"&&!(O instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:E,keys:A}=cg(O);this.path=O,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=E,this._keys=A}match(O){if(s){if(typeof s=="string")if(O.startsWith(s))O=O.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const L=O.match(s);if(L&&L[0])O=O.substr(L[0].length)||"/";else return null}}const M=this._pattern.exec(O);if(M===null)return null;if(this._keys===!1)return M;const E={};let A=0;for(;A<this._keys.length;){try{E[this._keys[A]]=decodeURIComponent(M[A+1]||"")||null}catch{E[this._keys[A]]=null}A++}return E}async checkConditions(O){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](O))return!1;return!0}}const r=[];i instanceof Map?i.forEach((T,O)=>{r.push(new o(O,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const d=Tt();async function p(T,O){await cn(),d(T,O)}let h=null,g=null;l&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",g),x1(()=>{u0(h)}));let _=null,b=null;const k=Vo.subscribe(async T=>{_=T;let O=0;for(;O<r.length;){const M=r[O].match(T.location);if(!M){O++;continue}const E={route:r[O].path,location:T.location,querystring:T.querystring,userData:r[O].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await r[O].checkConditions(E)){t(0,a=null),b=null,p("conditionsFailed",E);return}p("routeLoading",Object.assign({},E));const A=r[O].component;if(b!=A){A.loading?(t(0,a=A.loading),b=A,t(1,u=A.loadingParams),t(2,f={}),p("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const L=await A();if(T!=_)return;t(0,a=L&&L.default||L),b=A}M&&typeof M=="object"&&Object.keys(M).length?t(1,u=M):t(1,u=null),t(2,f=r[O].props),p("routeLoaded",Object.assign({},E,{component:a,name:a.name,params:u})).then(()=>{yu.set(u)});return}t(0,a=null),b=null,yu.set(void 0)});jo(()=>{k(),g&&window.removeEventListener("popstate",g)});function $(T){he.call(this,n,T)}function C(T){he.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,$,C]}class d0 extends ve{constructor(e){super(),be(this,e,c0,a0,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ro=[];let dg;function pg(n){const e=n.pattern.test(dg);Su(n,n.className,e),Su(n,n.inactiveClassName,!e)}function Su(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Vo.subscribe(n=>{dg=n.location+(n.querystring?"?"+n.querystring:""),ro.map(pg)});function zn(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"?cg(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ro.push(i),pg(i),{destroy(){ro.splice(ro.indexOf(i),1)}}}const p0="modulepreload",m0=function(n,e){return new URL(n,e).href},$u={},ut=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=m0(l,i),l in $u)return;$u[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===l&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":p0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var Wr=function(n,e){return Wr=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])},Wr(n,e)};function nn(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}Wr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Yr=function(){return Yr=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},Yr.apply(this,arguments)};function xt(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(d){return d instanceof t?d:new t(function(p){p(d)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}function en(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(d){if(t)throw new TypeError("Generator is already executing.");for(;l&&(l=0,d[0]&&(o=0)),o;)try{if(t=1,i&&(s=2&d[0]?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[2&d[0],s.value]),d[0]){case 0:case 1:s=d;break;case 4:return o.label++,{value:d[1],done:!1};case 5:o.label++,i=d[1],d=[0];continue;case 7:d=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||d[0]!==6&&d[0]!==2)){o=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){o.label=d[1];break}if(d[0]===6&&o.label<s[1]){o.label=s[1],s=d;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(d);break}s[2]&&o.ops.pop(),o.trys.pop();continue}d=e.call(n,o)}catch(p){d=[6,p],i=0}finally{t=s=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([a,u])}}}var mg,yi=function(n){function e(t){var i,s,l,o,r=this;return(r=n.call(this,"ClientResponseError")||this).url="",r.status=0,r.response={},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.response=t.data!==null&&typeof t.data=="object"?t.data:{},r.isAbort=!!t.isAbort),typeof DOMException<"u"&&t instanceof DOMException&&(r.isAbort=!0),r.name="ClientResponseError "+r.status,r.message=(i=r.response)===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 nn(e,n),Object.defineProperty(e.prototype,"data",{get:function(){return this.response},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return Yr({},this)},e}(Error),jl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Tu(n,e,t){var i=Object.assign({},t||{}),s=i.encode||_0;if(!jl.test(n))throw new TypeError("argument name is invalid");var l=s(e);if(l&&!jl.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(!jl.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!jl.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 h0(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function _0(n){return encodeURIComponent(n)}function hg(n){if(n)try{var e=decodeURIComponent(mg(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function _g(n,e){e===void 0&&(e=0);var t=hg(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}mg=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 Cl=function(){function n(e){e===void 0&&(e={}),this.$load(e||{})}return n.prototype.load=function(e){return this.$load(e)},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(){return this.$clone()},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 this.$export()},n.prototype.$export=function(){return typeof structuredClone=="function"?structuredClone(this):Object.assign({},this)},n}(),wi=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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}(Cl),rs=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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}(Cl),Cu="pb_auth",g0=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!_g(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 wi(t):new rs(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=Cu);var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||h0,f=0;f<o.length;){var d=o.indexOf("=",f);if(d===-1)break;var p=o.indexOf(";",f);if(p===-1)p=o.length;else if(p<d){f=o.lastIndexOf(";",d-1)+1;continue}var h=o.slice(f,d).trim();if(a[h]===void 0){var g=o.slice(d+1,p).trim();g.charCodeAt(0)===34&&(g=g.slice(1,-1));try{a[h]=u(g)}catch{a[h]=g}}f=p+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=Cu);var o={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},r=hg(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=Tu(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 wi&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=Tu(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}(),gg=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 nn(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 rs(i.model):new wi(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}(g0),fs=function(e){this.client=e},b0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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,i){t===void 0&&(t="storage"),i===void 0&&(i={});var s={filesystem:t};return this.client.send("/api/settings/test/s3",{method:"POST",params:i,body:s}).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.prototype.generateAppleClientSecret=function(t,i,s,l,o,r,a){return r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({clientId:t,teamId:i,keyId:s,privateKey:l,duration:o},r),this.client.send("/api/settings/apple/generate-client-secret",{method:"POST",params:a,body:r})},e}(fs),bg=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||[]},Ma=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.getFullList=function(t,i){if(typeof t=="number")return this._getFullList(this.baseCrudPath,t,i);var s=Object.assign({},t,i);return this._getFullList(this.baseCrudPath,s.batch||200,s)},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 nn(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=200),s===void 0&&(s={});var o=[],r=function(a){return xt(l,void 0,void 0,function(){return en(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var d=f,p=d.items,h=d.totalItems;return o=o.concat(p),p.length&&h>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 d=f[u];a.push(o.decode(d))}}return new bg((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 yi({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}(fs)),v0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.decode=function(t){return new rs(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}(Ma),y0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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}(Cl),k0=function(n){function e(t,i){var s=n.call(this,t)||this;return s.collectionIdOrName=i,s}return nn(e,n),e.prototype.decode=function(t){return new wi(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 xt(this,void 0,void 0,function(){return en(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 xt(this,void 0,void 0,function(){var s;return en(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 xt(this,void 0,void 0,function(){return en(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){if(typeof t=="number")return n.prototype.getFullList.call(this,t,i);var s=Object.assign({},t,i);return n.prototype.getFullList.call(this,s)},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.authWithOAuth2Code=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.authWithOAuth2=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return xt(this,void 0,void 0,function(){var s,l,o,r,a=this;return en(this,function(u){switch(u.label){case 0:return t.length>1||typeof(t==null?void 0:t[0])=="string"?(console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),[2,this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{})]):(s=(t==null?void 0:t[0])||{},[4,this.listAuthMethods()]);case 1:if(l=u.sent(),!(o=l.authProviders.find(function(f){return f.name===s.provider})))throw new yi(new Error('Missing or invalid provider "'.concat(s.provider,'".')));return r=this.client.buildUrl("/api/oauth2-redirect"),[2,new Promise(function(f,d){return xt(a,void 0,void 0,function(){var p,h,g,_,b=this;return en(this,function(k){switch(k.label){case 0:return k.trys.push([0,3,,4]),[4,this.client.realtime.subscribe("@oauth2",function($){return xt(b,void 0,void 0,function(){var C,T,O;return en(this,function(M){switch(M.label){case 0:C=this.client.realtime.clientId,M.label=1;case 1:if(M.trys.push([1,3,,4]),p(),!$.state||C!==$.state)throw new Error("State parameters don't match.");return[4,this.authWithOAuth2Code(o.name,$.code,o.codeVerifier,r,s.createData,s.body,s.query)];case 2:return T=M.sent(),f(T),[3,4];case 3:return O=M.sent(),d(new yi(O)),[3,4];case 4:return[2]}})})})];case 1:return p=k.sent(),(h=new URL(o.authUrl+r)).searchParams.set("state",this.client.realtime.clientId),!((_=s.scopes)===null||_===void 0)&&_.length&&h.searchParams.set("scope",s.scopes.join(" ")),[4,s.urlCallback?s.urlCallback(h.toString()):this._defaultUrlCallback(h.toString())];case 2:return k.sent(),[3,4];case 3:return g=k.sent(),d(new yi(g)),[3,4];case 4:return[2]}})})})]}})})},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 y0(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.prototype._defaultUrlCallback=function(t){if(typeof window>"u"||!(window!=null&&window.open))throw new yi(new Error("Not in a browser context - please pass a custom urlCallback function."));var i=1024,s=768,l=window.innerWidth,o=window.innerHeight,r=l/2-(i=i>l?l:i)/2,a=o/2-(s=s>o?o:s)/2;window.open(t,"oauth2-popup","width="+i+",height="+s+",top="+a+",left="+r+",resizable,menubar=no")},e}(Ma),wn=function(e){e===void 0&&(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.options=typeof e.options=="object"&&e.options!==null?e.options:{}},kn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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!==null?t.options:{},this.indexes=Array.isArray(t.indexes)?t.indexes:[],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 wn(l))}},Object.defineProperty(e.prototype,"isBase",{get:function(){return this.$isBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$isBase",{get:function(){return this.type==="base"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAuth",{get:function(){return this.$isAuth},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.$isView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"$isView",{get:function(){return this.type==="view"},enumerable:!1,configurable:!0}),e}(Cl),w0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.decode=function(t){return new kn(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={}),xt(this,void 0,void 0,function(){return en(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}(Ma),Kr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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}(Cl),S0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(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 Kr(u))}}return new bg((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 Kr(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}(fs),$0=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 nn(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 xt(this,void 0,void 0,function(){var l,o=this;return en(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 xt(o,void 0,void 0,function(){return en(this,function(a){return[2,this.unsubscribeByTopicAndListener(t,l)]})})}]}})})},e.prototype.unsubscribe=function(t){var i;return xt(this,void 0,void 0,function(){var s,l,o;return en(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 xt(this,void 0,void 0,function(){var s,l,o,r,a;return en(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 xt(this,void 0,void 0,function(){var l,o;return en(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 xt(this,void 0,void 0,function(){return en(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 xt(this,void 0,void 0,function(){var t=this;return en(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 xt(t,void 0,void 0,function(){var l;return en(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 yi(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 yi(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}(fs),T0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.check=function(t){return t===void 0&&(t={}),this.client.send("/api/health",{method:"GET",params:t})},e}(fs),C0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.getUrl=function(t,i,s){s===void 0&&(s={});var l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(t.collectionId||t.collectionName)),l.push(encodeURIComponent(t.id)),l.push(encodeURIComponent(i));var o=this.client.buildUrl(l.join("/"));if(Object.keys(s).length){var r=new URLSearchParams(s);o+=(o.includes("?")?"&":"?")+r}return o},e.prototype.getToken=function(t){return t===void 0&&(t={}),this.client.send("/api/files/token",{method:"POST",params:t}).then(function(i){return(i==null?void 0:i.token)||""})},e}(fs),M0=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return nn(e,n),e.prototype.getFullList=function(t){return t===void 0&&(t={}),this.client.send("/api/backups",{method:"GET",params:t})},e.prototype.create=function(t,i){i===void 0&&(i={});var s={name:t};return this.client.send("/api/backups",{method:"POST",params:i,body:s}).then(function(){return!0})},e.prototype.delete=function(t,i){return i===void 0&&(i={}),this.client.send("/api/backups/".concat(encodeURIComponent(t)),{method:"DELETE",params:i}).then(function(){return!0})},e.prototype.restore=function(t,i){return i===void 0&&(i={}),this.client.send("/api/backups/".concat(encodeURIComponent(t),"/restore"),{method:"POST",params:i}).then(function(){return!0})},e.prototype.getDownloadUrl=function(t,i){return this.client.buildUrl("/api/backups/".concat(encodeURIComponent(i),"?token=").concat(encodeURIComponent(t)))},e}(fs),zo=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 gg,this.admins=new v0(this),this.collections=new w0(this),this.files=new C0(this),this.logs=new S0(this),this.settings=new b0(this),this.realtime=new $0(this),this.health=new T0(this),this.backups=new M0(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new k0(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 xt(this,void 0,void 0,function(){var d,p,h,g,_,b,k,$,C,T=this;return en(this,function(O){switch(O.label){case 0:return d=Object.assign({method:"GET"},t),this.isFormData(d.body)||(d.body&&typeof d.body!="string"&&(d.body=JSON.stringify(d.body)),((i=d==null?void 0:d.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(d.headers=Object.assign({},d.headers,{"Content-Type":"application/json"}))),((s=d==null?void 0:d.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(d.headers=Object.assign({},d.headers,{"Accept-Language":this.lang})),!((l=this.authStore)===null||l===void 0)&&l.token&&((o=d==null?void 0:d.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(d.headers=Object.assign({},d.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&((r=d.params)===null||r===void 0?void 0:r.$autoCancel)!==!1&&(p=((a=d.params)===null||a===void 0?void 0:a.$cancelKey)||(d.method||"GET")+e,this.cancelRequest(p),h=new AbortController,this.cancelControllers[p]=h,d.signal=h.signal),(u=d.params)===null||u===void 0||delete u.$autoCancel,(f=d.params)===null||f===void 0||delete f.$cancelKey,g=this.buildUrl(e),d.params!==void 0&&((_=this.serializeQueryParams(d.params))&&(g+=(g.includes("?")?"&":"?")+_),delete d.params),this.beforeSend?($=(k=Object).assign,C=[{}],[4,this.beforeSend(g,d)]):[3,2];case 1:(b=$.apply(k,C.concat([O.sent()]))).url!==void 0||b.options!==void 0?(g=b.url||g,d=b.options||d):Object.keys(b).length&&(d=b,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`.")),O.label=2;case 2:return[2,fetch(g,d).then(function(M){return xt(T,void 0,void 0,function(){var E;return en(this,function(A){switch(A.label){case 0:E={},A.label=1;case 1:return A.trys.push([1,3,,4]),[4,M.json()];case 2:return E=A.sent(),[3,4];case 3:return A.sent(),[3,4];case 4:return this.afterSend?[4,this.afterSend(M,E)]:[3,6];case 5:E=A.sent(),A.label=6;case 6:if(M.status>=400)throw new yi({url:M.url,status:M.status,data:E});return[2,E]}})})}).catch(function(M){throw new yi(M)})]}})})},n.prototype.getFileUrl=function(e,t,i){return i===void 0&&(i={}),this.files.getUrl(e,t,i)},n.prototype.buildUrl=function(e){var t,i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i},n.prototype.isFormData=function(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)},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 cs extends Error{}class O0 extends cs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class E0 extends cs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class D0 extends cs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class tl extends cs{}class vg extends cs{constructor(e){super(`Invalid unit ${e}`)}}class Bn extends cs{}class Ei extends cs{constructor(){super("Zone is an abstract class")}}const Le="numeric",xn="short",An="long",Jr={year:Le,month:Le,day:Le},yg={year:Le,month:xn,day:Le},A0={year:Le,month:xn,day:Le,weekday:xn},kg={year:Le,month:An,day:Le},wg={year:Le,month:An,day:Le,weekday:An},Sg={hour:Le,minute:Le},$g={hour:Le,minute:Le,second:Le},Tg={hour:Le,minute:Le,second:Le,timeZoneName:xn},Cg={hour:Le,minute:Le,second:Le,timeZoneName:An},Mg={hour:Le,minute:Le,hourCycle:"h23"},Og={hour:Le,minute:Le,second:Le,hourCycle:"h23"},Eg={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:xn},Dg={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:An},Ag={year:Le,month:Le,day:Le,hour:Le,minute:Le},Ig={year:Le,month:Le,day:Le,hour:Le,minute:Le,second:Le},Lg={year:Le,month:xn,day:Le,hour:Le,minute:Le},Pg={year:Le,month:xn,day:Le,hour:Le,minute:Le,second:Le},I0={year:Le,month:xn,day:Le,weekday:xn,hour:Le,minute:Le},Ng={year:Le,month:An,day:Le,hour:Le,minute:Le,timeZoneName:xn},Fg={year:Le,month:An,day:Le,hour:Le,minute:Le,second:Le,timeZoneName:xn},Rg={year:Le,month:An,day:Le,weekday:An,hour:Le,minute:Le,timeZoneName:An},qg={year:Le,month:An,day:Le,weekday:An,hour:Le,minute:Le,second:Le,timeZoneName:An};function st(n){return typeof n>"u"}function is(n){return typeof n=="number"}function Ho(n){return typeof n=="number"&&n%1===0}function L0(n){return typeof n=="string"}function P0(n){return Object.prototype.toString.call(n)==="[object Date]"}function jg(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function N0(n){return Array.isArray(n)?n:[n]}function Mu(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 F0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ds(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return Ho(n)&&n>=e&&n<=t}function R0(n,e){return n-e*Math.floor(n/e)}function Yt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ai(n){if(!(st(n)||n===null||n===""))return parseInt(n,10)}function Wi(n){if(!(st(n)||n===null||n===""))return parseFloat(n)}function Oa(n){if(!(st(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ea(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Ml(n){return n%4===0&&(n%100!==0||n%400===0)}function ll(n){return Ml(n)?366:365}function go(n,e){const t=R0(e-1,12)+1,i=n+(e-t)/12;return t===2?Ml(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Da(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 bo(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 Zr(n){return n>99?n:n>60?1900+n:2e3+n}function Vg(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 Bo(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 zg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Bn(`Invalid unit value ${n}`);return e}function vo(n,e){const t={};for(const i in n)if(Ds(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=zg(s)}return t}function ol(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}${Yt(t,2)}:${Yt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Yt(t,2)}${Yt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Uo(n){return F0(n,["hour","minute","second","millisecond"])}const Hg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,q0=["January","February","March","April","May","June","July","August","September","October","November","December"],Bg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],j0=["J","F","M","A","M","J","J","A","S","O","N","D"];function Ug(n){switch(n){case"narrow":return[...j0];case"short":return[...Bg];case"long":return[...q0];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 Wg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Yg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],V0=["M","T","W","T","F","S","S"];function Kg(n){switch(n){case"narrow":return[...V0];case"short":return[...Yg];case"long":return[...Wg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Jg=["AM","PM"],z0=["Before Christ","Anno Domini"],H0=["BC","AD"],B0=["B","A"];function Zg(n){switch(n){case"narrow":return[...B0];case"short":return[...H0];case"long":return[...z0];default:return null}}function U0(n){return Jg[n.hour<12?0:1]}function W0(n,e){return Kg(e)[n.weekday-1]}function Y0(n,e){return Ug(e)[n.month-1]}function K0(n,e){return Zg(e)[n.year<0?0:1]}function J0(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 d=n==="days";switch(e){case 1:return d?"tomorrow":`next ${s[n][0]}`;case-1:return d?"yesterday":`last ${s[n][0]}`;case 0:return d?"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 Ou(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Z0={D:Jr,DD:yg,DDD:kg,DDDD:wg,t:Sg,tt:$g,ttt:Tg,tttt:Cg,T:Mg,TT:Og,TTT:Eg,TTTT:Dg,f:Ag,ff:Lg,fff:Ng,ffff:Rg,F:Ig,FF:Pg,FFF:Fg,FFFF:qg};class yn{static create(e,t={}){return new yn(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 Z0[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 Yt(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=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?U0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?Y0(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?W0(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=yn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},d=h=>i?K0(e,h):l({era:h},"era"),p=h=>{switch(h){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 d("short");case"GG":return d("long");case"GGGGG":return d("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(h)}};return Ou(yn.parseFormat(t),p)}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=yn.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 Ou(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ol{get type(){throw new Ei}get name(){throw new Ei}get ianaName(){return this.name}get isUniversal(){throw new Ei}offsetName(e,t){throw new Ei}formatOffset(e,t){throw new Ei}offset(e){throw new Ei}equals(e){throw new Ei}get isValid(){throw new Ei}}let or=null;class Aa extends Ol{static get instance(){return or===null&&(or=new Aa),or}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Vg(e,t,i)}formatOffset(e,t){return ol(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ao={};function G0(n){return ao[n]||(ao[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"})),ao[n]}const X0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Q0(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 x0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=X0[l];l==="era"?i[r]=o:st(r)||(i[r]=parseInt(o,10))}return i}let Vl={};class Si extends Ol{static create(e){return Vl[e]||(Vl[e]=new Si(e)),Vl[e]}static resetCache(){Vl={},ao={}}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=Si.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Vg(e,t,i,this.name)}formatOffset(e,t){return ol(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=G0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?x0(i,t):Q0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const p=Da({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let h=+t;const g=h%1e3;return h-=g>=0?g:1e3+g,(p-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let rr=null;class hn extends Ol{static get utcInstance(){return rr===null&&(rr=new hn(0)),rr}static instance(e){return e===0?hn.utcInstance:new hn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new hn(Bo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ol(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ol(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ol(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 ev extends Ol{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 Ii(n,e){if(st(n)||n===null)return e;if(n instanceof Ol)return n;if(L0(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?hn.utcInstance:hn.parseSpecifier(t)||Si.create(n)}else return is(n)?hn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new ev(n)}let Eu=()=>Date.now(),Du="system",Au=null,Iu=null,Lu=null,Pu;class Zt{static get now(){return Eu}static set now(e){Eu=e}static set defaultZone(e){Du=e}static get defaultZone(){return Ii(Du,Aa.instance)}static get defaultLocale(){return Au}static set defaultLocale(e){Au=e}static get defaultNumberingSystem(){return Iu}static set defaultNumberingSystem(e){Iu=e}static get defaultOutputCalendar(){return Lu}static set defaultOutputCalendar(e){Lu=e}static get throwOnInvalid(){return Pu}static set throwOnInvalid(e){Pu=e}static resetCaches(){Dt.resetCache(),Si.resetCache()}}let Nu={};function tv(n,e={}){const t=JSON.stringify([n,e]);let i=Nu[t];return i||(i=new Intl.ListFormat(n,e),Nu[t]=i),i}let Gr={};function Xr(n,e={}){const t=JSON.stringify([n,e]);let i=Gr[t];return i||(i=new Intl.DateTimeFormat(n,e),Gr[t]=i),i}let Qr={};function nv(n,e={}){const t=JSON.stringify([n,e]);let i=Qr[t];return i||(i=new Intl.NumberFormat(n,e),Qr[t]=i),i}let xr={};function iv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=xr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),xr[s]=l),l}let nl=null;function sv(){return nl||(nl=new Intl.DateTimeFormat().resolvedOptions().locale,nl)}function lv(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Xr(n).resolvedOptions()}catch{t=Xr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function ov(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function rv(n){const e=[];for(let t=1;t<=12;t++){const i=We.utc(2016,t,1);e.push(n(i))}return e}function av(n){const e=[];for(let t=1;t<=7;t++){const i=We.utc(2016,11,13+t);e.push(n(i))}return e}function zl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function uv(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 fv{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=nv(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):Ea(e,3);return Yt(t,this.padTo)}}}class cv{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&&Si.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:We.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=Xr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class dv{constructor(e,t,i){this.opts={style:"long",...i},!t&&jg()&&(this.rtf=iv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):J0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Dt{static fromOpts(e){return Dt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Zt.defaultLocale,o=l||(s?"en-US":sv()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new Dt(o,r,a,l)}static resetCache(){nl=null,Gr={},Qr={},xr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Dt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=lv(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=ov(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=uv(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Dt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,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 zl(this,e,i,Ug,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=rv(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return zl(this,e,i,Kg,()=>{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]=av(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return zl(this,void 0,e,()=>Jg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[We.utc(2016,11,13,9),We.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return zl(this,e,t,Zg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[We.utc(-40,1,1),We.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 fv(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new cv(e,this.intl,t)}relFormatter(e={}){return new dv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return tv(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 Rs(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function qs(...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 js(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 Gg(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=Ai(e[t+s]);return[i,null,t+s]}}const Xg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,pv=`(?:${Xg.source}?(?:\\[(${Hg.source})\\])?)?`,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Qg=RegExp(`${Ia.source}${pv}`),La=RegExp(`(?:T${Qg.source})?`),mv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,hv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,_v=/(\d{4})-?(\d{3})/,gv=Gg("weekYear","weekNumber","weekDay"),bv=Gg("year","ordinal"),vv=/(\d{4})-(\d\d)-(\d\d)/,xg=RegExp(`${Ia.source} ?(?:${Xg.source}|(${Hg.source}))?`),yv=RegExp(`(?: ${xg.source})?`);function Ts(n,e,t){const i=n[e];return st(i)?t:Ai(i)}function kv(n,e){return[{year:Ts(n,e),month:Ts(n,e+1,1),day:Ts(n,e+2,1)},null,e+3]}function Vs(n,e){return[{hours:Ts(n,e,0),minutes:Ts(n,e+1,0),seconds:Ts(n,e+2,0),milliseconds:Oa(n[e+3])},null,e+4]}function El(n,e){const t=!n[e]&&!n[e+1],i=Bo(n[e+1],n[e+2]),s=t?null:hn.instance(i);return[{},s,e+3]}function Dl(n,e){const t=n[e]?Si.create(n[e]):null;return[{},t,e+1]}const wv=RegExp(`^T?${Ia.source}$`),Sv=/^-?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 $v(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",d=a&&a[0]==="-",p=(h,g=!1)=>h!==void 0&&(g||h&&f)?-h:h;return[{years:p(Wi(t)),months:p(Wi(i)),weeks:p(Wi(s)),days:p(Wi(l)),hours:p(Wi(o)),minutes:p(Wi(r)),seconds:p(Wi(a),a==="-0"),milliseconds:p(Oa(u),d)}]}const Tv={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 Pa(n,e,t,i,s,l,o){const r={year:e.length===2?Zr(Ai(e)):Ai(e),month:Bg.indexOf(t)+1,day:Ai(i),hour:Ai(s),minute:Ai(l)};return o&&(r.second=Ai(o)),n&&(r.weekday=n.length>3?Wg.indexOf(n)+1:Yg.indexOf(n)+1),r}const Cv=/^(?:(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 Mv(n){const[,e,t,i,s,l,o,r,a,u,f,d]=n,p=Pa(e,s,i,t,l,o,r);let h;return a?h=Tv[a]:u?h=0:h=Bo(f,d),[p,new hn(h)]}function Ov(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Ev=/^(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$/,Dv=/^(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$/,Av=/^(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 Fu(n){const[,e,t,i,s,l,o,r]=n;return[Pa(e,s,i,t,l,o,r),hn.utcInstance]}function Iv(n){const[,e,t,i,s,l,o,r]=n;return[Pa(e,r,t,i,s,l,o),hn.utcInstance]}const Lv=Rs(mv,La),Pv=Rs(hv,La),Nv=Rs(_v,La),Fv=Rs(Qg),eb=qs(kv,Vs,El,Dl),Rv=qs(gv,Vs,El,Dl),qv=qs(bv,Vs,El,Dl),jv=qs(Vs,El,Dl);function Vv(n){return js(n,[Lv,eb],[Pv,Rv],[Nv,qv],[Fv,jv])}function zv(n){return js(Ov(n),[Cv,Mv])}function Hv(n){return js(n,[Ev,Fu],[Dv,Fu],[Av,Iv])}function Bv(n){return js(n,[Sv,$v])}const Uv=qs(Vs);function Wv(n){return js(n,[wv,Uv])}const Yv=Rs(vv,yv),Kv=Rs(xg),Jv=qs(Vs,El,Dl);function Zv(n){return js(n,[Yv,eb],[Kv,Jv])}const Gv="Invalid Duration",tb={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}},Xv={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},...tb},Rn=146097/400,bs=146097/4800,Qv={years:{quarters:4,months:12,weeks:Rn/7,days:Rn,hours:Rn*24,minutes:Rn*24*60,seconds:Rn*24*60*60,milliseconds:Rn*24*60*60*1e3},quarters:{months:3,weeks:Rn/28,days:Rn/4,hours:Rn*24/4,minutes:Rn*24*60/4,seconds:Rn*24*60*60/4,milliseconds:Rn*24*60*60*1e3/4},months:{weeks:bs/7,days:bs,hours:bs*24,minutes:bs*24*60,seconds:bs*24*60*60,milliseconds:bs*24*60*60*1e3},...tb},Xi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],xv=Xi.slice(0).reverse();function Yi(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new at(i)}function ey(n){return n<0?Math.floor(n):Math.ceil(n)}function nb(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?ey(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function ty(n,e){xv.reduce((t,i)=>st(e[i])?t:(t&&nb(n,e,t,e,i),i),null)}class at{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Dt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Qv:Xv,this.isLuxonDuration=!0}static fromMillis(e,t){return at.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Bn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new at({values:vo(e,at.normalizeUnit),loc:Dt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(is(e))return at.fromMillis(e);if(at.isDuration(e))return e;if(typeof e=="object")return at.fromObject(e);throw new Bn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Bv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Wv(e);return i?at.fromObject(i,t):at.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Bn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new D0(i);return new at({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 vg(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?yn.create(this.loc,i).formatDurationFromString(this,e):Gv}toHuman(e={}){const t=Xi.map(i=>{const s=this.values[i];return st(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+=Ea(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=at.fromDurationLike(e),i={};for(const s of Xi)(Ds(t.values,s)||Ds(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Yi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=at.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]=zg(e(this.values[i],i));return Yi(this,{values:t},!0)}get(e){return this[at.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...vo(e,at.normalizeUnit)};return Yi(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),Yi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return ty(this.matrix,e),Yi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>at.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Xi)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;is(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)Xi.indexOf(u)>Xi.indexOf(o)&&nb(this.matrix,s,u,t,o)}else is(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 Yi(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 Yi(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of Xi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Us="Invalid Interval";function ny(n,e){return!n||!n.isValid?Pt.invalid("missing or invalid start"):!e||!e.isValid?Pt.invalid("missing or invalid end"):e<n?Pt.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 Pt{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 Bn("need to specify a reason the Interval is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new E0(i);return new Pt({invalid:i})}static fromDateTimes(e,t){const i=Ks(e),s=Ks(t),l=ny(i,s);return l??new Pt({start:i,end:s})}static after(e,t){const i=at.fromDurationLike(t),s=Ks(e);return Pt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=at.fromDurationLike(t),s=Ks(e);return Pt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=We.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=We.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return Pt.fromDateTimes(l,r);if(o){const u=at.fromISO(s,t);if(u.isValid)return Pt.after(l,u)}else if(a){const u=at.fromISO(i,t);if(u.isValid)return Pt.before(r,u)}}return Pt.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?Pt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ks).filter(o=>this.contains(o)).sort(),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(Pt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=at.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(Pt.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:Pt.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 Pt.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(Pt.fromDateTimes(t,a.time)),t=null);return Pt.merge(s)}difference(...e){return Pt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:Us}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Us}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Us}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Us}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Us}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):at.invalid(this.invalidReason)}mapEndpoints(e){return Pt.fromDateTimes(e(this.s),e(this.e))}}class Hl{static hasDST(e=Zt.defaultZone){const t=We.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Si.isValidZone(e)}static normalizeZone(e){return Ii(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Dt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Dt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Dt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Dt.create(t,null,"gregory").eras(e)}static features(){return{relative:jg()}}}function Ru(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(at.fromMillis(i).as("days"))}function iy(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=Ru(r,a);return(u-u%7)/7}],["days",Ru]],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 sy(n,e,t,i){let[s,l,o,r]=iy(n,e,t);const a=e-s,u=t.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=at.fromObject(l,i);return u.length>0?at.fromMillis(a,i).shiftTo(...u).plus(f):f}const Na={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},qu={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]},ly=Na.hanidec.replace(/[\[|\]]/g,"").split("");function oy(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(Na.hanidec)!==-1)e+=ly.indexOf(n[t]);else for(const s in qu){const[l,o]=qu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Zn({numberingSystem:n},e=""){return new RegExp(`${Na[n||"latn"]}${e}`)}const ry="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(oy(t))}}const ay=String.fromCharCode(160),ib=`[ ${ay}]`,sb=new RegExp(ib,"g");function uy(n){return n.replace(/\./g,"\\.?").replace(sb,ib)}function ju(n){return n.replace(/\./g,"").replace(sb," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(uy).join("|")),deser:([t])=>n.findIndex(i=>ju(t)===ju(i))+e}}function Vu(n,e){return{regex:n,deser:([,t,i])=>Bo(t,i),groups:e}}function ar(n){return{regex:n,deser:([e])=>e}}function fy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function cy(n,e){const t=Zn(e),i=Zn(e,"{2}"),s=Zn(e,"{3}"),l=Zn(e,"{4}"),o=Zn(e,"{6}"),r=Zn(e,"{1,2}"),a=Zn(e,"{1,3}"),u=Zn(e,"{1,6}"),f=Zn(e,"{1,9}"),d=Zn(e,"{2,4}"),p=Zn(e,"{4,6}"),h=b=>({regex:RegExp(fy(b.val)),deser:([k])=>k,literal:!0}),_=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return ft(u);case"yy":return ft(d,Zr);case"yyyy":return ft(l);case"yyyyy":return ft(p);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(s);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(s);case"u":return ar(f);case"uu":return ar(r);case"uuu":return ft(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return ft(l);case"kk":return ft(d,Zr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Vu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Vu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ar(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:ry};return _.token=n,_}const dy={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 py(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=dy[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function my(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function hy(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ds(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 _y(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return st(n.z)||(t=Si.create(n.z)),st(n.Z)||(t||(t=new hn(n.Z)),i=n.Z),st(n.q)||(n.M=(n.q-1)*3+1),st(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),st(n.u)||(n.S=Oa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ur=null;function gy(){return ur||(ur=We.fromMillis(1555555555555)),ur}function by(n,e){if(n.literal)return n;const t=yn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=yn.create(e,t).formatDateTimeParts(gy()).map(o=>py(o,e,t));return l.includes(void 0)?n:l}function vy(n,e){return Array.prototype.concat(...n.map(t=>by(t,e)))}function lb(n,e,t){const i=vy(yn.parseFormat(t),n),s=i.map(o=>cy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=my(s),a=RegExp(o,"i"),[u,f]=hy(e,a,r),[d,p,h]=f?_y(f):[null,null,void 0];if(Ds(f,"a")&&Ds(f,"H"))throw new tl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:d,zone:p,specificOffset:h}}}function yy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=lb(n,e,t);return[i,s,l,o]}const ob=[0,31,59,90,120,151,181,212,243,273,304,334],rb=[0,31,60,91,121,152,182,213,244,274,305,335];function Wn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function ab(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 ub(n,e,t){return t+(Ml(n)?rb:ob)[e-1]}function fb(n,e){const t=Ml(n)?rb:ob,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function ea(n){const{year:e,month:t,day:i}=n,s=ub(e,t,i),l=ab(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=bo(r)):o>bo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Uo(n)}}function zu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=ab(e,1,4),l=ll(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=ll(r)):o>l?(r=e+1,o-=ll(e)):r=e;const{month:a,day:u}=fb(r,o);return{year:r,month:a,day:u,...Uo(n)}}function fr(n){const{year:e,month:t,day:i}=n,s=ub(e,t,i);return{year:e,ordinal:s,...Uo(n)}}function Hu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=fb(e,t);return{year:e,month:i,day:s,...Uo(n)}}function ky(n){const e=Ho(n.weekYear),t=ki(n.weekNumber,1,bo(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Wn("weekday",n.weekday):Wn("week",n.week):Wn("weekYear",n.weekYear)}function wy(n){const e=Ho(n.year),t=ki(n.ordinal,1,ll(n.year));return e?t?!1:Wn("ordinal",n.ordinal):Wn("year",n.year)}function cb(n){const e=Ho(n.year),t=ki(n.month,1,12),i=ki(n.day,1,go(n.year,n.month));return e?t?i?!1:Wn("day",n.day):Wn("month",n.month):Wn("year",n.year)}function db(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Wn("millisecond",s):Wn("second",i):Wn("minute",t):Wn("hour",e)}const cr="Invalid DateTime",Bu=864e13;function Bl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function dr(n){return n.weekData===null&&(n.weekData=ea(n.c)),n.weekData}function Ws(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new We({...t,...e,old:t})}function pb(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 Uu(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 uo(n,e,t){return pb(Da(n),e,t)}function Wu(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,go(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=at.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=Da(l);let[a,u]=pb(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Ys(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=We.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return We.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ul(n,e,t=!0){return n.isValid?yn.create(Dt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function pr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Yt(n.c.year,t?6:4),e?(i+="-",i+=Yt(n.c.month),i+="-",i+=Yt(n.c.day)):(i+=Yt(n.c.month),i+=Yt(n.c.day)),i}function Yu(n,e,t,i,s,l){let o=Yt(n.c.hour);return e?(o+=":",o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Yt(n.c.minute),(n.c.second!==0||!t)&&(o+=Yt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Yt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Yt(Math.trunc(-n.o/60)),o+=":",o+=Yt(Math.trunc(-n.o%60))):(o+="+",o+=Yt(Math.trunc(n.o/60)),o+=":",o+=Yt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const mb={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Sy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},$y={ordinal:1,hour:0,minute:0,second:0,millisecond:0},hb=["year","month","day","hour","minute","second","millisecond"],Ty=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cy=["year","ordinal","hour","minute","second","millisecond"];function Ku(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 vg(n);return e}function Ju(n,e){const t=Ii(e.zone,Zt.defaultZone),i=Dt.fromObject(e),s=Zt.now();let l,o;if(st(n.year))l=s;else{for(const u of hb)st(n[u])&&(n[u]=mb[u]);const r=cb(n)||db(n);if(r)return We.invalid(r);const a=t.offset(s);[l,o]=uo(n,a,t)}return new We({ts:l,zone:t,loc:i,o})}function Zu(n,e,t){const i=st(t.round)?!0:t.round,s=(o,r)=>(o=Ea(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 Gu(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 We{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Bl(t));this.ts=st(e.ts)?Zt.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=Uu(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Dt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new We({})}static local(){const[e,t]=Gu(arguments),[i,s,l,o,r,a,u]=t;return Ju({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Gu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=hn.utcInstance,Ju({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=P0(e)?e.valueOf():NaN;if(Number.isNaN(i))return We.invalid("invalid input");const s=Ii(t.zone,Zt.defaultZone);return s.isValid?new We({ts:i,zone:s,loc:Dt.fromObject(t)}):We.invalid(Bl(s))}static fromMillis(e,t={}){if(is(e))return e<-Bu||e>Bu?We.invalid("Timestamp out of range"):new We({ts:e,zone:Ii(t.zone,Zt.defaultZone),loc:Dt.fromObject(t)});throw new Bn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(is(e))return new We({ts:e*1e3,zone:Ii(t.zone,Zt.defaultZone),loc:Dt.fromObject(t)});throw new Bn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ii(t.zone,Zt.defaultZone);if(!i.isValid)return We.invalid(Bl(i));const s=Zt.now(),l=st(t.specificOffset)?i.offset(s):t.specificOffset,o=vo(e,Ku),r=!st(o.ordinal),a=!st(o.year),u=!st(o.month)||!st(o.day),f=a||u,d=o.weekYear||o.weekNumber,p=Dt.fromObject(t);if((f||r)&&d)throw new tl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new tl("Can't mix ordinal dates with month/day");const h=d||o.weekday&&!f;let g,_,b=Uu(s,l);h?(g=Ty,_=Sy,b=ea(b)):r?(g=Cy,_=$y,b=fr(b)):(g=hb,_=mb);let k=!1;for(const A of g){const L=o[A];st(L)?k?o[A]=_[A]:o[A]=b[A]:k=!0}const $=h?ky(o):r?wy(o):cb(o),C=$||db(o);if(C)return We.invalid(C);const T=h?zu(o):r?Hu(o):o,[O,M]=uo(T,l,i),E=new We({ts:O,zone:i,o:M,loc:p});return o.weekday&&f&&e.weekday!==E.weekday?We.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=Vv(e);return Ys(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=zv(e);return Ys(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=Hv(e);return Ys(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(st(e)||st(t))throw new Bn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=yy(o,e,t);return f?We.invalid(f):Ys(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return We.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=Zv(e);return Ys(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Bn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Zt.throwOnInvalid)throw new O0(i);return new We({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?dr(this).weekYear:NaN}get weekNumber(){return this.isValid?dr(this).weekNumber:NaN}get weekday(){return this.isValid?dr(this).weekday:NaN}get ordinal(){return this.isValid?fr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Hl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Hl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Hl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Hl.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 Ml(this.year)}get daysInMonth(){return go(this.year,this.month)}get daysInYear(){return this.isValid?ll(this.year):NaN}get weeksInWeekYear(){return this.isValid?bo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=yn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(hn.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ii(e,Zt.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]=uo(o,l,e)}return Ws(this,{ts:s,zone:e})}else return We.invalid(Bl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ws(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=vo(e,Ku),i=!st(t.weekYear)||!st(t.weekNumber)||!st(t.weekday),s=!st(t.ordinal),l=!st(t.year),o=!st(t.month)||!st(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new tl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new tl("Can't mix ordinal dates with month/day");let u;i?u=zu({...ea(this.c),...t}):st(t.ordinal)?(u={...this.toObject(),...t},st(t.day)&&(u.day=Math.min(go(u.year,u.month),u.day))):u=Hu({...fr(this.c),...t});const[f,d]=uo(u,this.o,this.zone);return Ws(this,{ts:f,o:d})}plus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e);return Ws(this,Wu(this,t))}minus(e){if(!this.isValid)return this;const t=at.fromDurationLike(e).negate();return Ws(this,Wu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=at.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?yn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):cr}toLocaleString(e=Jr,t={}){return this.isValid?yn.create(this.loc.clone(t),e).formatDateTime(this):cr}toLocaleParts(e={}){return this.isValid?yn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=pr(this,o);return r+="T",r+=Yu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?pr(this,e==="extended"):null}toISOWeekDate(){return Ul(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":"")+Yu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Ul(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ul(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?pr(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")),Ul(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():cr}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 at.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=N0(t).map(at.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=sy(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(We.now(),e,t)}until(e){return this.isValid?Pt.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||We.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),Zu(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Zu(e.base||We.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(We.isDateTime))throw new Bn("min requires all arguments be DateTimes");return Mu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(We.isDateTime))throw new Bn("max requires all arguments be DateTimes");return Mu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Dt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return lb(o,e,t)}static fromStringExplain(e,t,i={}){return We.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Jr}static get DATE_MED(){return yg}static get DATE_MED_WITH_WEEKDAY(){return A0}static get DATE_FULL(){return kg}static get DATE_HUGE(){return wg}static get TIME_SIMPLE(){return Sg}static get TIME_WITH_SECONDS(){return $g}static get TIME_WITH_SHORT_OFFSET(){return Tg}static get TIME_WITH_LONG_OFFSET(){return Cg}static get TIME_24_SIMPLE(){return Mg}static get TIME_24_WITH_SECONDS(){return Og}static get TIME_24_WITH_SHORT_OFFSET(){return Eg}static get TIME_24_WITH_LONG_OFFSET(){return Dg}static get DATETIME_SHORT(){return Ag}static get DATETIME_SHORT_WITH_SECONDS(){return Ig}static get DATETIME_MED(){return Lg}static get DATETIME_MED_WITH_SECONDS(){return Pg}static get DATETIME_MED_WITH_WEEKDAY(){return I0}static get DATETIME_FULL(){return Ng}static get DATETIME_FULL_WITH_SECONDS(){return Fg}static get DATETIME_HUGE(){return Rg}static get DATETIME_HUGE_WITH_SECONDS(){return qg}}function Ks(n){if(We.isDateTime(n))return n;if(n&&n.valueOf&&is(n.valueOf()))return We.fromJSDate(n);if(n&&typeof n=="object")return We.fromObject(n);throw new Bn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const My=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Oy=[".mp4",".avi",".mov",".3gp",".wmv"],Ey=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Dy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class W{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static 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||W.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 W.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!W.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!W.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){W.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]=W.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(!W.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)(!W.isObject(l)&&!Array.isArray(l)||!W.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)(!W.isObject(s)&&!Array.isArray(s)||!W.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):W.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||W.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||W.isObject(e)&&Object.keys(e).length>0)&&W.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 trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=e||"",e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let s=e[i];typeof s=="string"&&(s=W.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 l in s)e=e.replace(s[l],l);return e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),W.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",W.isEmpty(s)||i.push(s);return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return We.fromFormat(e,i,{zone:"UTC"})}return We.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return W.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return W.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",W.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return!!My.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Oy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Ey.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Dy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return W.hasImageExtension(e)?"image":W.hasDocumentExtension(e)?"document":W.hasVideoExtension(e)?"video":W.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,d=r.height;return a.width=t,a.height=i,u.drawImage(r,f>d?(f-d)/2:0,0,f>d?d:f,f>d?d: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(W.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)W.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):W.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,d,p;const t=(e==null?void 0:e.schema)||[],i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!(e!=null&&e.$isView)||W.extractColumnsFromQuery((o=e==null?void 0:e.options)==null?void 0:o.query).includes("created"))&&(i.created="2022-01-01 01:00:00.123Z"),(!(e!=null&&e.$isView)||W.extractColumnsFromQuery((r=e==null?void 0:e.options)==null?void 0:r.query).includes("updated"))&&(i.updated="2022-01-01 23:59:59.456Z");for(const h of t){let g=null;h.type==="number"?g=123:h.type==="date"?g="2022-01-01 10:00:00.123Z":h.type==="bool"?g=!0:h.type==="email"?g="test@example.com":h.type==="url"?g="https://example.com":h.type==="json"?g="JSON":h.type==="file"?(g="filename.jpg",((a=h.options)==null?void 0:a.maxSelect)!==1&&(g=[g])):h.type==="select"?(g=(f=(u=h.options)==null?void 0:u.values)==null?void 0:f[0],((d=h.options)==null?void 0:d.maxSelect)!==1&&(g=[g])):h.type==="relation"?(g="RELATION_RECORD_ID",((p=h.options)==null?void 0:p.maxSelect)!==1&&(g=[g])):g="test",i[h.name]=g}return i}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=W.isObject(u)&&W.findByKey(s,"id",u.id);if(!f)return!1;for(let d in f)if(JSON.stringify(u[d])!=JSON.stringify(f[d]))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","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample direction | 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],d=u.create(a,o,f);u.add(d),e(d.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()},setup:e=>{e.on("keydown",i=>{(i.ctrlKey||i.metaKey)&&i.code=="KeyS"&&e.formElement&&(i.preventDefault(),i.stopPropagation(),e.formElement.dispatchEvent(new KeyboardEvent("keydown",i)))});const t="tinymce_last_direction";e.on("init",()=>{var s;const i=(s=window==null?void 0:window.localStorage)==null?void 0:s.getItem(t);!e.isDirty()&&e.getContent()==""&&i=="rtl"&&e.execCommand("mceDirectionRTL")}),e.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:i=>{i([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"ltr"),tinymce.activeEditor.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var l;(l=window==null?void 0:window.localStorage)==null||l.setItem(t,"rtl"),tinymce.activeEditor.execCommand("mceDirectionRTL")}}])}})}}}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"||(W.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?W.plainText(r):r,s.push(W.truncate(r))):s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","label","heading","message","key","id"];for(const o of l)if(!W.isEmpty(e[o]))return e[o];return i}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.$isView)for(let l of W.extractColumnsFromQuery(e.options.query))W.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)W.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,d,p;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s+\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!W.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((_==null?void 0:_.length)!=4)continue;const b=(d=(f=_[1])==null?void 0:f.trim())==null?void 0:d.replace(l,"");b&&t.columns.push({name:b,collate:_[2]||"",sort:((p=_[3])==null?void 0:p.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+W.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=`
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=W.parseIndex(e);return i.tableName=t,W.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=W.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?W.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Wo=Ln([]);function yo(n,e=4e3){return Yo(n,"info",e)}function Ht(n,e=3e3){return Yo(n,"success",e)}function As(n,e=4500){return Yo(n,"error",e)}function Ay(n,e=4500){return Yo(n,"warning",e)}function Yo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{_b(i)},t)};Wo.update(s=>(Ra(s,i.message),W.pushOrReplaceByKey(s,i,"message"),s))}function _b(n){Wo.update(e=>(Ra(e,n),e))}function Fa(){Wo.update(n=>{for(let e of n)Ra(n,e);return[]})}function Ra(n,e){let t;typeof e=="string"?t=W.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),W.removeByKey(n,"message",t.message))}const Ti=Ln({});function tn(n){Ti.set(n||{})}function ui(n){Ti.update(e=>(W.deleteByPath(e,n),e))}const qa=Ln({});function ta(n){qa.set(n||{})}const di=Ln([]),fi=Ln({}),ko=Ln(!1),gb=Ln({});function Iy(n){di.update(e=>{const t=W.findByKey(e,"id",n);return t?fi.set(t):e.length&&fi.set(e[0]),e})}function Ly(n){fi.update(e=>W.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),di.update(e=>(W.pushOrReplaceByKey(e,n,"id"),ja(),W.sortCollections(e)))}function Py(n){di.update(e=>(W.removeByKey(e,"id",n.id),fi.update(t=>t.id===n.id?e[0]:t),ja(),e))}async function Ny(n=null){ko.set(!0);try{let e=await de.collections.getFullList(200,{sort:"+name"});e=W.sortCollections(e),di.set(e);const t=n&&W.findByKey(e,"id",n);t?fi.set(t):e.length&&fi.set(e[0]),ja()}catch(e){de.error(e)}ko.set(!1)}function ja(){gb.update(n=>(di.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const mr="pb_admin_file_token";zo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Vi("/login")};zo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&As(l)}if(W.isEmpty(s.data)||tn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Vi("/")};zo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=z1(gb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||_g(t,10))&&(t&&localStorage.removeItem(mr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(mr,t),this._adminFileTokenRequest=null),t};class Fy extends gg{save(e,t){super.save(e,t),t instanceof rs&&ta(t)}clear(){super.clear(),ta(null)}}const de=new zo("../",new Fy("pb_admin_auth"));de.authStore.model instanceof rs&&ta(de.authStore.model);function Ry(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=n[3].default,g=kt(h,n,n[2],null);return{c(){e=y("div"),t=y("main"),g&&g.c(),i=D(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=y("span"),r.textContent="|",a=D(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.16.1",m(t,"class","page-content"),m(l,"href","https://pocketbase.io/docs/"),m(l,"target","_blank"),m(l,"rel","noopener noreferrer"),m(r,"class","delimiter"),m(f,"class","txt"),m(u,"href","https://github.com/pocketbase/pocketbase/releases"),m(u,"target","_blank"),m(u,"rel","noopener noreferrer"),m(u,"title","Releases"),m(s,"class","page-footer"),m(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(_,b){S(_,e,b),v(e,t),g&&g.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(_,[b]){g&&g.p&&(!p||b&4)&&St(g,h,_,_[2],p?wt(h,_[2],b,null):$t(_[2]),null),(!p||b&2&&d!==(d="page-wrapper "+_[1]))&&m(e,"class",d),(!p||b&3)&&x(e,"center-content",_[0])},i(_){p||(I(g,_),p=!0)},o(_){P(g,_),p=!1},d(_){_&&w(e),g&&g.d(_)}}}function qy(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 Sn extends ve{constructor(e){super(),be(this,e,qy,Ry,_e,{center:0,class:1})}}function Xu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=y("div"),m(e,"class","block txt-center m-b-lg"),m(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 jy(n){let e,t,i,s=!n[0]&&Xu();const l=n[1].default,o=kt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=D(),o&&o.c(),m(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Xu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,l,r,r[2],i?wt(l,r[2],a,null):$t(r[2]),null)},i(r){i||(I(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Vy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[jy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zy(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 bb extends ve{constructor(e){super(),be(this,e,zy,Vy,_e,{nobranding:0})}}function Ko(n){const e=n-1;return e*e*e+1}function na(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ci(n,{delay:e=0,duration:t=400,easing:i=Ko,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),[d,p]=gu(s),[h,g]=gu(l);return{delay:e,duration:t,easing:i,css:(_,b)=>`
transform: ${u} translate(${(1-_)*d}${p}, ${(1-_)*h}${g});
opacity: ${a-f*b}`}}function rt(n,{delay:e=0,duration:t=400,easing:i=Ko,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),_=parseFloat(l[`border${f[0]}Width`]),b=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*h}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*_}px;border-${u[1]}-width: ${k*b}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Ko,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:(d,p)=>`
transform: ${a} scale(${1-u*p});
opacity: ${r-f*p}
`}}let ia,Ki;const sa="app-tooltip";function Qu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Fi(){return Ki=Ki||document.querySelector("."+sa),Ki||(Ki=document.createElement("div"),Ki.classList.add(sa),document.body.appendChild(Ki)),Ki}function vb(n,e){let t=Fi();if(!t.classList.contains("active")||!(e!=null&&e.text)){la();return}t.textContent=e.text,t.className=sa+" 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 la(){clearTimeout(ia),Fi().classList.remove("active"),Fi().activeNode=void 0}function Hy(n,e){Fi().activeNode=n,clearTimeout(ia),ia=setTimeout(()=>{Fi().classList.add("active"),vb(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Qu(e);function i(){Hy(n,t)}function s(){la()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&W.isFocusable(n))&&n.addEventListener("click",s),Fi(),{update(l){var o,r;t=Qu(l),(r=(o=Fi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&vb(n,t)},destroy(){var l,o;(o=(l=Fi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&la(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function xu(n,e,t){const i=n.slice();return i[12]=e[t],i}const By=n=>({}),ef=n=>({uniqueId:n[4]});function Uy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=tf(xu(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=xu(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=tf(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function Wy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),m(t,"class","ri-error-warning-fill txt-danger"),m(e,"class","form-field-addon")},m(a,u){S(a,e,u),v(e,t),l=!0,o||(r=Ee(i=Be.call(null,t,{position:"left",text:n[3].map(wo).join(`
`)})),o=!0)},p(a,u){i&&jt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(wo).join(`
`)})},i(a){l||(a&&et(()=>{l&&(s||(s=Ve(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function tf(n){let e,t,i=wo(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=Y(i),l=D(),m(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=wo(a[12])+"")&&le(s,i)},i(a){r||(a&&et(()=>{r&&(o||(o=Ve(e,rt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,rt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function Yy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=kt(a,n,n[8],ef),f=[Wy,Uy],d=[];function p(h,g){return h[0]&&h[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=D(),s.c(),m(e,"class",n[1]),x(e,"error",n[3].length)},m(h,g){S(h,e,g),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&St(u,a,h,h[8],l?wt(a,h[8],g,By):$t(h[8]),ef);let _=i;i=p(h),i===_?d[i].p(h,g):(ue(),P(d[_],1,1,()=>{d[_]=null}),fe(),s=d[i],s?s.p(h,g):(s=d[i]=f[i](h),s.c()),I(s,1),s.m(e,null)),(!l||g&2)&&m(e,"class",h[1]),(!l||g&10)&&x(e,"error",h[3].length)},i(h){l||(I(u,h),I(s),l=!0)},o(h){P(u,h),P(s),l=!1},d(h){h&&w(e),u&&u.d(h),d[i].d(),n[11](null),o=!1,r()}}}const nf="Invalid value";function wo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||nf:n||nf}function Ky(n,e,t){let i;Ze(n,Ti,_=>t(7,i=_));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){ui(r)}Xt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function h(_){he.call(this,n,_)}function g(_){ne[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,l=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=W.toArray(W.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,h,g]}class me extends ve{constructor(e){super(),be(this,e,Ky,Yy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Jy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Email"),s=D(),l=y("input"),m(e,"for",i=n[9]),m(l,"type","email"),m(l,"autocomplete","off"),m(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&1&&l.value!==u[0]&&ae(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Zy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=Y("Password"),s=D(),l=y("input"),r=D(),a=y("div"),a.textContent="Minimum 10 characters.",m(e,"for",i=n[9]),m(l,"type","password"),m(l,"autocomplete","new-password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0,m(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ae(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&m(e,"for",i),p&512&&o!==(o=d[9])&&m(l,"id",o),p&2&&l.value!==d[1]&&ae(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Gy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Password confirm"),s=D(),l=y("input"),m(e,"for",i=n[9]),m(l,"type","password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Xy(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;return s=new me({props:{class:"form-field required",name:"email",$$slots:{default:[Jy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[Zy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Gy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),B(s.$$.fragment),l=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),u=D(),f=y("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(f,"type","submit"),m(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(g,_){S(g,e,_),v(e,t),v(e,i),z(s,e,null),v(e,l),z(o,e,null),v(e,r),z(a,e,null),v(e,u),v(e,f),d=!0,p||(h=J(e,"submit",xe(n[4])),p=!0)},p(g,[_]){const b={};_&1537&&(b.$$scope={dirty:_,ctx:g}),s.$set(b);const k={};_&1538&&(k.$$scope={dirty:_,ctx:g}),o.$set(k);const $={};_&1540&&($.$$scope={dirty:_,ctx:g}),a.$set($),(!d||_&8)&&x(f,"btn-disabled",g[3]),(!d||_&8)&&x(f,"btn-loading",g[3])},i(g){d||(I(s.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),d=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),d=!1},d(g){g&&w(e),H(s),H(o),H(a),p=!1,h()}}}function Qy(n,e,t){const i=Tt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await de.admins.create({email:s,password:l,passwordConfirm:o}),await de.admins.authWithPassword(s,l),i("submit")}catch(p){de.error(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class xy extends ve{constructor(e){super(),be(this,e,Qy,Xy,_e,{})}}function sf(n){let e,t;return e=new bb({props:{$$slots:{default:[ek]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ek(n){let e,t;return e=new xy({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p:te,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tk(n){let e,t,i=n[0]&&sf(n);return{c(){i&&i.c(),e=we()},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&&I(i,1)):(i=sf(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(ue(),P(i,1,1,()=>{i=null}),fe())},i(s){t||(I(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function nk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){de.logout(!1),t(0,i=!0);return}de.authStore.isValid?Vi("/collections"):de.logout()}return[i,async()=>{t(0,i=!1),await cn(),window.location.search=""}]}class ik extends ve{constructor(e){super(),be(this,e,nk,tk,_e,{})}}const Mt=Ln(""),So=Ln(""),Is=Ln(!1);function sk(n){let e,t,i,s;return{c(){e=y("input"),m(e,"type","text"),m(e,"id",n[8]),m(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ae(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&m(e,"placeholder",t),o&128&&e.value!==l[7]&&ae(e,l[7])},i:te,o:te,d(l){l&&w(e),n[13](null),i=!1,s()}}}function lk(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=Rt(o,r(n)),ne.push(()=>pe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=we()},m(a,u){e&&z(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],ge(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ue();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}o?(e=Rt(o,r(a)),ne.push(()=>pe(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function lf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Search</span>',m(e,"type","submit"),m(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=Ve(e,ci,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ci,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function of(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[15]),s=!0)},p:te,i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,ci,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,ci,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function ok(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[lk,sk],h=[];function g(k,$){return k[4]&&!k[5]?0:1}l=g(n),o=h[l]=p[l](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&lf(),b=(n[0].length||n[7].length)&&of(n);return{c(){e=y("form"),t=y("label"),i=y("i"),s=D(),o.c(),r=D(),_&&_.c(),a=D(),b&&b.c(),m(i,"class","ri-search-line"),m(t,"for",n[8]),m(t,"class","m-l-10 txt-xl"),m(e,"class","searchbar")},m(k,$){S(k,e,$),v(e,t),v(t,i),v(e,s),h[l].m(e,null),v(e,r),_&&_.m(e,null),v(e,a),b&&b.m(e,null),u=!0,f||(d=[J(e,"click",In(n[11])),J(e,"submit",xe(n[10]))],f=!0)},p(k,[$]){let C=l;l=g(k),l===C?h[l].p(k,$):(ue(),P(h[C],1,1,()=>{h[C]=null}),fe(),o=h[l],o?o.p(k,$):(o=h[l]=p[l](k),o.c()),I(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?_?$&129&&I(_,1):(_=lf(),_.c(),I(_,1),_.m(e,a)):_&&(ue(),P(_,1,1,()=>{_=null}),fe()),k[0].length||k[7].length?b?(b.p(k,$),$&129&&I(b,1)):(b=of(k),b.c(),I(b,1),b.m(e,null)):b&&(ue(),P(b,1,1,()=>{b=null}),fe())},i(k){u||(I(o),I(_),I(b),u=!0)},o(k){P(o),P(_),P(b),u=!1},d(k){k&&w(e),h[l].d(),_&&_.d(),b&&b.d(),f=!1,De(d)}}}function rk(n,e,t){const i=Tt(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=new kn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,d,p="";function h(O=!0){t(7,p=""),O&&(d==null||d.focus()),i("clear")}function g(){t(0,l=p),i("submit",l)}async function _(){u||f||(t(5,f=!0),t(4,u=(await ut(()=>import("./FilterAutocompleteInput-da38bd6a.js"),["./FilterAutocompleteInput-da38bd6a.js","./index-8b57b6cd.js"],import.meta.url)).default),t(5,f=!1))}Xt(()=>{_()});function b(O){he.call(this,n,O)}function k(O){p=O,t(7,p),t(0,l)}function $(O){ne[O?"unshift":"push"](()=>{d=O,t(6,d)})}function C(){p=this.value,t(7,p),t(0,l)}const T=()=>{h(!1),g()};return n.$$set=O=>{"value"in O&&t(0,l=O.value),"placeholder"in O&&t(1,o=O.placeholder),"autocompleteCollection"in O&&t(2,r=O.autocompleteCollection),"extraAutocompleteKeys"in O&&t(3,a=O.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,p=l)},[l,o,r,a,u,f,d,p,s,h,g,b,k,$,C,T]}class Jo extends ve{constructor(e){super(),be(this,e,rk,ok,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function ak(n){let e,t,i,s,l,o;return{c(){e=y("button"),t=y("i"),m(t,"class","ri-refresh-line svelte-1bvelc2"),m(e,"type","button"),m(e,"aria-label","Refresh"),m(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){S(r,e,a),v(e,t),l||(o=[Ee(s=Be.call(null,e,n[0])),J(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&m(e,"class",i),s&&jt(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:te,o:te,d(r){r&&w(e),l=!1,De(o)}}}function uk(n,e,t){const i=Tt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Xt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Zo extends ve{constructor(e){super(),be(this,e,uk,ak,_e,{tooltip:0,class:1})}}function fk(n){let e,t,i,s,l;const o=n[6].default,r=kt(o,n,n[5],null);return{c(){e=y("th"),r&&r.c(),m(e,"tabindex","0"),m(e,"title",n[2]),m(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[J(e,"click",n[7]),J(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&St(r,o,a,a[5],i?wt(o,a[5],u,null):$t(a[5]),null),(!i||u&4)&&m(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&m(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(I(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,De(l)}}}function ck(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(),d=p=>{(p.code==="Enter"||p.code==="Space")&&(p.preventDefault(),u())};return n.$$set=p=>{"class"in p&&t(1,l=p.class),"name"in p&&t(2,o=p.name),"sort"in p&&t(0,r=p.sort),"disable"in p&&t(3,a=p.disable),"$$scope"in p&&t(5,s=p.$$scope)},[r,l,o,a,u,s,i,f,d]}class un extends ve{constructor(e){super(),be(this,e,ck,fk,_e,{class:1,name:2,sort:0,disable:3})}}function dk(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function pk(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("div"),i=Y(n[2]),s=D(),l=y("div"),o=Y(n[1]),r=Y(" UTC"),m(t,"class","date"),m(l,"class","time svelte-zdiknu"),m(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(e,s),v(e,l),v(l,o),v(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function mk(n){let e;function t(l,o){return l[0]?pk:dk}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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:te,o:te,d(l){s.d(l),l&&w(e)}}}function hk(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 $i extends ve{constructor(e){super(),be(this,e,hk,mk,_e,{date:0})}}const _k=n=>({}),rf=n=>({}),gk=n=>({}),af=n=>({});function bk(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=kt(u,n,n[4],af),d=n[5].default,p=kt(d,n,n[4],null),h=n[5].after,g=kt(h,n,n[4],rf);return{c(){e=y("div"),f&&f.c(),t=D(),i=y("div"),p&&p.c(),l=D(),g&&g.c(),m(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),m(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(_,b){S(_,e,b),f&&f.m(e,null),v(e,t),v(e,i),p&&p.m(i,null),n[6](i),v(e,l),g&&g.m(e,null),o=!0,r||(a=[J(window,"resize",n[1]),J(i,"scroll",n[1])],r=!0)},p(_,[b]){f&&f.p&&(!o||b&16)&&St(f,u,_,_[4],o?wt(u,_[4],b,gk):$t(_[4]),af),p&&p.p&&(!o||b&16)&&St(p,d,_,_[4],o?wt(d,_[4],b,null):$t(_[4]),null),(!o||b&9&&s!==(s="horizontal-scroller "+_[0]+" "+_[3]+" svelte-wc2j9h"))&&m(i,"class",s),g&&g.p&&(!o||b&16)&&St(g,h,_,_[4],o?wt(h,_[4],b,_k):$t(_[4]),rf)},i(_){o||(I(f,_),I(p,_),I(g,_),o=!0)},o(_){P(f,_),P(p,_),P(g,_),o=!1},d(_){_&&w(e),f&&f.d(_),p&&p.d(_),n[6](null),g&&g.d(_),r=!1,De(a)}}}function vk(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 p=o.offsetWidth,h=o.scrollWidth;h-p?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+p==h&&t(3,r+=" scroll-end")):t(3,r="")},100))}Xt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function d(p){ne[p?"unshift":"push"](()=>{o=p,t(2,o)})}return n.$$set=p=>{"class"in p&&t(0,l=p.class),"$$scope"in p&&t(4,s=p.$$scope)},[l,f,o,r,s,i,d]}class Va extends ve{constructor(e){super(),be(this,e,vk,bk,_e,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function uf(n,e,t){const i=n.slice();return i[23]=e[t],i}function yk(n){let e;return{c(){e=y("div"),e.innerHTML=`<i class="ri-global-line"></i>
<span class="txt">Method</span>`,m(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function kk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="URL",m(t,"class",W.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function wk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Referer",m(t,"class",W.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function Sk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="User IP",m(t,"class",W.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function $k(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Status",m(t,"class",W.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function Tk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Created",m(t,"class",W.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function ff(n){let e;function t(l,o){return l[6]?Mk:Ck}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 Ck(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&cf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=cf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Mk(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function cf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function df(n){let e;return{c(){e=y("i"),m(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),m(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pf(n,e){var Oe,Ge,_t;let t,i,s,l=((Oe=e[23].method)==null?void 0:Oe.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,h,g,_,b,k,$=(e[23].referer||"N/A")+"",C,T,O,M,E,A=(e[23].userIp||"N/A")+"",L,N,R,F,q,V=e[23].status+"",U,j,Q,X,Z,re,ee,se,ye,$e,ze=(((Ge=e[23].meta)==null?void 0:Ge.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&df();X=new $i({props:{date:e[23].created}});function Ue(){return e[17](e[23])}function Se(...Xe){return e[18](e[23],...Xe)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=Y(l),a=D(),u=y("td"),f=y("span"),p=Y(d),g=D(),ze&&ze.c(),_=D(),b=y("td"),k=y("span"),C=Y($),O=D(),M=y("td"),E=y("span"),L=Y(A),R=D(),F=y("td"),q=y("span"),U=Y(V),j=D(),Q=y("td"),B(X.$$.fragment),Z=D(),re=y("td"),re.innerHTML='<i class="ri-arrow-right-line"></i>',ee=D(),m(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),m(i,"class","col-type-text col-field-method min-width"),m(f,"class","txt txt-ellipsis"),m(f,"title",h=e[23].url),m(u,"class","col-type-text col-field-url"),m(k,"class","txt txt-ellipsis"),m(k,"title",T=e[23].referer),x(k,"txt-hint",!e[23].referer),m(b,"class","col-type-text col-field-referer"),m(E,"class","txt txt-ellipsis"),m(E,"title",N=e[23].userIp),x(E,"txt-hint",!e[23].userIp),m(M,"class","col-type-number col-field-userIp"),m(q,"class","label"),x(q,"label-danger",e[23].status>=400),m(F,"class","col-type-number col-field-status"),m(Q,"class","col-type-date col-field-created"),m(re,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Xe,Ke){S(Xe,t,Ke),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,g),ze&&ze.m(u,null),v(t,_),v(t,b),v(b,k),v(k,C),v(t,O),v(t,M),v(M,E),v(E,L),v(t,R),v(t,F),v(F,q),v(q,U),v(t,j),v(t,Q),z(X,Q,null),v(t,Z),v(t,re),v(t,ee),se=!0,ye||($e=[J(t,"click",Ue),J(t,"keydown",Se)],ye=!0)},p(Xe,Ke){var ce,He,At;e=Xe,(!se||Ke&8)&&l!==(l=((ce=e[23].method)==null?void 0:ce.toUpperCase())+"")&&le(o,l),(!se||Ke&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!se||Ke&8)&&d!==(d=e[23].url+"")&&le(p,d),(!se||Ke&8&&h!==(h=e[23].url))&&m(f,"title",h),(He=e[23].meta)!=null&&He.errorMessage||(At=e[23].meta)!=null&&At.errorData?ze||(ze=df(),ze.c(),ze.m(u,null)):ze&&(ze.d(1),ze=null),(!se||Ke&8)&&$!==($=(e[23].referer||"N/A")+"")&&le(C,$),(!se||Ke&8&&T!==(T=e[23].referer))&&m(k,"title",T),(!se||Ke&8)&&x(k,"txt-hint",!e[23].referer),(!se||Ke&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(L,A),(!se||Ke&8&&N!==(N=e[23].userIp))&&m(E,"title",N),(!se||Ke&8)&&x(E,"txt-hint",!e[23].userIp),(!se||Ke&8)&&V!==(V=e[23].status+"")&&le(U,V),(!se||Ke&8)&&x(q,"label-danger",e[23].status>=400);const Te={};Ke&8&&(Te.date=e[23].created),X.$set(Te)},i(Xe){se||(I(X.$$.fragment,Xe),se=!0)},o(Xe){P(X.$$.fragment,Xe),se=!1},d(Xe){Xe&&w(t),ze&&ze.d(),H(X),ye=!1,De($e)}}}function Ok(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L=[],N=new Map,R;function F(Se){n[11](Se)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[yk]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new un({props:q}),ne.push(()=>pe(s,"sort",F));function V(Se){n[12](Se)}let U={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[kk]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),r=new un({props:U}),ne.push(()=>pe(r,"sort",V));function j(Se){n[13](Se)}let Q={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[wk]},$$scope:{ctx:n}};n[1]!==void 0&&(Q.sort=n[1]),f=new un({props:Q}),ne.push(()=>pe(f,"sort",j));function X(Se){n[14](Se)}let Z={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Sk]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),h=new un({props:Z}),ne.push(()=>pe(h,"sort",X));function re(Se){n[15](Se)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[$k]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),b=new un({props:ee}),ne.push(()=>pe(b,"sort",re));function se(Se){n[16](Se)}let ye={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Tk]},$$scope:{ctx:n}};n[1]!==void 0&&(ye.sort=n[1]),C=new un({props:ye}),ne.push(()=>pe(C,"sort",se));let $e=n[3];const ze=Se=>Se[23].id;for(let Se=0;Se<$e.length;Se+=1){let Oe=uf(n,$e,Se),Ge=ze(Oe);N.set(Ge,L[Se]=pf(Ge,Oe))}let Ue=null;return $e.length||(Ue=ff(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),B(s.$$.fragment),o=D(),B(r.$$.fragment),u=D(),B(f.$$.fragment),p=D(),B(h.$$.fragment),_=D(),B(b.$$.fragment),$=D(),B(C.$$.fragment),O=D(),M=y("th"),E=D(),A=y("tbody");for(let Se=0;Se<L.length;Se+=1)L[Se].c();Ue&&Ue.c(),m(M,"class","col-type-action min-width"),m(e,"class","table"),x(e,"table-loading",n[6])},m(Se,Oe){S(Se,e,Oe),v(e,t),v(t,i),z(s,i,null),v(i,o),z(r,i,null),v(i,u),z(f,i,null),v(i,p),z(h,i,null),v(i,_),z(b,i,null),v(i,$),z(C,i,null),v(i,O),v(i,M),v(e,E),v(e,A);for(let Ge=0;Ge<L.length;Ge+=1)L[Ge]&&L[Ge].m(A,null);Ue&&Ue.m(A,null),R=!0},p(Se,Oe){const Ge={};Oe&67108864&&(Ge.$$scope={dirty:Oe,ctx:Se}),!l&&Oe&2&&(l=!0,Ge.sort=Se[1],ge(()=>l=!1)),s.$set(Ge);const _t={};Oe&67108864&&(_t.$$scope={dirty:Oe,ctx:Se}),!a&&Oe&2&&(a=!0,_t.sort=Se[1],ge(()=>a=!1)),r.$set(_t);const Xe={};Oe&67108864&&(Xe.$$scope={dirty:Oe,ctx:Se}),!d&&Oe&2&&(d=!0,Xe.sort=Se[1],ge(()=>d=!1)),f.$set(Xe);const Ke={};Oe&67108864&&(Ke.$$scope={dirty:Oe,ctx:Se}),!g&&Oe&2&&(g=!0,Ke.sort=Se[1],ge(()=>g=!1)),h.$set(Ke);const Te={};Oe&67108864&&(Te.$$scope={dirty:Oe,ctx:Se}),!k&&Oe&2&&(k=!0,Te.sort=Se[1],ge(()=>k=!1)),b.$set(Te);const ce={};Oe&67108864&&(ce.$$scope={dirty:Oe,ctx:Se}),!T&&Oe&2&&(T=!0,ce.sort=Se[1],ge(()=>T=!1)),C.$set(ce),Oe&841&&($e=Se[3],ue(),L=vt(L,Oe,ze,1,Se,$e,N,A,Ut,pf,null,uf),fe(),!$e.length&&Ue?Ue.p(Se,Oe):$e.length?Ue&&(Ue.d(1),Ue=null):(Ue=ff(Se),Ue.c(),Ue.m(A,null))),(!R||Oe&64)&&x(e,"table-loading",Se[6])},i(Se){if(!R){I(s.$$.fragment,Se),I(r.$$.fragment,Se),I(f.$$.fragment,Se),I(h.$$.fragment,Se),I(b.$$.fragment,Se),I(C.$$.fragment,Se);for(let Oe=0;Oe<$e.length;Oe+=1)I(L[Oe]);R=!0}},o(Se){P(s.$$.fragment,Se),P(r.$$.fragment,Se),P(f.$$.fragment,Se),P(h.$$.fragment,Se),P(b.$$.fragment,Se),P(C.$$.fragment,Se);for(let Oe=0;Oe<L.length;Oe+=1)P(L[Oe]);R=!1},d(Se){Se&&w(e),H(s),H(r),H(f),H(h),H(b),H(C);for(let Oe=0;Oe<L.length;Oe+=1)L[Oe].d();Ue&&Ue.d()}}}function mf(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=y("small"),t=Y("Showing "),s=Y(i),l=Y(" of "),o=Y(n[4]),m(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),v(e,t),v(e,s),v(e,l),v(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 hf(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=y("div"),t=y("button"),i=y("span"),s=Y("Load more ("),o=Y(l),r=Y(")"),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[6]),x(t,"btn-disabled",n[6]),m(e,"class","block txt-center m-t-xs")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(i,s),v(i,o),v(i,r),a||(u=J(t,"click",n[20]),a=!0)},p(f,d){d&24&&l!==(l=f[4]-f[3].length+"")&&le(o,l),d&64&&x(t,"btn-loading",f[6]),d&64&&x(t,"btn-disabled",f[6])},d(f){f&&w(e),a=!1,u()}}}function Ek(n){let e,t,i,s,l;e=new Va({props:{class:"table-wrapper",$$slots:{default:[Ok]},$$scope:{ctx:n}}});let o=n[3].length&&mf(n),r=n[3].length&&n[7]&&hf(n);return{c(){B(e.$$.fragment),t=D(),o&&o.c(),i=D(),r&&r.c(),s=we()},m(a,u){z(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=mf(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=hf(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(I(e.$$.fragment,a),l=!0)},o(a){P(e.$$.fragment,a),l=!1},d(a){H(e,a),a&&w(t),o&&o.d(a),a&&w(i),r&&r.d(a),a&&w(s)}}}function Dk(n,e,t){let i;const s=Tt(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,d=0,p=!1,h=0;async function g(N=1,R=!0){return t(6,p=!0),de.logs.getRequestsList(N,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async F=>{if(N<=1&&_(),t(6,p=!1),t(5,f=F.page),t(4,d=F.totalItems),s("load",u.concat(F.items)),R){const q=++h;for(;F.items.length&&h==q;)t(3,u=u.concat(F.items.splice(0,10))),await W.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,p=!1),console.warn(F),_(),de.error(F,!1))})}function _(){t(3,u=[]),t(5,f=1),t(4,d=0)}function b(N){a=N,t(1,a)}function k(N){a=N,t(1,a)}function $(N){a=N,t(1,a)}function C(N){a=N,t(1,a)}function T(N){a=N,t(1,a)}function O(N){a=N,t(1,a)}const M=N=>s("select",N),E=(N,R)=>{R.code==="Enter"&&(R.preventDefault(),s("select",N))},A=()=>t(0,o=""),L=()=>g(f+1);return n.$$set=N=>{"filter"in N&&t(0,o=N.filter),"presets"in N&&t(10,r=N.presets),"sort"in N&&t(1,a=N.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(_(),g(1)),n.$$.dirty&24&&t(7,i=d>u.length)},[o,a,g,u,d,f,p,i,s,l,r,b,k,$,C,T,O,M,E,A,L]}class Ak extends ve{constructor(e){super(),be(this,e,Dk,Ek,_e,{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 hi(){}const Ik=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function Ct(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 nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return Bt(n)?n:e}function lt(n,e){return typeof n>"u"?e:n}const Lk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,yb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Nt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(Ct(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(nt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function $o(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 To(n){if(Ct(n))return n.map(To);if(nt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=To(n[t[s]]);return e}return n}function kb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Pk(n,e,t,i){if(!kb(n))return;const s=e[n],l=t[n];nt(s)&&nt(l)?_l(s,l,i):e[n]=To(l)}function _l(n,e,t){const i=Ct(e)?e:[e],s=i.length;if(!nt(n))return n;t=t||{};const l=t.merger||Pk;for(let o=0;o<s;++o){if(e=i[o],!nt(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 rl(n,e){return _l(n,e,{merger:Nk})}function Nk(n,e,t){if(!kb(n))return;const i=e[n],s=t[n];nt(i)&&nt(s)?rl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=To(s))}const _f={"":n=>n,x:n=>n.x,y:n=>n.y};function qi(n,e){return(_f[e]||(_f[e]=Fk(e)))(n)}function Fk(n){const e=Rk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Rk(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 za(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n<"u",ji=n=>typeof n=="function",gf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function qk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const qt=Math.PI,bt=2*qt,jk=bt+qt,Co=Number.POSITIVE_INFINITY,Vk=qt/180,Ft=qt/2,Js=qt/4,bf=qt*2/3,Un=Math.log10,ri=Math.sign;function vf(n){const e=Math.round(n);n=al(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Un(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zk(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 Ls(n){return!isNaN(parseFloat(n))&&isFinite(n)}function al(n,e,t){return Math.abs(n-e)<t}function Hk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function wb(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 Qn(n){return n*(qt/180)}function Ha(n){return n*(180/qt)}function yf(n){if(!Bt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Sb(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*qt&&(l+=bt),{angle:l,distance:s}}function oa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Bk(n,e){return(n-e+jk)%bt-qt}function En(n){return(n%bt+bt)%bt}function gl(n,e,t,i){const s=En(n),l=En(e),o=En(t),r=En(l-s),a=En(o-s),u=En(s-l),f=En(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function fn(n,e,t){return Math.max(e,Math.min(t,n))}function Uk(n){return fn(n,-32768,32767)}function bl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ba(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 ts=(n,e,t,i)=>Ba(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Wk=(n,e,t)=>Ba(n,t,i=>n[i][e]>=t);function Yk(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 $b=["push","pop","shift","splice","unshift"];function Kk(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),$b.forEach(t=>{const i="_onData"+za(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 kf(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)&&($b.forEach(l=>{delete n[l]}),delete n._chartjs)}function Tb(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 Cb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Mb(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,Cb.call(window,()=>{s=!1,n.apply(e,l)}))}}function Jk(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Zk=n=>n==="start"?"left":n==="end"?"right":"center",wf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Ob(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:d,maxDefined:p}=o.getUserBounds();d&&(s=fn(Math.min(ts(r,o.axis,u).lo,t?i:ts(e,a,o.getPixelForValue(u)).lo),0,i-1)),p?l=fn(Math.max(ts(r,o.axis,f,!0).hi+1,t?0:ts(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Eb(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 Wl=n=>n===0||n===1,Sf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*bt/t)),$f=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*bt/t)+1,ul={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*Ft)+1,easeOutSine:n=>Math.sin(n*Ft),easeInOutSine:n=>-.5*(Math.cos(qt*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=>Wl(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=>Wl(n)?n:Sf(n,.075,.3),easeOutElastic:n=>Wl(n)?n:$f(n,.075,.3),easeInOutElastic(n){return Wl(n)?n:n<.5?.5*Sf(n*2,.1125,.45):.5+.5*$f(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-ul.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?ul.easeInBounce(n*2)*.5:ul.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 Al(n){return n+.5|0}const Li=(n,e,t)=>Math.max(Math.min(n,t),e);function il(n){return Li(Al(n*2.55),0,255)}function Ri(n){return Li(Al(n*255),0,255)}function bi(n){return Li(Al(n/2.55)/100,0,1)}function Tf(n){return Li(Al(n*100),0,100)}const qn={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},ra=[..."0123456789ABCDEF"],Gk=n=>ra[n&15],Xk=n=>ra[(n&240)>>4]+ra[n&15],Yl=n=>(n&240)>>4===(n&15),Qk=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function xk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&qn[n[1]]*17,g:255&qn[n[2]]*17,b:255&qn[n[3]]*17,a:e===5?qn[n[4]]*17:255}:(e===7||e===9)&&(t={r:qn[n[1]]<<4|qn[n[2]],g:qn[n[3]]<<4|qn[n[4]],b:qn[n[5]]<<4|qn[n[6]],a:e===9?qn[n[7]]<<4|qn[n[8]]:255})),t}const e2=(n,e)=>n<255?e(n):"";function t2(n){var e=Qk(n)?Gk:Xk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+e2(n.a,e):void 0}const n2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Db(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 i2(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 s2(n,e,t){const i=Db(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 l2(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 Ua(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=l2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Wa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Ya(n,e,t){return Wa(Db,n,e,t)}function o2(n,e,t){return Wa(s2,n,e,t)}function r2(n,e,t){return Wa(i2,n,e,t)}function Ab(n){return(n%360+360)%360}function a2(n){const e=n2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?il(+e[5]):Ri(+e[5]));const s=Ab(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=o2(s,l,o):e[1]==="hsv"?i=r2(s,l,o):i=Ya(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function u2(n,e){var t=Ua(n);t[0]=Ab(t[0]+e),t=Ya(t),n.r=t[0],n.g=t[1],n.b=t[2]}function f2(n){if(!n)return;const e=Ua(n),t=e[0],i=Tf(e[1]),s=Tf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${bi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Cf={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 c2(){const n={},e=Object.keys(Mf),t=Object.keys(Cf);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,Cf[l]);l=parseInt(Mf[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Kl;function d2(n){Kl||(Kl=c2(),Kl.transparent=[0,0,0,0]);const e=Kl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const p2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function m2(n){const e=p2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?il(o):Li(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?il(i):Li(i,0,255)),s=255&(e[4]?il(s):Li(s,0,255)),l=255&(e[6]?il(l):Li(l,0,255)),{r:i,g:s,b:l,a:t}}}function h2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${bi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const hr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,vs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function _2(n,e,t){const i=vs(bi(n.r)),s=vs(bi(n.g)),l=vs(bi(n.b));return{r:Ri(hr(i+t*(vs(bi(e.r))-i))),g:Ri(hr(s+t*(vs(bi(e.g))-s))),b:Ri(hr(l+t*(vs(bi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Jl(n,e,t){if(n){let i=Ua(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Ya(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ib(n,e){return n&&Object.assign(e||{},n)}function Of(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=Ri(n[3]))):(e=Ib(n,{r:0,g:0,b:0,a:1}),e.a=Ri(e.a)),e}function g2(n){return n.charAt(0)==="r"?m2(n):a2(n)}class Mo{constructor(e){if(e instanceof Mo)return e;const t=typeof e;let i;t==="object"?i=Of(e):t==="string"&&(i=xk(e)||d2(e)||g2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Ib(this._rgb);return e&&(e.a=bi(e.a)),e}set rgb(e){this._rgb=Of(e)}rgbString(){return this._valid?h2(this._rgb):void 0}hexString(){return this._valid?t2(this._rgb):void 0}hslString(){return this._valid?f2(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=_2(this._rgb,e._rgb,t)),this}clone(){return new Mo(this.rgb)}alpha(e){return this._rgb.a=Ri(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(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 Jl(this._rgb,2,e),this}darken(e){return Jl(this._rgb,2,-e),this}saturate(e){return Jl(this._rgb,1,e),this}desaturate(e){return Jl(this._rgb,1,-e),this}rotate(e){return u2(this._rgb,e),this}}function Lb(n){return new Mo(n)}function Pb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ef(n){return Pb(n)?n:Lb(n)}function _r(n){return Pb(n)?n:Lb(n).saturate(.5).darken(.1).hexString()}const as=Object.create(null),aa=Object.create(null);function fl(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 gr(n,e,t){return typeof e=="string"?_l(fl(n,e),t):_l(fl(n,""),e)}class b2{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)=>_r(i.backgroundColor),this.hoverBorderColor=(t,i)=>_r(i.borderColor),this.hoverColor=(t,i)=>_r(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 gr(this,e,t)}get(e){return fl(this,e)}describe(e,t){return gr(aa,e,t)}override(e,t){return gr(as,e,t)}route(e,t,i,s){const l=fl(this,e),o=fl(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 nt(a)?Object.assign({},u,a):lt(a,u)},set(a){this[r]=a}}})}}var ot=new b2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function v2(n){return!n||dt(n.size)||dt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Oo(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 y2(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,d,p;for(a=0;a<r;a++)if(d=t[a],d!=null&&Ct(d)!==!0)o=Oo(n,s,l,o,d);else if(Ct(d))for(u=0,f=d.length;u<f;u++)p=d[u],p!=null&&!Ct(p)&&(o=Oo(n,s,l,o,p));n.restore();const h=l.length/2;if(h>t.length){for(a=0;a<h;a++)delete s[l[a]];l.splice(0,h)}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 Df(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function ua(n,e,t,i){k2(n,e,t,i,null)}function k2(n,e,t,i,s){let l,o,r,a,u,f;const d=e.pointStyle,p=e.rotation,h=e.radius;let g=(p||0)*Vk;if(d&&typeof d=="object"&&(l=d.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),n.restore();return}if(!(isNaN(h)||h<=0)){switch(n.beginPath(),d){default:s?n.ellipse(t,i,s/2,h,0,0,bt):n.arc(t,i,h,0,bt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=bf,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=bf,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),n.closePath();break;case"rectRounded":u=h*.516,a=h-u,o=Math.cos(g+Js)*a,r=Math.sin(g+Js)*a,n.arc(t-o,i-r,u,g-qt,g-Ft),n.arc(t+r,i-o,u,g-Ft,g),n.arc(t+o,i+r,u,g,g+Ft),n.arc(t-r,i+o,u,g+Ft,g+qt),n.closePath();break;case"rect":if(!p){a=Math.SQRT1_2*h,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}g+=Js;case"rectRot":o=Math.cos(g)*h,r=Math.sin(g)*h,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":g+=Js;case"cross":o=Math.cos(g)*h,r=Math.sin(g)*h,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(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),g+=Js,o=Math.cos(g)*h,r=Math.sin(g)*h,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(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*h,i+Math.sin(g)*h);break}n.fill(),e.borderWidth>0&&n.stroke()}}function vl(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 Ka(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Ja(n){n.restore()}function w2(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 S2(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 Eo(n,e,t,i,s,l={}){const o=Ct(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,$2(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),dt(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),T2(n,t,i,u,l),i+=s.lineHeight;n.restore()}function $2(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),dt(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 T2(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Do(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-Ft,qt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,qt,Ft,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,Ft,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-Ft,!0),n.lineTo(t+o.topLeft,i)}const C2=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),M2=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function O2(n,e){const t=(""+n).match(C2);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 E2=n=>+n||0;function Za(n,e){const t={},i=nt(e),s=i?Object.keys(e):e,l=nt(n)?i?o=>lt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=E2(l(o));return t}function Nb(n){return Za(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Cs(n){return Za(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Kn(n){const e=Nb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Dn(n,e){n=n||{},e=e||ot.font;let t=lt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=lt(n.style,e.style);i&&!(""+i).match(M2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:lt(n.family,e.family),lineHeight:O2(lt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:lt(n.weight,e.weight),string:""};return s.string=v2(s),s}function Zl(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&&Ct(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function D2(n,e,t){const{min:i,max:s}=n,l=yb(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 zi(n,e){return Object.assign(Object.create(n),e)}function Ga(n,e=[""],t=n,i,s=()=>n[0]){Yn(i)||(i=jb("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ga([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 Rb(o,r,()=>q2(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return If(o).includes(r)},ownKeys(o){return If(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ps(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:Fb(n,i),setContext:l=>Ps(n,l,t,i),override:l=>Ps(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 Rb(l,o,()=>I2(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 Fb(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:ji(t)?t:()=>t,isIndexable:ji(i)?i:()=>i}}const A2=(n,e)=>n?n+za(e):e,Xa=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Rb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function I2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ji(r)&&o.isScriptable(e)&&(r=L2(e,r,n,t)),Ct(r)&&r.length&&(r=P2(e,r,n,o.isIndexable)),Xa(e,r)&&(r=Ps(r,s,l&&l[e],o)),r}function L2(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),Xa(n,e)&&(e=Qa(s._scopes,s,n,e)),e}function P2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Yn(l.index)&&i(n))e=e[l.index%e.length];else if(nt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const d=Qa(u,s,n,f);e.push(Ps(d,l,o&&o[n],r))}}return e}function qb(n,e,t){return ji(n)?n(e,t):n}const N2=(n,e)=>n===!0?e:typeof n=="string"?qi(e,n):void 0;function F2(n,e,t,i,s){for(const l of e){const o=N2(t,l);if(o){n.add(o);const r=qb(o._fallback,t,s);if(Yn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Yn(i)&&t!==i)return null}return!1}function Qa(n,e,t,i){const s=e._rootScopes,l=qb(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Af(r,o,t,l||t,i);return a===null||Yn(l)&&l!==t&&(a=Af(r,o,l,a,i),a===null)?!1:Ga(Array.from(r),[""],s,l,()=>R2(e,t,i))}function Af(n,e,t,i,s){for(;t;)t=F2(n,e,t,i,s);return t}function R2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ct(s)&&nt(t)?t:s}function q2(n,e,t,i){let s;for(const l of e)if(s=jb(A2(l,n),t),Yn(s))return Xa(n,s)?Qa(t,i,n,s):s}function jb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Yn(i))return i}}function If(n){let e=n._keys;return e||(e=n._keys=j2(n._scopes)),e}function j2(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 Vb(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(qi(f,l),u)};return o}const V2=Number.EPSILON||1e-14,Ns=(n,e)=>e<n.length&&!n[e].skip&&n[e],zb=n=>n==="x"?"y":"x";function z2(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=oa(l,s),a=oa(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const d=i*u,p=i*f;return{previous:{x:l.x-d*(o.x-s.x),y:l.y-d*(o.y-s.y)},next:{x:l.x+p*(o.x-s.x),y:l.y+p*(o.y-s.y)}}}function H2(n,e,t){const i=n.length;let s,l,o,r,a,u=Ns(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Ns(n,f+1),!(!a||!u)){if(al(e[f],0,V2)){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 B2(n,e,t="x"){const i=zb(t),s=n.length;let l,o,r,a=Ns(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Ns(n,u+1),!r)continue;const f=r[t],d=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=d-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=d+l*e[u])}}function U2(n,e="x"){const t=zb(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Ns(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Ns(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?ri(s[o-1])!==ri(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}H2(n,s,l),B2(n,l,e)}function Gl(n,e,t){return Math.max(Math.min(n,t),e)}function W2(n,e){let t,i,s,l,o,r=vl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&vl(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Gl(s.cp1x,e.left,e.right),s.cp1y=Gl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Gl(s.cp2x,e.left,e.right),s.cp2y=Gl(s.cp2y,e.top,e.bottom)))}function Y2(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")U2(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=z2(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&&W2(n,t)}function Hb(){return typeof window<"u"&&typeof document<"u"}function xa(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ao(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 Go=n=>window.getComputedStyle(n,null);function K2(n,e){return Go(n).getPropertyValue(e)}const J2=["top","right","bottom","left"];function ss(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 Z2=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function G2(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Z2(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 Qi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Go(t),l=s.boxSizing==="border-box",o=ss(s,"padding"),r=ss(s,"border","width"),{x:a,y:u,box:f}=G2(n,t),d=o.left+(f&&r.left),p=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-d)/h*t.width/i),y:Math.round((u-p)/g*t.height/i)}}function X2(n,e,t){let i,s;if(e===void 0||t===void 0){const l=xa(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Go(l),a=ss(r,"border","width"),u=ss(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ao(r.maxWidth,l,"clientWidth"),s=Ao(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||Co,maxHeight:s||Co}}const br=n=>Math.round(n*10)/10;function Q2(n,e,t,i){const s=Go(n),l=ss(s,"margin"),o=Ao(s.maxWidth,n,"clientWidth")||Co,r=Ao(s.maxHeight,n,"clientHeight")||Co,a=X2(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const d=ss(s,"border","width"),p=ss(s,"padding");u-=p.width+d.width,f-=p.height+d.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=br(Math.min(u,o,a.maxWidth)),f=br(Math.min(f,r,a.maxHeight)),u&&!f&&(f=br(u/2)),{width:u,height:f}}function Lf(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 x2=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 Pf(n,e){const t=K2(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function xi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function ew(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 tw(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=xi(n,s,t),r=xi(s,l,t),a=xi(l,e,t),u=xi(o,r,t),f=xi(r,a,t);return xi(u,f,t)}const Nf=new Map;function nw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Nf.get(t);return i||(i=new Intl.NumberFormat(n,e),Nf.set(t,i)),i}function Il(n,e,t){return nw(e,t).format(n)}const iw=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}}},sw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function vr(n,e,t){return n?iw(e,t):sw()}function lw(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 ow(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Bb(n){return n==="angle"?{between:gl,compare:Bk,normalize:En}:{between:bl,compare:(e,t)=>e-t,normalize:e=>e}}function Ff({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 rw(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Bb(i),a=e.length;let{start:u,end:f,loop:d}=n,p,h;if(d){for(u+=a,f+=a,p=0,h=a;p<h&&o(r(e[u%a][i]),s,l);++p)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:d,style:n.style}}function Ub(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=Bb(i),{start:f,end:d,loop:p,style:h}=rw(n,e,t),g=[];let _=!1,b=null,k,$,C;const T=()=>a(s,C,k)&&r(s,C)!==0,O=()=>r(l,k)===0||a(l,C,k),M=()=>_||T(),E=()=>!_||O();for(let A=f,L=f;A<=d;++A)$=e[A%o],!$.skip&&(k=u($[i]),k!==C&&(_=a(k,s,l),b===null&&M()&&(b=r(k,s)===0?A:L),b!==null&&E()&&(g.push(Ff({start:b,end:A,loop:p,count:o,style:h})),b=null),L=A,C=k));return b!==null&&g.push(Ff({start:b,end:d,loop:p,count:o,style:h})),g}function Wb(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=Ub(i[s],n.points,e);l.length&&t.push(...l)}return t}function aw(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 uw(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 fw(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=aw(t,s,l,i);if(i===!0)return Rf(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 Rf(n,uw(t,o,a,u),t,e)}function Rf(n,e,t,i){return!i||!i.setContext||!t?e:cw(n,e,t,i)}function cw(n,e,t,i){const s=n._chart.getContext(),l=qf(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,d=e[0].start,p=d;function h(g,_,b,k){const $=r?-1:1;if(g!==_){for(g+=a;t[g%a].skip;)g-=$;for(;t[_%a].skip;)_+=$;g%a!==_%a&&(u.push({start:g%a,end:_%a,loop:b,style:k}),f=k,d=_%a)}}for(const g of e){d=r?d:g.start;let _=t[d%a],b;for(p=d+1;p<=g.end;p++){const k=t[p%a];b=qf(i.setContext(zi(s,{type:"segment",p0:_,p1:k,p0DataIndex:(p-1)%a,p1DataIndex:p%a,datasetIndex:o}))),dw(b,f)&&h(d,p-1,g.loop,f),_=k,f=b}d<p-1&&h(d,p-1,g.loop,f)}return u}function qf(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function dw(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 pw{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=Cb.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 _i=new pw;const jf="transparent",mw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Ef(n||jf),s=i.valid&&Ef(e||jf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class hw{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||mw[e.type||typeof o],this._easing=ul[e.easing]||ul.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=Zl([e.to,t,s,e.from]),this._from=Zl([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 _w=["x","y","borderWidth","radius","tension"],gw=["color","borderColor","backgroundColor"];ot.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 bw=Object.keys(ot.animation);ot.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ot.set("animations",{colors:{type:"color",properties:gw},numbers:{type:"number",properties:_w}});ot.describe("animations",{_fallback:"animation"});ot.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 Yb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!nt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!nt(s))return;const l={};for(const o of bw)l[o]=s[o];(Ct(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=yw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&vw(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 d=l[u];const p=i.get(u);if(d)if(p&&d.active()){d.update(p,f,r);continue}else d.cancel();if(!p||!p.duration){e[u]=f;continue}l[u]=d=new hw(p,e,u,f),s.push(d)}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 _i.add(this._chart,i),!0}}function vw(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 yw(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 Vf(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 kw(n,e,t){if(t===!1)return!1;const i=Vf(n,t),s=Vf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function ww(n){let e,t,i,s;return nt(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 Kb(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 zf(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],Bt(u)&&(l||e===0||ri(e)===ri(u))&&(e+=u)}return e}}function Sw(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 Hf(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function $w(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function Tw(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 Cw(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Bf(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 Uf(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=$w(l,o,i),d=e.length;let p;for(let h=0;h<d;++h){const g=e[h],{[a]:_,[u]:b}=g,k=g._stacks||(g._stacks={});p=k[u]=Cw(s,f,_),p[r]=b,p._top=Bf(p,o,!0,i.type),p._bottom=Bf(p,o,!1,i.type)}}function yr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Mw(n,e){return zi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Ow(n,e,t){return zi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Zs(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 kr=n=>n==="reset"||n==="none",Wf=(n,e)=>e?n:Object.assign({},n),Ew=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Kb(t,!0),values:null};class ei{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=Hf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Zs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(d,p,h,g)=>d==="x"?p:d==="r"?g:h,l=t.xAxisID=lt(i.xAxisID,yr(e,"x")),o=t.yAxisID=lt(i.yAxisID,yr(e,"y")),r=t.rAxisID=lt(i.rAxisID,yr(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&&kf(this._data,this),e._stacked&&Zs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t))this._data=Sw(t);else if(i!==t){if(i){kf(i,this);const s=this._cachedMeta;Zs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Kk(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=Hf(t.vScale,t),t.stack!==i.stack&&(s=!0,Zs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Uf(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,d,p;if(this._parsing===!1)i._parsed=s,i._sorted=!0,p=s;else{Ct(s[e])?p=this.parseArrayData(i,s,e,t):nt(s[e])?p=this.parseObjectData(i,s,e,t):p=this.parsePrimitiveData(i,s,e,t);const h=()=>d[r]===null||u&&d[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=d=p[f],a&&(h()&&(a=!1),u=d);i._sorted=a}o&&Uf(this,p)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,d=new Array(s);let p,h,g;for(p=0,h=s;p<h;++p)g=p+i,d[p]={[r]:f||l.parse(u[g],g),[a]:o.parse(t[g],g)};return d}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,d;for(a=0,u=s;a<u;++a)f=a+i,d=t[f],r[a]={x:l.parse(d[0],f),y:o.parse(d[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,d,p,h;for(f=0,d=s;f<d;++f)p=f+i,h=t[p],u[f]={x:l.parse(qi(h,r),p),y:o.parse(qi(h,a),p)};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:Kb(s,!0),values:t._stacks[e.axis]};return zf(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=zf(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=Ew(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:d}=Tw(r);let p,h;function g(){h=s[p];const _=h[r.axis];return!Bt(h[e.axis])||f>_||d<_}for(p=0;p<o&&!(!g()&&(this.updateRangeFromParsed(u,e,h,a),l));++p);if(l){for(p=o-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(u,e,h,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],Bt(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=ww(lt(this.options.clip,kw(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 d=s[f];d.hidden||(d.active&&u?o.push(d):d.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=Ow(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=Mw(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&&Yn(i);if(r)return Wf(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),d=s?[`${e}Hover`,"hover",e,""]:[e,""],p=u.getOptionScopes(this.getDataset(),f),h=Object.keys(ot.elements[e]),g=()=>this.getContext(i,s),_=u.resolveNamedOptions(p,h,g,d);return _.$shared&&(_.$shared=a,l[o]=Object.freeze(Wf(_,a))),_}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,d=f.datasetAnimationScopeKeys(this._type,t),p=f.getOptionScopes(this.getDataset(),d);a=f.createResolver(p,this.getContext(e,i,t))}const u=new Yb(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||kr(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){kr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!kr(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&&Zs(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])}}ei.defaults={};ei.prototype.datasetElementType=null;ei.prototype.dataElementType=null;function Dw(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=Tb(i.sort((s,l)=>s-l))}return n._cache.$bar}function Aw(n){const e=n.iScale,t=Dw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Yn(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 Iw(n,e,t,i){const s=t.barThickness;let l,o;return dt(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 Lw(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 Pw(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 Jb(n,e,t,i){return Ct(n)?Pw(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Yf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,d,p;for(u=t,f=t+i;u<f;++u)p=e[u],d={},d[s.axis]=r||s.parse(o[u],u),a.push(Jb(p,d,l,u));return a}function wr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Nw(n,e,t){return n!==0?ri(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Fw(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 Rw(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}=Fw(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[Kf(f,o,r,a)]=!0,s=u)),l[Kf(s,o,r,a)]=!0,n.borderSkipped=l}function Kf(n,e,t,i){return i?(n=qw(n,e,t),n=Jf(n,t,e)):n=Jf(n,e,t),n}function qw(n,e,t){return n===e?t:n===t?e:n}function Jf(n,e,t){return n==="start"?e:n==="end"?t:n}function jw(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class eu extends ei{parsePrimitiveData(e,t,i,s){return Yf(e,t,i,s)}parseArrayData(e,t,i,s){return Yf(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,d=[];let p,h,g,_;for(p=i,h=i+s;p<h;++p)_=t[p],g={},g[l.axis]=l.parse(qi(_,u),p),d.push(Jb(qi(_,f),g,o,p));return d}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=wr(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:d,includeOptions:p}=this._getSharedOptions(t,s);for(let h=t;h<t+i;h++){const g=this.getParsed(h),_=l||dt(g[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,f),k=(g._stacks||{})[r.axis],$={horizontal:u,base:_.base,enableBorderRadius:!k||wr(g._custom)||o===k._top||o===k._bottom,x:u?_.head:b.center,y:u?b.center:_.head,height:u?b.size:Math.abs(_.size),width:u?Math.abs(_.size):b.size};p&&($.options=d||this.resolveDataElementOptions(h,e[h].active?"active":s));const C=$.options||e[h].options;Rw($,C,k,o),jw($,C,f.ratio),this.updateElement(e[h],h,$,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(dt(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||Aw(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=wr(a);let f=r[t.axis],d=0,p=i?this.applyStack(t,r,i):f,h,g;p!==f&&(d=p-f,p=f),u&&(f=a.barStart,p=a.barEnd-a.barStart,f!==0&&ri(f)!==ri(a.barEnd)&&(d=0),d+=f);const _=!dt(s)&&!u?s:d;let b=t.getPixelForValue(_);if(this.chart.getDataVisibility(e)?h=t.getPixelForValue(d+p):h=b,g=h-b,Math.abs(g)<l){g=Nw(g,t,o)*l,f===o&&(b-=g/2);const k=t.getPixelForDecimal(0),$=t.getPixelForDecimal(1),C=Math.min(k,$),T=Math.max(k,$);b=Math.max(Math.min(b,T),C),h=b+g}if(b===t.getPixelForValue(o)){const k=ri(g)*t.getLineWidthForValue(o)/2;b+=k,g-=k}return{size:g,base:b,head:h,center:h+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=lt(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?Lw(e,t,s,u):Iw(e,t,s,u),d=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*d+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)}}eu.id="bar";eu.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};eu.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class tu extends ei{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=lt(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=lt(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,d=r.axis;for(let p=t;p<t+i;p++){const h=e[p],g=!l&&this.getParsed(p),_={},b=_[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(g[f]),k=_[d]=l?r.getBasePixel():r.getPixelForValue(g[d]);_.skip=isNaN(b)||isNaN(k),u&&(_.options=a||this.resolveDataElementOptions(p,h.active?"active":s),l&&(_.options.radius=0)),this.updateElement(h,p,_,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+=lt(i&&i._custom,l),s}}tu.id="bubble";tu.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};tu.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Vw(n,e,t){let i=1,s=1,l=0,o=0;if(e<bt){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),d=Math.cos(a),p=Math.sin(a),h=(C,T,O)=>gl(C,r,a,!0)?1:Math.max(T,T*t,O,O*t),g=(C,T,O)=>gl(C,r,a,!0)?-1:Math.min(T,T*t,O,O*t),_=h(0,u,d),b=h(Ft,f,p),k=g(qt,u,d),$=g(qt+Ft,f,p);i=(_-k)/2,s=(b-$)/2,l=-(_+k)/2,o=-(b+$)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Ll extends ei{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(nt(i[e])){const{key:a="value"}=this._parsing;l=u=>+qi(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Qn(this.options.rotation-90)}_getCircumference(){return Qn(this.options.circumference)}_getRotationExtents(){let e=bt,t=-bt;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(Lk(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:_}=Vw(d,f,a),b=(i.width-o)/p,k=(i.height-o)/h,$=Math.max(Math.min(b,k)/2,0),C=yb(this.options.radius,$),T=Math.max(C*a,0),O=(C-T)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=_*C,s.total=this.calculateTotal(),this.outerRadius=C-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*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/bt)}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,d=(r.top+r.bottom)/2,p=l&&u.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:_,includeOptions:b}=this._getSharedOptions(t,s);let k=this._getRotation(),$;for($=0;$<t;++$)k+=this._circumference($,l);for($=t;$<t+i;++$){const C=this._circumference($,l),T=e[$],O={x:f+this.offsetX,y:d+this.offsetY,startAngle:k,endAngle:k+C,circumference:C,outerRadius:g,innerRadius:h};b&&(O.options=_||this.resolveDataElementOptions($,T.active?"active":s)),k+=C,this.updateElement(T,$,O,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)?bt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(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(lt(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ll.id="doughnut";Ll.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"};Ll.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Ll.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 Ct(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Xo extends ei{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}=Ob(t,s,o);this._drawStart=r,this._drawCount=a,Eb(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:d}=this._getSharedOptions(t,s),p=o.axis,h=r.axis,{spanGaps:g,segment:_}=this.options,b=Ls(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const T=e[C],O=this.getParsed(C),M=k?T:{},E=dt(O[h]),A=M[p]=o.getPixelForValue(O[p],C),L=M[h]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,O,a):O[h],C);M.skip=isNaN(A)||isNaN(L)||E,M.stop=C>0&&Math.abs(O[p]-$[p])>b,_&&(M.parsed=O,M.raw=u.data[C]),d&&(M.options=f||this.resolveDataElementOptions(C,T.active?"active":s)),k||this.updateElement(T,C,M,s),$=O}}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()}}Xo.id="line";Xo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Xo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class nu extends ei{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=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Vb.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,d=u.yCenter,p=u.getIndexAngle(0)-.5*qt;let h=p,g;const _=360/this.countVisibleElements();for(g=0;g<t;++g)h+=this._computeAngle(g,s,_);for(g=t;g<t+i;g++){const b=e[g];let k=h,$=h+this._computeAngle(g,s,_),C=o.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=$,l&&(a.animateScale&&(C=0),a.animateRotate&&(k=$=p));const T={x:f,y:d,innerRadius:0,outerRadius:C,startAngle:k,endAngle:$,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,T,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}nu.id="polarArea";nu.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};nu.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 Zb extends Ll{}Zb.id="pie";Zb.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class iu extends ei{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 Vb.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),d=o?l.xCenter:f.x,p=o?l.yCenter:f.y,h={x:d,y:p,angle:f.angle,skip:isNaN(d)||isNaN(p),options:u};this.updateElement(a,r,h,s)}}}iu.id="radar";iu.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};iu.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 Ls(this.x)&&Ls(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 Gb={values(n){return Ct(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=zw(n,t)}const o=Un(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),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Un(n)));return i===1||i===2||i===5?Gb.numeric.call(this,n,e,t):""}};function zw(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 Qo={formatters:Gb};ot.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:Qo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});ot.route("scale.ticks","color","","color");ot.route("scale.grid","color","","borderColor");ot.route("scale.grid","borderColor","","borderColor");ot.route("scale.title","color","","color");ot.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});ot.describe("scales",{_fallback:"scale"});ot.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function Hw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||Bw(n),s=t.major.enabled?Ww(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Yw(e,a,s,l/i),a;const u=Uw(s,e,i);if(l>0){let f,d;const p=l>1?Math.round((r-o)/(l-1)):null;for(Xl(e,a,u,dt(p)?0:o-p,o),f=0,d=l-1;f<d;f++)Xl(e,a,u,s[f],s[f+1]);return Xl(e,a,u,r,dt(p)?e.length:r+p),a}return Xl(e,a,u),a}function Bw(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 Uw(n,e,t){const i=Kw(n),s=e.length/t;if(!i)return Math.max(s,1);const l=zk(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 Ww(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function Yw(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 Xl(n,e,t,i,s){const l=lt(i,0),o=Math.min(lt(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 Kw(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 Jw=n=>n==="left"?"right":n==="right"?"left":n,Zf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Gf(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 Zw(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 Gw(n,e){mt(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 Gs(n){return n.drawTicks?n.tickLength:0}function Xf(n,e){if(!n.display)return 0;const t=Dn(n.font,e),i=Kn(n.padding);return(Ct(n.text)?n.text.length:1)*t.lineHeight+i.height}function Xw(n,e){return zi(n,{scale:e,type:"scale"})}function Qw(n,e,t){return zi(n,{tick:t,index:e,type:"tick"})}function xw(n,e,t){let i=Zk(n);return(t&&e!=="right"||!t&&e==="right")&&(i=Jw(i)),i}function e3(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let d=0,p,h,g;const _=o-s,b=r-l;if(n.isHorizontal()){if(h=wf(i,l,r),nt(t)){const k=Object.keys(t)[0],$=t[k];g=f[k].getPixelForValue($)+_-e}else t==="center"?g=(u.bottom+u.top)/2+_-e:g=Zf(n,t,e);p=r-l}else{if(nt(t)){const k=Object.keys(t)[0],$=t[k];h=f[k].getPixelForValue($)-b+e}else t==="center"?h=(u.left+u.right)/2-b+e:h=Zf(n,t,e);g=wf(i,o,s),d=t==="left"?-Ft:Ft}return{titleX:h,titleY:g,maxWidth:p,rotation:d}}class ds 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=jn(e,Number.POSITIVE_INFINITY),t=jn(t,Number.NEGATIVE_INFINITY),i=jn(i,Number.POSITIVE_INFINITY),s=jn(s,Number.NEGATIVE_INFINITY),{min:jn(e,i),max:jn(t,s),minDefined:Bt(e),maxDefined:Bt(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:jn(t,jn(i,t)),max:jn(i,jn(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(){Nt(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=D2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Gf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Hw(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(){Nt(this.options.afterUpdate,[this])}beforeSetDimensions(){Nt(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(){Nt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Nt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Nt(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=Nt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){Nt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Nt(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(),d=f.widest.width,p=f.highest.height,h=fn(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),d+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Gs(e.grid)-t.padding-Xf(e.title,this.chart.options.font),u=Math.sqrt(d*d+p*p),o=Ha(Math.min(Math.asin(fn((f.highest.height+6)/r,-1,1)),Math.asin(fn(a/u,-1,1))-Math.asin(fn(p/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Nt(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=Xf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Gs(l)+a):(e.height=this.maxHeight,e.width=Gs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:d,highest:p}=this._getLabelSizes(),h=i.padding*2,g=Qn(this.labelRotation),_=Math.cos(g),b=Math.sin(g);if(r){const k=i.mirror?0:b*d.width+_*p.height;e.height=Math.min(this.maxHeight,e.height+k+h)}else{const k=i.mirror?0:_*d.width+b*p.height;e.width=Math.min(this.maxWidth,e.width+k+h)}this._calculatePadding(u,f,b,_)}}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,d=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;a?u?(p=s*e.width,h=i*t.height):(p=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?p=e.width:l!=="inner"&&(p=e.width/2,h=t.width/2),this.paddingLeft=Math.max((p-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-d+o)*this.width/(this.width-d),0)}else{let f=t.height/2,d=e.height/2;l==="start"?(f=0,d=e.height):l==="end"&&(f=t.height,d=0),this.paddingTop=f+o,this.paddingBottom=d+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(){Nt(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++)dt(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=Gf(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,d,p,h,g,_,b,k,$,C;for(u=0;u<t;++u){if(p=e[u].label,h=this._resolveTickFontOptions(u),i.font=g=h.string,_=s[g]=s[g]||{data:{},gc:[]},b=h.lineHeight,k=$=0,!dt(p)&&!Ct(p))k=Oo(i,_.data,_.gc,k,p),$=b;else if(Ct(p))for(f=0,d=p.length;f<d;++f)C=p[f],!dt(C)&&!Ct(C)&&(k=Oo(i,_.data,_.gc,k,C),$+=b);l.push(k),o.push($),r=Math.max(k,r),a=Math.max($,a)}Gw(s,t);const T=l.indexOf(r),O=o.indexOf(a),M=E=>({width:l[E]||0,height:o[E]||0});return{first:M(0),last:M(t-1),widest:M(T),highest:M(O),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 Uk(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=Qw(this.getContext(),e,i))}return this.$context||(this.$context=Xw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Qn(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),d=Gs(l),p=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,_=g/2,b=function(U){return Ji(i,U,g)};let k,$,C,T,O,M,E,A,L,N,R,F;if(o==="top")k=b(this.bottom),M=this.bottom-d,A=k-_,N=b(e.top)+_,F=e.bottom;else if(o==="bottom")k=b(this.top),N=e.top,F=b(e.bottom)-_,M=k+_,A=this.top+d;else if(o==="left")k=b(this.right),O=this.right-d,E=k-_,L=b(e.left)+_,R=e.right;else if(o==="right")k=b(this.left),L=e.left,R=b(e.right)-_,O=k+_,E=this.left+d;else if(t==="x"){if(o==="center")k=b((e.top+e.bottom)/2+.5);else if(nt(o)){const U=Object.keys(o)[0],j=o[U];k=b(this.chart.scales[U].getPixelForValue(j))}N=e.top,F=e.bottom,M=k+_,A=M+d}else if(t==="y"){if(o==="center")k=b((e.left+e.right)/2);else if(nt(o)){const U=Object.keys(o)[0],j=o[U];k=b(this.chart.scales[U].getPixelForValue(j))}O=k-_,E=O-d,L=e.left,R=e.right}const q=lt(s.ticks.maxTicksLimit,f),V=Math.max(1,Math.ceil(f/q));for($=0;$<f;$+=V){const U=l.setContext(this.getContext($)),j=U.lineWidth,Q=U.color,X=U.borderDash||[],Z=U.borderDashOffset,re=U.tickWidth,ee=U.tickColor,se=U.tickBorderDash||[],ye=U.tickBorderDashOffset;C=Zw(this,$,r),C!==void 0&&(T=Ji(i,C,j),a?O=E=L=R=T:M=A=N=F=T,p.push({tx1:O,ty1:M,tx2:E,ty2:A,x1:L,y1:N,x2:R,y2:F,width:j,color:Q,borderDash:X,borderDashOffset:Z,tickWidth:re,tickColor:ee,tickBorderDash:se,tickBorderDashOffset:ye}))}return this._ticksLength=f,this._borderValue=k,p}_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:d}=l,p=Gs(i.grid),h=p+f,g=d?-f:h,_=-Qn(this.labelRotation),b=[];let k,$,C,T,O,M,E,A,L,N,R,F,q="middle";if(s==="top")M=this.bottom-g,E=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+g,E=this._getXAxisLabelAlignment();else if(s==="left"){const U=this._getYAxisLabelAlignment(p);E=U.textAlign,O=U.x}else if(s==="right"){const U=this._getYAxisLabelAlignment(p);E=U.textAlign,O=U.x}else if(t==="x"){if(s==="center")M=(e.top+e.bottom)/2+h;else if(nt(s)){const U=Object.keys(s)[0],j=s[U];M=this.chart.scales[U].getPixelForValue(j)+h}E=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")O=(e.left+e.right)/2-h;else if(nt(s)){const U=Object.keys(s)[0],j=s[U];O=this.chart.scales[U].getPixelForValue(j)}E=this._getYAxisLabelAlignment(p).textAlign}t==="y"&&(a==="start"?q="top":a==="end"&&(q="bottom"));const V=this._getLabelSizes();for(k=0,$=r.length;k<$;++k){C=r[k],T=C.label;const U=l.setContext(this.getContext(k));A=this.getPixelForTick(k)+l.labelOffset,L=this._resolveTickFontOptions(k),N=L.lineHeight,R=Ct(T)?T.length:1;const j=R/2,Q=U.color,X=U.textStrokeColor,Z=U.textStrokeWidth;let re=E;o?(O=A,E==="inner"&&(k===$-1?re=this.options.reverse?"left":"right":k===0?re=this.options.reverse?"right":"left":re="center"),s==="top"?u==="near"||_!==0?F=-R*N+N/2:u==="center"?F=-V.highest.height/2-j*N+N:F=-V.highest.height+N/2:u==="near"||_!==0?F=N/2:u==="center"?F=V.highest.height/2-j*N:F=V.highest.height-R*N,d&&(F*=-1)):(M=A,F=(1-R)*N/2);let ee;if(U.showLabelBackdrop){const se=Kn(U.backdropPadding),ye=V.heights[k],$e=V.widths[k];let ze=M+F-se.top,Ue=O-se.left;switch(q){case"middle":ze-=ye/2;break;case"bottom":ze-=ye;break}switch(E){case"center":Ue-=$e/2;break;case"right":Ue-=$e;break}ee={left:Ue,top:ze,width:$e+se.width,height:ye+se.height,color:U.backdropColor}}b.push({rotation:_,label:T,font:L,color:Q,strokeColor:X,strokeWidth:Z,textOffset:F,textAlign:re,textBaseline:q,translation:[O,M],backdrop:ee})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Qn(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,d;this.isHorizontal()?(a=Ji(e,this.left,l)-l/2,u=Ji(e,this.right,o)+o/2,f=d=r):(f=Ji(e,this.top,l)-l/2,d=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,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Ka(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 d=a.textOffset;Eo(i,f,0,d,u,a)}s&&Ja(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Dn(i.font),o=Kn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||nt(t)?(a+=o.bottom,Ct(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:d,rotation:p}=e3(this,a,t,r);Eo(e,i.text,0,0,l,{color:i.color,maxWidth:d,rotation:p,textAlign:xw(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=lt(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ds.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 Dn(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Ql{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;i3(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,t3(e,o,i),this.override&&ot.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 ot[s]&&(delete ot[s][i],this.override&&delete as[i])}}function t3(n,e,t){const i=_l(Object.create(null),[t?ot.get(t):{},ot.get(e),n.defaults]);ot.set(e,i),n.defaultRoutes&&n3(e,n.defaultRoutes),n.descriptors&&ot.describe(e,n.descriptors)}function n3(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(".");ot.route(l,s,a,r)})}function i3(n){return"id"in n&&"defaults"in n}class s3{constructor(){this.controllers=new Ql(ei,"datasets",!0),this.elements=new Ql(Ci,"elements"),this.plugins=new Ql(Object,"plugins"),this.scales=new Ql(ds,"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):mt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=za(e);Nt(i["before"+s],[],i),t[e](i),Nt(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 oi=new s3;class su extends ei{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=Ob(t,i,s);if(this._drawStart=l,this._drawCount=o,Eb(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=oi.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),d=this.getSharedOptions(f),p=this.includeOptions(s,d),h=o.axis,g=r.axis,{spanGaps:_,segment:b}=this.options,k=Ls(_)?_:Number.POSITIVE_INFINITY,$=this.chart._animationsDisabled||l||s==="none";let C=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){const O=e[T],M=this.getParsed(T),E=$?O:{},A=dt(M[g]),L=E[h]=o.getPixelForValue(M[h],T),N=E[g]=l||A?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[g],T);E.skip=isNaN(L)||isNaN(N)||A,E.stop=T>0&&Math.abs(M[h]-C[h])>k,b&&(E.parsed=M,E.raw=u.data[T]),p&&(E.options=d||this.resolveDataElementOptions(T,O.active?"active":s)),$||this.updateElement(O,T,E,s),C=M}this.updateSharedOptions(d,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}}su.id="scatter";su.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};su.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Zi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class fa{constructor(e){this.options=e||{}}init(e){}formats(){return Zi()}parse(e,t){return Zi()}format(e,t){return Zi()}add(e,t,i){return Zi()}diff(e,t,i){return Zi()}startOf(e,t,i){return Zi()}endOf(e,t){return Zi()}}fa.override=function(n){Object.assign(fa.prototype,n)};var Xb={_date:fa};function l3(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?Wk:ts;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const d=a(l,e,t-f),p=a(l,e,t+f);return{lo:d.lo,hi:p.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Pl(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:d,hi:p}=l3(l[r],e,o,s);for(let h=d;h<=p;++h){const g=f[h];g.skip||i(g,u,h)}}}function o3(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 Sr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Pl(n,t,e,function(r,a,u){!s&&!vl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function r3(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Sb(o,{x:e.x,y:e.y});gl(d,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Pl(n,t,e,l),s}function a3(n,e,t,i,s,l){let o=[];const r=o3(t);let a=Number.POSITIVE_INFINITY;function u(f,d,p){const h=f.inRange(e.x,e.y,s);if(i&&!h)return;const g=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(g))&&!h)return;const b=r(e,g);b<a?(o=[{element:f,datasetIndex:d,index:p}],a=b):b===a&&o.push({element:f,datasetIndex:d,index:p})}return Pl(n,t,e,u),o}function $r(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?r3(n,e,t,s):a3(n,e,t,i,s,l)}function Qf(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Pl(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 u3={evaluateInteractionItems:Pl,modes:{index(n,e,t,i){const s=Qi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Sr(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,d=u.data[f];d&&!d.skip&&a.push({element:d,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Qi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Sr(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=Qi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return Sr(n,s,l,i,o)},nearest(n,e,t,i){const s=Qi(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=Qi(e,n);return Qf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Qi(e,n);return Qf(n,s,"y",t.intersect,i)}}};const Qb=["left","top","right","bottom"];function Xs(n,e){return n.filter(t=>t.pos===e)}function xf(n,e){return n.filter(t=>Qb.indexOf(t.pos)===-1&&t.box.axis===e)}function Qs(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 f3(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 c3(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!Qb.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 d3(n,e){const t=c3(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 p3(n){const e=f3(n),t=Qs(e.filter(u=>u.box.fullSize),!0),i=Qs(Xs(e,"left"),!0),s=Qs(Xs(e,"right")),l=Qs(Xs(e,"top"),!0),o=Qs(Xs(e,"bottom")),r=xf(e,"x"),a=xf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Xs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function ec(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function xb(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 m3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!nt(s)){t.size&&(n[s]-=t.size);const d=i[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?l.height:l.width),t.size=d.size/d.count,n[s]+=t.size}l.getPadding&&xb(o,l.getPadding());const r=Math.max(0,e.outerWidth-ec(o,n,"left","right")),a=Math.max(0,e.outerHeight-ec(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 h3(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 _3(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 sl(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,_3(r.horizontal,e));const{same:d,other:p}=m3(e,t,r,i);u|=d&&s.length,f=f||p,a.fullSize||s.push(r)}return u&&sl(s,e,t,i)||f}function xl(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 tc(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 d=e.w*f,p=u.size||a.height;Yn(u.start)&&(o=u.start),a.fullSize?xl(a,s.left,o,t.outerWidth-s.right-s.left,p):xl(a,e.left+u.placed,o,d,p),u.start=o,u.placed+=d,o=a.bottom}else{const d=e.h*f,p=u.size||a.width;Yn(u.start)&&(l=u.start),a.fullSize?xl(a,l,s.top,p,t.outerHeight-s.bottom-s.top):xl(a,l,e.top+u.placed,p,d),u.start=l,u.placed+=d,l=a.right}}e.x=l,e.y=o}ot.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var eo={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=Kn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=p3(n.boxes),a=r.vertical,u=r.horizontal;mt(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,b)=>b.box.options&&b.box.options.display===!1?_:_+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),p=Object.assign({},s);xb(p,Kn(i));const h=Object.assign({maxPadding:p,w:l,h:o,x:s.left,y:s.top},s),g=d3(a.concat(u),d);sl(r.fullSize,h,d,g),sl(a,h,d,g),sl(u,h,d,g)&&sl(a,h,d,g),h3(h),tc(r.leftAndTop,h,d,g),h.x+=h.w,h.y+=h.h,tc(r.rightAndBottom,h,d,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},mt(r.chartArea,_=>{const b=_.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class e1{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 g3 extends e1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const fo="$chartjs",b3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},nc=n=>n===null||n==="";function v3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[fo]={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",nc(s)){const l=Pf(n,"width");l!==void 0&&(n.width=l)}if(nc(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=Pf(n,"height");l!==void 0&&(n.height=l)}return n}const t1=x2?{passive:!0}:!1;function y3(n,e,t){n.addEventListener(e,t,t1)}function k3(n,e,t){n.canvas.removeEventListener(e,t,t1)}function w3(n,e){const t=b3[n.type]||n.type,{x:i,y:s}=Qi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Io(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function S3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Io(r.addedNodes,i),o=o&&!Io(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function $3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Io(r.removedNodes,i),o=o&&!Io(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const yl=new Map;let ic=0;function n1(){const n=window.devicePixelRatio;n!==ic&&(ic=n,yl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function T3(n,e){yl.size||window.addEventListener("resize",n1),yl.set(n,e)}function C3(n){yl.delete(n),yl.size||window.removeEventListener("resize",n1)}function M3(n,e,t){const i=n.canvas,s=i&&xa(i);if(!s)return;const l=Mb((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),T3(n,l),o}function Tr(n,e,t){t&&t.disconnect(),e==="resize"&&C3(n)}function O3(n,e,t){const i=n.canvas,s=Mb(l=>{n.ctx!==null&&t(w3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return y3(i,e,s),s}class E3 extends e1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(v3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[fo])return!1;const i=t[fo].initial;["height","width"].forEach(l=>{const o=i[l];dt(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[fo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:S3,detach:$3,resize:M3}[t]||O3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:Tr,detach:Tr,resize:Tr}[t]||k3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Q2(e,t,i,s)}isAttached(e){const t=xa(e);return!!(t&&t.isConnected)}}function D3(n){return!Hb()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?g3:E3}class A3{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(Nt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){dt(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=lt(i.options&&i.options.plugins,{}),l=I3(i);return s===!1&&!t?[]:P3(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 I3(n){const e={},t=[],i=Object.keys(oi.plugins.items);for(let l=0;l<i.length;l++)t.push(oi.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 L3(n,e){return!e&&n===!1?null:n===!0?{}:n}function P3(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=L3(i[a],s);u!==null&&l.push({plugin:r,options:N3(n.config,{plugin:r,local:t[a]},u,o)})}return l}function N3(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 ca(n,e){const t=ot.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function F3(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function R3(n,e){return n===e?"_index_":"_value_"}function q3(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function da(n,e){return n==="x"||n==="y"?n:e.axis||q3(e.position)||n.charAt(0).toLowerCase()}function j3(n,e){const t=as[n.type]||{scales:{}},i=e.scales||{},s=ca(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!nt(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=da(r,a),f=R3(u,s),d=t.scales||{};l[u]=l[u]||r,o[r]=rl(Object.create(null),[{axis:u},a,d[u],d[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||ca(a,e),d=(as[a]||{}).scales||{};Object.keys(d).forEach(p=>{const h=F3(p,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),rl(o[g],[{axis:h},i[g],d[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];rl(a,[ot.scales[a.type],ot.scale])}),o}function i1(n){const e=n.options||(n.options={});e.plugins=lt(e.plugins,{}),e.scales=j3(n,e)}function s1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function V3(n){return n=n||{},n.data=s1(n.data),i1(n),n}const sc=new Map,l1=new Set;function to(n,e){let t=sc.get(n);return t||(t=e(),sc.set(n,t),l1.add(t)),t}const xs=(n,e,t)=>{const i=qi(e,t);i!==void 0&&n.add(i)};class z3{constructor(e){this._config=V3(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=s1(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(),i1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return to(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return to(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return to(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return to(`${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(d=>xs(a,e,d))),f.forEach(d=>xs(a,s,d)),f.forEach(d=>xs(a,as[l]||{},d)),f.forEach(d=>xs(a,ot,d)),f.forEach(d=>xs(a,aa,d))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),l1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,as[t]||{},ot.datasets[t]||{},{type:t},ot,aa]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=lc(this._resolverCache,e,s);let a=o;if(B3(o,t)){l.$shared=!1,i=ji(i)?i():i;const u=this.createResolver(e,i,r);a=Ps(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=lc(this._resolverCache,e,i);return nt(t)?Ps(l,t,void 0,s):l}}function lc(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:Ga(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const H3=n=>nt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||ji(n[t]),!1);function B3(n,e){const{isScriptable:t,isIndexable:i}=Fb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ji(r)||H3(r))||o&&Ct(r))return!0}return!1}var U3="3.9.1";const W3=["top","bottom","left","right","chartArea"];function oc(n,e){return n==="top"||n==="bottom"||W3.indexOf(n)===-1&&e==="x"}function rc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function ac(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Nt(t&&t.onComplete,[n],e)}function Y3(n){const e=n.chart,t=e.options.animation;Nt(t&&t.onProgress,[n],e)}function o1(n){return Hb()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lo={},r1=n=>{const e=o1(n);return Object.values(Lo).filter(t=>t.canvas===e).pop()};function K3(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 J3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Po{constructor(e,t){const i=this.config=new z3(t),s=o1(e),l=r1(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||D3(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=Ik(),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 A3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Jk(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Lo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}_i.listen(this,"complete",ac),_i.listen(this,"progress",Y3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return dt(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():Lf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Df(this.canvas,this.ctx),this}stop(){return _i.stop(this),this}resize(e,t){_i.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,Lf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Nt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};mt(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=da(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),mt(l,o=>{const r=o.options,a=r.id,u=da(a,r),f=lt(r.type,o.dtype);(r.position===void 0||oc(r.position,u)!==oc(o.dposition))&&(r.position=o.dposition),s[a]=!0;let d=null;if(a in i&&i[a].type===f)d=i[a];else{const p=oi.getScale(f);d=new p({id:a,type:f,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(r,e)}),mt(s,(o,r)=>{o||delete i[r]}),mt(i,o=>{eo.configure(this,o,o.options),eo.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(rc("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||ca(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=oi.getController(r),{datasetElementType:u,dataElementType:f}=ot.datasets[r];Object.assign(a.prototype,{dataElementType:oi.getElement(f),datasetElementType:u&&oi.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){mt(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:d}=this.getDatasetMeta(u),p=!s&&l.indexOf(d)===-1;d.buildOrUpdateElements(p),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||mt(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(rc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){mt(this.scales,e=>{eo.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!gf(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;K3(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(!gf(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;eo.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],mt(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,ji(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&&(_i.has(this)?this.attached&&!_i.running(this)&&_i.start(this):(this.draw(),ac({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&&Ka(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ja(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return vl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=u3.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=zi(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);Yn(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(),_i.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(),Df(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Lo[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)};mt(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(){mt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},mt(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}});!$o(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(d=>f.datasetIndex===d.datasetIndex&&f.index===d.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=qk(e),u=J3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Nt(l.onHover,[e,r,this],this),a&&Nt(l.onClick,[e,r,this],this));const f=!$o(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 uc=()=>mt(Po.instances,n=>n._plugins.invalidate()),Di=!0;Object.defineProperties(Po,{defaults:{enumerable:Di,value:ot},instances:{enumerable:Di,value:Lo},overrides:{enumerable:Di,value:as},registry:{enumerable:Di,value:oi},version:{enumerable:Di,value:U3},getChart:{enumerable:Di,value:r1},register:{enumerable:Di,value:(...n)=>{oi.add(...n),uc()}},unregister:{enumerable:Di,value:(...n)=>{oi.remove(...n),uc()}}});function a1(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+Ft,i-Ft),n.closePath(),n.clip()}function Z3(n){return Za(n,["outerStart","outerEnd","innerStart","innerEnd"])}function G3(n,e,t,i){const s=Z3(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 fn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:fn(s.innerStart,0,o),innerEnd:fn(s.innerEnd,0,o)}}function ys(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function pa(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,d=Math.max(e.outerRadius+i+t-u,0),p=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const U=f>0?f-i:0,j=d>0?d-i:0,Q=(U+j)/2,X=Q!==0?g*Q/(Q+i):g;h=(g-X)/2}const _=Math.max(.001,g*d-t/qt)/d,b=(g-_)/2,k=a+b+h,$=s-b-h,{outerStart:C,outerEnd:T,innerStart:O,innerEnd:M}=G3(e,p,d,$-k),E=d-C,A=d-T,L=k+C/E,N=$-T/A,R=p+O,F=p+M,q=k+O/R,V=$-M/F;if(n.beginPath(),l){if(n.arc(o,r,d,L,N),T>0){const Q=ys(A,N,o,r);n.arc(Q.x,Q.y,T,N,$+Ft)}const U=ys(F,$,o,r);if(n.lineTo(U.x,U.y),M>0){const Q=ys(F,V,o,r);n.arc(Q.x,Q.y,M,$+Ft,V+Math.PI)}if(n.arc(o,r,p,$-M/p,k+O/p,!0),O>0){const Q=ys(R,q,o,r);n.arc(Q.x,Q.y,O,q+Math.PI,k-Ft)}const j=ys(E,k,o,r);if(n.lineTo(j.x,j.y),C>0){const Q=ys(E,L,o,r);n.arc(Q.x,Q.y,C,k-Ft,L)}}else{n.moveTo(o,r);const U=Math.cos(L)*d+o,j=Math.sin(L)*d+r;n.lineTo(U,j);const Q=Math.cos(N)*d+o,X=Math.sin(N)*d+r;n.lineTo(Q,X)}n.closePath()}function X3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){pa(n,e,t,i,o+bt,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%bt,r%bt===0&&(a+=bt))}return pa(n,e,t,i,a,s),n.fill(),a}function Q3(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&&a1(n,e,l+bt),n.beginPath(),n.arc(i,s,u,l+bt,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+bt),f=0;f<r;++f)n.stroke()}function x3(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&&Q3(n,e,u),u&&a1(n,e,s),pa(n,e,t,i,s,l),n.stroke())}class lu 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}=Sb(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=this.options.spacing/2,g=lt(d,a-r)>=bt||gl(l,r,a),_=bl(o,u+p,f+p);return 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,d=(o+r+u+a)/2;return{x:t+Math.cos(f)*d,y:i+Math.sin(f)*d}}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>bt?Math.floor(i/bt):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>=qt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=X3(e,this,r,l,o);x3(e,this,r,l,a,o),e.restore()}}lu.id="arc";lu.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};lu.defaultRoutes={backgroundColor:"backgroundColor"};function u1(n,e,t=e){n.lineCap=lt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(lt(t.borderDash,e.borderDash)),n.lineDashOffset=lt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=lt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=lt(t.borderWidth,e.borderWidth),n.strokeStyle=lt(t.borderColor,e.borderColor)}function eS(n,e,t){n.lineTo(t.x,t.y)}function tS(n){return n.stepped?w2:n.tension||n.cubicInterpolationMode==="monotone"?S2:eS}function f1(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 nS(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=f1(s,t,i),f=tS(l);let{move:d=!0,reverse:p}=i||{},h,g,_;for(h=0;h<=u;++h)g=s[(r+(p?u-h:h))%o],!g.skip&&(d?(n.moveTo(g.x,g.y),d=!1):f(n,_,g,p,l.stepped),_=g);return a&&(g=s[(r+(p?u:0))%o],f(n,_,g,p,l.stepped)),!!a}function iS(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=f1(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,d=0,p,h,g,_,b,k;const $=T=>(o+(u?r-T:T))%l,C=()=>{_!==b&&(n.lineTo(f,b),n.lineTo(f,_),n.lineTo(f,k))};for(a&&(h=s[$(0)],n.moveTo(h.x,h.y)),p=0;p<=r;++p){if(h=s[$(p)],h.skip)continue;const T=h.x,O=h.y,M=T|0;M===g?(O<_?_=O:O>b&&(b=O),f=(d*f+T)/++d):(C(),n.lineTo(T,O),g=M,d=0,_=b=O),k=O}C()}function ma(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?iS:nS}function sS(n){return n.stepped?ew:n.tension||n.cubicInterpolationMode==="monotone"?tw:xi}function lS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),u1(n,e.options),n.stroke(s)}function oS(n,e,t,i){const{segments:s,options:l}=e,o=ma(e);for(const r of s)u1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const rS=typeof Path2D=="function";function aS(n,e,t,i){rS&&!e.options.segment?lS(n,e,t,i):oS(n,e,t,i)}class Hi 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;Y2(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=fw(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=Wb(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=sS(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:d,end:p}=o[u],h=l[d],g=l[p];if(h===g){r.push(h);continue}const _=Math.abs((s-h[t])/(g[t]-h[t])),b=a(h,g,_,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return ma(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=ma(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(),aS(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Hi.id="line";Hi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Hi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Hi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function fc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class xo 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 fc(this,e,"x",t)}inYRange(e,t){return fc(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||!vl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,ua(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}xo.id="point";xo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};xo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function c1(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,d;return n.horizontal?(d=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-d,f=i+d):(d=l/2,r=t-d,a=t+d,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function Pi(n,e,t,i){return n?0:fn(e,t,i)}function uS(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=Nb(i);return{t:Pi(s.top,l.top,0,t),r:Pi(s.right,l.right,0,e),b:Pi(s.bottom,l.bottom,0,t),l:Pi(s.left,l.left,0,e)}}function fS(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=Cs(s),o=Math.min(e,t),r=n.borderSkipped,a=i||nt(s);return{topLeft:Pi(!a||r.top||r.left,l.topLeft,0,o),topRight:Pi(!a||r.top||r.right,l.topRight,0,o),bottomLeft:Pi(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:Pi(!a||r.bottom||r.right,l.bottomRight,0,o)}}function cS(n){const e=c1(n),t=e.right-e.left,i=e.bottom-e.top,s=uS(n,t/2,i/2),l=fS(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 Cr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&c1(n,i);return r&&(s||bl(e,r.left,r.right))&&(l||bl(t,r.top,r.bottom))}function dS(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function pS(n,e){n.rect(e.x,e.y,e.w,e.h)}function Mr(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 ou 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}=cS(this),r=dS(o.radius)?Do:pS;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,Mr(o,t,l)),e.clip(),r(e,Mr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Mr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return Cr(this,e,t,i)}inXRange(e,t){return Cr(this,e,null,t)}inYRange(e,t){return Cr(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}}ou.id="bar";ou.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};ou.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function mS(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=ru(a,u,s);const f=ha(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const d=Wb(e,f);for(const p of d){const h=ha(t,l[p.start],l[p.end],p.loop),g=Ub(r,s,h);for(const _ of g)o.push({source:_,target:p,start:{[t]:cc(f,h,"start",Math.max)},end:{[t]:cc(f,h,"end",Math.min)}})}}return o}function ha(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=En(s),l=En(l)),{property:n,start:s,end:l}}function hS(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=ru(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 ru(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function cc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function d1(n,e){let t=[],i=!1;return Ct(n)?(i=!0,t=n):t=hS(n,e),t.length?new Hi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function dc(n){return n&&n.fill!==!1}function _S(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(!Bt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function gS(n,e,t){const i=kS(n);if(nt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Bt(s)&&Math.floor(s)===s?bS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function bS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function vS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function yS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function kS(n){const e=n.options,t=e.fill;let i=lt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function wS(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=SS(e,t);r.push(d1({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++)$S(s,o[f],r)}return new Hi({points:s,options:{}})}function SS(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 $S(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=TS(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function TS(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],d=o[f.start][t],p=o[f.end][t];if(bl(s,d,p)){r=s===d,a=s===p;break}}return{first:r,last:a,point:i}}class p1{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:bt},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 CS(n){const{chart:e,fill:t,line:i}=n;if(Bt(t))return MS(e,t);if(t==="stack")return wS(n);if(t==="shape")return!0;const s=OS(n);return s instanceof p1?s:d1(s,i)}function MS(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function OS(n){return(n.scale||{}).getPointPositionForValue?DS(n):ES(n)}function ES(n){const{scale:e={},fill:t}=n,i=vS(t,e);if(Bt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function DS(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=yS(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new p1({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 Or(n,e,t){const i=CS(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:d=u}=a||{};i&&s.points.length&&(Ka(n,t),AS(n,{line:s,target:i,above:f,below:d,area:t,scale:l,axis:o}),Ja(n))}function AS(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&&(pc(n,i,o.top),mc(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),pc(n,i,o.bottom)),mc(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function pc(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],d=s[ru(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(d.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function mc(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=mS(t,i,s);for(const{source:a,target:u,start:f,end:d}of r){const{style:{backgroundColor:p=l}={}}=a,h=i!==!0;n.save(),n.fillStyle=p,IS(n,o,h&&ha(s,f,d)),n.beginPath();const g=!!t.pathSegment(n,a);let _;if(h){g?n.closePath():hc(n,i,d,s);const b=!!i.pathSegment(n,u,{move:g,reverse:!0});_=g&&b,_||hc(n,i,f,s)}n.closePath(),n.fill(_?"evenodd":"nonzero"),n.restore()}}function IS(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 hc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var LS={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 Hi&&(a={visible:n.isDatasetVisible(o),index:o,fill:gS(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=_S(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&&Or(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;dc(l)&&Or(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!dc(i)||t.drawTime!=="beforeDatasetDraw"||Or(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cl={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=oa(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 si(n,e){return e&&(Ct(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function gi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function PS(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 _c(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Dn(e.bodyFont),u=Dn(e.titleFont),f=Dn(e.footerFont),d=l.length,p=s.length,h=i.length,g=Kn(e.padding);let _=g.height,b=0,k=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(_+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=h*T+(k-h)*a.lineHeight+(k-1)*e.bodySpacing}p&&(_+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const C=function(T){b=Math.max(b,t.measureText(T).width+$)};return t.save(),t.font=u.string,mt(n.title,C),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,mt(i,T=>{mt(T.before,C),mt(T.lines,C),mt(T.after,C)}),$=0,t.font=f.string,mt(n.footer,C),t.restore(),b+=g.width,{width:b,height:_}}function NS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function FS(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 RS(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"),FS(u,n,e,t)&&(u="center"),u}function gc(n,e,t){const i=t.yAlign||e.yAlign||NS(n,t);return{xAlign:t.xAlign||e.xAlign||RS(n,e,t,i),yAlign:i}}function qS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function jS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function bc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:h}=Cs(o);let g=qS(e,r);const _=jS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,p)+s:r==="right"&&(g+=Math.max(d,h)+s),{x:fn(g,0,i.width-e.width),y:fn(_,0,i.height-e.height)}}function no(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function vc(n){return si([],gi(n))}function VS(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function yc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class _a 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 Yb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=VS(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=si(r,gi(s)),r=si(r,gi(l)),r=si(r,gi(o)),r}getBeforeBody(e,t){return vc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=yc(i,l);si(o.before,gi(r.beforeLabel.call(this,l))),si(o.lines,r.label.call(this,l)),si(o.after,gi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return vc(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=si(r,gi(s)),r=si(r,gi(l)),r=si(r,gi(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(PS(this.chart,t[a]));return e.filter&&(r=r.filter((f,d,p)=>e.filter(f,d,p,i))),e.itemSort&&(r=r.sort((f,d)=>e.itemSort(f,d,i))),mt(r,f=>{const d=yc(e.callbacks,f);s.push(d.labelColor.call(this,f)),l.push(d.labelPointStyle.call(this,f)),o.push(d.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=cl[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=_c(this,i),u=Object.assign({},r,a),f=gc(this.chart,i,u),d=bc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:d.x,y:d.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:d}=Cs(r),{x:p,y:h}=e,{width:g,height:_}=t;let b,k,$,C,T,O;return l==="center"?(T=h+_/2,s==="left"?(b=p,k=b-o,C=T+o,O=T-o):(b=p+g,k=b+o,C=T-o,O=T+o),$=b):(s==="left"?k=p+Math.max(a,f)+o:s==="right"?k=p+g-Math.max(u,d)-o:k=this.caretX,l==="top"?(C=h,T=C-o,b=k-o,$=k+o):(C=h+_,T=C+o,b=k+o,$=k-o),O=C),{x1:b,x2:k,x3:$,y1:C,y2:T,y3:O}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=vr(i.rtl,this.x,this.width);for(e.x=no(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Dn(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,d=Dn(l.bodyFont),p=no(this,"left",l),h=s.x(p),g=a<d.lineHeight?(d.lineHeight-a)/2:0,_=t.y+g;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},k=s.leftForLtr(h,u)+u/2,$=_+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,ua(e,b,k,$),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,ua(e,b,k,$)}else{e.lineWidth=nt(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(h,u-f),k=s.leftForLtr(s.xPlus(h,1),u-f-2),$=Cs(o.borderRadius);Object.values($).some(C=>C!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Do(e,{x:b,y:_,w:u,h:a,radius:$}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Do(e,{x:k,y:_+1,w:u-2,h:a-2,radius:$}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,_,u,a),e.strokeRect(b,_,u,a),e.fillStyle=o.backgroundColor,e.fillRect(k,_+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,d=Dn(i.bodyFont);let p=d.lineHeight,h=0;const g=vr(i.rtl,this.x,this.width),_=function(A){t.fillText(A,g.x(e.x+h),e.y+p/2),e.y+=p+l},b=g.textAlign(o);let k,$,C,T,O,M,E;for(t.textAlign=o,t.textBaseline="middle",t.font=d.string,e.x=no(this,b,i),t.fillStyle=i.bodyColor,mt(this.beforeBody,_),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,M=s.length;T<M;++T){for(k=s[T],$=this.labelTextColors[T],t.fillStyle=$,mt(k.before,_),C=k.lines,r&&C.length&&(this._drawColorBox(t,e,T,g,i),p=Math.max(d.lineHeight,a)),O=0,E=C.length;O<E;++O)_(C[O]),p=d.lineHeight;mt(k.after,_)}h=0,p=d.lineHeight,mt(this.afterBody,_),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=vr(i.rtl,this.x,this.width);for(e.x=no(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Dn(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:d,topRight:p,bottomLeft:h,bottomRight:g}=Cs(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+d,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-p,a),t.quadraticCurveTo(r+u,a,r+u,a+p),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-g),t.quadraticCurveTo(r+u,a+f,r+u-g,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+h,a+f),t.quadraticCurveTo(r,a+f,r,a+f-h),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+d),t.quadraticCurveTo(r,a,r+d,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=cl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=_c(this,e),a=Object.assign({},o,this._size),u=gc(t,e,a),f=bc(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=Kn(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),lw(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),ow(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=!$o(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||!$o(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=cl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}_a.positioners=cl;var zS={id:"tooltip",_element:_a,positioners:cl,afterInit(n,e,t){t&&(n.tooltip=new _a({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:hi,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:hi,beforeBody:hi,beforeLabel:hi,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 dt(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:hi,afterBody:hi,beforeFooter:hi,footer:hi,afterFooter:hi}},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 HS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function BS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return HS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const US=(n,e)=>n===null?null:fn(Math.round(n),0,e);class ga extends ds{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(dt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:BS(i,e,lt(t,e),this._addedLabels),US(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}}ga.id="category";ga.defaults={ticks:{callback:ga.prototype.getLabelForValue}};function WS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:d,includeBounds:p}=n,h=l||1,g=f-1,{min:_,max:b}=e,k=!dt(o),$=!dt(r),C=!dt(u),T=(b-_)/(d+1);let O=vf((b-_)/g/h)*h,M,E,A,L;if(O<1e-14&&!k&&!$)return[{value:_},{value:b}];L=Math.ceil(b/O)-Math.floor(_/O),L>g&&(O=vf(L*O/g/h)*h),dt(a)||(M=Math.pow(10,a),O=Math.ceil(O*M)/M),s==="ticks"?(E=Math.floor(_/O)*O,A=Math.ceil(b/O)*O):(E=_,A=b),k&&$&&l&&Hk((r-o)/l,O/1e3)?(L=Math.round(Math.min((r-o)/O,f)),O=(r-o)/L,E=o,A=r):C?(E=k?o:E,A=$?r:A,L=u-1,O=(A-E)/L):(L=(A-E)/O,al(L,Math.round(L),O/1e3)?L=Math.round(L):L=Math.ceil(L));const N=Math.max(yf(O),yf(E));M=Math.pow(10,dt(a)?N:a),E=Math.round(E*M)/M,A=Math.round(A*M)/M;let R=0;for(k&&(p&&E!==o?(t.push({value:o}),E<o&&R++,al(Math.round((E+R*O)*M)/M,o,kc(o,T,n))&&R++):E<o&&R++);R<L;++R)t.push({value:Math.round((E+R*O)*M)/M});return $&&p&&A!==r?t.length&&al(t[t.length-1].value,r,kc(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!$||A===r)&&t.push({value:A}),t}function kc(n,e,{horizontal:t,minRotation:i}){const s=Qn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class No extends ds{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 dt(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=ri(s),u=ri(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=WS(s,l);return e.bounds==="ticks"&&wb(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 Il(e,this.chart.options.locale,this.options.ticks.format)}}class au extends No{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?e:0,this.max=Bt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(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}}au.id="linear";au.defaults={ticks:{callback:Qo.formatters.numeric}};function wc(n){return n/Math.pow(10,Math.floor(Un(n)))===1}function YS(n,e){const t=Math.floor(Un(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=jn(n.min,Math.pow(10,Math.floor(Un(e.min)))),o=Math.floor(Un(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:wc(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=jn(n.max,l);return s.push({value:u,major:wc(l)}),s}class m1 extends ds{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=No.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Bt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Bt(e)?Math.max(0,e):null,this.max=Bt(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(Un(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=YS(t,this);return e.bounds==="ticks"&&wb(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":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Un(e),this._valueRange=Un(this.max)-Un(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Un(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}m1.id="logarithmic";m1.defaults={ticks:{callback:Qo.formatters.logarithmic,major:{enabled:!0}}};function ba(n){const e=n.ticks;if(e.display&&n.display){const t=Kn(e.backdropPadding);return lt(e.font&&e.font.size,ot.font.size)+t.height}return 0}function KS(n,e,t){return t=Ct(t)?t:[t],{w:y2(n,e.string,t),h:t.length*e.lineHeight}}function Sc(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?qt/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),d=Dn(u.font),p=KS(n.ctx,d,n._pointLabels[a]);i[a]=p;const h=En(n.getIndexAngle(a)+r),g=Math.round(Ha(h)),_=Sc(g,f.x,p.w,0,180),b=Sc(g,f.y,p.h,90,270);ZS(t,e,h,_,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=GS(n,i,s)}function ZS(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 GS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ba(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?qt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),d=Math.round(Ha(En(f.angle+Ft))),p=e[u],h=xS(f.y,p.h,d),g=XS(d),_=QS(f.x,p.w,g);i.push({x:f.x,y:h,textAlign:g,left:_,top:h,right:_+p.w,bottom:h+p.h})}return i}function XS(n){return n===0||n===180?"center":n<180?"left":"right"}function QS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function xS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function e$(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=Dn(l.font),{x:r,y:a,textAlign:u,left:f,top:d,right:p,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!dt(g)){const _=Cs(l.borderRadius),b=Kn(l.backdropPadding);t.fillStyle=g;const k=f-b.left,$=d-b.top,C=p-f+b.width,T=h-d+b.height;Object.values(_).some(O=>O!==0)?(t.beginPath(),Do(t,{x:k,y:$,w:C,h:T,radius:_}),t.fill()):t.fillRect(k,$,C,T)}Eo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function h1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,bt);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 t$(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(),h1(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function n$(n,e,t){return zi(n,{label:t,index:e,type:"pointLabel"})}class er extends No{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=Kn(ba(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=Bt(e)&&!isNaN(e)?e:0,this.max=Bt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ba(this.options))}generateTickLabels(e){No.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=Nt(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=bt/(this._pointLabels.length||1),i=this.options.startAngle||0;return En(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(dt(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(dt(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 n$(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-Ft+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(),h1(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&&e$(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const d=s.setContext(this.getContext(f-1));t$(this,d,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:d}=u;!d||!f||(e.lineWidth=d,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=Dn(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 d=Kn(u.backdropPadding);e.fillRect(-o/2-d.left,-l-f.size/2-d.top,o+d.width,f.size+d.height)}Eo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}er.id="radialLinear";er.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Qo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};er.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};er.descriptors={angleLines:{_fallback:"grid"}};const tr={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}},vn=Object.keys(tr);function i$(n,e){return n-e}function $c(n,e){if(dt(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)),Bt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ls(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Tc(n,e,t,i){const s=vn.length;for(let l=vn.indexOf(n);l<s-1;++l){const o=tr[vn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return vn[l]}return vn[s-1]}function s$(n,e,t,i,s){for(let l=vn.length-1;l>=vn.indexOf(t);l--){const o=vn[l];if(tr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return vn[t?vn.indexOf(t):0]}function l$(n){for(let e=vn.indexOf(n)+1,t=vn.length;e<t;++e)if(tr[vn[e]].common)return vn[e]}function Cc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ba(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function o$(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:o$(n,i,s,t)}class Nl extends ds{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 Xb._date(e.adapters.date);s.init(t),rl(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:$c(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=Bt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Bt(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=Yk(s,l,o);return this._unit=t.unit||(i.autoSkip?Tc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):s$(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l$(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=fn(t,0,o),i=fn(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||Tc(l.minUnit,t,i,this._getLabelCapacity(t)),r=lt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ls(a)||a===!0,f={};let d=t,p,h;if(u&&(d=+e.startOf(d,"isoWeek",a)),d=+e.startOf(d,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 g=s.ticks.source==="data"&&this.getDataTimestamps();for(p=d,h=0;p<i;p=+e.add(p,r,o),h++)Cc(f,p,g);return(p===i||s.bounds==="ticks"||h===1)&&Cc(f,p,g),Object.keys(f).sort((_,b)=>_-b).map(_=>+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],d=i[t],p=a&&f&&d&&d.major,h=this._adapter.format(e,s||(p?f:u)),g=l.ticks.callback;return g?Nt(g,[h,t,i],this):h}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=Qn(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($c(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Tb(e.sort(i$))}}Nl.id="time";Nl.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function io(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}=ts(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}=ts(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 _1 extends Nl{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=io(t,this.min),this._tableRange=io(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(io(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return io(this._table,i*this._tableRange+this._minPos,!0)}}_1.id="timeseries";_1.defaults=Nl.defaults;/*!
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const r$={datetime:We.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:We.TIME_WITH_SECONDS,minute:We.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Xb._date.override({_id:"luxon",_create:function(n){return We.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return r$},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=We.fromFormat(n,e,t):n=We.fromISO(n,t):n instanceof Date?n=We.fromJSDate(n,t):i==="object"&&!(n instanceof We)&&(n=We.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 Oc(n){let e,t,i;return{c(){e=y("div"),m(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function a$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=Y(n[1]),t=D(),s=Y(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 u$(n){let e;return{c(){e=Y("Loading...")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function f$(n){let e,t,i,s,l,o=n[2]&&Oc();function r(f,d){return f[2]?u$:a$}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=D(),i=y("canvas"),s=D(),l=y("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Hr(i,"height","250px"),Hr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,d){S(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&I(o,1):(o=Oc(),o.c(),I(o,1),o.m(e,t)):o&&(ue(),P(o,1,1,()=>{o=null}),fe()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){I(o)},o(f){P(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function c$(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),de.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{d();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(d(),console.warn(h),de.error(h,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Xt(()=>(Po.register(Hi,xo,Xo,au,Nl,LS,zS),t(6,o=new Po(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:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(h){ne[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.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,p]}class d$ extends ve{constructor(e){super(),be(this,e,c$,f$,_e,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Ec=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function p$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var g1={exports:{}};(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 $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,T){T=T||{};var O,M;switch(r.util.type(C)){case"Object":if(M=r.util.objId(C),T[M])return T[M];O={},T[M]=O;for(var E in C)C.hasOwnProperty(E)&&(O[E]=$(C[E],T));return O;case"Array":return M=r.util.objId(C),T[M]?T[M]:(O=[],T[M]=O,C.forEach(function(A,L){O[L]=$(A,T)}),O);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(O){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(O.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==$)return C[T]}return null}},isActive:function($,C,T){for(var O="no-"+C;$;){var M=$.classList;if(M.contains(C))return!0;if(M.contains(O))return!1;$=$.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var T=r.util.clone(r.languages[$]);for(var O in C)T[O]=C[O];return T},insertBefore:function($,C,T,O){O=O||r.languages;var M=O[$],E={};for(var A in M)if(M.hasOwnProperty(A)){if(A==C)for(var L in T)T.hasOwnProperty(L)&&(E[L]=T[L]);T.hasOwnProperty(A)||(E[A]=M[A])}var N=O[$];return O[$]=E,r.languages.DFS(r.languages,function(R,F){F===N&&R!=$&&(this[R]=E)}),E},DFS:function $(C,T,O,M){M=M||{};var E=r.util.objId;for(var A in C)if(C.hasOwnProperty(A)){T.call(C,A,C[A],O||A);var L=C[A],N=r.util.type(L);N==="Object"&&!M[E(L)]?(M[E(L)]=!0,$(L,T,null,M)):N==="Array"&&!M[E(L)]&&(M[E(L)]=!0,$(L,T,A,M))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,T){var O={callback:T,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",O),O.elements=Array.prototype.slice.apply(O.container.querySelectorAll(O.selector)),r.hooks.run("before-all-elements-highlight",O);for(var M=0,E;E=O.elements[M++];)r.highlightElement(E,C===!0,O.callback)},highlightElement:function($,C,T){var O=r.util.getLanguage($),M=r.languages[O];r.util.setLanguage($,O);var E=$.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,O);var A=$.textContent,L={element:$,language:O,grammar:M,code:A};function N(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){N(r.util.encode(L.code));return}if(C&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(F){N(F.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else N(r.highlight(L.code,L.grammar,L.language))},highlight:function($,C,T){var O={code:$,grammar:C,language:T};if(r.hooks.run("before-tokenize",O),!O.grammar)throw new Error('The language "'+O.language+'" has no grammar.');return O.tokens=r.tokenize(O.code,O.grammar),r.hooks.run("after-tokenize",O),a.stringify(r.util.encode(O.tokens),O.language)},tokenize:function($,C){var T=C.rest;if(T){for(var O in T)C[O]=T[O];delete C.rest}var M=new d;return p(M,M.head,$),f($,M,C,M.head,0),g(M)},hooks:{all:{},add:function($,C){var T=r.hooks.all;T[$]=T[$]||[],T[$].push(C)},run:function($,C){var T=r.hooks.all[$];if(!(!T||!T.length))for(var O=0,M;M=T[O++];)M(C)}},Token:a};i.Prism=r;function a($,C,T,O){this.type=$,this.content=C,this.alias=T,this.length=(O||"").length|0}a.stringify=function $(C,T){if(typeof C=="string")return C;if(Array.isArray(C)){var O="";return C.forEach(function(N){O+=$(N,T)}),O}var M={type:C.type,content:$(C.content,T),tag:"span",classes:["token",C.type],attributes:{},language:T},E=C.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(M.classes,E):M.classes.push(E)),r.hooks.run("wrap",M);var A="";for(var L in M.attributes)A+=" "+L+'="'+(M.attributes[L]||"").replace(/"/g,"&quot;")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+A+">"+M.content+"</"+M.tag+">"};function u($,C,T,O){$.lastIndex=C;var M=$.exec(T);if(M&&O&&M[1]){var E=M[1].length;M.index+=E,M[0]=M[0].slice(E)}return M}function f($,C,T,O,M,E){for(var A in T)if(!(!T.hasOwnProperty(A)||!T[A])){var L=T[A];L=Array.isArray(L)?L:[L];for(var N=0;N<L.length;++N){if(E&&E.cause==A+","+N)return;var R=L[N],F=R.inside,q=!!R.lookbehind,V=!!R.greedy,U=R.alias;if(V&&!R.pattern.global){var j=R.pattern.toString().match(/[imsuy]*$/)[0];R.pattern=RegExp(R.pattern.source,j+"g")}for(var Q=R.pattern||R,X=O.next,Z=M;X!==C.tail&&!(E&&Z>=E.reach);Z+=X.value.length,X=X.next){var re=X.value;if(C.length>$.length)return;if(!(re instanceof a)){var ee=1,se;if(V){if(se=u(Q,Z,$,q),!se||se.index>=$.length)break;var Ue=se.index,ye=se.index+se[0].length,$e=Z;for($e+=X.value.length;Ue>=$e;)X=X.next,$e+=X.value.length;if($e-=X.value.length,Z=$e,X.value instanceof a)continue;for(var ze=X;ze!==C.tail&&($e<ye||typeof ze.value=="string");ze=ze.next)ee++,$e+=ze.value.length;ee--,re=$.slice(Z,$e),se.index-=Z}else if(se=u(Q,0,re,q),!se)continue;var Ue=se.index,Se=se[0],Oe=re.slice(0,Ue),Ge=re.slice(Ue+Se.length),_t=Z+re.length;E&&_t>E.reach&&(E.reach=_t);var Xe=X.prev;Oe&&(Xe=p(C,Xe,Oe),Z+=Oe.length),h(C,Xe,ee);var Ke=new a(A,F?r.tokenize(Se,F):Se,U,Se);if(X=p(C,Xe,Ke),Ge&&p(C,X,Ge),ee>1){var Te={cause:A+","+N,reach:_t};f($,C,T,X.prev,Z,Te),E&&Te.reach>E.reach&&(E.reach=Te.reach)}}}}}}function d(){var $={value:null,prev:null,next:null},C={value:null,prev:$,next:null};$.next=C,this.head=$,this.tail=C,this.length=0}function p($,C,T){var O=C.next,M={value:T,prev:C,next:O};return C.next=M,O.prev=M,$.length++,M}function h($,C,T){for(var O=C.next,M=0;M<T&&O!==$.tail;M++)O=O.next;C.next=O,O.prev=C,$.length-=M}function g($){for(var C=[],T=$.head.next;T!==$.tail;)C.push(T.value),T=T.next;return C}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function($){var C=JSON.parse($.data),T=C.language,O=C.code,M=C.immediateClose;i.postMessage(r.highlight(O,r.languages[T],T)),M&&i.close()},!1)),r;var _=r.util.currentScript();_&&(r.filename=_.src,_.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var k=document.readyState;k==="loading"||k==="interactive"&&_&&_.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof Ec<"u"&&(Ec.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(_,b){return"✖ Error "+_+" 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",d="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function p(_,b,k){var $=new XMLHttpRequest;$.open("GET",_,!0),$.onreadystatechange=function(){$.readyState==4&&($.status<400&&$.responseText?b($.responseText):$.status>=400?k(s($.status,$.statusText)):k(l))},$.send(null)}function h(_){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(_||"");if(b){var k=Number(b[1]),$=b[2],C=b[3];return $?C?[k,Number(C)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(_){_.selector+=", "+d}),t.hooks.add("before-sanity-check",function(_){var b=_.element;if(b.matches(d)){_.code="",b.setAttribute(r,a);var k=b.appendChild(document.createElement("CODE"));k.textContent=i;var $=b.getAttribute("data-src"),C=_.language;if(C==="none"){var T=(/\.(\w+)$/.exec($)||[,"none"])[1];C=o[T]||T}t.util.setLanguage(k,C),t.util.setLanguage(b,C);var O=t.plugins.autoloader;O&&O.loadLanguages(C),p($,function(M){b.setAttribute(r,u);var E=h(b.getAttribute("data-range"));if(E){var A=M.split(/\r\n?|\n/g),L=E[0],N=E[1]==null?A.length:E[1];L<0&&(L+=A.length),L=Math.max(0,Math.min(L-1,A.length)),N<0&&(N+=A.length),N=Math.max(0,Math.min(N,A.length)),M=A.slice(L,N).join(`
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+1))}k.textContent=M,t.highlightElement(k)},function(M){b.setAttribute(r,f),k.textContent=M})}}),t.plugins.fileHighlight={highlight:function(b){for(var k=(b||document).querySelectorAll(d),$=0,C;C=k[$++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(g1);var m$=g1.exports;const el=p$(m$);var h$={exports:{}};(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),d=0,p=0;p<f.length;++p){var h=s(f[p]);d+=h,d>r&&(f[p]=`
`+f[p],d=h)}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 d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,h="",g="",_=!1,b=0;b<p.length;++b){var k=p[b];k==o.element?_=!0:k.nodeName==="#text"&&(_?g+=k.nodeValue:h+=k.nodeValue,a.removeChild(k),--b)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(h$);(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 _$(n){let e,t,i;return{c(){e=y("div"),t=y("code"),m(t,"class","svelte-10s5tkd"),m(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),v(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&m(e,"class",i)},i:te,o:te,d(s){s&&w(e)}}}function g$(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=el.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),el.highlight(a,el.languages[l]||el.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 el<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class b1 extends ve{constructor(e){super(),be(this,e,g$,_$,_e,{class:0,content:2,language:3})}}const b$=n=>({}),Dc=n=>({}),v$=n=>({}),Ac=n=>({});function Ic(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C=n[4]&&!n[2]&&Lc(n);const T=n[19].header,O=kt(T,n,n[18],Ac);let M=n[4]&&n[2]&&Pc(n);const E=n[19].default,A=kt(E,n,n[18],null),L=n[19].footer,N=kt(L,n,n[18],Dc);return{c(){e=y("div"),t=y("div"),s=D(),l=y("div"),o=y("div"),C&&C.c(),r=D(),O&&O.c(),a=D(),M&&M.c(),u=D(),f=y("div"),A&&A.c(),d=D(),p=y("div"),N&&N.c(),m(t,"class","overlay"),m(o,"class","overlay-panel-section panel-header"),m(f,"class","overlay-panel-section panel-content"),m(p,"class","overlay-panel-section panel-footer"),m(l,"class",h="overlay-panel "+n[1]+" "+n[8]),x(l,"popup",n[2]),m(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(R,F){S(R,e,F),v(e,t),v(e,s),v(e,l),v(l,o),C&&C.m(o,null),v(o,r),O&&O.m(o,null),v(o,a),M&&M.m(o,null),v(l,u),v(l,f),A&&A.m(f,null),n[21](f),v(l,d),v(l,p),N&&N.m(p,null),b=!0,k||($=[J(t,"click",xe(n[20])),J(f,"scroll",n[22])],k=!0)},p(R,F){n=R,n[4]&&!n[2]?C?C.p(n,F):(C=Lc(n),C.c(),C.m(o,r)):C&&(C.d(1),C=null),O&&O.p&&(!b||F[0]&262144)&&St(O,T,n,n[18],b?wt(T,n[18],F,v$):$t(n[18]),Ac),n[4]&&n[2]?M?M.p(n,F):(M=Pc(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),A&&A.p&&(!b||F[0]&262144)&&St(A,E,n,n[18],b?wt(E,n[18],F,null):$t(n[18]),null),N&&N.p&&(!b||F[0]&262144)&&St(N,L,n,n[18],b?wt(L,n[18],F,b$):$t(n[18]),Dc),(!b||F[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&m(l,"class",h),(!b||F[0]&262)&&x(l,"popup",n[2]),(!b||F[0]&4)&&x(e,"padded",n[2]),(!b||F[0]&1)&&x(e,"active",n[0])},i(R){b||(R&&et(()=>{b&&(i||(i=Ve(t,na,{duration:ks,opacity:0},!0)),i.run(1))}),I(O,R),I(A,R),I(N,R),et(()=>{b&&(_&&_.end(1),g=ag(l,ci,n[2]?{duration:ks,y:-10}:{duration:ks,x:50}),g.start())}),b=!0)},o(R){R&&(i||(i=Ve(t,na,{duration:ks,opacity:0},!1)),i.run(0)),P(O,R),P(A,R),P(N,R),g&&g.invalidate(),_=Ta(l,ci,n[2]?{duration:ks,y:10}:{duration:ks,x:50}),b=!1},d(R){R&&w(e),R&&i&&i.end(),C&&C.d(),O&&O.d(R),M&&M.d(),A&&A.d(R),n[21](null),N&&N.d(R),R&&_&&_.end(),k=!1,De($)}}}function Lc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-close-line"></i>',m(e,"type","button"),m(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",xe(n[5])),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Pc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',m(e,"type","button"),m(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){S(s,e,l),t||(i=J(e,"click",xe(n[5])),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function y$(n){let e,t,i,s,l=n[0]&&Ic(n);return{c(){e=y("div"),l&&l.c(),m(e,"class","overlay-panel-wrapper"),m(e,"tabindex","-1")},m(o,r){S(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[J(window,"resize",n[10]),J(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&I(l,1)):(l=Ic(o),l.c(),I(l,1),l.m(e,null)):l&&(ue(),P(l,1,1,()=>{l=null}),fe())},i(o){t||(I(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,De(s)}}}let Gi,Er=[];function v1(){return Gi=Gi||document.querySelector(".overlays"),Gi||(Gi=document.createElement("div"),Gi.classList.add("overlays"),document.body.appendChild(Gi)),Gi}let ks=150;function Nc(){return 1e3+v1().querySelectorAll(".overlay-panel-container.active").length}function k$(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:d=void 0}=e,{beforeHide:p=void 0}=e;const h=Tt(),g="op_"+W.randomString(10);let _,b,k,$,C="",T=o;function O(){typeof d=="function"&&d()===!1||t(0,o=!0)}function M(){typeof p=="function"&&p()===!1||t(0,o=!1)}function E(){return o}async function A(Z){t(17,T=Z),Z?(k=document.activeElement,h("show"),_==null||_.focus()):(clearTimeout($),h("hide"),k==null||k.focus()),await cn(),L()}function L(){_&&(o?t(6,_.style.zIndex=Nc(),_):t(6,_.style="",_))}function N(){W.pushUnique(Er,g),document.body.classList.add("overlay-active")}function R(){W.removeByValue(Er,g),Er.length||document.body.classList.remove("overlay-active")}function F(Z){o&&f&&Z.code=="Escape"&&!W.isInput(Z.target)&&_&&_.style.zIndex==Nc()&&(Z.preventDefault(),M())}function q(Z){o&&V(b)}function V(Z,re){re&&t(8,C=""),Z&&($||($=setTimeout(()=>{if(clearTimeout($),$=null,!Z)return;if(Z.scrollHeight-Z.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}Z.scrollTop==0?t(8,C+=" scroll-top-reached"):Z.scrollTop+Z.offsetHeight==Z.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Xt(()=>(v1().appendChild(_),()=>{var Z;clearTimeout($),R(),(Z=_==null?void 0:_.classList)==null||Z.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?M():!0;function j(Z){ne[Z?"unshift":"push"](()=>{b=Z,t(7,b)})}const Q=Z=>V(Z.target);function X(Z){ne[Z?"unshift":"push"](()=>{_=Z,t(6,_)})}return n.$$set=Z=>{"class"in Z&&t(1,l=Z.class),"active"in Z&&t(0,o=Z.active),"popup"in Z&&t(2,r=Z.popup),"overlayClose"in Z&&t(3,a=Z.overlayClose),"btnClose"in Z&&t(4,u=Z.btnClose),"escClose"in Z&&t(12,f=Z.escClose),"beforeOpen"in Z&&t(13,d=Z.beforeOpen),"beforeHide"in Z&&t(14,p=Z.beforeHide),"$$scope"in Z&&t(18,s=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&A(o),n.$$.dirty[0]&128&&V(b,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?N():R())},[o,l,r,a,u,M,_,b,C,F,q,V,f,d,p,O,E,T,s,i,U,j,Q,X]}class on extends ve{constructor(e){super(),be(this,e,k$,y$,_e,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function w$(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function S$(n){let e,t=n[2].referer+"",i,s;return{c(){e=y("a"),i=Y(t),m(e,"href",s=n[2].referer),m(e,"target","_blank"),m(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&m(e,"href",s)},d(l){l&&w(e)}}}function $$(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function T$(n){let e,t,i;return t=new b1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","block")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function C$(n){var Pe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,d,p,h,g,_=n[2].status+"",b,k,$,C,T,O,M=((Pe=n[2].method)==null?void 0:Pe.toUpperCase())+"",E,A,L,N,R,F,q=n[2].auth+"",V,U,j,Q,X,Z,re=n[2].url+"",ee,se,ye,$e,ze,Ue,Se,Oe,Ge,_t,Xe,Ke=n[2].remoteIp+"",Te,ce,He,At,Ne,Ce,it=n[2].userIp+"",It,Vt,Wt,Pn,ti,$n,gt=n[2].userAgent+"",Nn,ps,ni,Oi,ms,mi,ke,Ie,Re,Qe,Et,Tn,Fn,Ui,sn,dn;function Rl(Fe,Ae){return Fe[2].referer?S$:w$}let K=Rl(n),G=K(n);const ie=[T$,$$],oe=[];function Me(Fe,Ae){return Ae&4&&(ke=null),ke==null&&(ke=!W.isEmpty(Fe[2].meta)),ke?0:1}return Ie=Me(n,-1),Re=oe[Ie]=ie[Ie](n),sn=new $i({props:{date:n[2].created}}),{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="ID",l=D(),o=y("td"),a=Y(r),u=D(),f=y("tr"),d=y("td"),d.textContent="Status",p=D(),h=y("td"),g=y("span"),b=Y(_),k=D(),$=y("tr"),C=y("td"),C.textContent="Method",T=D(),O=y("td"),E=Y(M),A=D(),L=y("tr"),N=y("td"),N.textContent="Auth",R=D(),F=y("td"),V=Y(q),U=D(),j=y("tr"),Q=y("td"),Q.textContent="URL",X=D(),Z=y("td"),ee=Y(re),se=D(),ye=y("tr"),$e=y("td"),$e.textContent="Referer",ze=D(),Ue=y("td"),G.c(),Se=D(),Oe=y("tr"),Ge=y("td"),Ge.textContent="Remote IP",_t=D(),Xe=y("td"),Te=Y(Ke),ce=D(),He=y("tr"),At=y("td"),At.textContent="User IP",Ne=D(),Ce=y("td"),It=Y(it),Vt=D(),Wt=y("tr"),Pn=y("td"),Pn.textContent="UserAgent",ti=D(),$n=y("td"),Nn=Y(gt),ps=D(),ni=y("tr"),Oi=y("td"),Oi.textContent="Meta",ms=D(),mi=y("td"),Re.c(),Qe=D(),Et=y("tr"),Tn=y("td"),Tn.textContent="Created",Fn=D(),Ui=y("td"),B(sn.$$.fragment),m(s,"class","min-width txt-hint txt-bold"),m(d,"class","min-width txt-hint txt-bold"),m(g,"class","label"),x(g,"label-danger",n[2].status>=400),m(C,"class","min-width txt-hint txt-bold"),m(N,"class","min-width txt-hint txt-bold"),m(Q,"class","min-width txt-hint txt-bold"),m($e,"class","min-width txt-hint txt-bold"),m(Ge,"class","min-width txt-hint txt-bold"),m(At,"class","min-width txt-hint txt-bold"),m(Pn,"class","min-width txt-hint txt-bold"),m(Oi,"class","min-width txt-hint txt-bold"),m(Tn,"class","min-width txt-hint txt-bold"),m(e,"class","table-border")},m(Fe,Ae){S(Fe,e,Ae),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,a),v(t,u),v(t,f),v(f,d),v(f,p),v(f,h),v(h,g),v(g,b),v(t,k),v(t,$),v($,C),v($,T),v($,O),v(O,E),v(t,A),v(t,L),v(L,N),v(L,R),v(L,F),v(F,V),v(t,U),v(t,j),v(j,Q),v(j,X),v(j,Z),v(Z,ee),v(t,se),v(t,ye),v(ye,$e),v(ye,ze),v(ye,Ue),G.m(Ue,null),v(t,Se),v(t,Oe),v(Oe,Ge),v(Oe,_t),v(Oe,Xe),v(Xe,Te),v(t,ce),v(t,He),v(He,At),v(He,Ne),v(He,Ce),v(Ce,It),v(t,Vt),v(t,Wt),v(Wt,Pn),v(Wt,ti),v(Wt,$n),v($n,Nn),v(t,ps),v(t,ni),v(ni,Oi),v(ni,ms),v(ni,mi),oe[Ie].m(mi,null),v(t,Qe),v(t,Et),v(Et,Tn),v(Et,Fn),v(Et,Ui),z(sn,Ui,null),dn=!0},p(Fe,Ae){var Ye;(!dn||Ae&4)&&r!==(r=Fe[2].id+"")&&le(a,r),(!dn||Ae&4)&&_!==(_=Fe[2].status+"")&&le(b,_),(!dn||Ae&4)&&x(g,"label-danger",Fe[2].status>=400),(!dn||Ae&4)&&M!==(M=((Ye=Fe[2].method)==null?void 0:Ye.toUpperCase())+"")&&le(E,M),(!dn||Ae&4)&&q!==(q=Fe[2].auth+"")&&le(V,q),(!dn||Ae&4)&&re!==(re=Fe[2].url+"")&&le(ee,re),K===(K=Rl(Fe))&&G?G.p(Fe,Ae):(G.d(1),G=K(Fe),G&&(G.c(),G.m(Ue,null))),(!dn||Ae&4)&&Ke!==(Ke=Fe[2].remoteIp+"")&&le(Te,Ke),(!dn||Ae&4)&&it!==(it=Fe[2].userIp+"")&&le(It,it),(!dn||Ae&4)&&gt!==(gt=Fe[2].userAgent+"")&&le(Nn,gt);let Je=Ie;Ie=Me(Fe,Ae),Ie===Je?oe[Ie].p(Fe,Ae):(ue(),P(oe[Je],1,1,()=>{oe[Je]=null}),fe(),Re=oe[Ie],Re?Re.p(Fe,Ae):(Re=oe[Ie]=ie[Ie](Fe),Re.c()),I(Re,1),Re.m(mi,null));const qe={};Ae&4&&(qe.date=Fe[2].created),sn.$set(qe)},i(Fe){dn||(I(Re),I(sn.$$.fragment,Fe),dn=!0)},o(Fe){P(Re),P(sn.$$.fragment,Fe),dn=!1},d(Fe){Fe&&w(e),G.d(),oe[Ie].d(),H(sn)}}}function M$(n){let e;return{c(){e=y("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function O$(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Close</span>',m(e,"type","button"),m(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[4]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function E$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[O$],header:[M$],default:[C$]},$$scope:{ctx:n}};return e=new on({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),H(e,s)}}}function D$(n,e,t){let i,s=new Kr;function l(d){return t(2,s=d),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(d){ne[d?"unshift":"push"](()=>{i=d,t(1,i)})}function u(d){he.call(this,n,d)}function f(d){he.call(this,n,d)}return[o,i,s,l,r,a,u,f]}class A$ extends ve{constructor(e){super(),be(this,e,D$,E$,_e,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function I$(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Include requests by admins"),m(e,"type","checkbox"),m(e,"id",t=n[14]),m(s,"for",o=n[14])},m(u,f){S(u,e,f),e.checked=n[1],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&m(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Fc(n){let e,t;return e=new d$({props:{filter:n[4],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Rc(n){let e,t;return e=new Ak({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function L$(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$=n[3],C,T=n[3],O,M;r=new Zo({}),r.$on("refresh",n[9]),p=new me({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[I$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new Jo({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),g.$on("submit",n[11]);let E=Fc(n),A=Rc(n);return{c(){e=y("div"),t=y("header"),i=y("nav"),s=y("div"),l=Y(n[6]),o=D(),B(r.$$.fragment),a=D(),u=y("div"),f=D(),d=y("div"),B(p.$$.fragment),h=D(),B(g.$$.fragment),_=D(),b=y("div"),k=D(),E.c(),C=D(),A.c(),O=we(),m(s,"class","breadcrumb-item"),m(i,"class","breadcrumbs"),m(u,"class","flex-fill"),m(d,"class","inline-flex"),m(t,"class","page-header"),m(b,"class","clearfix m-b-base"),m(e,"class","page-header-wrapper m-b-0")},m(L,N){S(L,e,N),v(e,t),v(t,i),v(i,s),v(s,l),v(t,o),z(r,t,null),v(t,a),v(t,u),v(t,f),v(t,d),z(p,d,null),v(e,h),z(g,e,null),v(e,_),v(e,b),v(e,k),E.m(e,null),S(L,C,N),A.m(L,N),S(L,O,N),M=!0},p(L,N){(!M||N&64)&&le(l,L[6]);const R={};N&49154&&(R.$$scope={dirty:N,ctx:L}),p.$set(R);const F={};N&1&&(F.value=L[0]),g.$set(F),N&8&&_e($,$=L[3])?(ue(),P(E,1,1,te),fe(),E=Fc(L),E.c(),I(E,1),E.m(e,null)):E.p(L,N),N&8&&_e(T,T=L[3])?(ue(),P(A,1,1,te),fe(),A=Rc(L),A.c(),I(A,1),A.m(O.parentNode,O)):A.p(L,N)},i(L){M||(I(r.$$.fragment,L),I(p.$$.fragment,L),I(g.$$.fragment,L),I(E),I(A),M=!0)},o(L){P(r.$$.fragment,L),P(p.$$.fragment,L),P(g.$$.fragment,L),P(E),P(A),M=!1},d(L){L&&w(e),H(r),H(p),H(g),E.d(L),L&&w(C),L&&w(O),A.d(L)}}}function P$(n){let e,t,i,s;e=new Sn({props:{$$slots:{default:[L$]},$$scope:{ctx:n}}});let l={};return i=new A$({props:l}),n[13](i),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(o,r){z(e,o,r),S(o,t,r),z(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(I(e.$$.fragment,o),I(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){H(e,o),o&&w(t),n[13](null),H(i,o)}}}const qc="includeAdminLogs";function N$(n,e,t){var k;let i,s,l;Ze(n,Mt,$=>t(6,l=$));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];ln(Mt,l="Request logs",l);let r,a="",u=((k=window.localStorage)==null?void 0:k.getItem(qc))<<0,f=1;function d(){t(3,f++,f)}const p=()=>d();function h(){u=this.checked,t(1,u)}const g=$=>t(0,a=$.detail),_=$=>r==null?void 0:r.show($==null?void 0:$.detail);function b($){ne[$?"unshift":"push"](()=>{r=$,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(qc,u<<0),n.$$.dirty&1&&t(4,s=W.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,d,p,h,g,_,b]}class F$ extends ve{constructor(e){super(),be(this,e,N$,P$,_e,{})}}const uu=Ln({});function mn(n,e,t){uu.set({text:n,yesCallback:e,noCallback:t})}function y1(){uu.set({})}function jc(n){let e,t,i;const s=n[17].default,l=kt(s,n,n[16],null);return{c(){e=y("div"),l&&l.c(),m(e,"class",n[1]),x(e,"active",n[0])},m(o,r){S(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&St(l,s,o,o[16],i?wt(s,o[16],r,null):$t(o[16]),null),(!i||r&2)&&m(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(I(l,o),o&&et(()=>{i&&(t||(t=Ve(e,ci,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,ci,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function R$(n){let e,t,i,s,l=n[0]&&jc(n);return{c(){e=y("div"),l&&l.c(),m(e,"class","toggler-container"),m(e,"tabindex","-1")},m(o,r){S(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[J(window,"mousedown",n[5]),J(window,"click",n[6]),J(window,"keydown",n[4]),J(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&I(l,1)):(l=jc(o),l.c(),I(l,1),l.m(e,null)):l&&(ue(),P(l,1,1,()=>{l=null}),fe())},i(o){t||(I(l),t=!0)},o(o){P(l),t=!1},d(o){o&&w(e),l&&l.d(),n[19](null),i=!1,De(s)}}}function q$(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,d,p,h,g,_=!1;const b=Tt();function k(){t(0,o=!1),_=!1,clearTimeout(g)}function $(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(p!=null&&p.scrollIntoViewIfNeeded?p==null||p.scrollIntoViewIfNeeded():p!=null&&p.scrollIntoView&&(p==null||p.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?k():$()}function T(U){return!d||U.classList.contains(u)||(h==null?void 0:h.contains(U))&&!d.contains(U)||d.contains(U)&&U.closest&&U.closest("."+u)}function O(U){(!o||T(U.target))&&(U.preventDefault(),U.stopPropagation(),C())}function M(U){(U.code==="Enter"||U.code==="Space")&&(!o||T(U.target))&&(U.preventDefault(),U.stopPropagation(),C())}function E(U){o&&r&&U.code==="Escape"&&(U.preventDefault(),k())}function A(U){o&&!(d!=null&&d.contains(U.target))?_=!0:_&&(_=!1)}function L(U){var j;o&&_&&!(d!=null&&d.contains(U.target))&&!(h!=null&&h.contains(U.target))&&!((j=U.target)!=null&&j.closest(".flatpickr-calendar"))&&k()}function N(U){A(U),L(U)}function R(U){F(),d==null||d.addEventListener("click",O),t(15,h=U||(d==null?void 0:d.parentNode)),h==null||h.addEventListener("click",O),h==null||h.addEventListener("keydown",M)}function F(){clearTimeout(g),d==null||d.removeEventListener("click",O),h==null||h.removeEventListener("click",O),h==null||h.removeEventListener("keydown",M)}Xt(()=>(R(),()=>F()));function q(U){ne[U?"unshift":"push"](()=>{p=U,t(3,p)})}function V(U){ne[U?"unshift":"push"](()=>{d=U,t(2,d)})}return n.$$set=U=>{"trigger"in U&&t(8,l=U.trigger),"active"in U&&t(0,o=U.active),"escClose"in U&&t(9,r=U.escClose),"autoScroll"in U&&t(10,a=U.autoScroll),"closableClass"in U&&t(11,u=U.closableClass),"class"in U&&t(1,f=U.class),"$$scope"in U&&t(16,s=U.$$scope)},n.$$.update=()=>{var U,j;n.$$.dirty&260&&d&&R(l),n.$$.dirty&32769&&(o?((U=h==null?void 0:h.classList)==null||U.add("active"),b("show")):((j=h==null?void 0:h.classList)==null||j.remove("active"),b("hide")))},[o,f,d,p,E,A,L,N,l,r,a,u,k,$,C,h,s,i,q,V]}class Jn extends ve{constructor(e){super(),be(this,e,q$,R$,_e,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Vc(n,e,t){const i=n.slice();return i[27]=e[t],i}function j$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("input"),s=D(),l=y("label"),o=Y("Unique"),m(e,"type","checkbox"),m(e,"id",t=n[30]),e.checked=i=n[3].unique,m(l,"for",r=n[30])},m(f,d){S(f,e,d),S(f,s,d),S(f,l,d),v(l,o),a||(u=J(e,"change",n[19]),a=!0)},p(f,d){d[0]&1073741824&&t!==(t=f[30])&&m(e,"id",t),d[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),d[0]&1073741824&&r!==(r=f[30])&&m(l,"for",r)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function V$(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a){var f;let u={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(u.value=a[2]),{props:u}}return o&&(e=Rt(o,r(n)),ne.push(()=>pe(e,"value",l))),{c(){e&&B(e.$$.fragment),i=we()},m(a,u){e&&z(e,a,u),S(a,i,u),s=!0},p(a,u){var d;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(d=a[0])==null?void 0:d.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],ge(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){ue();const p=e;P(p.$$.fragment,1,0,()=>{H(p,1)}),fe()}o?(e=Rt(o,r(a)),ne.push(()=>pe(e,"value",l)),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function z$(n){let e;return{c(){e=y("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function H$(n){let e,t,i,s;const l=[z$,V$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},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):(ue(),P(o[f],1,1,()=>{o[f]=null}),fe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function zc(n){let e,t,i,s=n[10],l=[];for(let o=0;o<s.length;o+=1)l[o]=Hc(Vc(n,s,o));return{c(){e=y("div"),t=y("span"),t.textContent="Presets",i=D();for(let o=0;o<l.length;o+=1)l[o].c();m(t,"class","txt txt-hint"),m(e,"class","inline-flex gap-10")},m(o,r){S(o,e,r),v(e,t),v(e,i);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null)},p(o,r){if(r[0]&9728){s=o[10];let a;for(a=0;a<s.length;a+=1){const u=Vc(o,s,a);l[a]?l[a].p(u,r):(l[a]=Hc(u),l[a].c(),l[a].m(e,null))}for(;a<l.length;a+=1)l[a].d(1);l.length=s.length}},d(o){o&&w(e),ht(l,o)}}}function Hc(n){let e,t=n[27]+"",i,s,l,o;function r(){return n[21](n[27])}return{c(){e=y("button"),i=Y(t),s=D(),m(e,"type","button"),m(e,"class","label link-primary"),x(e,"label-info",n[9].includes(n[27]))},m(a,u){S(a,e,u),v(e,i),v(e,s),l||(o=J(e,"click",r),l=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&le(i,t),u[0]&1536&&x(e,"label-info",n[9].includes(n[27]))},d(a){a&&w(e),l=!1,o()}}}function B$(n){let e,t,i,s,l,o;e=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[j$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[H$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&zc(n);return{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),s=D(),r&&r.c(),l=we()},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&64&&(d.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(d.$$scope={dirty:u,ctx:a}),i.$set(d),a[10].length>0?r?r.p(a,u):(r=zc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),r&&r.d(a),a&&w(l)}}}function U$(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=y("h4"),i=Y(t),s=Y(" index")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&w(e)}}}function Bc(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-delete-bin-7-line"></i>',m(e,"type","button"),m(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){S(s,e,l),t||(i=[Ee(Be.call(null,e,{text:"Delete",position:"top"})),J(e,"click",n[16])],t=!0)},p:te,d(s){s&&w(e),t=!1,De(i)}}}function W$(n){let e,t,i,s,l,o,r=n[5]!=""&&Bc(n);return{c(){r&&r.c(),e=D(),t=y("button"),t.innerHTML='<span class="txt">Cancel</span>',i=D(),s=y("button"),s.innerHTML='<span class="txt">Set index</span>',m(t,"type","button"),m(t,"class","btn btn-transparent"),m(s,"type","button"),m(s,"class","btn"),x(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),l||(o=[J(t,"click",n[17]),J(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Bc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(s,"btn-disabled",a[9].length<=0)},d(a){r&&r.d(a),a&&w(e),a&&w(t),a&&w(i),a&&w(s),l=!1,De(o)}}}function Y$(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[W$],header:[U$],default:[B$]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=je(s,i[l]);return e=new on({props:s}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){B(e.$$.fragment)},m(l,o){z(e,l,o),t=!0},p(l,o){const r=o[0]&16384?Ot(i,[i[0],Qt(l[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[22](null),H(e,l)}}}function K$(n,e,t){let i,s,l;const o=["collection","show","hide"];let r=tt(e,o);const a=Tt();let{collection:u}=e,f,d="",p="",h="",g,_=!1;function b(U,j){return t(6,h=W.isEmpty(j)?"":j),t(5,d=U||$()),t(2,p=d),f==null?void 0:f.show()}function k(){return f==null?void 0:f.hide()}function $(){const U=W.parseIndex("");return U.tableName=(u==null?void 0:u.name)||"",W.buildIndex(U)}function C(){a("remove",d),k()}function T(){l.length&&(a("submit",{old:d,new:p}),k())}function O(U){const j=W.clone(s),Q=j.columns.find(X=>X.name==U);Q?W.removeByValue(j.columns,Q):W.pushUnique(j.columns,{name:U}),t(2,p=W.buildIndex(j))}Xt(async()=>{t(8,_=!0);try{t(7,g=(await ut(()=>import("./CodeEditor-cdb3aab1.js"),["./CodeEditor-cdb3aab1.js","./index-8b57b6cd.js"],import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const M=()=>C(),E=()=>k(),A=()=>T(),L=U=>{t(3,s.unique=U.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,p=W.buildIndex(s))};function N(U){p=U,t(2,p)}const R=U=>O(U);function F(U){ne[U?"unshift":"push"](()=>{f=U,t(4,f)})}function q(U){he.call(this,n,U)}function V(U){he.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Gt(U)),t(14,r=tt(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,j,Q;n.$$.dirty[0]&1&&t(10,i=(((j=(U=u==null?void 0:u.schema)==null?void 0:U.filter(X=>!X.toDelete))==null?void 0:j.map(X=>X.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=W.parseIndex(p)),n.$$.dirty[0]&8&&t(9,l=((Q=s.columns)==null?void 0:Q.map(X=>X.name))||[])},[u,k,p,s,f,d,h,g,_,l,i,C,T,O,r,b,M,E,A,L,N,R,F,q,V]}class J$ extends ve{constructor(e){super(),be(this,e,K$,Y$,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Uc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=W.parseIndex(i[10]);return i[11]=s,i}function Wc(n){let e;return{c(){e=y("strong"),e.textContent="Unique:"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Yc(n){var p;let e,t,i,s=((p=n[11].columns)==null?void 0:p.map(Kc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Wc();function d(){return n[4](n[10],n[13])}return{c(){var h,g;e=y("button"),f&&f.c(),t=D(),i=y("span"),l=Y(s),m(i,"class","txt"),m(e,"type","button"),m(e,"class",o="label link-primary "+((g=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(h,g){var _,b;S(h,e,g),f&&f.m(e,null),v(e,t),v(e,i),v(i,l),a||(u=[Ee(r=Be.call(null,e,((b=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:b.message)||"")),J(e,"click",d)],a=!0)},p(h,g){var _,b,k,$,C;n=h,n[11].unique?f||(f=Wc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&s!==(s=((_=n[11].columns)==null?void 0:_.map(Kc).join(", "))+"")&&le(l,s),g&4&&o!==(o="label link-primary "+((k=(b=n[2].indexes)==null?void 0:b[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&m(e,"class",o),r&&jt(r.update)&&g&4&&r.update.call(null,((C=($=n[2].indexes)==null?void 0:$[n[13]])==null?void 0:C.message)||"")},d(h){h&&w(e),f&&f.d(),a=!1,De(u)}}}function Z$(n){var T,O,M;let e,t,i=(((O=(T=n[0])==null?void 0:T.indexes)==null?void 0:O.length)||0)+"",s,l,o,r,a,u,f,d,p,h,g,_,b=((M=n[0])==null?void 0:M.indexes)||[],k=[];for(let E=0;E<b.length;E+=1)k[E]=Yc(Uc(n,b,E));function $(E){n[7](E)}let C={};return n[0]!==void 0&&(C.collection=n[0]),d=new J$({props:C}),n[6](d),ne.push(()=>pe(d,"collection",$)),d.$on("remove",n[8]),d.$on("submit",n[9]),{c(){e=y("div"),t=Y("Unique constraints and indexes ("),s=Y(i),l=Y(")"),o=D(),r=y("div");for(let E=0;E<k.length;E+=1)k[E].c();a=D(),u=y("button"),u.innerHTML=`<span class="txt">+</span>
<span class="txt">New index</span>`,f=D(),B(d.$$.fragment),m(e,"class","section-title"),m(u,"type","button"),m(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),m(r,"class","indexes-list svelte-167lbwu")},m(E,A){S(E,e,A),v(e,t),v(e,s),v(e,l),S(E,o,A),S(E,r,A);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),S(E,f,A),z(d,E,A),h=!0,g||(_=J(u,"click",n[5]),g=!0)},p(E,[A]){var N,R,F;if((!h||A&1)&&i!==(i=(((R=(N=E[0])==null?void 0:N.indexes)==null?void 0:R.length)||0)+"")&&le(s,i),A&7){b=((F=E[0])==null?void 0:F.indexes)||[];let q;for(q=0;q<b.length;q+=1){const V=Uc(E,b,q);k[q]?k[q].p(V,A):(k[q]=Yc(V),k[q].c(),k[q].m(r,a))}for(;q<k.length;q+=1)k[q].d(1);k.length=b.length}const L={};!p&&A&1&&(p=!0,L.collection=E[0],ge(()=>p=!1)),d.$set(L)},i(E){h||(I(d.$$.fragment,E),h=!0)},o(E){P(d.$$.fragment,E),h=!1},d(E){E&&w(e),E&&w(o),E&&w(r),ht(k,E),E&&w(f),n[6](null),H(d,E),g=!1,_()}}}const Kc=n=>n.name;function G$(n,e,t){let i;Ze(n,Ti,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==h){t(0,s.indexes[_]=g,s),ui("indexes."+_);return}s.indexes.push(g),t(0,s)}const r=(h,g)=>l==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){ne[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const d=h=>{for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==h.detail){s.indexes.splice(g,1),ui("indexes."+g);break}t(0,s)},p=h=>{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,d,p]}class X$ extends ve{constructor(e){super(),be(this,e,G$,Z$,_e,{collection:0})}}function Jc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),o=Y(l),r=D(),m(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),m(s,"class","txt"),m(e,"tabindex","0"),m(e,"class","dropdown-item closable svelte-1gz9b6p")},m(p,h){S(p,e,h),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",In(f)),J(e,"keydown",In(d))],a=!0)},p(p,h){n=p},d(p){p&&w(e),a=!1,De(u)}}}function Q$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Zc(Jc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Jc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Zc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function x$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Jn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[Q$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=D(),s=y("div"),s.textContent="New field",l=D(),B(o.$$.fragment),m(t,"class","ri-add-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),z(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const h={};p&512&&(h.$$scope={dirty:p,ctx:d}),o.$set(h),(!a||p&1&&r!==(r="field-types-btn "+d[0]+" svelte-1gz9b6p"))&&m(e,"class",r)},i(d){a||(I(o.$$.fragment,d),a=!0)},o(d){P(o.$$.fragment,d),a=!1},d(d){d&&w(e),H(o),u=!1,f()}}}function eT(n,e,t){let{class:i=""}=e;const s=Tt(),l=[{label:"Plain text",value:"text",icon:W.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:W.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:W.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:W.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:W.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:W.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:W.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:W.getFieldTypeIcon("select")},{label:"File",value:"file",icon:W.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:W.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:W.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class tT extends ve{constructor(e){super(),be(this,e,eT,x$,_e,{class:0})}}const nT=n=>({interactive:n&128,hasErrors:n&64}),Gc=n=>({interactive:n[7],hasErrors:n[6]}),iT=n=>({interactive:n&128,hasErrors:n&64}),Xc=n=>({interactive:n[7],hasErrors:n[6]}),sT=n=>({interactive:n&128,hasErrors:n&64}),Qc=n=>({interactive:n[7],hasErrors:n[6]}),lT=n=>({interactive:n&128,hasErrors:n&64}),xc=n=>({interactive:n[7],hasErrors:n[6]});function ed(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="drag-handle"></span>',m(e,"class","drag-handle-wrapper"),m(e,"draggable","true"),m(e,"aria-label","Sort")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function td(n){let e,t,i,s;return{c(){e=y("span"),m(e,"class","marker marker-required")},m(l,o){S(l,e,o),i||(s=Ee(t=Be.call(null,e,n[5])),i=!0)},p(l,o){t&&jt(t.update)&&o&32&&t.update.call(null,l[5])},d(l){l&&w(e),i=!1,s()}}}function oT(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g=n[0].required&&td(n);return{c(){e=y("div"),g&&g.c(),t=D(),i=y("div"),s=y("i"),o=D(),r=y("input"),m(e,"class","markers"),m(s,"class",l=W.getFieldTypeIcon(n[0].type)),m(i,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(i,"txt-disabled",!n[7]),m(r,"type","text"),r.required=!0,r.disabled=a=!n[7],r.readOnly=u=n[0].id&&n[0].system,m(r,"spellcheck","false"),r.autofocus=f=!n[0].id,m(r,"placeholder","Field name"),r.value=d=n[0].name},m(_,b){S(_,e,b),g&&g.m(e,null),S(_,t,b),S(_,i,b),v(i,s),S(_,o,b),S(_,r,b),n[16](r),n[0].id||r.focus(),p||(h=J(r,"input",n[17]),p=!0)},p(_,b){_[0].required?g?g.p(_,b):(g=td(_),g.c(),g.m(e,null)):g&&(g.d(1),g=null),b&1&&l!==(l=W.getFieldTypeIcon(_[0].type))&&m(s,"class",l),b&128&&x(i,"txt-disabled",!_[7]),b&128&&a!==(a=!_[7])&&(r.disabled=a),b&1&&u!==(u=_[0].id&&_[0].system)&&(r.readOnly=u),b&1&&f!==(f=!_[0].id)&&(r.autofocus=f),b&1&&d!==(d=_[0].name)&&r.value!==d&&(r.value=d)},d(_){_&&w(e),g&&g.d(),_&&w(t),_&&w(i),_&&w(o),_&&w(r),n[16](null),p=!1,h()}}}function rT(n){let e;return{c(){e=y("span"),m(e,"class","separator")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function aT(n){let e,t,i,s,l;return{c(){e=y("button"),t=y("i"),m(t,"class","ri-settings-3-line"),m(e,"type","button"),m(e,"aria-label","Toggle field options"),m(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[4]?"btn-secondary":"btn-transparent")),x(e,"btn-hint",!n[4]&&!n[6]),x(e,"btn-danger",n[6])},m(o,r){S(o,e,r),v(e,t),s||(l=J(e,"click",n[12]),s=!0)},p(o,r){r&16&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[4]?"btn-secondary":"btn-transparent"))&&m(e,"class",i),r&80&&x(e,"btn-hint",!o[4]&&!o[6]),r&80&&x(e,"btn-danger",o[6])},d(o){o&&w(e),s=!1,l()}}}function uT(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-restart-line"></i>',m(e,"type","button"),m(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),m(e,"aria-label","Restore")},m(s,l){S(s,e,l),t||(i=[Ee(Be.call(null,e,"Restore")),J(e,"click",n[10])],t=!0)},p:te,d(s){s&&w(e),t=!1,De(i)}}}function nd(n){let e,t,i,s,l,o,r,a,u,f,d;const p=n[14].options,h=kt(p,n,n[23],Qc),g=n[14].beforeNonempty,_=kt(g,n,n[23],Xc);r=new me({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[fT,({uniqueId:C})=>({29:C}),({uniqueId:C})=>C?536870912:0]},$$scope:{ctx:n}}});const b=n[14].afterNonempty,k=kt(b,n,n[23],Gc);let $=!n[0].toDelete&&id(n);return{c(){e=y("div"),t=y("div"),i=y("div"),h&&h.c(),s=D(),_&&_.c(),l=D(),o=y("div"),B(r.$$.fragment),a=D(),k&&k.c(),u=D(),$&&$.c(),m(i,"class","col-sm-12 hidden-empty"),m(o,"class","col-sm-4"),m(t,"class","grid grid-sm"),m(e,"class","schema-field-options")},m(C,T){S(C,e,T),v(e,t),v(t,i),h&&h.m(i,null),v(t,s),_&&_.m(t,null),v(t,l),v(t,o),z(r,o,null),v(t,a),k&&k.m(t,null),v(t,u),$&&$.m(t,null),d=!0},p(C,T){h&&h.p&&(!d||T&8388800)&&St(h,p,C,C[23],d?wt(p,C[23],T,sT):$t(C[23]),Qc),_&&_.p&&(!d||T&8388800)&&St(_,g,C,C[23],d?wt(g,C[23],T,iT):$t(C[23]),Xc);const O={};T&545259553&&(O.$$scope={dirty:T,ctx:C}),r.$set(O),k&&k.p&&(!d||T&8388800)&&St(k,b,C,C[23],d?wt(b,C[23],T,nT):$t(C[23]),Gc),C[0].toDelete?$&&(ue(),P($,1,1,()=>{$=null}),fe()):$?($.p(C,T),T&1&&I($,1)):($=id(C),$.c(),I($,1),$.m(t,null))},i(C){d||(I(h,C),I(_,C),I(r.$$.fragment,C),I(k,C),I($),C&&et(()=>{d&&(f||(f=Ve(e,rt,{duration:150},!0)),f.run(1))}),d=!0)},o(C){P(h,C),P(_,C),P(r.$$.fragment,C),P(k,C),P($),C&&(f||(f=Ve(e,rt,{duration:150},!1)),f.run(0)),d=!1},d(C){C&&w(e),h&&h.d(C),_&&_.d(C),H(r),k&&k.d(C),$&&$.d(),C&&f&&f.end()}}}function fT(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),o=Y(n[5]),r=D(),a=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(l,"class","txt"),m(a,"class","ri-information-line link-hint"),m(s,"for",f=n[29])},m(h,g){S(h,e,g),e.checked=n[0].required,S(h,i,g),S(h,s,g),v(s,l),v(l,o),v(s,r),v(s,a),d||(p=[J(e,"change",n[18]),Ee(u=Be.call(null,a,{text:`Requires the field value NOT to be ${W.zeroDefaultStr(n[0])}.`,position:"right"}))],d=!0)},p(h,g){g&536870912&&t!==(t=h[29])&&m(e,"id",t),g&1&&(e.checked=h[0].required),g&32&&le(o,h[5]),u&&jt(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${W.zeroDefaultStr(h[0])}.`,position:"right"}),g&536870912&&f!==(f=h[29])&&m(s,"for",f)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,De(p)}}}function id(n){let e,t,i,s,l,o,r,a,u;return a=new Jn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[cT]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=D(),s=y("div"),l=y("button"),o=y("i"),r=D(),B(a.$$.fragment),m(t,"class","flex-fill"),m(o,"class","ri-more-line"),m(l,"type","button"),m(l,"aria-label","More"),m(l,"class","btn btn-circle btn-sm btn-transparent"),m(s,"class","inline-flex flex-gap-sm flex-nowrap"),m(e,"class","col-sm-4 m-l-auto txt-right")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(s,l),v(l,o),v(l,r),z(a,l,null),u=!0},p(f,d){const p={};d&8388608&&(p.$$scope={dirty:d,ctx:f}),a.$set(p)},i(f){u||(I(a.$$.fragment,f),u=!0)},o(f){P(a.$$.fragment,f),u=!1},d(f){f&&w(e),H(a)}}}function cT(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Remove</span>',m(e,"type","button"),m(e,"class","dropdown-item txt-right")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[9]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function dT(n){let e,t,i,s,l,o,r,a,u,f,d,p=n[7]&&ed();s=new me({props:{class:"form-field required m-0 "+(n[7]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[oT]},$$scope:{ctx:n}}});const h=n[14].default,g=kt(h,n,n[23],xc),_=g||rT();function b(T,O){if(T[0].toDelete)return uT;if(T[7])return aT}let k=b(n),$=k&&k(n),C=n[7]&&n[4]&&nd(n);return{c(){e=y("div"),t=y("div"),p&&p.c(),i=D(),B(s.$$.fragment),l=D(),_&&_.c(),o=D(),$&&$.c(),r=D(),C&&C.c(),m(t,"class","schema-field-header"),m(e,"draggable",!0),m(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[7]&&n[4]),x(e,"deleted",n[0].toDelete),x(e,"drag-over",n[3])},m(T,O){S(T,e,O),v(e,t),p&&p.m(t,null),v(t,i),z(s,t,null),v(t,l),_&&_.m(t,null),v(t,o),$&&$.m(t,null),v(e,r),C&&C.m(e,null),u=!0,f||(d=[J(e,"dragstart",n[19]),J(e,"dragenter",n[20]),J(e,"drop",xe(n[21])),J(e,"dragleave",n[22]),J(e,"dragover",xe(n[15]))],f=!0)},p(T,[O]){T[7]?p||(p=ed(),p.c(),p.m(t,i)):p&&(p.d(1),p=null);const M={};O&128&&(M.class="form-field required m-0 "+(T[7]?"":"disabled")),O&2&&(M.name="schema."+T[1]+".name"),O&8388773&&(M.$$scope={dirty:O,ctx:T}),s.$set(M),g&&g.p&&(!u||O&8388800)&&St(g,h,T,T[23],u?wt(h,T[23],O,lT):$t(T[23]),xc),k===(k=b(T))&&$?$.p(T,O):($&&$.d(1),$=k&&k(T),$&&($.c(),$.m(t,null))),T[7]&&T[4]?C?(C.p(T,O),O&144&&I(C,1)):(C=nd(T),C.c(),I(C,1),C.m(e,null)):C&&(ue(),P(C,1,1,()=>{C=null}),fe()),(!u||O&1)&&x(e,"required",T[0].required),(!u||O&144)&&x(e,"expanded",T[7]&&T[4]),(!u||O&1)&&x(e,"deleted",T[0].toDelete),(!u||O&8)&&x(e,"drag-over",T[3])},i(T){u||(I(s.$$.fragment,T),I(_,T),I(C),T&&et(()=>{u&&(a||(a=Ve(e,rt,{duration:150},!0)),a.run(1))}),u=!0)},o(T){P(s.$$.fragment,T),P(_,T),P(C),T&&(a||(a=Ve(e,rt,{duration:150},!1)),a.run(0)),u=!1},d(T){T&&w(e),p&&p.d(),H(s),_&&_.d(T),$&&$.d(),C&&C.d(),T&&a&&a.end(),f=!1,De(d)}}}let Dr=[];function pT(n,e,t){let i,s,l,o;Ze(n,Ti,j=>t(13,o=j));let{$$slots:r={},$$scope:a}=e,{key:u=""}=e,{field:f=new wn}=e,d,p=!1,h=!1;const g="f_"+W.randomString(8),_=Tt(),b={bool:"Nonfalsey",number:"Nonzero"};function k(){f.id?t(0,f.toDelete=!0,f):_("remove")}function $(){t(0,f.toDelete=!1,f),tn({})}function C(j){return W.slugify(j)}function T(){t(4,h=!0),E()}function O(){t(4,h=!1)}function M(){h?O():T()}function E(){for(let j of Dr)j.id!=g&&j.collapse()}Xt(()=>(Dr.push({id:g,collapse:O}),f.onMountSelect&&(t(0,f.onMountSelect=!1,f),d==null||d.select()),()=>{W.removeByKey(Dr,"id",g)}));function A(j){he.call(this,n,j)}function L(j){ne[j?"unshift":"push"](()=>{d=j,t(2,d)})}const N=j=>{const Q=f.name;t(0,f.name=C(j.target.value),f),j.target.value=f.name,_("rename",{oldName:Q,newName:f.name})};function R(){f.required=this.checked,t(0,f)}const F=j=>{if(!j.target.classList.contains("drag-handle-wrapper")){j.preventDefault();return}const Q=document.createElement("div");j.dataTransfer.setDragImage(Q,0,0),i&&_("dragstart",j)},q=j=>{i&&(t(3,p=!0),_("dragenter",j))},V=j=>{i&&(t(3,p=!1),_("drop",j))},U=j=>{i&&(t(3,p=!1),_("dragleave",j))};return n.$$set=j=>{"key"in j&&t(1,u=j.key),"field"in j&&t(0,f=j.field),"$$scope"in j&&t(23,a=j.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&f.toDelete&&f.originalName&&f.name!==f.originalName&&t(0,f.name=f.originalName,f),n.$$.dirty&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty&1&&t(7,i=!f.toDelete&&!(f.id&&f.system)),n.$$.dirty&8194&&t(6,s=!W.isEmpty(W.getNestedVal(o,`schema.${u}`))),n.$$.dirty&1&&t(5,l=b[f==null?void 0:f.type]||"Nonempty")},[f,u,d,p,h,l,s,i,_,k,$,C,M,o,r,A,L,N,R,F,q,V,U,a]}class pi extends ve{constructor(e){super(),be(this,e,pT,dT,_e,{key:1,field:0})}}function mT(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Min length"),s=D(),l=y("input"),m(e,"for",i=n[13]),m(l,"type","number"),m(l,"id",o=n[13]),m(l,"step","1"),m(l,"min","0")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&m(e,"for",i),f&8192&&o!==(o=u[13])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function hT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=Y("Max length"),s=D(),l=y("input"),m(e,"for",i=n[13]),m(l,"type","number"),m(l,"id",o=n[13]),m(l,"step","1"),m(l,"min",r=n[0].options.min||0)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ae(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&8192&&i!==(i=f[13])&&m(e,"for",i),d&8192&&o!==(o=f[13])&&m(l,"id",o),d&1&&r!==(r=f[0].options.min||0)&&m(l,"min",r),d&1&&pt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Regex pattern"),s=D(),l=y("input"),m(e,"for",i=n[13]),m(l,"type","text"),m(l,"id",o=n[13]),m(l,"placeholder","Valid Go regular expression, eg. ^w+$")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.pattern),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&m(e,"for",i),f&8192&&o!==(o=u[13])&&m(l,"id",o),f&1&&l.value!==u[0].options.pattern&&ae(l,u[0].options.pattern)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gT(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:[mT,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[hT,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[_T,({uniqueId:d})=>({13:d}),({uniqueId:d})=>d?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),a=y("div"),B(u.$$.fragment),m(t,"class","col-sm-3"),m(l,"class","col-sm-3"),m(a,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(d,p){S(d,e,p),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),v(e,a),z(u,a,null),f=!0},p(d,p){const h={};p&2&&(h.name="schema."+d[1]+".options.min"),p&24577&&(h.$$scope={dirty:p,ctx:d}),i.$set(h);const g={};p&2&&(g.name="schema."+d[1]+".options.max"),p&24577&&(g.$$scope={dirty:p,ctx:d}),o.$set(g);const _={};p&2&&(_.name="schema."+d[1]+".options.pattern"),p&24577&&(_.$$scope={dirty:p,ctx:d}),u.$set(_)},i(d){f||(I(i.$$.fragment,d),I(o.$$.fragment,d),I(u.$$.fragment,d),f=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),f=!1},d(d){d&&w(e),H(i),H(o),H(u)}}}function bT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[gT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("drop",n[9]),e.$on("dragstart",n[10]),e.$on("dragenter",n[11]),e.$on("dragleave",n[12]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function vT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(k){l=k,t(0,l)}function d(k){he.call(this,n,k)}function p(k){he.call(this,n,k)}function h(k){he.call(this,n,k)}function g(k){he.call(this,n,k)}function _(k){he.call(this,n,k)}function b(k){he.call(this,n,k)}return n.$$set=k=>{e=je(je({},e),Gt(k)),t(2,s=tt(e,i)),"field"in k&&t(0,l=k.field),"key"in k&&t(1,o=k.key)},[l,o,s,r,a,u,f,d,p,h,g,_,b]}class yT extends ve{constructor(e){super(),be(this,e,vT,bT,_e,{field:0,key:1})}}function kT(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Min"),s=D(),l=y("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.min),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.min&&ae(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=Y("Max"),s=D(),l=y("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),m(l,"min",r=n[0].options.min)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ae(l,n[0].options.max),a||(u=J(l,"input",n[4]),a=!0)},p(f,d){d&4096&&i!==(i=f[12])&&m(e,"for",i),d&4096&&o!==(o=f[12])&&m(l,"id",o),d&1&&r!==(r=f[0].options.min)&&m(l,"min",r),d&1&&pt(l.value)!==f[0].options.max&&ae(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function ST(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:[kT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[wT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function $T(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[ST]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function TT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=pt(this.value),t(0,l)}function a(){l.options.max=pt(this.value),t(0,l)}function u(b){l=b,t(0,l)}function f(b){he.call(this,n,b)}function d(b){he.call(this,n,b)}function p(b){he.call(this,n,b)}function h(b){he.call(this,n,b)}function g(b){he.call(this,n,b)}function _(b){he.call(this,n,b)}return n.$$set=b=>{e=je(je({},e),Gt(b)),t(2,s=tt(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,h,g,_]}class CT extends ve{constructor(e){super(),be(this,e,TT,$T,_e,{field:0,key:1})}}function MT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function OT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(g){l=g,t(0,l)}function a(g){he.call(this,n,g)}function u(g){he.call(this,n,g)}function f(g){he.call(this,n,g)}function d(g){he.call(this,n,g)}function p(g){he.call(this,n,g)}function h(g){he.call(this,n,g)}return n.$$set=g=>{e=je(je({},e),Gt(g)),t(2,s=tt(e,i)),"field"in g&&t(0,l=g.field),"key"in g&&t(1,o=g.key)},[l,o,s,r,a,u,f,d,p,h]}class ET extends ve{constructor(e){super(),be(this,e,OT,MT,_e,{field:0,key:1})}}function DT(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r<l.length;r+=1)o=je(o,l[r]);return{c(){e=y("input"),ai(e,o)},m(r,a){S(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(s=J(e,"input",n[6]),i=!0)},p(r,[a]){ai(e,o=Ot(l,[a&32&&t!==(t=r[5].type||"text")&&{type:t},a&16&&e.value!==r[4]&&{value:r[4]},a&8&&{disabled:r[3]},a&4&&{readOnly:r[2]},a&32&&r[5]])),"value"in o&&(e.value=o.value)},i:te,o:te,d(r){r&&w(e),i=!1,s()}}}function AT(n,e,t){let i;const s=["value","separator","readonly","disabled"];let l=tt(e,s),{value:o=[]}=e,{separator:r=","}=e,{readonly:a=null}=e,{disabled:u=null}=e;const f=d=>{t(0,o=W.splitNonEmpty(d.target.value,r))};return n.$$set=d=>{e=je(je({},e),Gt(d)),t(5,l=tt(e,s)),"value"in d&&t(0,o=d.value),"separator"in d&&t(1,r=d.separator),"readonly"in d&&t(2,a=d.readonly),"disabled"in d&&t(3,u=d.disabled)},n.$$.update=()=>{n.$$.dirty&1&&t(4,i=(o||[]).join(", "))},[o,r,a,u,i,l,f]}class zs extends ve{constructor(e){super(),be(this,e,AT,DT,_e,{value:0,separator:1,readonly:2,disabled:3})}}function IT(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(b){n[3](b)}let _={id:n[12],disabled:!W.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new zs({props:_}),ne.push(()=>pe(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(h=Ee(Be.call(null,s,{text:`List of domains that are NOT allowed.
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&m(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!W.isEmpty(b[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptDomains,ge(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,h()}}}function LT(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(b){n[4](b)}let _={id:n[12]+".options.onlyDomains",disabled:!W.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new zs({props:_}),ne.push(()=>pe(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]+".options.onlyDomains"),m(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(h=Ee(Be.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]+".options.onlyDomains"))&&m(e,"for",l);const $={};k&4096&&($.id=b[12]+".options.onlyDomains"),k&1&&($.disabled=!W.isEmpty(b[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyDomains,ge(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,h()}}}function PT(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:[IT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[LT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function NT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(b){n.$$.not_equal(l.options.exceptDomains,b)&&(l.options.exceptDomains=b,t(0,l))}function a(b){n.$$.not_equal(l.options.onlyDomains,b)&&(l.options.onlyDomains=b,t(0,l))}function u(b){l=b,t(0,l)}function f(b){he.call(this,n,b)}function d(b){he.call(this,n,b)}function p(b){he.call(this,n,b)}function h(b){he.call(this,n,b)}function g(b){he.call(this,n,b)}function _(b){he.call(this,n,b)}return n.$$set=b=>{e=je(je({},e),Gt(b)),t(2,s=tt(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,s,r,a,u,f,d,p,h,g,_]}class k1 extends ve{constructor(e){super(),be(this,e,FT,NT,_e,{field:0,key:1})}}function RT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new k1({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function qT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(g){l=g,t(0,l)}function a(g){he.call(this,n,g)}function u(g){he.call(this,n,g)}function f(g){he.call(this,n,g)}function d(g){he.call(this,n,g)}function p(g){he.call(this,n,g)}function h(g){he.call(this,n,g)}return n.$$set=g=>{e=je(je({},e),Gt(g)),t(2,s=tt(e,i)),"field"in g&&t(0,l=g.field),"key"in g&&t(1,o=g.key)},[l,o,s,r,a,u,f,d,p,h]}class jT extends ve{constructor(e){super(),be(this,e,qT,RT,_e,{field:0,key:1})}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(g){l=g,t(0,l)}function a(g){he.call(this,n,g)}function u(g){he.call(this,n,g)}function f(g){he.call(this,n,g)}function d(g){he.call(this,n,g)}function p(g){he.call(this,n,g)}function h(g){he.call(this,n,g)}return n.$$set=g=>{e=je(je({},e),Gt(g)),t(2,s=tt(e,i)),"field"in g&&t(0,l=g.field),"key"in g&&t(1,o=g.key)},[l,o,s,r,a,u,f,d,p,h]}class HT extends ve{constructor(e){super(),be(this,e,zT,VT,_e,{field:0,key:1})}}var Ar=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Ms={_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},kl={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},gn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function sd(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Ir=function(n){return n instanceof Array?n:[n]};function pn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(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 so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function w1(n,e){if(e(n))return n;if(n.parentNode)return w1(n.parentNode,e)}function lo(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),s=ct("span","arrowUp"),l=ct("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 Mn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Lr=function(){},Fo=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},BT={D:Lr,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*Vn(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:Lr,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:Lr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},es={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})"},dl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[dl.w(n,e,t)]},F:function(n,e,t){return Fo(dl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return gn(dl.h(n,e,t))},H:function(n){return gn(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[Vn(n.getHours()>11)]},M:function(n,e){return Fo(n.getMonth(),!0,e)},S:function(n){return gn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return gn(n.getFullYear(),4)},d:function(n){return gn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return gn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return gn(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)}},S1=function(n){var e=n.config,t=e===void 0?Ms:e,i=n.l10n,s=i===void 0?kl: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(d,p,h){return dl[d]&&h[p-1]!=="\\"?dl[d](r,f,t):d!=="\\"?d:""}).join("")}},va=function(n){var e=n.config,t=e===void 0?Ms:e,i=n.l10n,s=i===void 0?kl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,d=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 p=o||(t||Ms).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,p);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,_=[],b=0,k=0,$="";b<p.length;b++){var C=p[b],T=C==="\\",O=p[b-1]==="\\"||T;if(es[C]&&!O){$+=es[C];var M=new RegExp($).exec(l);M&&(g=!0)&&_[C!=="Y"?"push":"unshift"]({fn:BT[C],val:M[++k]})}else T||($+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),_.forEach(function(E){var A=E.fn,L=E.val;return f=A(f,L,u)||f}),f=g?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+d));return}return r===!0&&f.setHours(0,0,0,0),f}}};function On(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 UT=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Pr=function(n,e,t){return n*3600+e*60+t},WT=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},YT={DAY:864e5};function Nr(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 an=globalThis&&globalThis.__assign||function(){return an=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},an.apply(this,arguments)},ld=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},KT=300;function JT(n,e){var t={config:an(an({},Ms),Kt.defaultConfig),l10n:kl};t.parseDate=va({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=_,t._setHoursFromDate=p,t._positionCalendar=it,t.changeMonth=ee,t.changeYear=Se,t.clear=se,t.close=ye,t.onMouseOver=Ke,t._createElement=ct,t.createDay=M,t.destroy=$e,t.isEnabled=Oe,t.jumpToDate=$,t.updateValue=sn,t.open=ce,t.redraw=Wt,t.set=gt,t.setDate=ps,t.toggle=Ie;function i(){t.utils={getDaysInMonth:function(K,G){return K===void 0&&(K=t.currentMonth),G===void 0&&(G=t.currentYear),K===1&&(G%4===0&&G%100!==0||G%400===0)?29:t.l10n.daysInMonth[K]}}}function s(){t.element=t.input=n,t.isOpen=!1,At(),Ce(),ms(),Oi(),i(),t.isMobile||O(),k(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&p(t.config.noCalendar?t.latestSelectedDateObj:void 0),sn(!1)),r();var K=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&K&&it(),Re("onReady")}function l(){var K;return((K=t.calendarContainer)===null||K===void 0?void 0:K.getRootNode()).activeElement||document.activeElement}function o(K){return K.bind(t)}function r(){var K=t.config;K.weekNumbers===!1&&K.showMonths===1||K.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 G=(t.days.offsetWidth+1)*K.showMonths;t.daysContainer.style.width=G+"px",t.calendarContainer.style.width=G+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(K){if(t.selectedDates.length===0){var G=t.config.minDate===void 0||On(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ie=Nr(t.config);G.setHours(ie.hours,ie.minutes,ie.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}K!==void 0&&K.type!=="blur"&&Rl(K);var oe=t._input.value;d(),sn(),t._input.value!==oe&&t._debouncedChange()}function u(K,G){return K%12+12*Vn(G===t.l10n.amPM[1])}function f(K){switch(K%24){case 0:case 12:return 12;default:return K%12}}function d(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var K=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(K=u(K,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.minDate,!0)===0,Me=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&On(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 Pe=Pr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Fe=Pr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ae=Pr(K,G,ie);if(Ae>Fe&&Ae<Pe){var Je=WT(Pe);K=Je[0],G=Je[1],ie=Je[2]}}else{if(Me){var qe=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;K=Math.min(K,qe.getHours()),K===qe.getHours()&&(G=Math.min(G,qe.getMinutes())),G===qe.getMinutes()&&(ie=Math.min(ie,qe.getSeconds()))}if(oe){var Ye=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;K=Math.max(K,Ye.getHours()),K===Ye.getHours()&&G<Ye.getMinutes()&&(G=Ye.getMinutes()),G===Ye.getMinutes()&&(ie=Math.max(ie,Ye.getSeconds()))}}h(K,G,ie)}}function p(K){var G=K||t.latestSelectedDateObj;G&&G instanceof Date&&h(G.getHours(),G.getMinutes(),G.getSeconds())}function h(K,G,ie){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(K%24,G,ie||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=gn(t.config.time_24hr?K:(12+K)%12+12*Vn(K%12===0)),t.minuteElement.value=gn(G),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Vn(K>=12)]),t.secondElement!==void 0&&(t.secondElement.value=gn(ie)))}function g(K){var G=Mn(K),ie=parseInt(G.value)+(K.delta||0);(ie/1e3>1||K.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&Se(ie)}function _(K,G,ie,oe){if(G instanceof Array)return G.forEach(function(Me){return _(K,Me,ie,oe)});if(K instanceof Array)return K.forEach(function(Me){return _(Me,G,ie,oe)});K.addEventListener(G,ie,oe),t._handlers.push({remove:function(){return K.removeEventListener(G,ie,oe)}})}function b(){Re("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(oe){return _(oe,"click",t[ie])})}),t.isMobile){ke();return}var K=sd(Te,50);if(t._debouncedChange=sd(b,KT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&Ke(Mn(ie))}),_(t._input,"keydown",Xe),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Xe),!t.config.inline&&!t.config.static&&_(window,"resize",K),window.ontouchstart!==void 0?_(window.document,"touchstart",Ue):_(window.document,"mousedown",Ue),_(window.document,"focus",Ue,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",dn),_(t.monthNav,["keyup","increment"],g),_(t.daysContainer,"click",ti)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ie){return Mn(ie).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",C),_([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&_(t._input,"blur",_t)}function $(K,G){var ie=K!==void 0?t.parseDate(K):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,Me=t.currentMonth;try{ie!==void 0&&(t.currentYear=ie.getFullYear(),t.currentMonth=ie.getMonth())}catch(Pe){Pe.message="Invalid date supplied: "+ie,t.config.errorHandler(Pe)}G&&t.currentYear!==oe&&(Re("onYearChange"),q()),G&&(t.currentYear!==oe||t.currentMonth!==Me)&&Re("onMonthChange"),t.redraw()}function C(K){var G=Mn(K);~G.className.indexOf("arrow")&&T(K,G.classList.contains("arrowUp")?1:-1)}function T(K,G,ie){var oe=K&&Mn(K),Me=ie||oe&&oe.parentNode&&oe.parentNode.firstChild,Pe=Qe("increment");Pe.delta=G,Me&&Me.dispatchEvent(Pe)}function O(){var K=window.document.createDocumentFragment();if(t.calendarContainer=ct("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(K.appendChild(j()),t.innerContainer=ct("div","flatpickr-innerContainer"),t.config.weekNumbers){var G=re(),ie=G.weekWrapper,oe=G.weekNumbers;t.innerContainer.appendChild(ie),t.weekNumbers=oe,t.weekWrapper=ie}t.rContainer=ct("div","flatpickr-rContainer"),t.rContainer.appendChild(X()),t.daysContainer||(t.daysContainer=ct("div","flatpickr-days"),t.daysContainer.tabIndex=-1),F(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),K.appendChild(t.innerContainer)}t.config.enableTime&&K.appendChild(Q()),pn(t.calendarContainer,"rangeMode",t.config.mode==="range"),pn(t.calendarContainer,"animate",t.config.animate===!0),pn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(K);var Me=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&&(!Me&&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 Pe=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Pe,t.element),Pe.appendChild(t.element),t.altInput&&Pe.appendChild(t.altInput),Pe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(K,G,ie,oe){var Me=Oe(G,!0),Pe=ct("span",K,G.getDate().toString());return Pe.dateObj=G,Pe.$i=oe,Pe.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),K.indexOf("hidden")===-1&&On(G,t.now)===0&&(t.todayDateElem=Pe,Pe.classList.add("today"),Pe.setAttribute("aria-current","date")),Me?(Pe.tabIndex=-1,Et(G)&&(Pe.classList.add("selected"),t.selectedDateElem=Pe,t.config.mode==="range"&&(pn(Pe,"startRange",t.selectedDates[0]&&On(G,t.selectedDates[0],!0)===0),pn(Pe,"endRange",t.selectedDates[1]&&On(G,t.selectedDates[1],!0)===0),K==="nextMonthDay"&&Pe.classList.add("inRange")))):Pe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Tn(G)&&!Et(G)&&Pe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&K!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(G)+"</span>"),Re("onDayCreate",Pe),Pe}function E(K){K.focus(),t.config.mode==="range"&&Ke(K)}function A(K){for(var G=K>0?0:t.config.showMonths-1,ie=K>0?t.config.showMonths:-1,oe=G;oe!=ie;oe+=K)for(var Me=t.daysContainer.children[oe],Pe=K>0?0:Me.children.length-1,Fe=K>0?Me.children.length:-1,Ae=Pe;Ae!=Fe;Ae+=K){var Je=Me.children[Ae];if(Je.className.indexOf("hidden")===-1&&Oe(Je.dateObj))return Je}}function L(K,G){for(var ie=K.className.indexOf("Month")===-1?K.dateObj.getMonth():t.currentMonth,oe=G>0?t.config.showMonths:-1,Me=G>0?1:-1,Pe=ie-t.currentMonth;Pe!=oe;Pe+=Me)for(var Fe=t.daysContainer.children[Pe],Ae=ie-t.currentMonth===Pe?K.$i+G:G<0?Fe.children.length-1:0,Je=Fe.children.length,qe=Ae;qe>=0&&qe<Je&&qe!=(G>0?Je:-1);qe+=Me){var Ye=Fe.children[qe];if(Ye.className.indexOf("hidden")===-1&&Oe(Ye.dateObj)&&Math.abs(K.$i-qe)>=Math.abs(G))return E(Ye)}t.changeMonth(Me),N(A(Me),0)}function N(K,G){var ie=l(),oe=Ge(ie||document.body),Me=K!==void 0?K:oe?ie:t.selectedDateElem!==void 0&&Ge(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Ge(t.todayDateElem)?t.todayDateElem:A(G>0?1:-1);Me===void 0?t._input.focus():oe?L(Me,G):E(Me)}function R(K,G){for(var ie=(new Date(K,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((G-1+12)%12,K),Me=t.utils.getDaysInMonth(G,K),Pe=window.document.createDocumentFragment(),Fe=t.config.showMonths>1,Ae=Fe?"prevMonthDay hidden":"prevMonthDay",Je=Fe?"nextMonthDay hidden":"nextMonthDay",qe=oe+1-ie,Ye=0;qe<=oe;qe++,Ye++)Pe.appendChild(M("flatpickr-day "+Ae,new Date(K,G-1,qe),qe,Ye));for(qe=1;qe<=Me;qe++,Ye++)Pe.appendChild(M("flatpickr-day",new Date(K,G,qe),qe,Ye));for(var yt=Me+1;yt<=42-ie&&(t.config.showMonths===1||Ye%7!==0);yt++,Ye++)Pe.appendChild(M("flatpickr-day "+Je,new Date(K,G+1,yt%Me),yt,Ye));var ii=ct("div","dayContainer");return ii.appendChild(Pe),ii}function F(){if(t.daysContainer!==void 0){so(t.daysContainer),t.weekNumbers&&so(t.weekNumbers);for(var K=document.createDocumentFragment(),G=0;G<t.config.showMonths;G++){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+G),K.appendChild(R(ie.getFullYear(),ie.getMonth()))}t.daysContainer.appendChild(K),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Ke()}}function q(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var K=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 G=0;G<12;G++)if(K(G)){var ie=ct("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,G).getMonth().toString(),ie.textContent=Fo(G,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===G&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function V(){var K=ct("div","flatpickr-month"),G=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Fe){var Ae=Mn(Fe),Je=parseInt(Ae.value,10);t.changeMonth(Je-t.currentMonth),Re("onMonthChange")}),q(),ie=t.monthsDropdownContainer);var oe=lo("cur-year",{tabindex:"-1"}),Me=oe.getElementsByTagName("input")[0];Me.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Me.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Me.setAttribute("max",t.config.maxDate.getFullYear().toString()),Me.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Pe=ct("div","flatpickr-current-month");return Pe.appendChild(ie),Pe.appendChild(oe),G.appendChild(Pe),K.appendChild(G),{container:K,yearElement:Me,monthElement:ie}}function U(){so(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var K=t.config.showMonths;K--;){var G=V();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.container)}t.monthNav.appendChild(t.nextMonthNav)}function j(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(K){t.__hidePrevMonthArrow!==K&&(pn(t.prevMonthNav,"flatpickr-disabled",K),t.__hidePrevMonthArrow=K)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(K){t.__hideNextMonthArrow!==K&&(pn(t.nextMonthNav,"flatpickr-disabled",K),t.__hideNextMonthArrow=K)}}),t.currentYearElement=t.yearElements[0],Fn(),t.monthNav}function Q(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var K=Nr(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=ct("span","flatpickr-time-separator",":"),ie=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var oe=lo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=oe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?K.hours:f(K.hours)),t.minuteElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():K.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(ie),t.timeContainer.appendChild(G),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Me=lo("flatpickr-second");t.secondElement=Me.getElementsByTagName("input")[0],t.secondElement.value=gn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():K.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(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Me)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[Vn((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 X(){t.weekdayContainer?so(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var K=t.config.showMonths;K--;){var G=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return Z(),t.weekdayContainer}function Z(){if(t.weekdayContainer){var K=t.l10n.firstDayOfWeek,G=ld(t.l10n.weekdays.shorthand);K>0&&K<G.length&&(G=ld(G.splice(K,G.length),G.splice(0,K)));for(var ie=t.config.showMonths;ie--;)t.weekdayContainer.children[ie].innerHTML=`
<span class='flatpickr-weekday'>
`+G.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function re(){t.calendarContainer.classList.add("hasWeeks");var K=ct("div","flatpickr-weekwrapper");K.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ct("div","flatpickr-weeks");return K.appendChild(G),{weekWrapper:K,weekNumbers:G}}function ee(K,G){G===void 0&&(G=!0);var ie=G?K:K-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Re("onYearChange"),q()),F(),Re("onMonthChange"),Fn())}function se(K,G){if(K===void 0&&(K=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Nr(t.config),oe=ie.hours,Me=ie.minutes,Pe=ie.seconds;h(oe,Me,Pe)}t.redraw(),K&&Re("onChange")}function ye(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Re("onClose")}function $e(){t.config!==void 0&&Re("onDestroy");for(var K=t._handlers.length;K--;)t._handlers[K].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(ie){try{delete t[ie]}catch{}})}function ze(K){return t.calendarContainer.contains(K)}function Ue(K){if(t.isOpen&&!t.config.inline){var G=Mn(K),ie=ze(G),oe=G===t.input||G===t.altInput||t.element.contains(G)||K.path&&K.path.indexOf&&(~K.path.indexOf(t.input)||~K.path.indexOf(t.altInput)),Me=!oe&&!ie&&!ze(K.relatedTarget),Pe=!t.config.ignoredFocusElements.some(function(Fe){return Fe.contains(G)});Me&&Pe&&(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 Se(K){if(!(!K||t.config.minDate&&K<t.config.minDate.getFullYear()||t.config.maxDate&&K>t.config.maxDate.getFullYear())){var G=K,ie=t.currentYear!==G;t.currentYear=G||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)),ie&&(t.redraw(),Re("onYearChange"),q())}}function Oe(K,G){var ie;G===void 0&&(G=!0);var oe=t.parseDate(K,void 0,G);if(t.config.minDate&&oe&&On(oe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&oe&&On(oe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Me=!!t.config.enable,Pe=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Fe=0,Ae=void 0;Fe<Pe.length;Fe++){if(Ae=Pe[Fe],typeof Ae=="function"&&Ae(oe))return Me;if(Ae instanceof Date&&oe!==void 0&&Ae.getTime()===oe.getTime())return Me;if(typeof Ae=="string"){var Je=t.parseDate(Ae,void 0,!0);return Je&&Je.getTime()===oe.getTime()?Me:!Me}else if(typeof Ae=="object"&&oe!==void 0&&Ae.from&&Ae.to&&oe.getTime()>=Ae.from.getTime()&&oe.getTime()<=Ae.to.getTime())return Me}return!Me}function Ge(K){return t.daysContainer!==void 0?K.className.indexOf("hidden")===-1&&K.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(K):!1}function _t(K){var G=K.target===t._input,ie=t._input.value.trimEnd()!==Ui();G&&ie&&!(K.relatedTarget&&ze(K.relatedTarget))&&t.setDate(t._input.value,!0,K.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Xe(K){var G=Mn(K),ie=t.config.wrap?n.contains(G):G===t._input,oe=t.config.allowInput,Me=t.isOpen&&(!oe||!ie),Pe=t.config.inline&&ie&&!oe;if(K.keyCode===13&&ie){if(oe)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(ze(G)||Me||Pe){var Fe=!!t.timeContainer&&t.timeContainer.contains(G);switch(K.keyCode){case 13:Fe?(K.preventDefault(),a(),Pn()):ti(K);break;case 27:K.preventDefault(),Pn();break;case 8:case 46:ie&&!t.config.allowInput&&(K.preventDefault(),t.clear());break;case 37:case 39:if(!Fe&&!ie){K.preventDefault();var Ae=l();if(t.daysContainer!==void 0&&(oe===!1||Ae&&Ge(Ae))){var Je=K.keyCode===39?1:-1;K.ctrlKey?(K.stopPropagation(),ee(Je),N(A(1),0)):N(void 0,Je)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:K.preventDefault();var qe=K.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?K.ctrlKey?(K.stopPropagation(),Se(t.currentYear-qe),N(A(1),0)):Fe||N(void 0,qe*7):G===t.currentYearElement?Se(t.currentYear-qe):t.config.enableTime&&(!Fe&&t.hourElement&&t.hourElement.focus(),a(K),t._debouncedChange());break;case 9:if(Fe){var Ye=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Cn){return Cn}),yt=Ye.indexOf(G);if(yt!==-1){var ii=Ye[yt+(K.shiftKey?-1:1)];K.preventDefault(),(ii||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&K.shiftKey&&(K.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(K.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),sn();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),sn();break}(ie||ze(G))&&Re("onKeyDown",K)}function Ke(K,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||K&&(!K.classList.contains(G)||K.classList.contains("flatpickr-disabled")))){for(var ie=K?K.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Me=Math.min(ie,t.selectedDates[0].getTime()),Pe=Math.max(ie,t.selectedDates[0].getTime()),Fe=!1,Ae=0,Je=0,qe=Me;qe<Pe;qe+=YT.DAY)Oe(new Date(qe),!0)||(Fe=Fe||qe>Me&&qe<Pe,qe<oe&&(!Ae||qe>Ae)?Ae=qe:qe>oe&&(!Je||qe<Je)&&(Je=qe));var Ye=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+G));Ye.forEach(function(yt){var ii=yt.dateObj,Cn=ii.getTime(),Hs=Ae>0&&Cn<Ae||Je>0&&Cn>Je;if(Hs){yt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(hs){yt.classList.remove(hs)});return}else if(Fe&&!Hs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(hs){yt.classList.remove(hs)}),K!==void 0&&(K.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),oe<ie&&Cn===oe?yt.classList.add("startRange"):oe>ie&&Cn===oe&&yt.classList.add("endRange"),Cn>=Ae&&(Je===0||Cn<=Je)&&UT(Cn,oe,ie)&&yt.classList.add("inRange"))})}}function Te(){t.isOpen&&!t.config.static&&!t.config.inline&&it()}function ce(K,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(K){K.preventDefault();var ie=Mn(K);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Re("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"),Re("onOpen"),it(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(K===void 0||!t.timeContainer.contains(K.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function He(K){return function(G){var ie=t.config["_"+K+"Date"]=t.parseDate(G,t.config.dateFormat),oe=t.config["_"+(K==="min"?"max":"min")+"Date"];ie!==void 0&&(t[K==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Me){return Oe(Me)}),!t.selectedDates.length&&K==="min"&&p(ie),sn()),t.daysContainer&&(Wt(),ie!==void 0?t.currentYearElement[K]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(K),t.currentYearElement.disabled=!!oe&&ie!==void 0&&oe.getFullYear()===ie.getFullYear())}}function At(){var K=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ye){t.config._enable=ni(Ye)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ye){t.config._disable=ni(Ye)}});var oe=G.mode==="time";if(!G.dateFormat&&(G.enableTime||oe)){var Me=Kt.defaultConfig.dateFormat||Ms.dateFormat;ie.dateFormat=G.noCalendar||oe?"H:i"+(G.enableSeconds?":S":""):Me+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||oe)&&!G.altFormat){var Pe=Kt.defaultConfig.altFormat||Ms.altFormat;ie.altFormat=G.noCalendar||oe?"h:i"+(G.enableSeconds?":S K":" K"):Pe+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:He("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:He("max")});var Fe=function(Ye){return function(yt){t.config[Ye==="min"?"_minTime":"_maxTime"]=t.parseDate(yt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Fe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Fe("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,G);for(var Ae=0;Ae<K.length;Ae++)t.config[K[Ae]]=t.config[K[Ae]]===!0||t.config[K[Ae]]==="true";Ar.filter(function(Ye){return t.config[Ye]!==void 0}).forEach(function(Ye){t.config[Ye]=Ir(t.config[Ye]||[]).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 Ae=0;Ae<t.config.plugins.length;Ae++){var Je=t.config.plugins[Ae](t)||{};for(var qe in Je)Ar.indexOf(qe)>-1?t.config[qe]=Ir(Je[qe]).map(o).concat(t.config[qe]):typeof G[qe]>"u"&&(t.config[qe]=Je[qe])}G.altInputClass||(t.config.altInputClass=Ne().className+" "+t.config.altInputClass),Re("onParseConfig")}function Ne(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ce(){typeof t.config.locale!="object"&&typeof Kt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Kt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Kt.l10ns[t.config.locale]:void 0),es.D="("+t.l10n.weekdays.shorthand.join("|")+")",es.l="("+t.l10n.weekdays.longhand.join("|")+")",es.M="("+t.l10n.months.shorthand.join("|")+")",es.F="("+t.l10n.months.longhand.join("|")+")",es.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var K=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));K.time_24hr===void 0&&Kt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=S1(t),t.parseDate=va({config:t.config,l10n:t.l10n})}function it(K){if(typeof t.config.position=="function")return void t.config.position(t,K);if(t.calendarContainer!==void 0){Re("onPreCalendarPosition");var G=K||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(R1,q1){return R1+q1.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Me=t.config.position.split(" "),Pe=Me[0],Fe=Me.length>1?Me[1]:null,Ae=G.getBoundingClientRect(),Je=window.innerHeight-Ae.bottom,qe=Pe==="above"||Pe!=="below"&&Je<ie&&Ae.top>ie,Ye=window.pageYOffset+Ae.top+(qe?-ie-2:G.offsetHeight+2);if(pn(t.calendarContainer,"arrowTop",!qe),pn(t.calendarContainer,"arrowBottom",qe),!t.config.inline){var yt=window.pageXOffset+Ae.left,ii=!1,Cn=!1;Fe==="center"?(yt-=(oe-Ae.width)/2,ii=!0):Fe==="right"&&(yt-=oe-Ae.width,Cn=!0),pn(t.calendarContainer,"arrowLeft",!ii&&!Cn),pn(t.calendarContainer,"arrowCenter",ii),pn(t.calendarContainer,"arrowRight",Cn);var Hs=window.document.body.offsetWidth-(window.pageXOffset+Ae.right),hs=yt+oe>window.document.body.offsetWidth,D1=Hs+oe>window.document.body.offsetWidth;if(pn(t.calendarContainer,"rightMost",hs),!t.config.static)if(t.calendarContainer.style.top=Ye+"px",!hs)t.calendarContainer.style.left=yt+"px",t.calendarContainer.style.right="auto";else if(!D1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Hs+"px";else{var sr=It();if(sr===void 0)return;var A1=window.document.body.offsetWidth,I1=Math.max(0,A1/2-oe/2),L1=".flatpickr-calendar.centerMost:before",P1=".flatpickr-calendar.centerMost:after",N1=sr.cssRules.length,F1="{left:"+Ae.left+"px;right:auto;}";pn(t.calendarContainer,"rightMost",!1),pn(t.calendarContainer,"centerMost",!0),sr.insertRule(L1+","+P1+F1,N1),t.calendarContainer.style.left=I1+"px",t.calendarContainer.style.right="auto"}}}}function It(){for(var K=null,G=0;G<document.styleSheets.length;G++){var ie=document.styleSheets[G];if(ie.cssRules){try{ie.cssRules}catch{continue}K=ie;break}}return K??Vt()}function Vt(){var K=document.createElement("style");return document.head.appendChild(K),K.sheet}function Wt(){t.config.noCalendar||t.isMobile||(q(),Fn(),F())}function Pn(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function ti(K){K.preventDefault(),K.stopPropagation();var G=function(Ye){return Ye.classList&&Ye.classList.contains("flatpickr-day")&&!Ye.classList.contains("flatpickr-disabled")&&!Ye.classList.contains("notAllowed")},ie=w1(Mn(K),G);if(ie!==void 0){var oe=ie,Me=t.latestSelectedDateObj=new Date(oe.dateObj.getTime()),Pe=(Me.getMonth()<t.currentMonth||Me.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Me];else if(t.config.mode==="multiple"){var Fe=Et(Me);Fe?t.selectedDates.splice(parseInt(Fe),1):t.selectedDates.push(Me)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Me,t.selectedDates.push(Me),On(Me,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ye,yt){return Ye.getTime()-yt.getTime()}));if(d(),Pe){var Ae=t.currentYear!==Me.getFullYear();t.currentYear=Me.getFullYear(),t.currentMonth=Me.getMonth(),Ae&&(Re("onYearChange"),q()),Re("onMonthChange")}if(Fn(),F(),sn(),!Pe&&t.config.mode!=="range"&&t.config.showMonths===1?E(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 Je=t.config.mode==="single"&&!t.config.enableTime,qe=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Je||qe)&&Pn()}b()}}var $n={locale:[Ce,Z],showMonths:[U,r,X],minDate:[$],maxDate:[$],positionElement:[mi],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function gt(K,G){if(K!==null&&typeof K=="object"){Object.assign(t.config,K);for(var ie in K)$n[ie]!==void 0&&$n[ie].forEach(function(oe){return oe()})}else t.config[K]=G,$n[K]!==void 0?$n[K].forEach(function(oe){return oe()}):Ar.indexOf(K)>-1&&(t.config[K]=Ir(G));t.redraw(),sn(!0)}function Nn(K,G){var ie=[];if(K instanceof Array)ie=K.map(function(oe){return t.parseDate(oe,G)});else if(K instanceof Date||typeof K=="number")ie=[t.parseDate(K,G)];else if(typeof K=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(K,G)];break;case"multiple":ie=K.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,G)});break;case"range":ie=K.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(K)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(oe){return oe instanceof Date&&Oe(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Me){return oe.getTime()-Me.getTime()})}function ps(K,G,ie){if(G===void 0&&(G=!1),ie===void 0&&(ie=t.config.dateFormat),K!==0&&!K||K instanceof Array&&K.length===0)return t.clear(G);Nn(K,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),$(void 0,G),p(),t.selectedDates.length===0&&t.clear(!1),sn(G),G&&Re("onChange")}function ni(K){return K.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function Oi(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var K=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);K&&Nn(K,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 ms(){if(t.input=Ne(),!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=ct(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"),mi()}function mi(){t._positionElement=t.config.positionElement||t._input}function ke(){var K=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=K,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=K==="datetime-local"?"Y-m-d\\TH:i:S":K==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(G){t.setDate(Mn(G).value,!1,t.mobileFormatStr),Re("onChange"),Re("onClose")})}function Ie(K){if(t.isOpen===!0)return t.close();t.open(K)}function Re(K,G){if(t.config!==void 0){var ie=t.config[K];if(ie!==void 0&&ie.length>0)for(var oe=0;ie[oe]&&oe<ie.length;oe++)ie[oe](t.selectedDates,t.input.value,t,G);K==="onChange"&&(t.input.dispatchEvent(Qe("change")),t.input.dispatchEvent(Qe("input")))}}function Qe(K){var G=document.createEvent("Event");return G.initEvent(K,!0,!0),G}function Et(K){for(var G=0;G<t.selectedDates.length;G++){var ie=t.selectedDates[G];if(ie instanceof Date&&On(ie,K)===0)return""+G}return!1}function Tn(K){return t.config.mode!=="range"||t.selectedDates.length<2?!1:On(K,t.selectedDates[0])>=0&&On(K,t.selectedDates[1])<=0}function Fn(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(K,G){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Fo(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),K.value=ie.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 Ui(K){var G=K||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,G)}).filter(function(ie,oe,Me){return t.config.mode!=="range"||t.config.enableTime||Me.indexOf(ie)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function sn(K){K===void 0&&(K=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ui(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ui(t.config.altFormat)),K!==!1&&Re("onValueUpdate")}function dn(K){var G=Mn(K),ie=t.prevMonthNav.contains(G),oe=t.nextMonthNav.contains(G);ie||oe?ee(ie?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rl(K){K.preventDefault();var G=K.type==="keydown",ie=Mn(K),oe=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Me=parseFloat(oe.getAttribute("min")),Pe=parseFloat(oe.getAttribute("max")),Fe=parseFloat(oe.getAttribute("step")),Ae=parseInt(oe.value,10),Je=K.delta||(G?K.which===38?1:-1:0),qe=Ae+Fe*Je;if(typeof oe.value<"u"&&oe.value.length===2){var Ye=oe===t.hourElement,yt=oe===t.minuteElement;qe<Me?(qe=Pe+qe+Vn(!Ye)+(Vn(Ye)&&Vn(!t.amPM)),yt&&T(void 0,-1,t.hourElement)):qe>Pe&&(qe=oe===t.hourElement?qe-Pe-Vn(!t.amPM):Me,yt&&T(void 0,1,t.hourElement)),t.amPM&&Ye&&(Fe===1?qe+Ae===23:Math.abs(qe-Ae)>Fe)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=gn(qe)}}return s(),t}function Os(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=JT(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 Os(this,n)},HTMLElement.prototype.flatpickr=function(n){return Os([this],n)});var Kt=function(n,e){return typeof n=="string"?Os(window.document.querySelectorAll(n),e):n instanceof Node?Os([n],e):Os(n,e)};Kt.defaultConfig={};Kt.l10ns={en:an({},kl),default:an({},kl)};Kt.localize=function(n){Kt.l10ns.default=an(an({},Kt.l10ns.default),n)};Kt.setDefaults=function(n){Kt.defaultConfig=an(an({},Kt.defaultConfig),n)};Kt.parseDate=va({});Kt.formatDate=S1({});Kt.compareDates=On;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Os(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=Kt);function ZT(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=je(i,t[s]);return{c(){e=y("input"),ai(e,i)},m(s,l){S(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){ai(e,i=Ot(t,[l&2&&s[1]]))},d(s){s&&w(e),n[11](null)}}}function GT(n){let e;const t=n[10].default,i=kt(t,n,n[9],null),s=i||ZT(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)&&St(i,t,l,l[9],e?wt(t,l[9],o,null):$t(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(I(s,l),e=!0)},o(l){P(s,l),e=!1},d(l){s&&s.d(l)}}}function XT(n){return n.charAt(2).toLowerCase()+n.substring(3)}function od(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function rd(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 QT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=tt(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:d=void 0}=e,{options:p={}}=e,h=!1,{input:g=void 0,flatpickr:_=void 0}=e;Xt(()=>{const T=f??g,O=k(p);return O.onReady.push((M,E,A)=>{a===void 0&&$(M,E,A),cn().then(()=>{t(8,h=!0)})}),t(3,_=Kt(T,Object.assign(O,f?{wrap:!0}:{}))),()=>{_.destroy()}});const b=Tt();function k(T={}){T=Object.assign({},T);for(const O of r){const M=(E,A,L)=>{b(XT(O),[E,A,L])};O in T?(Array.isArray(T[O])||(T[O]=[T[O]]),T[O].push(M)):T[O]=[M]}return T.onChange&&!T.onChange.includes($)&&T.onChange.push($),T}function $(T,O,M){const E=od(M,T);!rd(a,E)&&(a||E)&&t(2,a=E),t(4,u=O)}function C(T){ne[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=je(je({},e),Gt(T)),t(1,s=tt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,d=T.dateFormat),"options"in T&&t(7,p=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,_=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&h&&(rd(a,od(_,_.selectedDates))||_.setDate(a,!0,d)),n.$$.dirty&392&&_&&h)for(const[T,O]of Object.entries(k(p)))_.set(T,O)},[g,s,a,_,u,f,d,p,h,o,l,C]}class fu extends ve{constructor(e){super(),be(this,e,QT,GT,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function xT(n){let e,t,i,s,l,o,r,a;function u(p){n[6](p)}function f(p){n[7](p)}let d={id:n[19],options:W.defaultFlatpickrOptions()};return n[2]!==void 0&&(d.value=n[2]),n[0].options.min!==void 0&&(d.formattedValue=n[0].options.min),l=new fu({props:d}),ne.push(()=>pe(l,"value",u)),ne.push(()=>pe(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=y("label"),t=Y("Min date (UTC)"),s=D(),B(l.$$.fragment),m(e,"for",i=n[19])},m(p,h){S(p,e,h),v(e,t),S(p,s,h),z(l,p,h),a=!0},p(p,h){(!a||h&524288&&i!==(i=p[19]))&&m(e,"for",i);const g={};h&524288&&(g.id=p[19]),!o&&h&4&&(o=!0,g.value=p[2],ge(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=p[0].options.min,ge(()=>r=!1)),l.$set(g)},i(p){a||(I(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function e4(n){let e,t,i,s,l,o,r,a;function u(p){n[9](p)}function f(p){n[10](p)}let d={id:n[19],options:W.defaultFlatpickrOptions()};return n[3]!==void 0&&(d.value=n[3]),n[0].options.max!==void 0&&(d.formattedValue=n[0].options.max),l=new fu({props:d}),ne.push(()=>pe(l,"value",u)),ne.push(()=>pe(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=y("label"),t=Y("Max date (UTC)"),s=D(),B(l.$$.fragment),m(e,"for",i=n[19])},m(p,h){S(p,e,h),v(e,t),S(p,s,h),z(l,p,h),a=!0},p(p,h){(!a||h&524288&&i!==(i=p[19]))&&m(e,"for",i);const g={};h&524288&&(g.id=p[19]),!o&&h&8&&(o=!0,g.value=p[3],ge(()=>o=!1)),!r&&h&1&&(r=!0,g.formattedValue=p[0].options.max,ge(()=>r=!1)),l.$set(g)},i(p){a||(I(l.$$.fragment,p),a=!0)},o(p){P(l.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(s),H(l,p)}}}function t4(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:[xT,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[e4,({uniqueId:a})=>({19:a}),({uniqueId:a})=>a?524288:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1572869&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.max"),u&1572873&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&w(e),H(i),H(o)}}}function n4(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[t4]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("drop",n[15]),e.$on("dragstart",n[16]),e.$on("dragenter",n[17]),e.$on("dragleave",n[18]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?Ot(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&1048591&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function i4(n,e,t){var E,A;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=(E=l==null?void 0:l.options)==null?void 0:E.min,a=(A=l==null?void 0:l.options)==null?void 0:A.max;function u(L,N){L.detail&&L.detail.length==3&&t(0,l.options[N]=L.detail[1],l)}function f(L){r=L,t(2,r),t(0,l)}function d(L){n.$$.not_equal(l.options.min,L)&&(l.options.min=L,t(0,l))}const p=L=>u(L,"min");function h(L){a=L,t(3,a),t(0,l)}function g(L){n.$$.not_equal(l.options.max,L)&&(l.options.max=L,t(0,l))}const _=L=>u(L,"max");function b(L){l=L,t(0,l)}function k(L){he.call(this,n,L)}function $(L){he.call(this,n,L)}function C(L){he.call(this,n,L)}function T(L){he.call(this,n,L)}function O(L){he.call(this,n,L)}function M(L){he.call(this,n,L)}return n.$$set=L=>{e=je(je({},e),Gt(L)),t(5,s=tt(e,i)),"field"in L&&t(0,l=L.field),"key"in L&&t(1,o=L.key)},n.$$.update=()=>{var L,N,R,F;n.$$.dirty&5&&r!=((L=l==null?void 0:l.options)==null?void 0:L.min)&&t(2,r=(N=l==null?void 0:l.options)==null?void 0:N.min),n.$$.dirty&9&&a!=((R=l==null?void 0:l.options)==null?void 0:R.max)&&t(3,a=(F=l==null?void 0:l.options)==null?void 0:F.max)},[l,o,r,a,u,s,f,d,p,h,g,_,b,k,$,C,T,O,M]}class s4 extends ve{constructor(e){super(),be(this,e,i4,n4,_e,{field:0,key:1})}}const l4=n=>({}),ad=n=>({});function ud(n,e,t){const i=n.slice();return i[47]=e[t],i}const o4=n=>({}),fd=n=>({});function cd(n,e,t){const i=n.slice();return i[47]=e[t],i[51]=t,i}function dd(n){let e,t,i;return{c(){e=y("div"),t=Y(n[2]),i=D(),m(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(s,l){S(s,e,l),v(e,t),v(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&96&&x(e,"link-hint",!s[5]&&!s[6])},d(s){s&&w(e)}}}function r4(n){let e,t=n[47]+"",i;return{c(){e=y("span"),i=Y(t),m(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l[0]&1&&t!==(t=s[47]+"")&&le(i,t)},i:te,o:te,d(s){s&&w(e)}}}function a4(n){let e,t,i;const s=[{item:n[47]},n[10]];var l=n[9];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=Rt(l,o())),{c(){e&&B(e.$$.fragment),t=we()},m(r,a){e&&z(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&1025?Ot(s,[a[0]&1&&{item:r[47]},a[0]&1024&&Qt(r[10])]):{};if(a[0]&512&&l!==(l=r[9])){if(e){ue();const f=e;P(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}l?(e=Rt(l,o()),B(e.$$.fragment),I(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function pd(n){let e,t,i;function s(){return n[35](n[47])}return{c(){e=y("span"),e.innerHTML='<i class="ri-close-line"></i>',m(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[Ee(Be.call(null,e,"Clear")),J(e,"click",In(xe(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function md(n){let e,t,i,s,l,o;const r=[a4,r4],a=[];function u(d,p){return d[9]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[7])&&pd(n);return{c(){e=y("div"),i.c(),s=D(),f&&f.c(),l=D(),m(e,"class","option")},m(d,p){S(d,e,p),a[t].m(e,null),v(e,s),f&&f.m(e,null),v(e,l),o=!0},p(d,p){let h=t;t=u(d),t===h?a[t].p(d,p):(ue(),P(a[h],1,1,()=>{a[h]=null}),fe(),i=a[t],i?i.p(d,p):(i=a[t]=r[t](d),i.c()),I(i,1),i.m(e,s)),d[4]||d[7]?f?f.p(d,p):(f=pd(d),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(d){o||(I(i),o=!0)},o(d){P(i),o=!1},d(d){d&&w(e),a[t].d(),f&&f.d()}}}function hd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[19],$$slots:{default:[c4]},$$scope:{ctx:n}};return e=new Jn({props:i}),n[40](e),e.$on("show",n[25]),e.$on("hide",n[41]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,l){const o={};l[0]&524288&&(o.trigger=s[19]),l[0]&3225866|l[1]&4096&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[40](null),H(e,s)}}}function _d(n){let e,t,i,s,l,o,r,a,u=n[16].length&&gd(n);return{c(){e=y("div"),t=y("label"),i=y("div"),i.innerHTML='<i class="ri-search-line"></i>',s=D(),l=y("input"),o=D(),u&&u.c(),m(i,"class","addon p-r-0"),l.autofocus=!0,m(l,"type","text"),m(l,"placeholder",n[3]),m(t,"class","input-group"),m(e,"class","form-field form-field-sm options-search")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(t,s),v(t,l),ae(l,n[16]),v(t,o),u&&u.m(t,null),l.focus(),r||(a=J(l,"input",n[37]),r=!0)},p(f,d){d[0]&8&&m(l,"placeholder",f[3]),d[0]&65536&&l.value!==f[16]&&ae(l,f[16]),f[16].length?u?u.p(f,d):(u=gd(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 gd(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-close-line"></i>',m(t,"type","button"),m(t,"class","btn btn-sm btn-circle btn-transparent clear"),m(e,"class","addon suffix p-r-5")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",In(xe(n[22]))),i=!0)},p:te,d(l){l&&w(e),i=!1,s()}}}function bd(n){let e,t=n[1]&&vd(n);return{c(){t&&t.c(),e=we()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=vd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function vd(n){let e,t;return{c(){e=y("div"),t=Y(n[1]),m(e,"class","txt-missing")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function u4(n){let e=n[47]+"",t;return{c(){t=Y(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&2097152&&e!==(e=i[47]+"")&&le(t,e)},i:te,o:te,d(i){i&&w(t)}}}function f4(n){let e,t,i;const s=[{item:n[47]},n[12]];var l=n[11];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=Rt(l,o())),{c(){e&&B(e.$$.fragment),t=we()},m(r,a){e&&z(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&2101248?Ot(s,[a[0]&2097152&&{item:r[47]},a[0]&4096&&Qt(r[12])]):{};if(a[0]&2048&&l!==(l=r[11])){if(e){ue();const f=e;P(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}l?(e=Rt(l,o()),B(e.$$.fragment),I(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&I(e.$$.fragment,r),i=!0)},o(r){e&&P(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&H(e,r)}}}function yd(n){let e,t,i,s,l,o,r;const a=[f4,u4],u=[];function f(h,g){return h[11]?0:1}t=f(n),i=u[t]=a[t](n);function d(...h){return n[38](n[47],...h)}function p(...h){return n[39](n[47],...h)}return{c(){e=y("div"),i.c(),s=D(),m(e,"tabindex","0"),m(e,"class","dropdown-item option"),x(e,"closable",n[8]),x(e,"selected",n[20](n[47]))},m(h,g){S(h,e,g),u[t].m(e,null),v(e,s),l=!0,o||(r=[J(e,"click",d),J(e,"keydown",p)],o=!0)},p(h,g){n=h;let _=t;t=f(n),t===_?u[t].p(n,g):(ue(),P(u[_],1,1,()=>{u[_]=null}),fe(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),I(i,1),i.m(e,s)),(!l||g[0]&256)&&x(e,"closable",n[8]),(!l||g[0]&3145728)&&x(e,"selected",n[20](n[47]))},i(h){l||(I(i),l=!0)},o(h){P(i),l=!1},d(h){h&&w(e),u[t].d(),o=!1,De(r)}}}function c4(n){let e,t,i,s,l,o=n[13]&&_d(n);const r=n[34].beforeOptions,a=kt(r,n,n[43],fd);let u=n[21],f=[];for(let _=0;_<u.length;_+=1)f[_]=yd(ud(n,u,_));const d=_=>P(f[_],1,1,()=>{f[_]=null});let p=null;u.length||(p=bd(n));const h=n[34].afterOptions,g=kt(h,n,n[43],ad);return{c(){o&&o.c(),e=D(),a&&a.c(),t=D(),i=y("div");for(let _=0;_<f.length;_+=1)f[_].c();p&&p.c(),s=D(),g&&g.c(),m(i,"class","options-list")},m(_,b){o&&o.m(_,b),S(_,e,b),a&&a.m(_,b),S(_,t,b),S(_,i,b);for(let k=0;k<f.length;k+=1)f[k]&&f[k].m(i,null);p&&p.m(i,null),S(_,s,b),g&&g.m(_,b),l=!0},p(_,b){if(_[13]?o?o.p(_,b):(o=_d(_),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&4096)&&St(a,r,_,_[43],l?wt(r,_[43],b,o4):$t(_[43]),fd),b[0]&28317954){u=_[21];let k;for(k=0;k<u.length;k+=1){const $=ud(_,u,k);f[k]?(f[k].p($,b),I(f[k],1)):(f[k]=yd($),f[k].c(),I(f[k],1),f[k].m(i,null))}for(ue(),k=u.length;k<f.length;k+=1)d(k);fe(),!u.length&&p?p.p(_,b):u.length?p&&(p.d(1),p=null):(p=bd(_),p.c(),p.m(i,null))}g&&g.p&&(!l||b[1]&4096)&&St(g,h,_,_[43],l?wt(h,_[43],b,l4):$t(_[43]),ad)},i(_){if(!l){I(a,_);for(let b=0;b<u.length;b+=1)I(f[b]);I(g,_),l=!0}},o(_){P(a,_),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)P(f[b]);P(g,_),l=!1},d(_){o&&o.d(_),_&&w(e),a&&a.d(_),_&&w(t),_&&w(i),ht(f,_),p&&p.d(),_&&w(s),g&&g.d(_)}}}function d4(n){let e,t,i,s,l,o,r=W.toArray(n[0]),a=[];for(let p=0;p<r.length;p+=1)a[p]=md(cd(n,r,p));const u=p=>P(a[p],1,1,()=>{a[p]=null});let f=null;r.length||(f=dd(n));let d=!n[5]&&!n[6]&&hd(n);return{c(){e=y("div"),t=y("div");for(let p=0;p<a.length;p+=1)a[p].c();f&&f.c(),s=D(),d&&d.c(),m(t,"tabindex",i=n[5]||n[6]?"-1":"0"),m(t,"class","selected-container"),x(t,"disabled",n[5]),x(t,"readonly",n[6]),m(e,"class",l="select "+n[14]),x(e,"multiple",n[4]),x(e,"disabled",n[5]),x(e,"readonly",n[6])},m(p,h){S(p,e,h),v(e,t);for(let g=0;g<a.length;g+=1)a[g]&&a[g].m(t,null);f&&f.m(t,null),n[36](t),v(e,s),d&&d.m(e,null),n[42](e),o=!0},p(p,h){if(h[0]&34549){r=W.toArray(p[0]);let g;for(g=0;g<r.length;g+=1){const _=cd(p,r,g);a[g]?(a[g].p(_,h),I(a[g],1)):(a[g]=md(_),a[g].c(),I(a[g],1),a[g].m(t,null))}for(ue(),g=r.length;g<a.length;g+=1)u(g);fe(),!r.length&&f?f.p(p,h):r.length?f&&(f.d(1),f=null):(f=dd(p),f.c(),f.m(t,null))}(!o||h[0]&96&&i!==(i=p[5]||p[6]?"-1":"0"))&&m(t,"tabindex",i),(!o||h[0]&32)&&x(t,"disabled",p[5]),(!o||h[0]&64)&&x(t,"readonly",p[6]),!p[5]&&!p[6]?d?(d.p(p,h),h[0]&96&&I(d,1)):(d=hd(p),d.c(),I(d,1),d.m(e,null)):d&&(ue(),P(d,1,1,()=>{d=null}),fe()),(!o||h[0]&16384&&l!==(l="select "+p[14]))&&m(e,"class",l),(!o||h[0]&16400)&&x(e,"multiple",p[4]),(!o||h[0]&16416)&&x(e,"disabled",p[5]),(!o||h[0]&16448)&&x(e,"readonly",p[6])},i(p){if(!o){for(let h=0;h<r.length;h+=1)I(a[h]);I(d),o=!0}},o(p){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)P(a[h]);P(d),o=!1},d(p){p&&w(e),ht(a,p),f&&f.d(),n[36](null),d&&d.d(),n[42](null)}}}function p4(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 m4(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:d=[]}=e,{multiple:p=!1}=e,{disabled:h=!1}=e,{readonly:g=!1}=e,{selected:_=p?[]:void 0}=e,{toggle:b=p}=e,{closable:k=!0}=e,{labelComponent:$=void 0}=e,{labelComponentProps:C={}}=e,{optionComponent:T=void 0}=e,{optionComponentProps:O={}}=e,{searchable:M=!1}=e,{searchFunc:E=void 0}=e,{class:A=""}=e,L,N="",R,F;function q(ce){if(W.isEmpty(_))return;let He=W.toArray(_);W.inArray(He,ce)&&(W.removeByValue(He,ce),t(0,_=He)),R==null||R.dispatchEvent(new CustomEvent("change",{detail:_,bubbles:!0}))}function V(ce){if(p){let He=W.toArray(_);W.inArray(He,ce)||t(0,_=[...He,ce])}else t(0,_=ce);R==null||R.dispatchEvent(new CustomEvent("change",{detail:_,bubbles:!0}))}function U(ce){return s(ce)?q(ce):V(ce)}function j(){t(0,_=p?[]:void 0)}function Q(){L!=null&&L.show&&(L==null||L.show())}function X(){L!=null&&L.hide&&(L==null||L.hide())}function Z(){if(W.isEmpty(_)||W.isEmpty(d))return;let ce=W.toArray(_),He=[];for(const At of ce)W.inArray(d,At)||He.push(At);if(He.length){for(const At of He)W.removeByValue(ce,At);t(0,_=p?ce:ce[0])}}function re(){t(16,N="")}function ee(ce,He){ce=ce||[];const At=E||p4;return ce.filter(Ne=>At(Ne,He))||[]}function se(ce,He){ce.preventDefault(),b&&p?U(He):V(He)}function ye(ce,He){(ce.code==="Enter"||ce.code==="Space")&&(se(ce,He),k&&X())}function $e(){re(),setTimeout(()=>{const ce=R==null?void 0:R.querySelector(".dropdown-item.option.selected");ce&&(ce.focus(),ce.scrollIntoView({block:"nearest"}))},0)}function ze(ce){ce.stopPropagation(),!g&&!h&&(L==null||L.toggle())}Xt(()=>{const ce=document.querySelectorAll(`label[for="${r}"]`);for(const He of ce)He.addEventListener("click",ze);return()=>{for(const He of ce)He.removeEventListener("click",ze)}});const Ue=ce=>q(ce);function Se(ce){ne[ce?"unshift":"push"](()=>{F=ce,t(19,F)})}function Oe(){N=this.value,t(16,N)}const Ge=(ce,He)=>se(He,ce),_t=(ce,He)=>ye(He,ce);function Xe(ce){ne[ce?"unshift":"push"](()=>{L=ce,t(17,L)})}function Ke(ce){he.call(this,n,ce)}function Te(ce){ne[ce?"unshift":"push"](()=>{R=ce,t(18,R)})}return n.$$set=ce=>{"id"in ce&&t(26,r=ce.id),"noOptionsText"in ce&&t(1,a=ce.noOptionsText),"selectPlaceholder"in ce&&t(2,u=ce.selectPlaceholder),"searchPlaceholder"in ce&&t(3,f=ce.searchPlaceholder),"items"in ce&&t(27,d=ce.items),"multiple"in ce&&t(4,p=ce.multiple),"disabled"in ce&&t(5,h=ce.disabled),"readonly"in ce&&t(6,g=ce.readonly),"selected"in ce&&t(0,_=ce.selected),"toggle"in ce&&t(7,b=ce.toggle),"closable"in ce&&t(8,k=ce.closable),"labelComponent"in ce&&t(9,$=ce.labelComponent),"labelComponentProps"in ce&&t(10,C=ce.labelComponentProps),"optionComponent"in ce&&t(11,T=ce.optionComponent),"optionComponentProps"in ce&&t(12,O=ce.optionComponentProps),"searchable"in ce&&t(13,M=ce.searchable),"searchFunc"in ce&&t(28,E=ce.searchFunc),"class"in ce&&t(14,A=ce.class),"$$scope"in ce&&t(43,o=ce.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&134217728&&d&&(Z(),re()),n.$$.dirty[0]&134283264&&t(21,i=ee(d,N)),n.$$.dirty[0]&1&&t(20,s=function(ce){const He=W.toArray(_);return W.inArray(He,ce)})},[_,a,u,f,p,h,g,b,k,$,C,T,O,M,A,q,N,L,R,F,s,i,re,se,ye,$e,r,d,E,V,U,j,Q,X,l,Ue,Se,Oe,Ge,_t,Xe,Ke,Te,o]}class cu extends ve{constructor(e){super(),be(this,e,m4,d4,_e,{id:26,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:27,multiple:4,disabled:5,readonly:6,selected:0,toggle:7,closable:8,labelComponent:9,labelComponentProps:10,optionComponent:11,optionComponentProps:12,searchable:13,searchFunc:28,class:14,deselectItem:15,selectItem:29,toggleItem:30,reset:31,showDropdown:32,hideDropdown:33},null,[-1,-1])}get deselectItem(){return this.$$.ctx[15]}get selectItem(){return this.$$.ctx[29]}get toggleItem(){return this.$$.ctx[30]}get reset(){return this.$$.ctx[31]}get showDropdown(){return this.$$.ctx[32]}get hideDropdown(){return this.$$.ctx[33]}}function kd(n){let e,t;return{c(){e=y("i"),m(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)&&m(e,"class",t)},d(i){i&&w(e)}}}function h4(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&&kd(n);return{c(){l&&l.c(),e=D(),t=y("span"),s=Y(i),m(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),v(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=kd(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:te,o:te,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function _4(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class wd extends ve{constructor(e){super(),be(this,e,_4,h4,_e,{item:0})}}const g4=n=>({}),Sd=n=>({});function b4(n){let e;const t=n[8].afterOptions,i=kt(t,n,n[12],Sd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&St(i,t,s,s[12],e?wt(t,s[12],l,g4):$t(s[12]),Sd)},i(s){e||(I(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function v4(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:[b4]},$$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 cu({props:o}),ne.push(()=>pe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&62?Ot(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Qt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function y4(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=wd}=e,{optionComponent:d=wd}=e,{selectionKey:p="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(C){C=W.toArray(C,!0);let T=[];for(let O of C){const M=W.findByKey(r,p,O);M&&T.push(M)}C.length&&!T.length||t(0,u=a?T:T[0])}async function _(C){let T=W.toArray(C,!0).map(O=>O[p]);r.length&&t(6,h=a?T:T[0])}function b(C){u=C,t(0,u)}function k(C){he.call(this,n,C)}function $(C){he.call(this,n,C)}return n.$$set=C=>{e=je(je({},e),Gt(C)),t(5,s=tt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,d=C.optionComponent),"selectionKey"in C&&t(7,p=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&_(u)},[u,r,a,f,d,s,h,p,l,b,k,$,o]}class Bi extends ve{constructor(e){super(),be(this,e,y4,v4,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function k4(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[17],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[18]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new zs({props:a}),ne.push(()=>pe(t,"value",r)),{c(){e=y("div"),B(t.$$.fragment)},m(u,f){S(u,e,f),z(t,e,null),s=!0,l||(o=Ee(Be.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const d={};f&131072&&(d.id=u[17]),f&262144&&(d.readonly=!u[18]),!i&&f&1&&(i=!0,d.value=u[0].options.values,ge(()=>i=!1)),t.$set(d)},i(u){s||(I(t.$$.fragment,u),s=!0)},o(u){P(t.$$.fragment,u),s=!1},d(u){u&&w(e),H(t),l=!1,o()}}}function w4(n){let e,t,i;function s(o){n[8](o)}let l={id:n[17],items:n[3],readonly:!n[18]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),ne.push(()=>pe(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&131072&&(a.id=o[17]),r&262144&&(a.readonly=!o[18]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function S4(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[18]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[k4,({uniqueId:d})=>({17:d}),({uniqueId:d})=>d?131072:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[18]?"":"readonly"),inlineError:!0,$$slots:{default:[w4,({uniqueId:d})=>({17:d}),({uniqueId:d})=>d?131072:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),B(i.$$.fragment),s=D(),l=y("div"),o=D(),B(r.$$.fragment),a=D(),u=y("div"),m(e,"class","separator"),m(l,"class","separator"),m(u,"class","separator")},m(d,p){S(d,e,p),S(d,t,p),z(i,d,p),S(d,s,p),S(d,l,p),S(d,o,p),z(r,d,p),S(d,a,p),S(d,u,p),f=!0},p(d,p){const h={};p&262144&&(h.class="form-field required "+(d[18]?"":"readonly")),p&2&&(h.name="schema."+d[1]+".options.values"),p&917505&&(h.$$scope={dirty:p,ctx:d}),i.$set(h);const g={};p&262144&&(g.class="form-field form-field-single-multiple-select "+(d[18]?"":"readonly")),p&917508&&(g.$$scope={dirty:p,ctx:d}),r.$set(g)},i(d){f||(I(i.$$.fragment,d),I(r.$$.fragment,d),f=!0)},o(d){P(i.$$.fragment,d),P(r.$$.fragment,d),f=!1},d(d){d&&w(e),d&&w(t),H(i,d),d&&w(s),d&&w(l),d&&w(o),H(r,d),d&&w(a),d&&w(u)}}}function $d(n){let e,t;return e=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[$4,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&655361&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function $4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Max select"),s=D(),l=y("input"),m(e,"for",i=n[17]),m(l,"id",o=n[17]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.maxSelect),r||(a=J(l,"input",n[6]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&m(e,"for",i),f&131072&&o!==(o=u[17])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function T4(n){let e,t,i=!n[2]&&$d(n);return{c(){i&&i.c(),e=we()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,l){s[2]?i&&(ue(),P(i,1,1,()=>{i=null}),fe()):i?(i.p(s,l),l&4&&I(i,1)):(i=$d(s),i.c(),I(i,1),i.m(e.parentNode,e))},i(s){t||(I(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function C4(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[T4],default:[S4,({interactive:r})=>({18:r}),({interactive:r})=>r?262144:0]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("drop",n[12]),e.$on("dragstart",n[13]),e.$on("dragenter",n[14]),e.$on("dragleave",n[15]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&18?Ot(s,[a&2&&{key:r[1]},a&16&&Qt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function M4(n,e,t){var O;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((O=l.options)==null?void 0:O.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function d(){l.options.maxSelect=pt(this.value),t(0,l),t(5,u),t(2,a)}function p(M){n.$$.not_equal(l.options.values,M)&&(l.options.values=M,t(0,l),t(5,u),t(2,a))}function h(M){a=M,t(2,a)}function g(M){l=M,t(0,l),t(5,u),t(2,a)}function _(M){he.call(this,n,M)}function b(M){he.call(this,n,M)}function k(M){he.call(this,n,M)}function $(M){he.call(this,n,M)}function C(M){he.call(this,n,M)}function T(M){he.call(this,n,M)}return n.$$set=M=>{e=je(je({},e),Gt(M)),t(4,s=tt(e,i)),"field"in M&&t(0,l=M.field),"key"in M&&t(1,o=M.key)},n.$$.update=()=>{var M,E;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((E=(M=l.options)==null?void 0:M.values)==null?void 0:E.length)||2,l)),n.$$.dirty&1&&W.isEmpty(l.options)&&f()},[l,o,a,r,s,u,d,p,h,g,_,b,k,$,C,T]}class O4 extends ve{constructor(e){super(),be(this,e,M4,C4,_e,{field:0,key:1})}}function E4(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function D4(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Td(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E='"{"a":1,"b":2}"',A,L,N,R,F,q,V,U,j,Q,X,Z,re;return{c(){e=y("div"),t=y("div"),i=y("div"),s=Y("In order to support seamlessly both "),l=y("code"),l.textContent="application/json",o=Y(` and
`),r=y("code"),r.textContent="multipart/form-data",a=Y(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=Y(` field
is a
`),d=y("strong"),d.textContent="plain string",p=Y(`:
`),h=y("ul"),g=y("li"),g.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=D(),b=y("li"),b.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=D(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=D(),T=y("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=D(),M=y("li"),A=Y(E),L=Y(" is converted to the json "),N=y("code"),N.textContent='{"a":1,"b":2}',R=D(),F=y("li"),F.textContent="numeric strings are converted to json number",q=D(),V=y("li"),V.textContent="double quoted strings are left as they are (aka. without normalizations)",U=D(),j=y("li"),j.textContent="any other string (empty string too) is double quoted",Q=Y(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),X=y("code"),X.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(ee,se){S(ee,e,se),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,h),v(h,g),v(h,_),v(h,b),v(h,k),v(h,$),v(h,C),v(h,T),v(h,O),v(h,M),v(M,A),v(M,L),v(M,N),v(h,R),v(h,F),v(h,q),v(h,V),v(h,U),v(h,j),v(i,Q),v(i,X),re=!0},i(ee){re||(ee&&et(()=>{re&&(Z||(Z=Ve(e,rt,{duration:150},!0)),Z.run(1))}),re=!0)},o(ee){ee&&(Z||(Z=Ve(e,rt,{duration:150},!1)),Z.run(0)),re=!1},d(ee){ee&&w(e),ee&&Z&&Z.end()}}}function A4(n){let e,t,i,s,l,o,r;function a(p,h){return p[2]?D4:E4}let u=a(n),f=u(n),d=n[2]&&Td();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),d&&d.c(),l=we(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,h){S(p,e,h),v(e,t),v(e,i),f.m(e,null),S(p,s,h),d&&d.m(p,h),S(p,l,h),o||(r=J(e,"click",n[4]),o=!0)},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?h&4&&I(d,1):(d=Td(),d.c(),I(d,1),d.m(l.parentNode,l)):d&&(ue(),P(d,1,1,()=>{d=null}),fe())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function I4(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[A4]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?Ot(s,[a&2&&{key:r[1]},a&8&&Qt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function L4(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(b){l=b,t(0,l)}function f(b){he.call(this,n,b)}function d(b){he.call(this,n,b)}function p(b){he.call(this,n,b)}function h(b){he.call(this,n,b)}function g(b){he.call(this,n,b)}function _(b){he.call(this,n,b)}return n.$$set=b=>{e=je(je({},e),Gt(b)),t(3,s=tt(e,i)),"field"in b&&t(0,l=b.field),"key"in b&&t(1,o=b.key)},[l,o,r,s,a,u,f,d,p,h,g,_]}class P4 extends ve{constructor(e){super(),be(this,e,L4,I4,_e,{field:0,key:1})}}function N4(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=Y(t),s=D(),l=y("small"),r=Y(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),S(a,l,u),v(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:te,o:te,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function F4(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Cd extends ve{constructor(e){super(),be(this,e,F4,N4,_e,{item:0})}}const R4=[{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 q4(n){let e,t,i;function s(o){n[16](o)}let l={id:n[26],items:n[4],readonly:!n[27]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),ne.push(()=>pe(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&67108864&&(a.id=o[26]),r&134217728&&(a.readonly=!o[27]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function j4(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field form-field-single-multiple-select "+(n[27]?"":"readonly"),inlineError:!0,$$slots:{default:[q4,({uniqueId:r})=>({26:r}),({uniqueId:r})=>r?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),B(i.$$.fragment),s=D(),l=y("div"),m(e,"class","separator"),m(l,"class","separator")},m(r,a){S(r,e,a),S(r,t,a),z(i,r,a),S(r,s,a),S(r,l,a),o=!0},p(r,a){const u={};a&134217728&&(u.class="form-field form-field-single-multiple-select "+(r[27]?"":"readonly")),a&469762052&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(I(i.$$.fragment,r),o=!0)},o(r){P(i.$$.fragment,r),o=!1},d(r){r&&w(e),r&&w(t),H(i,r),r&&w(s),r&&w(l)}}}function V4(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=D(),l=y("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=D(),r=y("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable"),m(r,"type","button"),m(r,"class","dropdown-item closable")},m(f,d){S(f,e,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),S(f,o,d),S(f,r,d),a||(u=[J(e,"click",n[9]),J(i,"click",n[10]),J(l,"click",n[11]),J(r,"click",n[12])],a=!0)},p:te,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,De(u)}}}function z4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C;function T(M){n[8](M)}let O={id:n[26],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Cd,optionComponent:Cd};return n[0].options.mimeTypes!==void 0&&(O.keyOfSelected=n[0].options.mimeTypes),r=new Bi({props:O}),ne.push(()=>pe(r,"keyOfSelected",T)),b=new Jn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[V4]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Allowed mime types",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),d=y("button"),p=y("span"),p.textContent="Choose presets",h=D(),g=y("i"),_=D(),B(b.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[26]),m(p,"class","txt link-primary"),m(g,"class","ri-arrow-drop-down-fill"),m(d,"type","button"),m(d,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(M,E){S(M,e,E),v(e,t),v(e,i),v(e,s),S(M,o,E),z(r,M,E),S(M,u,E),S(M,f,E),v(f,d),v(d,p),v(d,h),v(d,g),v(d,_),z(b,d,null),k=!0,$||(C=Ee(Be.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,E){(!k||E&67108864&&l!==(l=M[26]))&&m(e,"for",l);const A={};E&67108864&&(A.id=M[26]),E&8&&(A.items=M[3]),!a&&E&1&&(a=!0,A.keyOfSelected=M[0].options.mimeTypes,ge(()=>a=!1)),r.$set(A);const L={};E&268435457&&(L.$$scope={dirty:E,ctx:M}),b.$set(L)},i(M){k||(I(r.$$.fragment,M),I(b.$$.fragment,M),k=!0)},o(M){P(r.$$.fragment,M),P(b.$$.fragment,M),k=!1},d(M){M&&w(e),M&&w(o),H(r,M),M&&w(u),M&&w(f),H(b),$=!1,C()}}}function H4(n){let e;return{c(){e=y("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>`,m(e,"class","m-0")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function B4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O;function M(A){n[13](A)}let E={id:n[26],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new zs({props:E}),ne.push(()=>pe(r,"value",M)),$=new Jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[H4]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=D(),h=y("button"),g=y("span"),g.textContent="Supported formats",_=D(),b=y("i"),k=D(),B($.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[26]),m(d,"class","txt"),m(g,"class","txt link-primary"),m(b,"class","ri-arrow-drop-down-fill"),m(h,"type","button"),m(h,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(A,L){S(A,e,L),v(e,t),v(e,i),v(e,s),S(A,o,L),z(r,A,L),S(A,u,L),S(A,f,L),v(f,d),v(f,p),v(f,h),v(h,g),v(h,_),v(h,b),v(h,k),z($,h,null),C=!0,T||(O=Ee(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(A,L){(!C||L&67108864&&l!==(l=A[26]))&&m(e,"for",l);const N={};L&67108864&&(N.id=A[26]),!a&&L&1&&(a=!0,N.value=A[0].options.thumbs,ge(()=>a=!1)),r.$set(N);const R={};L&268435456&&(R.$$scope={dirty:L,ctx:A}),$.$set(R)},i(A){C||(I(r.$$.fragment,A),I($.$$.fragment,A),C=!0)},o(A){P(r.$$.fragment,A),P($.$$.fragment,A),C=!1},d(A){A&&w(e),A&&w(o),H(r,A),A&&w(u),A&&w(f),H($),T=!1,O()}}}function U4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=Y("Max file size"),s=D(),l=y("input"),r=D(),a=y("div"),a.textContent="Must be in bytes.",m(e,"for",i=n[26]),m(l,"type","number"),m(l,"id",o=n[26]),m(l,"step","1"),m(l,"min","0"),m(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ae(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&67108864&&i!==(i=d[26])&&m(e,"for",i),p&67108864&&o!==(o=d[26])&&m(l,"id",o),p&1&&pt(l.value)!==d[0].options.maxSize&&ae(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Md(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[W4,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","col-sm-3")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function W4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Max select"),s=D(),l=y("input"),m(e,"for",i=n[26]),m(l,"id",o=n[26]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&m(e,"for",i),f&67108864&&o!==(o=u[26])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Y4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[z4,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[B4,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[U4,({uniqueId:_})=>({26:_}),({uniqueId:_})=>_?67108864:0]},$$scope:{ctx:n}}});let g=!n[2]&&Md(n);return{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),a=D(),u=y("div"),B(f.$$.fragment),p=D(),g&&g.c(),m(t,"class","col-sm-12"),m(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),m(u,"class",d=n[2]?"col-sm-4":"col-sm-3"),m(e,"class","grid grid-sm")},m(_,b){S(_,e,b),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,a),v(e,u),z(f,u,null),v(e,p),g&&g.m(e,null),h=!0},p(_,b){const k={};b&2&&(k.name="schema."+_[1]+".options.mimeTypes"),b&335544329&&(k.$$scope={dirty:b,ctx:_}),i.$set(k);const $={};b&2&&($.name="schema."+_[1]+".options.thumbs"),b&335544321&&($.$$scope={dirty:b,ctx:_}),o.$set($),(!h||b&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&m(l,"class",r);const C={};b&2&&(C.name="schema."+_[1]+".options.maxSize"),b&335544321&&(C.$$scope={dirty:b,ctx:_}),f.$set(C),(!h||b&4&&d!==(d=_[2]?"col-sm-4":"col-sm-3"))&&m(u,"class",d),_[2]?g&&(ue(),P(g,1,1,()=>{g=null}),fe()):g?(g.p(_,b),b&4&&I(g,1)):(g=Md(_),g.c(),I(g,1),g.m(e,null))},i(_){h||(I(i.$$.fragment,_),I(o.$$.fragment,_),I(f.$$.fragment,_),I(g),h=!0)},o(_){P(i.$$.fragment,_),P(o.$$.fragment,_),P(f.$$.fragment,_),P(g),h=!1},d(_){_&&w(e),H(i),H(o),H(f),g&&g.d()}}}function K4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Protected",r=D(),a=y("a"),a.textContent="(Learn more)",m(e,"type","checkbox"),m(e,"id",t=n[26]),m(l,"class","txt"),m(s,"for",o=n[26]),m(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),m(a,"class","toggle-info txt-sm txt-hint m-l-5"),m(a,"target","_blank"),m(a,"rel","noopener")},m(d,p){S(d,e,p),e.checked=n[0].options.protected,S(d,i,p),S(d,s,p),v(s,l),S(d,r,p),S(d,a,p),u||(f=J(e,"change",n[7]),u=!0)},p(d,p){p&67108864&&t!==(t=d[26])&&m(e,"id",t),p&1&&(e.checked=d[0].options.protected),p&67108864&&o!==(o=d[26])&&m(s,"for",o)},d(d){d&&w(e),d&&w(i),d&&w(s),d&&w(r),d&&w(a),u=!1,f()}}}function J4(n){let e,t,i;return t=new me({props:{class:"form-field form-field-toggle m-0",name:"schema."+n[1]+".options.protected",$$slots:{default:[K4,({uniqueId:s})=>({26:s}),({uniqueId:s})=>s?67108864:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","col-sm-4")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.protected"),l&335544321&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function Z4(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{afterNonempty:[J4],options:[Y4],default:[j4,({interactive:r})=>({27:r}),({interactive:r})=>r?134217728:0]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>pe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("drop",n[20]),e.$on("dragstart",n[21]),e.$on("dragenter",n[22]),e.$on("dragleave",n[23]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?Ot(s,[a&2&&{key:r[1]},a&32&&Qt(r[5])]):{};a&402653199&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ge(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function G4(n,e,t){var V;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=R4.slice(),u=((V=l.options)==null?void 0:V.maxSelect)<=1,f=u;function d(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function p(){if(W.isEmpty(l.options.mimeTypes))return;const U=[];for(const j of l.options.mimeTypes)a.find(Q=>Q.mimeType===j)||U.push({mimeType:j});U.length&&t(3,a=a.concat(U))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function g(U){n.$$.not_equal(l.options.mimeTypes,U)&&(l.options.mimeTypes=U,t(0,l),t(6,f),t(2,u))}const _=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},b=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},k=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},$=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(U){n.$$.not_equal(l.options.thumbs,U)&&(l.options.thumbs=U,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=pt(this.value),t(0,l),t(6,f),t(2,u)}function O(){l.options.maxSelect=pt(this.value),t(0,l),t(6,f),t(2,u)}function M(U){u=U,t(2,u)}function E(U){l=U,t(0,l),t(6,f),t(2,u)}function A(U){he.call(this,n,U)}function L(U){he.call(this,n,U)}function N(U){he.call(this,n,U)}function R(U){he.call(this,n,U)}function F(U){he.call(this,n,U)}function q(U){he.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),Gt(U)),t(5,s=tt(e,i)),"field"in U&&t(0,l=U.field),"key"in U&&t(1,o=U.key)},n.$$.update=()=>{var U,j;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((j=(U=l.options)==null?void 0:U.values)==null?void 0:j.length)||99,l)),n.$$.dirty&1&&(W.isEmpty(l.options)?d():p())},[l,o,u,a,r,s,f,h,g,_,b,k,$,C,T,O,M,E,A,L,N,R,F,q]}class X4 extends ve{constructor(e){super(),be(this,e,G4,Z4,_e,{field:0,key:1})}}function Q4(n){let e,t,i,s,l;return{c(){e=y("hr"),t=D(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,m(i,"type","button"),m(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=J(i,"click",n[17]),s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function x4(n){let e,t,i;function s(o){n[18](o)}let l={id:n[33],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],readonly:!n[34]||n[0].id,$$slots:{afterOptions:[Q4]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Bi({props:l}),ne.push(()=>pe(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[1]&4&&(a.id=o[33]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1|r[1]&8&&(a.readonly=!o[34]||o[0].id),r[0]&16|r[1]&16&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eC(n){let e,t,i;function s(o){n[19](o)}let l={id:n[33],items:n[8],readonly:!n[34]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),ne.push(()=>pe(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[1]&4&&(a.id=o[33]),r[1]&8&&(a.readonly=!o[34]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function tC(n){let e,t,i,s,l,o,r,a,u,f;return i=new me({props:{class:"form-field required "+(n[34]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[x4,({uniqueId:d})=>({33:d}),({uniqueId:d})=>[0,d?4:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field form-field-single-multiple-select "+(n[34]?"":"readonly"),inlineError:!0,$$slots:{default:[eC,({uniqueId:d})=>({33:d}),({uniqueId:d})=>[0,d?4:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),B(i.$$.fragment),s=D(),l=y("div"),o=D(),B(r.$$.fragment),a=D(),u=y("div"),m(e,"class","separator"),m(l,"class","separator"),m(u,"class","separator")},m(d,p){S(d,e,p),S(d,t,p),z(i,d,p),S(d,s,p),S(d,l,p),S(d,o,p),z(r,d,p),S(d,a,p),S(d,u,p),f=!0},p(d,p){const h={};p[1]&8&&(h.class="form-field required "+(d[34]?"":"readonly")),p[0]&2&&(h.name="schema."+d[1]+".options.collectionId"),p[0]&25|p[1]&28&&(h.$$scope={dirty:p,ctx:d}),i.$set(h);const g={};p[1]&8&&(g.class="form-field form-field-single-multiple-select "+(d[34]?"":"readonly")),p[0]&4|p[1]&28&&(g.$$scope={dirty:p,ctx:d}),r.$set(g)},i(d){f||(I(i.$$.fragment,d),I(r.$$.fragment,d),f=!0)},o(d){P(i.$$.fragment,d),P(r.$$.fragment,d),f=!1},d(d){d&&w(e),d&&w(t),H(i,d),d&&w(s),d&&w(l),d&&w(o),H(r,d),d&&w(a),d&&w(u)}}}function Od(n){let e,t,i,s,l,o;return t=new me({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[nC,({uniqueId:r})=>({33:r}),({uniqueId:r})=>[0,r?4:0]]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[iC,({uniqueId:r})=>({33:r}),({uniqueId:r})=>[0,r?4:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),B(t.$$.fragment),i=D(),s=y("div"),B(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){S(r,e,a),z(t,e,null),S(r,i,a),S(r,s,a),z(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&20&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&20&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(t.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(t),r&&w(i),r&&w(s),H(l)}}}function nC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Min select"),s=D(),l=y("input"),m(e,"for",i=n[33]),m(l,"type","number"),m(l,"id",o=n[33]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.minSelect),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&4&&i!==(i=u[33])&&m(e,"for",i),f[1]&4&&o!==(o=u[33])&&m(l,"id",o),f[0]&1&&pt(l.value)!==u[0].options.minSelect&&ae(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=Y("Max select"),s=D(),l=y("input"),m(e,"for",i=n[33]),m(l,"type","number"),m(l,"id",o=n[33]),m(l,"step","1"),m(l,"placeholder","No max limit"),m(l,"min",r=n[0].options.minSelect||2)},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ae(l,n[0].options.maxSelect),a||(u=J(l,"input",n[14]),a=!0)},p(f,d){d[1]&4&&i!==(i=f[33])&&m(e,"for",i),d[1]&4&&o!==(o=f[33])&&m(l,"id",o),d[0]&1&&r!==(r=f[0].options.minSelect||2)&&m(l,"min",r),d[0]&1&&pt(l.value)!==f[0].options.maxSelect&&ae(l,f[0].options.maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function sC(n){let e,t,i,s,l,o,r,a,u,f,d;function p(g){n[15](g)}let h={multiple:!0,searchable:!0,id:n[33],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(h.selected=n[0].options.displayFields),r=new cu({props:h}),ne.push(()=>pe(r,"selected",p)),{c(){e=y("label"),t=y("span"),t.textContent="Display fields",i=D(),s=y("i"),o=D(),B(r.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[33])},m(g,_){S(g,e,_),v(e,t),v(e,i),v(e,s),S(g,o,_),z(r,g,_),u=!0,f||(d=Ee(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(g,_){(!u||_[1]&4&&l!==(l=g[33]))&&m(e,"for",l);const b={};_[1]&4&&(b.id=g[33]),_[0]&32&&(b.items=g[5]),!a&&_[0]&1&&(a=!0,b.selected=g[0].options.displayFields,ge(()=>a=!1)),r.$set(b)},i(g){u||(I(r.$$.fragment,g),u=!0)},o(g){P(r.$$.fragment,g),u=!1},d(g){g&&w(e),g&&w(o),H(r,g),f=!1,d()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,d,p;function h(_){n[16](_)}let g={id:n[33],items:n[9]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new Bi({props:g}),ne.push(()=>pe(a,"keyOfSelected",h)),{c(){e=y("label"),t=y("span"),t.textContent="Cascade delete",i=D(),s=y("i"),r=D(),B(a.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",o=n[33])},m(_,b){var k,$;S(_,e,b),v(e,t),v(e,i),v(e,s),S(_,r,b),z(a,_,b),f=!0,d||(p=Ee(l=Be.call(null,s,{text:`Whether on ${((k=n[6])==null?void 0:k.name)||"relation"} record deletion to delete also the ${(($=n[7])==null?void 0:$.name)||"field"} associated records.`,position:"top"})),d=!0)},p(_,b){var $,C;l&&jt(l.update)&&b[0]&192&&l.update.call(null,{text:`Whether on ${(($=_[6])==null?void 0:$.name)||"relation"} record deletion to delete also the ${((C=_[7])==null?void 0:C.name)||"field"} associated records.`,position:"top"}),(!f||b[1]&4&&o!==(o=_[33]))&&m(e,"for",o);const k={};b[1]&4&&(k.id=_[33]),!u&&b[0]&1&&(u=!0,k.keyOfSelected=_[0].options.cascadeDelete,ge(()=>u=!1)),a.$set(k)},i(_){f||(I(a.$$.fragment,_),f=!0)},o(_){P(a.$$.fragment,_),f=!1},d(_){_&&w(e),_&&w(r),H(a,_),d=!1,p()}}}function oC(n){let e,t,i,s,l,o,r,a,u=!n[2]&&Od(n);return s=new me({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[sC,({uniqueId:f})=>({33:f}),({uniqueId:f})=>[0,f?4:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[lC,({uniqueId:f})=>({33:f}),({uniqueId:f})=>[0,f?4:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),u&&u.c(),t=D(),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),B(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(f,d){S(f,e,d),u&&u.m(e,null),v(e,t),v(e,i),z(s,i,null),v(e,l),v(e,o),z(r,o,null),a=!0},p(f,d){f[2]?u&&(ue(),P(u,1,1,()=>{u=null}),fe()):u?(u.p(f,d),d[0]&4&&I(u,1)):(u=Od(f),u.c(),I(u,1),u.m(e,t));const p={};d[0]&2&&(p.name="schema."+f[1]+".options.displayFields"),d[0]&33|d[1]&20&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const h={};d[0]&2&&(h.name="schema."+f[1]+".options.cascadeDelete"),d[0]&193|d[1]&20&&(h.$$scope={dirty:d,ctx:f}),r.$set(h)},i(f){a||(I(u),I(s.$$.fragment,f),I(r.$$.fragment,f),a=!0)},o(f){P(u),P(s.$$.fragment,f),P(r.$$.fragment,f),a=!1},d(f){f&&w(e),u&&u.d(),H(s),H(r)}}}function rC(n){let e,t,i,s,l;const o=[{key:n[1]},n[10]];function r(f){n[20](f)}let a={$$slots:{options:[oC],default:[tC,({interactive:f})=>({34:f}),({interactive:f})=>[0,f?8:0]]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=je(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new pi({props:a}),ne.push(()=>pe(e,"field",r)),e.$on("rename",n[21]),e.$on("remove",n[22]),e.$on("drop",n[23]),e.$on("dragstart",n[24]),e.$on("dragenter",n[25]),e.$on("dragleave",n[26]);let u={};return s=new du({props:u}),n[27](s),s.$on("save",n[28]),{c(){B(e.$$.fragment),i=D(),B(s.$$.fragment)},m(f,d){z(e,f,d),S(f,i,d),z(s,f,d),l=!0},p(f,d){const p=d[0]&1026?Ot(o,[d[0]&2&&{key:f[1]},d[0]&1024&&Qt(f[10])]):{};d[0]&255|d[1]&24&&(p.$$scope={dirty:d,ctx:f}),!t&&d[0]&1&&(t=!0,p.field=f[0],ge(()=>t=!1)),e.$set(p);const h={};s.$set(h)},i(f){l||(I(e.$$.fragment,f),I(s.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),P(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&w(i),n[27](null),H(s,f)}}}function aC(n,e,t){var ee;let i;const s=["field","key"];let l=tt(e,s),o,r;Ze(n,di,se=>t(3,o=se)),Ze(n,fi,se=>t(7,r=se));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],d=[{label:"False",value:!1},{label:"True",value:!0}],p=["id","created","updated"],h=["username","email","emailVisibility","verified"];let g=null,_=[],b=null,k=((ee=a.options)==null?void 0:ee.maxSelect)==1,$=k;function C(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},a),t(2,k=!0),t(12,$=k)}function T(){var se,ye;if(t(5,_=p.slice(0)),!!i){i.isAuth&&t(5,_=_.concat(h));for(const $e of i.schema)_.push($e.name);if(((ye=(se=a.options)==null?void 0:se.displayFields)==null?void 0:ye.length)>0)for(let $e=a.options.displayFields.length-1;$e>=0;$e--)_.includes(a.options.displayFields[$e])||a.options.displayFields.splice($e,1)}}function O(){a.options.minSelect=pt(this.value),t(0,a),t(12,$),t(2,k)}function M(){a.options.maxSelect=pt(this.value),t(0,a),t(12,$),t(2,k)}function E(se){n.$$.not_equal(a.options.displayFields,se)&&(a.options.displayFields=se,t(0,a),t(12,$),t(2,k))}function A(se){n.$$.not_equal(a.options.cascadeDelete,se)&&(a.options.cascadeDelete=se,t(0,a),t(12,$),t(2,k))}const L=()=>g==null?void 0:g.show();function N(se){n.$$.not_equal(a.options.collectionId,se)&&(a.options.collectionId=se,t(0,a),t(12,$),t(2,k))}function R(se){k=se,t(2,k)}function F(se){a=se,t(0,a),t(12,$),t(2,k)}function q(se){he.call(this,n,se)}function V(se){he.call(this,n,se)}function U(se){he.call(this,n,se)}function j(se){he.call(this,n,se)}function Q(se){he.call(this,n,se)}function X(se){he.call(this,n,se)}function Z(se){ne[se?"unshift":"push"](()=>{g=se,t(4,g)})}const re=se=>{var ye,$e;($e=(ye=se==null?void 0:se.detail)==null?void 0:ye.collection)!=null&&$e.id&&t(0,a.options.collectionId=se.detail.collection.id,a)};return n.$$set=se=>{e=je(je({},e),Gt(se)),t(10,l=tt(e,s)),"field"in se&&t(0,a=se.field),"key"in se&&t(1,u=se.key)},n.$$.update=()=>{n.$$.dirty[0]&4100&&$!=k&&(t(12,$=k),k?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty[0]&1&&W.isEmpty(a.options)&&C(),n.$$.dirty[0]&9&&t(6,i=o.find(se=>se.id==a.options.collectionId)||null),n.$$.dirty[0]&2049&&b!=a.options.collectionId&&(t(11,b=a.options.collectionId),T())},[a,u,k,o,g,_,i,r,f,d,l,b,$,O,M,E,A,L,N,R,F,q,V,U,j,Q,X,Z,re]}class uC extends ve{constructor(e){super(),be(this,e,aC,rC,_e,{field:0,key:1},null,[-1,-1])}}function Ed(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Dd(n){let e,t,i,s,l,o,r,a;return{c(){e=Y(`,
`),t=y("code"),t.textContent="username",i=Y(` ,
`),s=y("code"),s.textContent="email",l=Y(` ,
`),o=y("code"),o.textContent="emailVisibility",r=Y(` ,
`),a=y("code"),a.textContent="verified",m(t,"class","txt-sm"),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(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 Ad(n,e){let t,i,s,l,o;function r(h){e[7](h,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...h){return e[10](e[19],...h)}function f(...h){return e[11](e[19],...h)}var d=e[1][e[17].type];function p(h){let g={key:h[4](h[17])};return h[17]!==void 0&&(g.field=h[17]),{props:g}}return d&&(i=Rt(d,p(e)),ne.push(()=>pe(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=we(),i&&B(i.$$.fragment),l=we(),this.first=t},m(h,g){S(h,t,g),i&&z(i,h,g),S(h,l,g),o=!0},p(h,g){e=h;const _={};if(g&1&&(_.key=e[4](e[17])),!s&&g&1&&(s=!0,_.field=e[17],ge(()=>s=!1)),g&1&&d!==(d=e[1][e[17].type])){if(i){ue();const b=i;P(b.$$.fragment,1,0,()=>{H(b,1)}),fe()}d?(i=Rt(d,p(e)),ne.push(()=>pe(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),B(i.$$.fragment),I(i.$$.fragment,1),z(i,l.parentNode,l)):i=null}else d&&i.$set(_)},i(h){o||(i&&I(i.$$.fragment,h),o=!0)},o(h){i&&P(i.$$.fragment,h),o=!1},d(h){h&&w(t),h&&w(l),i&&H(i,h)}}}function fC(n){let e,t,i,s,l,o,r,a,u,f,d,p,h=[],g=new Map,_,b,k,$,C,T,O,M,E=n[0].$isAuth&&Dd(),A=n[0].schema;const L=F=>F[17];for(let F=0;F<A.length;F+=1){let q=Ed(n,A,F),V=L(q);g.set(V,h[F]=Ad(V,q))}b=new tT({props:{class:"btn btn-block btn-outline"}}),b.$on("select",n[12]);function N(F){n[13](F)}let R={};return n[0]!==void 0&&(R.collection=n[0]),T=new X$({props:R}),ne.push(()=>pe(T,"collection",N)),{c(){e=y("div"),t=y("p"),i=Y(`System fields:
`),s=y("code"),s.textContent="id",l=Y(` ,
`),o=y("code"),o.textContent="created",r=Y(` ,
`),a=y("code"),a.textContent="updated",u=D(),E&&E.c(),f=Y(`
.`),d=D(),p=y("div");for(let F=0;F<h.length;F+=1)h[F].c();_=D(),B(b.$$.fragment),k=D(),$=y("hr"),C=D(),B(T.$$.fragment),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm"),m(t,"class","txt-sm"),m(e,"class","block m-b-25"),m(p,"class","schema-fields")},m(F,q){S(F,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),E&&E.m(t,null),v(t,f),S(F,d,q),S(F,p,q);for(let V=0;V<h.length;V+=1)h[V]&&h[V].m(p,null);S(F,_,q),z(b,F,q),S(F,k,q),S(F,$,q),S(F,C,q),z(T,F,q),M=!0},p(F,[q]){F[0].$isAuth?E||(E=Dd(),E.c(),E.m(t,f)):E&&(E.d(1),E=null),q&119&&(A=F[0].schema,ue(),h=vt(h,q,L,1,F,A,g,p,Ut,Ad,null,Ed),fe());const V={};!O&&q&1&&(O=!0,V.collection=F[0],ge(()=>O=!1)),T.$set(V)},i(F){if(!M){for(let q=0;q<A.length;q+=1)I(h[q]);I(b.$$.fragment,F),I(T.$$.fragment,F),M=!0}},o(F){for(let q=0;q<h.length;q+=1)P(h[q]);P(b.$$.fragment,F),P(T.$$.fragment,F),M=!1},d(F){F&&w(e),E&&E.d(),F&&w(d),F&&w(p);for(let q=0;q<h.length;q+=1)h[q].d();F&&w(_),H(b,F),F&&w(k),F&&w($),F&&w(C),H(T,F)}}}function cC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function dC(n,e,t){let i,{collection:s=new kn}=e;const l={text:yT,number:CT,bool:ET,email:k1,url:jT,editor:HT,date:s4,select:O4,json:P4,file:X4,relation:uC};function o(T){s.schema[T]&&(s.schema.splice(T,1),t(0,s))}function r(T="text"){const O=new wn({name:a(),type:T});O.onMountSelect=!0,s.schema.push(O),t(0,s)}function a(T="field"){let O="";for(;u(T+O);)++O;return T+O}function u(T){return!!s.schema.find(O=>O.name===T)}function f(T){return i.findIndex(O=>O===T)}function d(T,O){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||T===O||!O||t(0,s.indexes=s.indexes.map(E=>W.replaceIndexColumn(E,T,O)),s)}function p(T,O){if(!T)return;T.dataTransfer.dropEffect="move";const M=parseInt(T.dataTransfer.getData("text/plain")),E=s.schema;M<O?(E.splice(O+1,0,E[M]),E.splice(M,1)):(E.splice(O,0,E[M]),E.splice(M+1,1)),t(0,s.schema=E,s),tn({})}function h(T,O,M,E){M[E]=T,t(0,s)}const g=T=>o(T),_=T=>d(T.detail.oldName,T.detail.newName),b=(T,O)=>cC(O.detail,T),k=(T,O)=>p(O.detail,T),$=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,d,p,h,g,_,b,k,$,C]}class pC extends ve{constructor(e){super(),be(this,e,dC,fC,_e,{collection:0})}}const mC=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),hC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),_C=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]});function gC(n){let e,t;return e=new me({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[vC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bC(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Nd(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Fd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,m(e,"type","button"),m(e,"class","unlock-overlay svelte-1akuazq"),m(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:te,i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function vC(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,d,p,h,g,_,b,k,$;const C=n[12].beforeLabel,T=kt(C,n,n[15],Pd),O=n[12].afterLabel,M=kt(O,n,n[15],Ld);let E=!n[9]&&Nd(n);function A(V){n[14](V)}var L=n[7];function N(V){let U={id:V[18],baseCollection:V[1],disabled:V[9],placeholder:V[9]?"":V[5]};return V[0]!==void 0&&(U.value=V[0]),{props:U}}L&&(h=Rt(L,N(n)),n[13](h),ne.push(()=>pe(h,"value",A)));let R=n[9]&&Fd(n);const F=n[12].default,q=kt(F,n,n[15],Id);return{c(){e=y("div"),t=y("label"),T&&T.c(),i=D(),s=y("span"),l=Y(n[2]),o=D(),a=Y(r),u=D(),M&&M.c(),f=D(),E&&E.c(),p=D(),h&&B(h.$$.fragment),_=D(),R&&R.c(),b=D(),k=y("div"),q&&q.c(),m(s,"class","txt"),x(s,"txt-hint",n[9]),m(t,"for",d=n[18]),m(e,"class","input-wrapper svelte-1akuazq"),m(k,"class","help-block")},m(V,U){S(V,e,U),v(e,t),T&&T.m(t,null),v(t,i),v(t,s),v(s,l),v(s,o),v(s,a),v(t,u),M&&M.m(t,null),v(t,f),E&&E.m(t,null),v(e,p),h&&z(h,e,null),v(e,_),R&&R.m(e,null),S(V,b,U),S(V,k,U),q&&q.m(k,null),$=!0},p(V,U){T&&T.p&&(!$||U&33280)&&St(T,C,V,V[15],$?wt(C,V[15],U,_C):$t(V[15]),Pd),(!$||U&4)&&le(l,V[2]),(!$||U&512)&&r!==(r=V[9]?"- Admins only":"")&&le(a,r),(!$||U&512)&&x(s,"txt-hint",V[9]),M&&M.p&&(!$||U&33280)&&St(M,O,V,V[15],$?wt(O,V[15],U,hC):$t(V[15]),Ld),V[9]?E&&(E.d(1),E=null):E?E.p(V,U):(E=Nd(V),E.c(),E.m(t,null)),(!$||U&262144&&d!==(d=V[18]))&&m(t,"for",d);const j={};if(U&262144&&(j.id=V[18]),U&2&&(j.baseCollection=V[1]),U&512&&(j.disabled=V[9]),U&544&&(j.placeholder=V[9]?"":V[5]),!g&&U&1&&(g=!0,j.value=V[0],ge(()=>g=!1)),U&128&&L!==(L=V[7])){if(h){ue();const Q=h;P(Q.$$.fragment,1,0,()=>{H(Q,1)}),fe()}L?(h=Rt(L,N(V)),V[13](h),ne.push(()=>pe(h,"value",A)),B(h.$$.fragment),I(h.$$.fragment,1),z(h,e,_)):h=null}else L&&h.$set(j);V[9]?R?(R.p(V,U),U&512&&I(R,1)):(R=Fd(V),R.c(),I(R,1),R.m(e,null)):R&&(ue(),P(R,1,1,()=>{R=null}),fe()),q&&q.p&&(!$||U&33280)&&St(q,F,V,V[15],$?wt(F,V[15],U,mC):$t(V[15]),Id)},i(V){$||(I(T,V),I(M,V),h&&I(h.$$.fragment,V),I(R),I(q,V),$=!0)},o(V){P(T,V),P(M,V),h&&P(h.$$.fragment,V),P(R),P(q,V),$=!1},d(V){V&&w(e),T&&T.d(V),M&&M.d(V),E&&E.d(),n[13](null),h&&H(h),R&&R.d(),V&&w(b),V&&w(k),q&&q.d(V)}}}function yC(n){let e,t,i,s;const l=[bC,gC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},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):(ue(),P(o[f],1,1,()=>{o[f]=null}),fe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Rd;function kC(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,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,h=null,g=Rd,_=!1;b();async function b(){g||_||(t(8,_=!0),t(7,g=(await ut(()=>import("./FilterAutocompleteInput-da38bd6a.js"),["./FilterAutocompleteInput-da38bd6a.js","./index-8b57b6cd.js"],import.meta.url)).default),Rd=g,t(8,_=!1))}async function k(){t(0,r=h||""),await cn(),p==null||p.focus()}async function $(){h=r,t(0,r=null)}function C(O){ne[O?"unshift":"push"](()=>{p=O,t(6,p)})}function T(O){r=O,t(0,r)}return n.$$set=O=>{"collection"in O&&t(1,o=O.collection),"rule"in O&&t(0,r=O.rule),"label"in O&&t(2,a=O.label),"formKey"in O&&t(3,u=O.formKey),"required"in O&&t(4,f=O.required),"placeholder"in O&&t(5,d=O.placeholder),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,g,_,i,k,$,s,C,T,l]}class Es extends ve{constructor(e){super(),be(this,e,kC,yC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function qd(n,e,t){const i=n.slice();return i[11]=e[t],i}function jd(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L=n[2],N=[];for(let R=0;R<L.length;R+=1)N[R]=Vd(qd(n,L,R));return{c(){e=y("div"),t=y("div"),i=y("div"),s=y("p"),s.textContent="The following record fields are available:",l=D(),o=y("div");for(let R=0;R<N.length;R+=1)N[R].c();r=D(),a=y("hr"),u=D(),f=y("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",d=D(),p=y("div"),p.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,h=D(),g=y("hr"),_=D(),b=y("p"),b.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=D(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=D(),T=y("hr"),O=D(),M=y("p"),M.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,m(s,"class","m-b-0"),m(o,"class","inline-flex flex-gap-5"),m(a,"class","m-t-10 m-b-5"),m(f,"class","m-b-0"),m(p,"class","inline-flex flex-gap-5"),m(g,"class","m-t-10 m-b-5"),m(b,"class","m-b-0"),m($,"class","inline-flex flex-gap-5"),m(T,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(R,F){S(R,e,F),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q<N.length;q+=1)N[q]&&N[q].m(o,null);v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,h),v(i,g),v(i,_),v(i,b),v(i,k),v(i,$),v(i,C),v(i,T),v(i,O),v(i,M),A=!0},p(R,F){if(F&4){L=R[2];let q;for(q=0;q<L.length;q+=1){const V=qd(R,L,q);N[q]?N[q].p(V,F):(N[q]=Vd(V),N[q].c(),N[q].m(o,null))}for(;q<N.length;q+=1)N[q].d(1);N.length=L.length}},i(R){A||(R&&et(()=>{A&&(E||(E=Ve(e,rt,{duration:150},!0)),E.run(1))}),A=!0)},o(R){R&&(E||(E=Ve(e,rt,{duration:150},!1)),E.run(0)),A=!1},d(R){R&&w(e),ht(N,R),R&&E&&E.end()}}}function Vd(n){let e,t=n[11]+"",i;return{c(){e=y("code"),i=Y(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&le(i,t)},d(s){s&&w(e)}}}function zd(n){let e,t,i,s,l,o,r,a,u;function f(b){n[6](b)}let d={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[wC,({isAdminOnly:b})=>({10:b}),({isAdminOnly:b})=>b?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Es({props:d}),ne.push(()=>pe(e,"rule",f));function p(b){n[7](b)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Es({props:h}),ne.push(()=>pe(s,"rule",p));function g(b){n[8](b)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Es({props:_}),ne.push(()=>pe(r,"rule",g)),{c(){B(e.$$.fragment),i=D(),B(s.$$.fragment),o=D(),B(r.$$.fragment)},m(b,k){z(e,b,k),S(b,i,k),z(s,b,k),S(b,o,k),z(r,b,k),u=!0},p(b,k){const $={};k&1&&($.collection=b[0]),k&17408&&($.$$scope={dirty:k,ctx:b}),!t&&k&1&&(t=!0,$.rule=b[0].createRule,ge(()=>t=!1)),e.$set($);const C={};k&1&&(C.collection=b[0]),!l&&k&1&&(l=!0,C.rule=b[0].updateRule,ge(()=>l=!1)),s.$set(C);const T={};k&1&&(T.collection=b[0]),!a&&k&1&&(a=!0,T.rule=b[0].deleteRule,ge(()=>a=!1)),r.$set(T)},i(b){u||(I(e.$$.fragment,b),I(s.$$.fragment,b),I(r.$$.fragment,b),u=!0)},o(b){P(e.$$.fragment,b),P(s.$$.fragment,b),P(r.$$.fragment,b),u=!1},d(b){H(e,b),b&&w(i),H(s,b),b&&w(o),H(r,b)}}}function Hd(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-information-line link-hint")},m(s,l){S(s,e,l),t||(i=Ee(Be.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&w(e),t=!1,i()}}}function wC(n){let e,t=!n[10]&&Hd();return{c(){t&&t.c(),e=we()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Hd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&w(e)}}}function Bd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[SC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Es({props:l}),ne.push(()=>pe(e,"rule",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function SC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=y("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:te,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function $C(n){var F,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,h,g,_,b,k,$,C,T,O=n[1]&&jd(n);function M(V){n[4](V)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),f=new Es({props:E}),ne.push(()=>pe(f,"rule",M));function A(V){n[5](V)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),h=new Es({props:L}),ne.push(()=>pe(h,"rule",A));let N=!((F=n[0])!=null&&F.$isView)&&zd(n),R=((q=n[0])==null?void 0:q.$isAuth)&&Bd(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=y("button"),r=Y(o),a=D(),O&&O.c(),u=D(),B(f.$$.fragment),p=D(),B(h.$$.fragment),_=D(),N&&N.c(),b=D(),R&&R.c(),k=we(),m(l,"type","button"),m(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),m(t,"class","flex txt-sm txt-hint m-b-5"),m(e,"class","block m-b-sm handle")},m(V,U){S(V,e,U),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),O&&O.m(e,null),S(V,u,U),z(f,V,U),S(V,p,U),z(h,V,U),S(V,_,U),N&&N.m(V,U),S(V,b,U),R&&R.m(V,U),S(V,k,U),$=!0,C||(T=J(l,"click",n[3]),C=!0)},p(V,[U]){var X,Z;(!$||U&2)&&o!==(o=V[1]?"Hide available fields":"Show available fields")&&le(r,o),V[1]?O?(O.p(V,U),U&2&&I(O,1)):(O=jd(V),O.c(),I(O,1),O.m(e,null)):O&&(ue(),P(O,1,1,()=>{O=null}),fe());const j={};U&1&&(j.collection=V[0]),!d&&U&1&&(d=!0,j.rule=V[0].listRule,ge(()=>d=!1)),f.$set(j);const Q={};U&1&&(Q.collection=V[0]),!g&&U&1&&(g=!0,Q.rule=V[0].viewRule,ge(()=>g=!1)),h.$set(Q),(X=V[0])!=null&&X.$isView?N&&(ue(),P(N,1,1,()=>{N=null}),fe()):N?(N.p(V,U),U&1&&I(N,1)):(N=zd(V),N.c(),I(N,1),N.m(b.parentNode,b)),(Z=V[0])!=null&&Z.$isAuth?R?(R.p(V,U),U&1&&I(R,1)):(R=Bd(V),R.c(),I(R,1),R.m(k.parentNode,k)):R&&(ue(),P(R,1,1,()=>{R=null}),fe())},i(V){$||(I(O),I(f.$$.fragment,V),I(h.$$.fragment,V),I(N),I(R),$=!0)},o(V){P(O),P(f.$$.fragment,V),P(h.$$.fragment,V),P(N),P(R),$=!1},d(V){V&&w(e),O&&O.d(),V&&w(u),H(f,V),V&&w(p),H(h,V),V&&w(_),N&&N.d(V),V&&w(b),R&&R.d(V),V&&w(k),C=!1,T()}}}function TC(n,e,t){let i,{collection:s=new kn}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function d(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function p(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=W.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class CC extends ve{constructor(e){super(),be(this,e,TC,$C,_e,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function MC(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-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Rt(o,r(n)),ne.push(()=>pe(e,"value",l)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=we()},m(a,u){e&&z(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,ge(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ue();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}o?(e=Rt(o,r(a)),ne.push(()=>pe(e,"value",l)),e.$on("change",a[6]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function OC(n){let e;return{c(){e=y("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Wd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Yd(Ud(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();m(t,"class","content"),m(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),v(e,t);for(let r=0;r<s.length;r+=1)s[r]&&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=Ud(l,i,r);s[r]?s[r].p(a,o):(s[r]=Yd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function Yd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=Y(t)},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function EC(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[OC,MC],h=[];function g(b,k){return b[2]?0:1}l=g(n),o=h[l]=p[l](n);let _=n[3].length&&Wd(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=D(),_&&_.c(),f=we(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),h[l].m(b,k),S(b,r,k),S(b,a,k),S(b,u,k),_&&_.m(b,k),S(b,f,k),d=!0},p(b,k){(!d||k&256&&i!==(i=b[8]))&&m(e,"for",i);let $=l;l=g(b),l===$?h[l].p(b,k):(ue(),P(h[$],1,1,()=>{h[$]=null}),fe(),o=h[l],o?o.p(b,k):(o=h[l]=p[l](b),o.c()),I(o,1),o.m(r.parentNode,r)),b[3].length?_?_.p(b,k):(_=Wd(b),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(b){d||(I(o),d=!0)},o(b){P(o),d=!1},d(b){b&&w(e),b&&w(s),h[l].d(b),b&&w(r),b&&w(a),b&&w(u),_&&_.d(b),b&&w(f)}}}function DC(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[EC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function AC(n,e,t){let i;Ze(n,Ti,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var g;t(3,r=[]);const p=W.getNestedVal(d,"schema",null);if(W.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const h=W.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);W.removeByValue(h,"id"),W.removeByValue(h,"created"),W.removeByValue(h,"updated");for(let _ in p)for(let b in p[_]){const k=p[_][b].message,$=h[_]||_;r.push(W.sentenize($+": "+k))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await ut(()=>import("./CodeEditor-cdb3aab1.js"),["./CodeEditor-cdb3aab1.js","./index-8b57b6cd.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&ui("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class IC extends ve{constructor(e){super(),be(this,e,AC,DC,_e,{collection:0})}}const LC=n=>({active:n&1}),Kd=n=>({active:n[0]});function Jd(n){let e,t,i;const s=n[15].default,l=kt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),m(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)&&St(l,s,o,o[14],i?wt(s,o[14],r,null):$t(o[14]),null)},i(o){i||(I(l,o),o&&et(()=>{i&&(t||(t=Ve(e,rt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,rt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function PC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=kt(a,n,n[14],Kd);let f=n[0]&&Jd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=D(),f&&f.c(),m(t,"type","button"),m(t,"class","accordion-header"),m(t,"draggable",n[2]),x(t,"interactive",n[3]),m(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",xe(n[17])),J(t,"drop",xe(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",xe(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&St(u,a,d,d[14],l?wt(a,d[14],p,LC):$t(d[14]),Kd),(!l||p&4)&&m(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&I(f,1)):(f=Jd(d),f.c(),I(f,1),f.m(e,null)):f&&(ue(),P(f,1,1,()=>{f=null}),fe()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&m(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(I(u,d),I(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,De(r)}}}function NC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,h=!1;function g(){return!!f}function _(){$(),t(0,f=!0),l("expand")}function b(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?b():_()}function $(){if(p&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const R of N)R.click()}}Xt(()=>()=>clearTimeout(r));function C(N){he.call(this,n,N)}const T=()=>d&&k(),O=N=>{u&&(t(7,h=!1),$(),l("drop",N))},M=N=>u&&l("dragstart",N),E=N=>{u&&(t(7,h=!0),l("dragenter",N))},A=N=>{u&&(t(7,h=!1),l("dragleave",N))};function L(N){ne[N?"unshift":"push"](()=>{o=N,t(6,o)})}return n.$$set=N=>{"class"in N&&t(1,a=N.class),"draggable"in N&&t(2,u=N.draggable),"active"in N&&t(0,f=N.active),"interactive"in N&&t(3,d=N.interactive),"single"in N&&t(9,p=N.single),"$$scope"in N&&t(14,s=N.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,d,k,$,o,h,l,p,g,_,b,r,s,i,C,T,O,M,E,A,L]}class co extends ve{constructor(e){super(),be(this,e,NC,PC,_e,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function FC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(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),v(s,l),r||(a=J(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function RC(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[FC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function qC(n){let e;return{c(){e=y("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function jC(n){let e;return{c(){e=y("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Jt,{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){let e,t,i,s,l,o,r;function a(p,h){return p[0].options.allowUsernameAuth?jC:qC}let u=a(n),f=u(n),d=n[3]&&Zd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?h&8&&I(d,1):(d=Zd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ue(),P(d,1,1,()=>{d=null}),fe())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function zC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(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),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Gd(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(W.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[HC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+(W.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[BC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(W.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(W.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(I(i.$$.fragment,u),I(o.$$.fragment,u),u&&et(()=>{a&&(r||(r=Ve(e,rt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,rt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),H(i),H(o),u&&r&&r.end()}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(b){n[7](b)}let _={id:n[12],disabled:!W.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new zs({props:_}),ne.push(()=>pe(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(h=Ee(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"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&m(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!W.isEmpty(b[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.exceptEmailDomains,ge(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,h()}}}function BC(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(b){n[8](b)}let _={id:n[12],disabled:!W.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new zs({props:_}),ne.push(()=>pe(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),B(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),z(r,b,k),S(b,u,k),S(b,f,k),d=!0,p||(h=Ee(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"})),p=!0)},p(b,k){(!d||k&4096&&l!==(l=b[12]))&&m(e,"for",l);const $={};k&4096&&($.id=b[12]),k&1&&($.disabled=!W.isEmpty(b[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=b[0].options.onlyEmailDomains,ge(()=>a=!1)),r.$set($)},i(b){d||(I(r.$$.fragment,b),d=!0)},o(b){P(r.$$.fragment,b),d=!1},d(b){b&&w(e),b&&w(o),H(r,b),b&&w(u),b&&w(f),p=!1,h()}}}function UC(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[zC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Gd(n);return{c(){B(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){z(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&&I(l,1)):(l=Gd(o),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(ue(),P(l,1,1,()=>{l=null}),fe())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function WC(n){let e;return{c(){e=y("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YC(n){let e;return{c(){e=y("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Xd(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function KC(n){let e,t,i,s,l,o,r;function a(p,h){return p[0].options.allowEmailAuth?YC:WC}let u=a(n),f=u(n),d=n[2]&&Xd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?h&4&&I(d,1):(d=Xd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ue(),P(d,1,1,()=>{d=null}),fe())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function JC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(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),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Qd(n){let e,t,i;return{c(){e=y("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>',m(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=Ve(e,rt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,rt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function ZC(n){let e,t,i,s;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[JC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Qd();return{c(){B(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){z(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&&I(l,1):(l=Qd(),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(ue(),P(l,1,1,()=>{l=null}),fe())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){H(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function GC(n){let e;return{c(){e=y("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function XC(n){let e;return{c(){e=y("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function xd(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function QC(n){let e,t,i,s,l,o,r;function a(p,h){return p[0].options.allowOAuth2Auth?XC:GC}let u=a(n),f=u(n),d=n[1]&&xd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?h&2&&I(d,1):(d=xd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ue(),P(d,1,1,()=>{d=null}),fe())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Minimum password length"),s=D(),l=y("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),l.required=!0,m(l,"min","6"),m(l,"max","72")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&ae(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function e6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Always require email",o=D(),r=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(l,"class","txt"),m(r,"class","ri-information-line txt-sm link-hint"),m(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(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(d,p){p&4096&&t!==(t=d[12])&&m(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&m(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function t6(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k;return s=new co({props:{single:!0,$$slots:{header:[VC],default:[RC]},$$scope:{ctx:n}}}),o=new co({props:{single:!0,$$slots:{header:[KC],default:[UC]},$$scope:{ctx:n}}}),a=new co({props:{single:!0,$$slots:{header:[QC],default:[ZC]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[xC,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),b=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[e6,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=D(),i=y("div"),B(s.$$.fragment),l=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),u=D(),f=y("hr"),d=D(),p=y("h4"),p.textContent="General",h=D(),B(g.$$.fragment),_=D(),B(b.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(p,"class","section-title")},m($,C){S($,e,C),S($,t,C),S($,i,C),z(s,i,null),v(i,l),z(o,i,null),v(i,r),z(a,i,null),S($,u,C),S($,f,C),S($,d,C),S($,p,C),S($,h,C),z(g,$,C),S($,_,C),z(b,$,C),k=!0},p($,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:$}),s.$set(T);const O={};C&8197&&(O.$$scope={dirty:C,ctx:$}),o.$set(O);const M={};C&8195&&(M.$$scope={dirty:C,ctx:$}),a.$set(M);const E={};C&12289&&(E.$$scope={dirty:C,ctx:$}),g.$set(E);const A={};C&12289&&(A.$$scope={dirty:C,ctx:$}),b.$set(A)},i($){k||(I(s.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(g.$$.fragment,$),I(b.$$.fragment,$),k=!0)},o($){P(s.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),P(g.$$.fragment,$),P(b.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),H(s),H(o),H(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(h),H(g,$),$&&w(_),H(b,$)}}}function n6(n,e,t){let i,s,l,o;Ze(n,Ti,_=>t(4,o=_));let{collection:r=new kn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function d(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=pt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,b,k,$;n.$$.dirty&1&&r.$isAuth&&W.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!W.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!W.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.onlyEmailDomains)||!W.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!W.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,h,g]}class i6 extends ve{constructor(e){super(),be(this,e,n6,t6,_e,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[17]=e[t],i}function tp(n,e,t){const i=n.slice();return i[17]=e[t],i}function np(n,e,t){const i=n.slice();return i[17]=e[t],i}function ip(n){let e;return{c(){e=y("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 sp(n){var r;let e,t,i,s,l=n[3]&&lp(n),o=!((r=n[2])!=null&&r.$isView)&&op(n);return{c(){e=y("h6"),e.textContent="Changes:",t=D(),i=y("ul"),l&&l.c(),s=D(),o&&o.c(),m(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=lp(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=op(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 lp(n){var h,g;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,d=((g=n[2])==null?void 0:g.name)+"",p;return{c(){e=y("li"),t=y("div"),i=Y(`Renamed collection
`),s=y("strong"),o=Y(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=Y(d),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(_,b){S(_,e,b),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(_,b){var k,$;b&2&&l!==(l=((k=_[1])==null?void 0:k.name)+"")&&le(o,l),b&4&&d!==(d=(($=_[2])==null?void 0:$.name)+"")&&le(p,d)},d(_){_&&w(e)}}}function op(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=rp(np(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=ap(tp(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=up(ep(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=D();for(let f=0;f<r.length;f+=1)r[f].c();t=D();for(let f=0;f<u.length;f+=1)u[f].c();i=we()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);S(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);S(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);S(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const h=np(f,s,p);l[p]?l[p].p(h,d):(l[p]=rp(h),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const h=tp(f,o,p);r[p]?r[p].p(h,d):(r[p]=ap(h),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const h=ep(f,a,p);u[p]?u[p].p(h,d):(u[p]=up(h),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){ht(l,f),f&&w(e),ht(r,f),f&&w(t),ht(u,f),f&&w(i)}}}function rp(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=Y(`Multiple to single value conversion of field
`),i=y("strong"),l=Y(s),o=D(),r=y("em"),r.textContent="(will keep only the last array item)",m(r,"class","txt-sm"),m(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function ap(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=Y(`Renamed field
`),s=y("strong"),o=Y(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=Y(d),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(h,g){S(h,e,g),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(h,g){g&128&&l!==(l=h[17].originalName+"")&&le(o,l),g&128&&d!==(d=h[17].name+"")&&le(p,d)},d(h){h&&w(e)}}}function up(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=Y("Removed field "),i=y("span"),l=Y(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(i,l),v(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function s6(n){let e,t,i,s,l,o,r,a,u=n[6].length&&ip(),f=n[8]&&sp(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=we(),m(t,"class","icon"),m(s,"class","content txt-bold"),m(e,"class","alert alert-warning")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=ip(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=sp(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function l6(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function o6(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function r6(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[o6],header:[l6],default:[s6]},$$scope:{ctx:n}};return e=new on({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),H(e,s)}}}function a6(n,e,t){let i,s,l,o,r;const a=Tt();let u,f,d;async function p(T,O){t(1,f=T),t(2,d=O),await cn(),i||s.length||l.length||o.length?u==null||u.show():g()}function h(){u==null||u.hide()}function g(){h(),a("confirm")}const _=()=>h(),b=()=>g();function k(T){ne[T?"unshift":"push"](()=>{u=T,t(4,u)})}function $(T){he.call(this,n,T)}function C(T){he.call(this,n,T)}return n.$$.update=()=>{var T,O,M;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((T=d==null?void 0:d.schema)==null?void 0:T.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(6,l=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(5,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(E=>{var L,N,R;const A=(L=f==null?void 0:f.schema)==null?void 0:L.find(F=>F.id==E.id);return A?((N=A.options)==null?void 0:N.maxSelect)!=1&&((R=E.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[h,f,d,i,u,o,l,s,r,g,p,_,b,k,$,C]}class u6 extends ve{constructor(e){super(),be(this,e,a6,r6,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function fp(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function f6(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new pC({props:l}),ne.push(()=>pe(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function c6(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new IC({props:l}),ne.push(()=>pe(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function cp(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 CC({props:o}),ne.push(()=>pe(t,"collection",l)),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){S(r,e,a),z(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ge(()=>i=!1)),t.$set(u)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function dp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new i6({props:o}),ne.push(()=>pe(t,"collection",l)),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","tab-item"),x(e,"active",n[3]===Fs)},m(r,a){S(r,e,a),z(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ge(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&x(e,"active",r[3]===Fs)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&w(e),H(t)}}}function d6(n){let e,t,i,s,l,o,r;const a=[c6,f6],u=[];function f(h,g){return h[2].$isView?0:1}i=f(n),s=u[i]=a[i](n);let d=n[3]===wl&&cp(n),p=n[2].$isAuth&&dp(n);return{c(){e=y("div"),t=y("div"),s.c(),l=D(),d&&d.c(),o=D(),p&&p.c(),m(t,"class","tab-item"),x(t,"active",n[3]===Ni),m(e,"class","tabs-content svelte-12y0yzb")},m(h,g){S(h,e,g),v(e,t),u[i].m(t,null),v(e,l),d&&d.m(e,null),v(e,o),p&&p.m(e,null),r=!0},p(h,g){let _=i;i=f(h),i===_?u[i].p(h,g):(ue(),P(u[_],1,1,()=>{u[_]=null}),fe(),s=u[i],s?s.p(h,g):(s=u[i]=a[i](h),s.c()),I(s,1),s.m(t,null)),(!r||g[0]&8)&&x(t,"active",h[3]===Ni),h[3]===wl?d?(d.p(h,g),g[0]&8&&I(d,1)):(d=cp(h),d.c(),I(d,1),d.m(e,o)):d&&(ue(),P(d,1,1,()=>{d=null}),fe()),h[2].$isAuth?p?(p.p(h,g),g[0]&4&&I(p,1)):(p=dp(h),p.c(),I(p,1),p.m(e,null)):p&&(ue(),P(p,1,1,()=>{p=null}),fe())},i(h){r||(I(s),I(d),I(p),r=!0)},o(h){P(s),P(d),P(p),r=!1},d(h){h&&w(e),u[i].d(),d&&d.d(),p&&p.d()}}}function pp(n){let e,t,i,s,l,o,r;return o=new Jn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[p6]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),i=y("button"),s=y("i"),l=D(),B(o.$$.fragment),m(e,"class","flex-fill"),m(s,"class","ri-more-line"),m(i,"type","button"),m(i,"aria-label","More"),m(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),v(i,s),v(i,l),z(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||(I(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),H(o)}}}function p6(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,t=D(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",In(xe(n[25])))],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function mp(n){let e,t,i,s;return i=new Jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[m6]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=D(),B(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),z(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||(I(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),H(i,l)}}}function hp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=D(),l=y("span"),r=Y(o),a=Y(" collection"),u=D(),m(t,"class",i=os(W.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(h,g){S(h,e,g),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(h,g){n=h,g[0]&64&&i!==(i=os(W.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),g[0]&64&&o!==(o=n[48]+"")&&le(r,o),g[0]&68&&x(e,"selected",n[47]==n[2].type)},d(h){h&&w(e),f=!1,d()}}}function m6(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=hp(fp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&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=fp(s,t,o);i[o]?i[o].p(r,l):(i[o]=hp(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function _p(n){let e;return{c(){e=y("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function h6(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k=(n[6][n[2].type]||"N/A")+"",$,C,T,O,M,E,A,L,N,R=n[2].$isNew&&mp(n),F=n[2].system&&_p();return{c(){e=y("label"),t=Y("Name"),s=D(),l=y("input"),f=D(),d=y("div"),p=y("button"),h=y("span"),g=D(),_=y("span"),b=Y("Type: "),$=Y(k),C=D(),R&&R.c(),M=D(),F&&F.c(),E=we(),m(e,"for",i=n[46]),m(l,"type","text"),m(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],m(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,m(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,m(_,"class","txt"),m(p,"type","button"),m(p,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=O=!n[2].$isNew,m(d,"class","form-field-addon")},m(q,V){S(q,e,V),v(e,t),S(q,s,V),S(q,l,V),S(q,f,V),S(q,d,V),v(d,p),v(p,h),v(p,g),v(p,_),v(_,b),v(_,$),v(p,C),R&&R.m(p,null),S(q,M,V),F&&F.m(q,V),S(q,E,V),A=!0,n[2].$isNew&&l.focus(),L||(N=J(l,"input",n[26]),L=!0)},p(q,V){(!A||V[1]&32768&&i!==(i=q[46]))&&m(e,"for",i),(!A||V[1]&32768&&o!==(o=q[46]))&&m(l,"id",o),(!A||V[0]&8192)&&(l.disabled=q[13]),(!A||V[0]&4&&r!==(r=q[2].$isNew))&&(l.autofocus=r),(!A||V[0]&4&&a!==(a=q[2].$isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!A||V[0]&4&&u!==(u=q[2].name)&&l.value!==u)&&(l.value=u),(!A||V[0]&68)&&k!==(k=(q[6][q[2].type]||"N/A")+"")&&le($,k),q[2].$isNew?R?(R.p(q,V),V[0]&4&&I(R,1)):(R=mp(q),R.c(),I(R,1),R.m(p,null)):R&&(ue(),P(R,1,1,()=>{R=null}),fe()),(!A||V[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&m(p,"class",T),(!A||V[0]&4&&O!==(O=!q[2].$isNew))&&(p.disabled=O),q[2].system?F||(F=_p(),F.c(),F.m(E.parentNode,E)):F&&(F.d(1),F=null)},i(q){A||(I(R),A=!0)},o(q){P(R),A=!1},d(q){q&&w(e),q&&w(s),q&&w(l),q&&w(f),q&&w(d),R&&R.d(),q&&w(M),F&&F.d(q),q&&w(E),L=!1,N()}}}function gp(n){let e,t,i,s,l,o;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Ee(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&et(()=>{s&&(i||(i=Ve(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=Ve(e,Jt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function bp(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function vp(n){var a,u,f;let e,t,i,s=!W.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&&yp();return{c(){e=y("button"),t=y("span"),t.textContent="Options",i=D(),r&&r.c(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","tab-item"),x(e,"active",n[3]===Fs)},m(d,p){S(d,e,p),v(e,t),v(e,i),r&&r.m(e,null),l||(o=J(e,"click",n[31]),l=!0)},p(d,p){var h,g,_;p[0]&32&&(s=!W.isEmpty((h=d[5])==null?void 0:h.options)&&!((_=(g=d[5])==null?void 0:g.options)!=null&&_.manageRule)),s?r?p[0]&32&&I(r,1):(r=yp(),r.c(),I(r,1),r.m(e,null)):r&&(ue(),P(r,1,1,()=>{r=null}),fe()),p[0]&8&&x(e,"active",d[3]===Fs)},d(d){d&&w(e),r&&r.d(),l=!1,o()}}}function yp(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function _6(n){var U,j,Q,X,Z,re,ee,se;let e,t=n[2].$isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,d,p,h,g=(U=n[2])!=null&&U.$isView?"Query":"Fields",_,b,k=!W.isEmpty(n[11]),$,C,T,O,M=!W.isEmpty((j=n[5])==null?void 0:j.listRule)||!W.isEmpty((Q=n[5])==null?void 0:Q.viewRule)||!W.isEmpty((X=n[5])==null?void 0:X.createRule)||!W.isEmpty((Z=n[5])==null?void 0:Z.updateRule)||!W.isEmpty((re=n[5])==null?void 0:re.deleteRule)||!W.isEmpty((se=(ee=n[5])==null?void 0:ee.options)==null?void 0:se.manageRule),E,A,L,N,R=!n[2].$isNew&&!n[2].system&&pp(n);r=new me({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[h6,({uniqueId:ye})=>({46:ye}),({uniqueId:ye})=>[0,ye?32768:0]]},$$scope:{ctx:n}}});let F=k&&gp(n),q=M&&bp(),V=n[2].$isAuth&&vp(n);return{c(){e=y("h4"),i=Y(t),s=D(),R&&R.c(),l=D(),o=y("form"),B(r.$$.fragment),a=D(),u=y("input"),f=D(),d=y("div"),p=y("button"),h=y("span"),_=Y(g),b=D(),F&&F.c(),$=D(),C=y("button"),T=y("span"),T.textContent="API Rules",O=D(),q&&q.c(),E=D(),V&&V.c(),m(e,"class","upsert-panel-title svelte-12y0yzb"),m(u,"type","submit"),m(u,"class","hidden"),m(u,"tabindex","-1"),m(o,"class","block"),m(h,"class","txt"),m(p,"type","button"),m(p,"class","tab-item"),x(p,"active",n[3]===Ni),m(T,"class","txt"),m(C,"type","button"),m(C,"class","tab-item"),x(C,"active",n[3]===wl),m(d,"class","tabs-header stretched")},m(ye,$e){S(ye,e,$e),v(e,i),S(ye,s,$e),R&&R.m(ye,$e),S(ye,l,$e),S(ye,o,$e),z(r,o,null),v(o,a),v(o,u),S(ye,f,$e),S(ye,d,$e),v(d,p),v(p,h),v(h,_),v(p,b),F&&F.m(p,null),v(d,$),v(d,C),v(C,T),v(C,O),q&&q.m(C,null),v(d,E),V&&V.m(d,null),A=!0,L||(N=[J(o,"submit",xe(n[28])),J(p,"click",n[29]),J(C,"click",n[30])],L=!0)},p(ye,$e){var Ue,Se,Oe,Ge,_t,Xe,Ke,Te;(!A||$e[0]&4)&&t!==(t=ye[2].$isNew?"New collection":"Edit collection")&&le(i,t),!ye[2].$isNew&&!ye[2].system?R?(R.p(ye,$e),$e[0]&4&&I(R,1)):(R=pp(ye),R.c(),I(R,1),R.m(l.parentNode,l)):R&&(ue(),P(R,1,1,()=>{R=null}),fe());const ze={};$e[0]&8192&&(ze.class="form-field collection-field-name required m-b-0 "+(ye[13]?"disabled":"")),$e[0]&8260|$e[1]&1081344&&(ze.$$scope={dirty:$e,ctx:ye}),r.$set(ze),(!A||$e[0]&4)&&g!==(g=(Ue=ye[2])!=null&&Ue.$isView?"Query":"Fields")&&le(_,g),$e[0]&2048&&(k=!W.isEmpty(ye[11])),k?F?(F.p(ye,$e),$e[0]&2048&&I(F,1)):(F=gp(ye),F.c(),I(F,1),F.m(p,null)):F&&(ue(),P(F,1,1,()=>{F=null}),fe()),(!A||$e[0]&8)&&x(p,"active",ye[3]===Ni),$e[0]&32&&(M=!W.isEmpty((Se=ye[5])==null?void 0:Se.listRule)||!W.isEmpty((Oe=ye[5])==null?void 0:Oe.viewRule)||!W.isEmpty((Ge=ye[5])==null?void 0:Ge.createRule)||!W.isEmpty((_t=ye[5])==null?void 0:_t.updateRule)||!W.isEmpty((Xe=ye[5])==null?void 0:Xe.deleteRule)||!W.isEmpty((Te=(Ke=ye[5])==null?void 0:Ke.options)==null?void 0:Te.manageRule)),M?q?$e[0]&32&&I(q,1):(q=bp(),q.c(),I(q,1),q.m(C,null)):q&&(ue(),P(q,1,1,()=>{q=null}),fe()),(!A||$e[0]&8)&&x(C,"active",ye[3]===wl),ye[2].$isAuth?V?V.p(ye,$e):(V=vp(ye),V.c(),V.m(d,null)):V&&(V.d(1),V=null)},i(ye){A||(I(R),I(r.$$.fragment,ye),I(F),I(q),A=!0)},o(ye){P(R),P(r.$$.fragment,ye),P(F),P(q),A=!1},d(ye){ye&&w(e),ye&&w(s),R&&R.d(ye),ye&&w(l),ye&&w(o),H(r),ye&&w(f),ye&&w(d),F&&F.d(),q&&q.d(),V&&V.d(),L=!1,De(N)}}}function g6(n){let e,t,i,s,l,o=n[2].$isNew?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),r=Y(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[9],m(l,"class","txt"),m(s,"type","button"),m(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=[J(e,"click",n[22]),J(s,"click",n[23])],u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&4&&o!==(o=d[2].$isNew?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function b6(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[36],$$slots:{footer:[g6],header:[_6],default:[d6]},$$scope:{ctx:n}};e=new on({props:l}),n[37](e),e.$on("hide",n[38]),e.$on("show",n[39]);let o={};return i=new u6({props:o}),n[40](i),i.$on("confirm",n[41]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[36]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[37](null),H(e,r),r&&w(t),n[40](null),H(i,r)}}}const Ni="schema",wl="api_rules",Fs="options",v6="base",kp="auth",wp="view";function Fr(n){return JSON.stringify(n)}function y6(n,e,t){let i,s,l,o;Ze(n,Ti,Te=>t(5,o=Te));const r={};r[v6]="Base",r[wp]="View",r[kp]="Auth";const a=Tt();let u,f,d=null,p=new kn,h=!1,g=!1,_=Ni,b=Fr(p),k="";function $(Te){t(3,_=Te)}function C(Te){return O(Te),t(10,g=!0),$(Ni),u==null?void 0:u.show()}function T(){return u==null?void 0:u.hide()}async function O(Te){tn({}),typeof Te<"u"?(t(20,d=Te),t(2,p=Te.$clone())):(t(20,d=null),t(2,p=new kn)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await cn(),t(21,b=Fr(p))}function M(){p.$isNew?E():f==null||f.show(d,p)}function E(){if(h)return;t(9,h=!0);const Te=A();let ce;p.$isNew?ce=de.collections.create(Te):ce=de.collections.update(p.id,Te),ce.then(He=>{Fa(),Ly(He),t(10,g=!1),T(),Ht(p.$isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:p.$isNew,collection:He})}).catch(He=>{de.error(He)}).finally(()=>{t(9,h=!1)})}function A(){const Te=p.$export();Te.schema=Te.schema.slice(0);for(let ce=Te.schema.length-1;ce>=0;ce--)Te.schema[ce].toDelete&&Te.schema.splice(ce,1);return Te}function L(){d!=null&&d.id&&mn(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>de.collections.delete(d==null?void 0:d.id).then(()=>{T(),Ht(`Successfully deleted collection "${d==null?void 0:d.name}".`),a("delete",d),Py(d)}).catch(Te=>{de.error(Te)}))}function N(Te){t(2,p.type=Te,p),ui("schema")}function R(){s?mn("You have unsaved changes. Do you really want to discard them?",()=>{F()}):F()}async function F(){const Te=d==null?void 0:d.$clone();if(Te){if(Te.id="",Te.created="",Te.updated="",Te.name+="_duplicate",!W.isEmpty(Te.schema))for(const ce of Te.schema)ce.id="";if(!W.isEmpty(Te.indexes))for(let ce=0;ce<Te.indexes.length;ce++){const He=W.parseIndex(Te.indexes[ce]);He.indexName="idx_"+W.randomString(7),He.tableName=Te.name,Te.indexes[ce]=W.buildIndex(He)}}C(Te),await cn(),t(21,b="")}const q=()=>T(),V=()=>M(),U=()=>R(),j=()=>L(),Q=Te=>{t(2,p.name=W.slugify(Te.target.value),p),Te.target.value=p.name},X=Te=>N(Te),Z=()=>{l&&M()},re=()=>$(Ni),ee=()=>$(wl),se=()=>$(Fs);function ye(Te){p=Te,t(2,p),t(20,d)}function $e(Te){p=Te,t(2,p),t(20,d)}function ze(Te){p=Te,t(2,p),t(20,d)}function Ue(Te){p=Te,t(2,p),t(20,d)}const Se=()=>s&&g?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),T()}),!1):!0;function Oe(Te){ne[Te?"unshift":"push"](()=>{u=Te,t(7,u)})}function Ge(Te){he.call(this,n,Te)}function _t(Te){he.call(this,n,Te)}function Xe(Te){ne[Te?"unshift":"push"](()=>{f=Te,t(8,f)})}const Ke=()=>E();return n.$$.update=()=>{var Te,ce;n.$$.dirty[0]&32&&(o.schema||(Te=o.options)!=null&&Te.query?t(11,k=W.getNestedVal(o,"schema.message")||"Has errors"):t(11,k="")),n.$$.dirty[0]&4&&p.type===wp&&(t(2,p.createRule=null,p),t(2,p.updateRule=null,p),t(2,p.deleteRule=null,p),t(2,p.indexes=[],p)),n.$$.dirty[0]&1048580&&p!=null&&p.name&&(d==null?void 0:d.name)!=(p==null?void 0:p.name)&&t(2,p.indexes=(ce=p.indexes)==null?void 0:ce.map(He=>W.replaceIndexTableName(He,p.name)),p),n.$$.dirty[0]&4&&t(13,i=!p.$isNew&&p.system),n.$$.dirty[0]&2097156&&t(4,s=b!=Fr(p)),n.$$.dirty[0]&20&&t(12,l=p.$isNew||s),n.$$.dirty[0]&12&&_===Fs&&p.type!==kp&&$(Ni)},[$,T,p,_,s,o,r,u,f,h,g,k,l,i,M,E,L,N,R,C,d,b,q,V,U,j,Q,X,Z,re,ee,se,ye,$e,ze,Ue,Se,Oe,Ge,_t,Xe,Ke]}class du extends ve{constructor(e){super(),be(this,e,y6,b6,_e,{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 Sp(n,e,t){const i=n.slice();return i[15]=e[t],i}function $p(n){let e,t=n[1].length&&Tp();return{c(){t&&t.c(),e=we()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[1].length?t||(t=Tp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Tp(n){let e;return{c(){e=y("p"),e.textContent="No collections found.",m(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 Cp(n,e){let t,i,s,l,o,r=e[15].name+"",a,u,f,d,p,h;return{key:n,first:null,c(){var g;t=y("a"),i=y("i"),l=D(),o=y("span"),a=Y(r),u=D(),m(i,"class",s=W.getCollectionTypeIcon(e[15].type)),m(o,"class","txt"),m(t,"href",f="/collections?collectionId="+e[15].id),m(t,"class","sidebar-list-item"),m(t,"title",d=e[15].name),x(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id),this.first=t},m(g,_){S(g,t,_),v(t,i),v(t,l),v(t,o),v(o,a),v(t,u),p||(h=Ee(rn.call(null,t)),p=!0)},p(g,_){var b;e=g,_&8&&s!==(s=W.getCollectionTypeIcon(e[15].type))&&m(i,"class",s),_&8&&r!==(r=e[15].name+"")&&le(a,r),_&8&&f!==(f="/collections?collectionId="+e[15].id)&&m(t,"href",f),_&8&&d!==(d=e[15].name)&&m(t,"title",d),_&40&&x(t,"active",((b=e[5])==null?void 0:b.id)===e[15].id)},d(g){g&&w(t),p=!1,h()}}}function Mp(n){let e,t,i,s;return{c(){e=y("footer"),t=y("button"),t.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){S(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:te,d(l){l&&w(e),i=!1,s()}}}function k6(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],h=new Map,g,_,b,k,$,C,T=n[3];const O=L=>L[15].id;for(let L=0;L<T.length;L+=1){let N=Sp(n,T,L),R=O(N);h.set(R,p[L]=Cp(R,N))}let M=null;T.length||(M=$p(n));let E=!n[7]&&Mp(n),A={};return b=new du({props:A}),n[13](b),b.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=y("input"),a=D(),u=y("hr"),f=D(),d=y("div");for(let L=0;L<p.length;L+=1)p[L].c();M&&M.c(),g=D(),E&&E.c(),_=D(),B(b.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),m(s,"class","form-field-addon"),m(r,"type","text"),m(r,"placeholder","Search collections..."),m(i,"class","form-field search"),x(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(L,N){S(L,e,N),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ae(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R<p.length;R+=1)p[R]&&p[R].m(d,null);M&&M.m(d,null),v(e,g),E&&E.m(e,null),S(L,_,N),z(b,L,N),k=!0,$||(C=[J(l,"click",n[10]),J(r,"input",n[11])],$=!0)},p(L,[N]){(!k||N&16)&&x(l,"hidden",!L[4]),N&1&&r.value!==L[0]&&ae(r,L[0]),(!k||N&16)&&x(i,"active",L[4]),N&42&&(T=L[3],p=vt(p,N,O,1,L,T,h,d,us,Cp,null,Sp),!T.length&&M?M.p(L,N):T.length?M&&(M.d(1),M=null):(M=$p(L),M.c(),M.m(d,null))),(!k||N&64)&&x(d,"fade",L[6]),(!k||N&8)&&x(d,"sidebar-content-compact",L[3].length>20),L[7]?E&&(E.d(1),E=null):E?E.p(L,N):(E=Mp(L),E.c(),E.m(e,null));const R={};b.$set(R)},i(L){k||(I(b.$$.fragment,L),k=!0)},o(L){P(b.$$.fragment,L),k=!1},d(L){L&&w(e);for(let N=0;N<p.length;N+=1)p[N].d();M&&M.d(),E&&E.d(),L&&w(_),n[13](null),H(b,L),$=!1,De(C)}}}function w6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function S6(n,e,t){let i,s,l,o,r,a,u;Ze(n,fi,$=>t(5,o=$)),Ze(n,di,$=>t(9,r=$)),Ze(n,ko,$=>t(6,a=$)),Ze(n,Is,$=>t(7,u=$));let f,d="";function p($){ln(fi,o=$,o)}const h=()=>t(0,d="");function g(){d=this.value,t(0,d)}const _=()=>f==null?void 0:f.show();function b($){ne[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var C;(C=$.detail)!=null&&C.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&w6(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,h,g,_,b,k]}class $6 extends ve{constructor(e){super(),be(this,e,S6,k6,_e,{})}}function Op(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Ep(n){n[18]=n[19].default}function Dp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ap(n){let e;return{c(){e=y("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ip(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Ap();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=we(),d&&d.c(),s=D(),l=y("button"),r=Y(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(h,g){S(h,t,g),d&&d.m(h,g),S(h,s,g),S(h,l,g),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Ap(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&8&&o!==(o=e[15].label+"")&&le(r,o),g&40&&x(l,"active",e[5]===e[14])},d(h){h&&w(t),d&&d.d(h),h&&w(s),h&&w(l),u=!1,f()}}}function Lp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:M6,then:C6,catch:T6,value:19,blocks:[,,,]};return bu(t=n[15].component,s),{c(){e=we(),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)&&bu(t,s)||n0(s,n,o)},i(l){i||(I(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];P(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function T6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function C6(n){Ep(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=D()},m(s,l){z(e,s,l),S(s,t,l),i=!0},p(s,l){Ep(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(I(e.$$.fragment,s),i=!0)},o(s){P(e.$$.fragment,s),i=!1},d(s){H(e,s),s&&w(t)}}}function M6(n){return{c:te,m:te,p:te,i:te,o:te,d:te}}function Pp(n,e){let t,i,s,l=e[5]===e[14]&&Lp(e);return{key:n,first:null,c(){t=we(),l&&l.c(),i=we(),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&&I(l,1)):(l=Lp(e),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(ue(),P(l,1,1,()=>{l=null}),fe())},i(o){s||(I(l),s=!0)},o(o){P(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function O6(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,d=Object.entries(n[3]);const p=_=>_[14];for(let _=0;_<d.length;_+=1){let b=Dp(n,d,_),k=p(b);l.set(k,s[_]=Ip(k,b))}let h=Object.entries(n[3]);const g=_=>_[14];for(let _=0;_<h.length;_+=1){let b=Op(n,h,_),k=g(b);u.set(k,a[_]=Pp(k,b))}return{c(){var _;e=y("div"),t=y("aside"),i=y("nav");for(let b=0;b<s.length;b+=1)s[b].c();o=D(),r=y("div");for(let b=0;b<a.length;b+=1)a[b].c();m(i,"class","sidebar-content"),m(t,"class","docs-sidebar"),x(t,"compact",(_=n[2])==null?void 0:_.$isAuth),m(r,"class","docs-content"),m(e,"class","docs-content-wrapper")},m(_,b){S(_,e,b),v(e,t),v(t,i);for(let k=0;k<s.length;k+=1)s[k]&&s[k].m(i,null);v(e,o),v(e,r);for(let k=0;k<a.length;k+=1)a[k]&&a[k].m(r,null);f=!0},p(_,b){var k;b&106&&(d=Object.entries(_[3]),s=vt(s,b,p,1,_,d,l,i,us,Ip,null,Dp)),(!f||b&4)&&x(t,"compact",(k=_[2])==null?void 0:k.$isAuth),b&44&&(h=Object.entries(_[3]),ue(),a=vt(a,b,g,1,_,h,u,r,Ut,Pp,null,Op),fe())},i(_){if(!f){for(let b=0;b<h.length;b+=1)I(a[b]);f=!0}},o(_){for(let b=0;b<a.length;b+=1)P(a[b]);f=!1},d(_){_&&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 E6(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Close</span>',m(e,"type","button"),m(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[8]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function D6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[E6],default:[O6]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function A6(n,e,t){const i={list:{label:"List/Search",component:ut(()=>import("./ListApiDocs-cf80c4f6.js"),["./ListApiDocs-cf80c4f6.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:ut(()=>import("./ViewApiDocs-95dcbd26.js"),["./ViewApiDocs-95dcbd26.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},create:{label:"Create",component:ut(()=>import("./CreateApiDocs-5b9c4a64.js"),["./CreateApiDocs-5b9c4a64.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},update:{label:"Update",component:ut(()=>import("./UpdateApiDocs-7cb6cf43.js"),["./UpdateApiDocs-7cb6cf43.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},delete:{label:"Delete",component:ut(()=>import("./DeleteApiDocs-959ba30f.js"),["./DeleteApiDocs-959ba30f.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:ut(()=>import("./RealtimeApiDocs-00d643f7.js"),["./RealtimeApiDocs-00d643f7.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:ut(()=>import("./AuthWithPasswordDocs-f6a8ff3b.js"),["./AuthWithPasswordDocs-f6a8ff3b.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:ut(()=>import("./AuthWithOAuth2Docs-7df3374f.js"),["./AuthWithOAuth2Docs-7df3374f.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},refresh:{label:"Auth refresh",component:ut(()=>import("./AuthRefreshDocs-f9d39566.js"),["./AuthRefreshDocs-f9d39566.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},"request-verification":{label:"Request verification",component:ut(()=>import("./RequestVerificationDocs-adfc9a42.js"),["./RequestVerificationDocs-adfc9a42.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:ut(()=>import("./ConfirmVerificationDocs-6837e742.js"),["./ConfirmVerificationDocs-6837e742.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:ut(()=>import("./RequestPasswordResetDocs-ceceab9d.js"),["./RequestPasswordResetDocs-ceceab9d.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:ut(()=>import("./ConfirmPasswordResetDocs-30f44131.js"),["./ConfirmPasswordResetDocs-30f44131.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:ut(()=>import("./RequestEmailChangeDocs-05350073.js"),["./RequestEmailChangeDocs-05350073.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:ut(()=>import("./ConfirmEmailChangeDocs-f648e8c7.js"),["./ConfirmEmailChangeDocs-f648e8c7.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:ut(()=>import("./AuthMethodsDocs-629f9c2d.js"),["./AuthMethodsDocs-629f9c2d.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:ut(()=>import("./ListExternalAuthsDocs-6edd015f.js"),["./ListExternalAuthsDocs-6edd015f.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-ba250473.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:ut(()=>import("./UnlinkExternalAuthDocs-0615d671.js"),["./UnlinkExternalAuthDocs-0615d671.js","./SdkTabs-ad912c8f.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new kn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),d(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function d(k){t(5,r=k)}const p=()=>f(),h=k=>d(k);function g(k){ne[k?"unshift":"push"](()=>{l=k,t(4,l)})}function _(k){he.call(this,n,k)}function b(k){he.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,d,o,a,l,r,i,u,p,h,g,_,b]}class I6 extends ve{constructor(e){super(),be(this,e,A6,D6,_e,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function L6(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Username",o=D(),r=y("input"),m(t,"class",W.getFieldTypeIcon("user")),m(s,"class","txt"),m(e,"for",l=n[13]),m(r,"type","text"),m(r,"requried",a=!n[2]),m(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),m(r,"id",f=n[13])},m(h,g){S(h,e,g),v(e,t),v(e,i),v(e,s),S(h,o,g),S(h,r,g),ae(r,n[0].username),d||(p=J(r,"input",n[5]),d=!0)},p(h,g){g&8192&&l!==(l=h[13])&&m(e,"for",l),g&4&&a!==(a=!h[2])&&m(r,"requried",a),g&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&m(r,"placeholder",u),g&8192&&f!==(f=h[13])&&m(r,"id",f),g&1&&r.value!==h[0].username&&ae(r,h[0].username)},d(h){h&&w(e),h&&w(o),h&&w(r),d=!1,p()}}}function P6(n){let e,t,i,s,l,o,r,a,u,f,d=n[0].emailVisibility?"On":"Off",p,h,g,_,b,k,$,C;return{c(){var T;e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Email",o=D(),r=y("div"),a=y("button"),u=y("span"),f=Y("Public: "),p=Y(d),g=D(),_=y("input"),m(t,"class",W.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[13]),m(u,"class","txt"),m(a,"type","button"),m(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),m(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),m(_,"type","email"),_.autofocus=n[2],m(_,"autocomplete","off"),m(_,"id",b=n[13]),_.required=k=(T=n[1].options)==null?void 0:T.requireEmail,m(_,"class","svelte-1751a4d")},m(T,O){S(T,e,O),v(e,t),v(e,i),v(e,s),S(T,o,O),S(T,r,O),v(r,a),v(a,u),v(u,f),v(u,p),S(T,g,O),S(T,_,O),ae(_,n[0].email),n[2]&&_.focus(),$||(C=[Ee(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),J(a,"click",n[6]),J(_,"input",n[7])],$=!0)},p(T,O){var M;O&8192&&l!==(l=T[13])&&m(e,"for",l),O&1&&d!==(d=T[0].emailVisibility?"On":"Off")&&le(p,d),O&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&m(a,"class",h),O&4&&(_.autofocus=T[2]),O&8192&&b!==(b=T[13])&&m(_,"id",b),O&2&&k!==(k=(M=T[1].options)==null?void 0:M.requireEmail)&&(_.required=k),O&1&&_.value!==T[0].email&&ae(_,T[0].email)},d(T){T&&w(e),T&&w(o),T&&w(r),T&&w(g),T&&w(_),$=!1,De(C)}}}function Np(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[N6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function N6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[13]),m(s,"for",o=n[13])},m(u,f){S(u,e,f),e.checked=n[3],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&m(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Fp(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[F6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[R6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),B(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),x(t,"p-t-xs",n[3]),m(e,"class","block")},m(f,d){S(f,e,d),v(e,t),v(t,i),z(s,i,null),v(t,l),v(t,o),z(r,o,null),u=!0},p(f,d){const p={};d&24577&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const h={};d&24577&&(h.$$scope={dirty:d,ctx:f}),r.$set(h),(!u||d&8)&&x(t,"p-t-xs",f[3])},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=Ve(e,rt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(e,rt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function F6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[13]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[13]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[0].password),u||(f=J(r,"input",n[9]),u=!0)},p(d,p){p&8192&&l!==(l=d[13])&&m(e,"for",l),p&8192&&a!==(a=d[13])&&m(r,"id",a),p&1&&r.value!==d[0].password&&ae(r,d[0].password)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function R6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password confirm",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[13]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[13]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[0].passwordConfirm),u||(f=J(r,"input",n[10]),u=!0)},p(d,p){p&8192&&l!==(l=d[13])&&m(e,"for",l),p&8192&&a!==(a=d[13])&&m(r,"id",a),p&1&&r.value!==d[0].passwordConfirm&&ae(r,d[0].passwordConfirm)},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function q6(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Verified"),m(e,"type","checkbox"),m(e,"id",t=n[13]),m(s,"for",o=n[13])},m(u,f){S(u,e,f),e.checked=n[0].verified,S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"change",n[11]),J(e,"change",xe(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&m(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function j6(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,h;i=new me({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[L6,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field "+((b=n[1].options)!=null&&b.requireEmail?"required":""),name:"email",$$slots:{default:[P6,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&Np(n),_=(n[2]||n[3])&&Fp(n);return p=new me({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[q6,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),a=y("div"),g&&g.c(),u=D(),_&&_.c(),f=D(),d=y("div"),B(p.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(a,"class","col-lg-12"),m(d,"class","col-lg-12"),m(e,"class","grid m-b-base")},m(k,$){S(k,e,$),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),v(e,a),g&&g.m(a,null),v(a,u),_&&_.m(a,null),v(e,f),v(e,d),z(p,d,null),h=!0},p(k,[$]){var M;const C={};$&4&&(C.class="form-field "+(k[2]?"":"required")),$&24581&&(C.$$scope={dirty:$,ctx:k}),i.$set(C);const T={};$&2&&(T.class="form-field "+((M=k[1].options)!=null&&M.requireEmail?"required":"")),$&24583&&(T.$$scope={dirty:$,ctx:k}),o.$set(T),k[2]?g&&(ue(),P(g,1,1,()=>{g=null}),fe()):g?(g.p(k,$),$&4&&I(g,1)):(g=Np(k),g.c(),I(g,1),g.m(a,u)),k[2]||k[3]?_?(_.p(k,$),$&12&&I(_,1)):(_=Fp(k),_.c(),I(_,1),_.m(a,null)):_&&(ue(),P(_,1,1,()=>{_=null}),fe());const O={};$&24581&&(O.$$scope={dirty:$,ctx:k}),p.$set(O)},i(k){h||(I(i.$$.fragment,k),I(o.$$.fragment,k),I(g),I(_),I(p.$$.fragment,k),h=!0)},o(k){P(i.$$.fragment,k),P(o.$$.fragment,k),P(g),P(_),P(p.$$.fragment,k),h=!1},d(k){k&&w(e),H(i),H(o),g&&g.d(),_&&_.d(),H(p)}}}function V6(n,e,t){let{collection:i=new kn}=e,{record:s=new wi}=e,{isNew:l=s.$isNew}=e,o=s.username||null,r=!1;function a(){s.username=this.value,t(0,s),t(3,r)}const u=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function f(){s.email=this.value,t(0,s),t(3,r)}function d(){r=this.checked,t(3,r)}function p(){s.password=this.value,t(0,s),t(3,r)}function h(){s.passwordConfirm=this.value,t(0,s),t(3,r)}function g(){s.verified=this.checked,t(0,s),t(3,r)}const _=b=>{l||mn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!b.target.checked,s)})};return n.$$set=b=>{"collection"in b&&t(1,i=b.collection),"record"in b&&t(0,s=b.record),"isNew"in b&&t(2,l=b.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!s.username&&s.username!==null&&t(0,s.username=null,s),n.$$.dirty&8&&(r||(t(0,s.password=null,s),t(0,s.passwordConfirm=null,s),ui("password"),ui("passwordConfirm")))},[s,i,l,r,o,a,u,f,d,p,h,g,_]}class z6 extends ve{constructor(e){super(),be(this,e,V6,j6,_e,{collection:1,record:0,isNew:2})}}function H6(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=y("textarea"),ai(e,l),x(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),ae(e,n[0]),t||(i=[J(e,"input",n[6]),J(e,"keydown",n[2])],t=!0)},p(o,[r]){ai(e,l=Ot(s,[r&8&&o[3]])),r&1&&ae(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:te,o:te,d(o){o&&w(e),n[5](null),t=!1,De(i)}}}function B6(n,e,t){const i=["value","maxHeight"];let s=tt(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,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Xt(()=>(u(),()=>clearTimeout(a)));function d(h){ne[h?"unshift":"push"](()=>{r=h,t(1,r)})}function p(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),Gt(h)),t(3,s=tt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,d,p]}class U6 extends ve{constructor(e){super(),be(this,e,B6,H6,_e,{value:0,maxHeight:4})}}function W6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function h(_){n[2](_)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new U6({props:g}),ne.push(()=>pe(f,"value",h)),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),B(f.$$.fragment),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3])},m(_,b){S(_,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(_,u,b),z(f,_,b),p=!0},p(_,b){(!p||b&2&&i!==(i=W.getFieldTypeIcon(_[1].type)))&&m(t,"class",i),(!p||b&2)&&o!==(o=_[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=_[3]))&&m(e,"for",a);const k={};b&8&&(k.id=_[3]),b&2&&(k.required=_[1].required),!d&&b&1&&(d=!0,k.value=_[0],ge(()=>d=!1)),f.$set(k)},i(_){p||(I(f.$$.fragment,_),p=!0)},o(_){P(f.$$.fragment,_),p=!1},d(_){_&&w(e),_&&w(u),H(f,_)}}}function Y6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[W6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function K6(n,e,t){let{field:i=new wn}=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 J6 extends ve{constructor(e){super(),be(this,e,K6,Y6,_e,{field:1,value:0})}}function Z6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g,_,b;return{c(){var k,$;e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("input"),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","number"),m(f,"id",d=n[3]),f.required=p=n[1].required,m(f,"min",h=(k=n[1].options)==null?void 0:k.min),m(f,"max",g=($=n[1].options)==null?void 0:$.max),m(f,"step","any")},m(k,$){S(k,e,$),v(e,t),v(e,s),v(e,l),v(l,r),S(k,u,$),S(k,f,$),ae(f,n[0]),_||(b=J(f,"input",n[2]),_=!0)},p(k,$){var C,T;$&2&&i!==(i=W.getFieldTypeIcon(k[1].type))&&m(t,"class",i),$&2&&o!==(o=k[1].name+"")&&le(r,o),$&8&&a!==(a=k[3])&&m(e,"for",a),$&8&&d!==(d=k[3])&&m(f,"id",d),$&2&&p!==(p=k[1].required)&&(f.required=p),$&2&&h!==(h=(C=k[1].options)==null?void 0:C.min)&&m(f,"min",h),$&2&&g!==(g=(T=k[1].options)==null?void 0:T.max)&&m(f,"max",g),$&1&&pt(f.value)!==k[0]&&ae(f,k[0])},d(k){k&&w(e),k&&w(u),k&&w(f),_=!1,b()}}}function G6(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Z6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function X6(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e;function l(){s=pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class Q6 extends ve{constructor(e){super(),be(this,e,X6,G6,_e,{field:1,value:0})}}function x6(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=y("input"),i=D(),s=y("label"),o=Y(l),m(e,"type","checkbox"),m(e,"id",t=n[3]),m(s,"for",r=n[3])},m(f,d){S(f,e,d),e.checked=n[0],S(f,i,d),S(f,s,d),v(s,o),a||(u=J(e,"change",n[2]),a=!0)},p(f,d){d&8&&t!==(t=f[3])&&m(e,"id",t),d&1&&(e.checked=f[0]),d&2&&l!==(l=f[1].name+"")&&le(o,l),d&8&&r!==(r=f[3])&&m(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function eM(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:[x6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tM(n,e,t){let{field:i=new wn}=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 nM extends ve{constructor(e){super(),be(this,e,tM,eM,_e,{field:1,value:0})}}function iM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g;return{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("input"),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","email"),m(f,"id",d=n[3]),f.required=p=n[1].required},m(_,b){S(_,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(_,u,b),S(_,f,b),ae(f,n[0]),h||(g=J(f,"input",n[2]),h=!0)},p(_,b){b&2&&i!==(i=W.getFieldTypeIcon(_[1].type))&&m(t,"class",i),b&2&&o!==(o=_[1].name+"")&&le(r,o),b&8&&a!==(a=_[3])&&m(e,"for",a),b&8&&d!==(d=_[3])&&m(f,"id",d),b&2&&p!==(p=_[1].required)&&(f.required=p),b&1&&f.value!==_[0]&&ae(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),h=!1,g()}}}function sM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[iM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function lM(n,e,t){let{field:i=new wn}=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 oM extends ve{constructor(e){super(),be(this,e,lM,sM,_e,{field:1,value:0})}}function rM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g;return{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("input"),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","url"),m(f,"id",d=n[3]),f.required=p=n[1].required},m(_,b){S(_,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(_,u,b),S(_,f,b),ae(f,n[0]),h||(g=J(f,"input",n[2]),h=!0)},p(_,b){b&2&&i!==(i=W.getFieldTypeIcon(_[1].type))&&m(t,"class",i),b&2&&o!==(o=_[1].name+"")&&le(r,o),b&8&&a!==(a=_[3])&&m(e,"for",a),b&8&&d!==(d=_[3])&&m(f,"id",d),b&2&&p!==(p=_[1].required)&&(f.required=p),b&1&&f.value!==_[0]&&ae(f,_[0])},d(_){_&&w(e),_&&w(u),_&&w(f),h=!1,g()}}}function aM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[rM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function uM(n,e,t){let{field:i=new wn}=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 fM extends ve{constructor(e){super(),be(this,e,uM,aM,_e,{field:1,value:0})}}function Rp(n){let e,t,i,s;return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-close-line"></i>',m(t,"type","button"),m(t,"class","link-hint clear-btn svelte-11df51y"),m(e,"class","form-field-addon")},m(l,o){S(l,e,o),v(e,t),i||(s=[Ee(Be.call(null,t,"Clear")),J(t,"click",n[5])],i=!0)},p:te,d(l){l&&w(e),i=!1,De(s)}}}function cM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g,_,b=n[0]&&!n[1].required&&Rp(n);function k(T){n[6](T)}function $(T){n[7](T)}let C={id:n[8],options:W.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),p=new fu({props:C}),ne.push(()=>pe(p,"value",k)),ne.push(()=>pe(p,"formattedValue",$)),p.$on("close",n[3]),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),a=Y(" (UTC)"),f=D(),b&&b.c(),d=D(),B(p.$$.fragment),m(t,"class",i=os(W.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),m(l,"class","txt"),m(e,"for",u=n[8])},m(T,O){S(T,e,O),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),S(T,f,O),b&&b.m(T,O),S(T,d,O),z(p,T,O),_=!0},p(T,O){(!_||O&2&&i!==(i=os(W.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&m(t,"class",i),(!_||O&2)&&o!==(o=T[1].name+"")&&le(r,o),(!_||O&256&&u!==(u=T[8]))&&m(e,"for",u),T[0]&&!T[1].required?b?b.p(T,O):(b=Rp(T),b.c(),b.m(d.parentNode,d)):b&&(b.d(1),b=null);const M={};O&256&&(M.id=T[8]),!h&&O&4&&(h=!0,M.value=T[2],ge(()=>h=!1)),!g&&O&1&&(g=!0,M.formattedValue=T[0],ge(()=>g=!1)),p.$set(M)},i(T){_||(I(p.$$.fragment,T),_=!0)},o(T){P(p.$$.fragment,T),_=!1},d(T){T&&w(e),T&&w(f),b&&b.d(T),T&&w(d),H(p,T)}}}function dM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function pM(n,e,t){let{field:i=new wn}=e,{value:s=void 0}=e,l=s;function o(d){d.detail&&d.detail.length==3&&t(0,s=d.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(d){l=d,t(2,l),t(0,s)}function f(d){s=d,t(0,s)}return n.$$set=d=>{"field"in d&&t(1,i=d.field),"value"in d&&t(0,s=d.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 mM extends ve{constructor(e){super(),be(this,e,pM,dM,_e,{field:1,value:0})}}function qp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=y("div"),t=Y("Select up to "),s=Y(i),l=Y(" items."),m(e,"class","help-block")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function hM(n){var $,C,T,O,M,E;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g;function _(A){n[3](A)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||(($=n[0])==null?void 0:$.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((M=(O=n[1].options)==null?void 0:O.values)==null?void 0:M.length)>5};n[0]!==void 0&&(b.selected=n[0]),f=new cu({props:b}),ne.push(()=>pe(f,"selected",_));let k=((E=n[1].options)==null?void 0:E.maxSelect)>1&&qp(n);return{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),B(f.$$.fragment),p=D(),k&&k.c(),h=we(),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[4])},m(A,L){S(A,e,L),v(e,t),v(e,s),v(e,l),v(l,r),S(A,u,L),z(f,A,L),S(A,p,L),k&&k.m(A,L),S(A,h,L),g=!0},p(A,L){var R,F,q,V,U,j;(!g||L&2&&i!==(i=W.getFieldTypeIcon(A[1].type)))&&m(t,"class",i),(!g||L&2)&&o!==(o=A[1].name+"")&&le(r,o),(!g||L&16&&a!==(a=A[4]))&&m(e,"for",a);const N={};L&16&&(N.id=A[4]),L&6&&(N.toggle=!A[1].required||A[2]),L&4&&(N.multiple=A[2]),L&7&&(N.closable=!A[2]||((R=A[0])==null?void 0:R.length)>=((F=A[1].options)==null?void 0:F.maxSelect)),L&2&&(N.items=(q=A[1].options)==null?void 0:q.values),L&2&&(N.searchable=((U=(V=A[1].options)==null?void 0:V.values)==null?void 0:U.length)>5),!d&&L&1&&(d=!0,N.selected=A[0],ge(()=>d=!1)),f.$set(N),((j=A[1].options)==null?void 0:j.maxSelect)>1?k?k.p(A,L):(k=qp(A),k.c(),k.m(h.parentNode,h)):k&&(k.d(1),k=null)},i(A){g||(I(f.$$.fragment,A),g=!0)},o(A){P(f.$$.fragment,A),g=!1},d(A){A&&w(e),A&&w(u),H(f,A),A&&w(p),k&&k.d(A),A&&w(h)}}}function _M(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gM(n,e,t){let i,{field:s=new wn}=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 bM extends ve{constructor(e){super(),be(this,e,gM,_M,_e,{field:1,value:0})}}function vM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p,h,g;return{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("textarea"),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[4]),m(f,"id",d=n[4]),m(f,"class","txt-mono"),f.required=p=n[1].required,f.value=n[2]},m(_,b){S(_,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(_,u,b),S(_,f,b),h||(g=J(f,"input",n[3]),h=!0)},p(_,b){b&2&&i!==(i=W.getFieldTypeIcon(_[1].type))&&m(t,"class",i),b&2&&o!==(o=_[1].name+"")&&le(r,o),b&16&&a!==(a=_[4])&&m(e,"for",a),b&16&&d!==(d=_[4])&&m(f,"id",d),b&2&&p!==(p=_[1].required)&&(f.required=p),b&4&&(f.value=_[2])},d(_){_&&w(e),_&&w(u),_&&w(f),h=!1,g()}}}function yM(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[vM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function kM(n,e,t){let{field:i=new wn}=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 wM extends ve{constructor(e){super(),be(this,e,kM,yM,_e,{field:1,value:0})}}const SM=n=>({dragging:n&4,dragover:n&8}),jp=n=>({dragging:n[2],dragover:n[3]});function $M(n){let e,t,i,s,l;const o=n[9].default,r=kt(o,n,n[8],jp);return{c(){e=y("div"),r&&r.c(),m(e,"draggable",t=!n[1]),m(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[J(e,"dragover",xe(n[10])),J(e,"dragleave",xe(n[11])),J(e,"dragend",n[12]),J(e,"dragstart",n[13]),J(e,"drop",n[14])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&268)&&St(r,o,a,a[8],i?wt(o,a[8],u,SM):$t(a[8]),jp),(!i||u&2&&t!==(t=!a[1]))&&m(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(I(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,De(l)}}}function TM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,f=!1,d=!1;function p(C,T){!C||u||(t(2,f=!0),C.dataTransfer.effectAllowed="move",C.dataTransfer.dropEffect="move",C.dataTransfer.setData("text/plain",JSON.stringify({index:T,group:a})))}function h(C,T){if(!C||u)return;t(3,d=!1),t(2,f=!1),C.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse(C.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const M=O.index<<0;M<T?(r.splice(T+1,0,r[M]),r.splice(M,1)):(r.splice(T,0,r[M]),r.splice(M+1,1)),t(6,r),l("sort",{oldIndex:M,newIndex:T,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},b=()=>{t(3,d=!1),t(2,f=!1)},k=C=>p(C,o),$=C=>h(C,o);return n.$$set=C=>{"index"in C&&t(0,o=C.index),"list"in C&&t(6,r=C.list),"group"in C&&t(7,a=C.group),"disabled"in C&&t(1,u=C.disabled),"$$scope"in C&&t(8,s=C.$$scope)},[o,u,f,d,p,h,r,a,s,i,g,_,b,k,$]}class nr extends ve{constructor(e){super(),be(this,e,TM,$M,_e,{index:0,list:6,group:7,disabled:1})}}function CM(n){let e,t;return{c(){e=y("i"),m(e,"class","ri-file-line"),m(e,"alt",t=n[0].name)},m(i,s){S(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&m(e,"alt",t)},d(i){i&&w(e)}}}function MM(n){let e,t,i;return{c(){e=y("img"),m(e,"draggable",!1),_n(e.src,t=n[2])||m(e,"src",t),m(e,"width",n[1]),m(e,"height",n[1]),m(e,"alt",i=n[0].name)},m(s,l){S(s,e,l)},p(s,l){l&4&&!_n(e.src,t=s[2])&&m(e,"src",t),l&2&&m(e,"width",s[1]),l&2&&m(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&m(e,"alt",i)},d(s){s&&w(e)}}}function OM(n){let e;function t(l,o){return l[2]?MM:CM}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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:te,o:te,d(l){s.d(l),l&&w(e)}}}function EM(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){W.hasImageExtension(s==null?void 0:s.name)?W.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class DM extends ve{constructor(e){super(),be(this,e,EM,OM,_e,{file:0,size:1})}}function Vp(n){let e;function t(l,o){return l[4]==="image"?IM:AM}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 AM(n){let e,t;return{c(){e=y("object"),t=Y("Cannot preview the file."),m(e,"title",n[2]),m(e,"data",n[1])},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&4&&m(e,"title",i[2]),s&2&&m(e,"data",i[1])},d(i){i&&w(e)}}}function IM(n){let e,t,i;return{c(){e=y("img"),_n(e.src,t=n[1])||m(e,"src",t),m(e,"alt",i="Preview "+n[2])},m(s,l){S(s,e,l)},p(s,l){l&2&&!_n(e.src,t=s[1])&&m(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&m(e,"alt",i)},d(s){s&&w(e)}}}function LM(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Vp(n);return{c(){i&&i.c(),t=we()},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=Vp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function PM(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-close-line"></i>',m(e,"type","button"),m(e,"class","overlay-close")},m(s,l){S(s,e,l),t||(i=J(e,"click",xe(n[0])),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function NM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("a"),t=Y(n[2]),i=D(),s=y("i"),l=D(),o=y("div"),r=D(),a=y("button"),a.textContent="Close",m(s,"class","ri-external-link-line"),m(e,"href",n[1]),m(e,"title",n[2]),m(e,"target","_blank"),m(e,"rel","noreferrer noopener"),m(e,"class","link-hint txt-ellipsis inline-flex"),m(o,"class","flex-fill"),m(a,"type","button"),m(a,"class","btn btn-transparent")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,l,p),S(d,o,p),S(d,r,p),S(d,a,p),u||(f=J(a,"click",n[0]),u=!0)},p(d,p){p&4&&le(t,d[2]),p&2&&m(e,"href",d[1]),p&4&&m(e,"title",d[2])},d(d){d&&w(e),d&&w(l),d&&w(o),d&&w(r),d&&w(a),u=!1,f()}}}function FM(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[NM],header:[PM],default:[LM]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function RM(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){ne[h?"unshift":"push"](()=>{o=h,t(3,o)})}function d(h){he.call(this,n,h)}function p(h){he.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=W.getFileType(s))},[u,r,s,o,l,a,i,f,d,p]}class qM extends ve{constructor(e){super(),be(this,e,RM,FM,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function jM(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?BM:u[3]==="video"||u[3]==="audio"?HM:zM}let r=o(n),a=r(n);return{c(){e=y("a"),a.c(),m(e,"draggable",!1),m(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),m(e,"href",n[6]),m(e,"target","_blank"),m(e,"rel","noreferrer"),m(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){S(u,e,f),a.m(e,null),s||(l=J(e,"click",In(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&m(e,"class",t),f&64&&m(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&m(e,"title",i)},d(u){u&&w(e),a.d(),s=!1,l()}}}function VM(n){let e,t;return{c(){e=y("div"),m(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){S(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&m(e,"class",t)},d(i){i&&w(e)}}}function zM(n){let e;return{c(){e=y("i"),m(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function HM(n){let e;return{c(){e=y("i"),m(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function BM(n){let e,t,i,s,l;return{c(){e=y("img"),m(e,"draggable",!1),_n(e.src,t=n[5])||m(e,"src",t),m(e,"alt",n[0]),m(e,"title",i="Preview "+n[0])},m(o,r){S(o,e,r),s||(l=J(e,"error",n[8]),s=!0)},p(o,r){r&32&&!_n(e.src,t=o[5])&&m(e,"src",t),r&1&&m(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&m(e,"title",i)},d(o){o&&w(e),s=!1,l()}}}function UM(n){let e,t,i;function s(a,u){return a[2]?VM:jM}let l=s(n),o=l(n),r={};return t=new qM({props:r}),n[12](t),{c(){o.c(),e=D(),B(t.$$.fragment)},m(a,u){o.m(a,u),S(a,e,u),z(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(I(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&w(e),n[12](null),H(t,a)}}}function WM(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",d="",p=!1;h();async function h(){t(2,p=!0);try{t(10,d=await de.getAdminFileToken(l.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,p=!1)}function g(){t(5,u="")}const _=k=>{s&&(k.preventDefault(),a==null||a.show(f))};function b(k){ne[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,l=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=W.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=p?"":de.files.getUrl(l,o,{token:d})),n.$$.dirty&1541&&t(5,u=p?"":de.files.getUrl(l,o,{thumb:"100x100",token:d}))},[o,r,p,i,a,u,f,s,g,l,d,_,b]}class pu extends ve{constructor(e){super(),be(this,e,WM,UM,_e,{record:9,filename:0,size:1})}}function zp(n,e,t){const i=n.slice();return i[30]=e[t],i[32]=t,i}function Hp(n,e,t){const i=n.slice();i[35]=e[t],i[32]=t;const s=i[2].includes(i[35]);return i[36]=s,i}function YM(n){let e,t,i;function s(){return n[18](n[35])}return{c(){e=y("button"),e.innerHTML='<i class="ri-close-line"></i>',m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){S(l,e,o),t||(i=[Ee(Be.call(null,e,"Remove file")),J(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,De(i)}}}function KM(n){let e,t,i;function s(){return n[17](n[35])}return{c(){e=y("button"),e.innerHTML='<span class="txt">Restore</span>',m(e,"type","button"),m(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){S(l,e,o),t||(i=J(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function JM(n){let e,t,i,s,l,o,r=n[35]+"",a,u,f,d,p,h;i=new pu({props:{record:n[3],filename:n[35]}});function g(k,$){return k[36]?KM:YM}let _=g(n),b=_(n);return{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),o=y("a"),a=Y(r),d=D(),p=y("div"),b.c(),x(t,"fade",n[36]),m(o,"draggable",!1),m(o,"href",u=de.files.getUrl(n[3],n[35],{token:n[10]})),m(o,"class",f="txt-ellipsis "+(n[36]?"txt-strikethrough txt-hint":"link-primary")),m(o,"title","Download"),m(o,"target","_blank"),m(o,"rel","noopener noreferrer"),m(l,"class","content"),m(p,"class","actions"),m(e,"class","list-item"),x(e,"dragging",n[33]),x(e,"dragover",n[34])},m(k,$){S(k,e,$),v(e,t),z(i,t,null),v(e,s),v(e,l),v(l,o),v(o,a),v(e,d),v(e,p),b.m(p,null),h=!0},p(k,$){const C={};$[0]&8&&(C.record=k[3]),$[0]&32&&(C.filename=k[35]),i.$set(C),(!h||$[0]&36)&&x(t,"fade",k[36]),(!h||$[0]&32)&&r!==(r=k[35]+"")&&le(a,r),(!h||$[0]&1064&&u!==(u=de.files.getUrl(k[3],k[35],{token:k[10]})))&&m(o,"href",u),(!h||$[0]&36&&f!==(f="txt-ellipsis "+(k[36]?"txt-strikethrough txt-hint":"link-primary")))&&m(o,"class",f),_===(_=g(k))&&b?b.p(k,$):(b.d(1),b=_(k),b&&(b.c(),b.m(p,null))),(!h||$[1]&4)&&x(e,"dragging",k[33]),(!h||$[1]&8)&&x(e,"dragover",k[34])},i(k){h||(I(i.$$.fragment,k),h=!0)},o(k){P(i.$$.fragment,k),h=!1},d(k){k&&w(e),H(i),b.d()}}}function Bp(n,e){let t,i,s,l;function o(a){e[19](a)}let r={group:e[4].name+"_uploaded",index:e[32],disabled:!e[6],$$slots:{default:[JM,({dragging:a,dragover:u})=>({33:a,34:u}),({dragging:a,dragover:u})=>[0,(a?4:0)|(u?8:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new nr({props:r}),ne.push(()=>pe(i,"list",o)),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),z(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[32]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&140&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],ge(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function ZM(n){let e,t,i,s,l,o,r,a,u=n[30].name+"",f,d,p,h,g,_,b;i=new DM({props:{file:n[30]}});function k(){return n[20](n[32])}return{c(){e=y("div"),t=y("figure"),B(i.$$.fragment),s=D(),l=y("div"),o=y("small"),o.textContent="New",r=D(),a=y("span"),f=Y(u),p=D(),h=y("button"),h.innerHTML='<i class="ri-close-line"></i>',m(t,"class","thumb"),m(o,"class","label label-success m-r-5"),m(a,"class","txt"),m(l,"class","filename m-r-auto"),m(l,"title",d=n[30].name),m(h,"type","button"),m(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(e,"class","list-item"),x(e,"dragging",n[33]),x(e,"dragover",n[34])},m($,C){S($,e,C),v(e,t),z(i,t,null),v(e,s),v(e,l),v(l,o),v(l,r),v(l,a),v(a,f),v(e,p),v(e,h),g=!0,_||(b=[Ee(Be.call(null,h,"Remove file")),J(h,"click",k)],_=!0)},p($,C){n=$;const T={};C[0]&2&&(T.file=n[30]),i.$set(T),(!g||C[0]&2)&&u!==(u=n[30].name+"")&&le(f,u),(!g||C[0]&2&&d!==(d=n[30].name))&&m(l,"title",d),(!g||C[1]&4)&&x(e,"dragging",n[33]),(!g||C[1]&8)&&x(e,"dragover",n[34])},i($){g||(I(i.$$.fragment,$),g=!0)},o($){P(i.$$.fragment,$),g=!1},d($){$&&w(e),H(i),_=!1,De(b)}}}function Up(n,e){let t,i,s,l;function o(a){e[21](a)}let r={group:e[4].name+"_new",index:e[32],disabled:!e[6],$$slots:{default:[ZM,({dragging:a,dragover:u})=>({33:a,34:u}),({dragging:a,dragover:u})=>[0,(a?4:0)|(u?8:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new nr({props:r}),ne.push(()=>pe(i,"list",o)),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),z(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[32]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&140&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],ge(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function GM(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,d=[],p=new Map,h,g=[],_=new Map,b,k,$,C,T,O,M,E,A,L,N,R,F=n[5];const q=j=>j[35]+j[3].id;for(let j=0;j<F.length;j+=1){let Q=Hp(n,F,j),X=q(Q);p.set(X,d[j]=Bp(X,Q))}let V=n[1];const U=j=>j[30].name+j[3].id;for(let j=0;j<V.length;j+=1){let Q=zp(n,V,j),X=U(Q);_.set(X,g[j]=Up(X,Q))}return{c(){var j,Q;e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("div");for(let X=0;X<d.length;X+=1)d[X].c();h=D();for(let X=0;X<g.length;X+=1)g[X].c();b=D(),k=y("div"),$=y("input"),T=D(),O=y("button"),M=y("i"),E=D(),A=y("span"),A.textContent="Upload new file",m(t,"class",i=W.getFieldTypeIcon(n[4].type)),m(l,"class","txt"),m(e,"for",a=n[29]),m($,"type","file"),m($,"class","hidden"),m($,"accept",C=((Q=(j=n[4].options)==null?void 0:j.mimeTypes)==null?void 0:Q.join(","))||null),$.multiple=n[6],m(M,"class","ri-upload-cloud-line"),m(A,"class","txt"),m(O,"type","button"),m(O,"class","btn btn-transparent btn-sm btn-block"),O.disabled=n[11],m(k,"class","list-item list-item-btn"),m(f,"class","list")},m(j,Q){S(j,e,Q),v(e,t),v(e,s),v(e,l),v(l,r),S(j,u,Q),S(j,f,Q);for(let X=0;X<d.length;X+=1)d[X]&&d[X].m(f,null);v(f,h);for(let X=0;X<g.length;X+=1)g[X]&&g[X].m(f,null);v(f,b),v(f,k),v(k,$),n[22]($),v(k,T),v(k,O),v(O,M),v(O,E),v(O,A),n[25](f),L=!0,N||(R=[J($,"change",n[23]),J(O,"click",n[24])],N=!0)},p(j,Q){var X,Z;(!L||Q[0]&16&&i!==(i=W.getFieldTypeIcon(j[4].type)))&&m(t,"class",i),(!L||Q[0]&16)&&o!==(o=j[4].name+"")&&le(r,o),(!L||Q[0]&536870912&&a!==(a=j[29]))&&m(e,"for",a),Q[0]&25725|Q[1]&12&&(F=j[5],ue(),d=vt(d,Q,q,1,j,F,p,f,Ut,Bp,h,Hp),fe()),Q[0]&32858|Q[1]&12&&(V=j[1],ue(),g=vt(g,Q,U,1,j,V,_,f,Ut,Up,b,zp),fe()),(!L||Q[0]&16&&C!==(C=((Z=(X=j[4].options)==null?void 0:X.mimeTypes)==null?void 0:Z.join(","))||null))&&m($,"accept",C),(!L||Q[0]&64)&&($.multiple=j[6]),(!L||Q[0]&2048)&&(O.disabled=j[11])},i(j){if(!L){for(let Q=0;Q<F.length;Q+=1)I(d[Q]);for(let Q=0;Q<V.length;Q+=1)I(g[Q]);L=!0}},o(j){for(let Q=0;Q<d.length;Q+=1)P(d[Q]);for(let Q=0;Q<g.length;Q+=1)P(g[Q]);L=!1},d(j){j&&w(e),j&&w(u),j&&w(f);for(let Q=0;Q<d.length;Q+=1)d[Q].d();for(let Q=0;Q<g.length;Q+=1)g[Q].d();n[22](null),n[25](null),N=!1,De(R)}}}function XM(n){let e,t,i,s,l;return t=new me({props:{class:`
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[GM,({uniqueId:o})=>({29:o}),({uniqueId:o})=>[o?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","block")},m(o,r){S(o,e,r),z(t,e,null),i=!0,s||(l=[J(e,"dragover",xe(n[26])),J(e,"dragleave",n[27]),J(e,"drop",n[16])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&536874495|r[1]&128&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(I(t.$$.fragment,o),i=!0)},o(o){P(t.$$.fragment,o),i=!1},d(o){o&&w(e),H(t),s=!1,De(l)}}}function QM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileNames:u=[]}=e,{field:f=new wn}=e,d,p,h=!1,g="";const _=["copy","copyMove","uninitialized"];function b(j){W.removeByValue(u,j),t(2,u)}function k(j){W.pushUnique(u,j),t(2,u)}function $(j){W.isEmpty(a[j])||a.splice(j,1),t(1,a)}function C(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileNames:u},bubbles:!0}))}function T(j){var X,Z,re;j.preventDefault(),t(9,h=!1);const Q=((X=j.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Q.length||!_.includes((Z=j.dataTransfer)==null?void 0:Z.effectAllowed))){for(const ee of Q){const se=s.length+a.length-u.length;if(((re=f.options)==null?void 0:re.maxSelect)<=se)break;a.push(ee)}t(1,a)}}Xt(async()=>{t(10,g=await de.getAdminFileToken(o.collectionId))});const O=j=>b(j),M=j=>k(j);function E(j){r=j,t(0,r),t(6,i),t(4,f)}const A=j=>$(j);function L(j){a=j,t(1,a)}function N(j){ne[j?"unshift":"push"](()=>{d=j,t(7,d)})}const R=()=>{for(let j of d.files)a.push(j);t(1,a),t(7,d.value=null,d)},F=()=>d==null?void 0:d.click();function q(j){ne[j?"unshift":"push"](()=>{p=j,t(8,p)})}const V=j=>{_.includes(j.dataTransfer.effectAllowed)&&t(9,h=!0)},U=()=>{t(9,h=!1)};return n.$$set=j=>{"record"in j&&t(3,o=j.record),"value"in j&&t(0,r=j.value),"uploadedFiles"in j&&t(1,a=j.uploadedFiles),"deletedFileNames"in j&&t(2,u=j.deletedFileNames),"field"in j&&t(4,f=j.field)},n.$$.update=()=>{var j,Q;n.$$.dirty[0]&2&&(Array.isArray(a)||t(1,a=W.toArray(a))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=W.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((j=f.options)==null?void 0:j.maxSelect)>1),n.$$.dirty[0]&65&&W.isEmpty(r)&&t(0,r=i?[]:""),n.$$.dirty[0]&1&&t(5,s=W.toArray(r)),n.$$.dirty[0]&54&&t(11,l=(s.length||a.length)&&((Q=f.options)==null?void 0:Q.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&6&&(a!==-1||u!==-1)&&C()},[r,a,u,o,f,s,i,d,p,h,g,l,_,b,k,$,T,O,M,E,A,L,N,R,F,q,V,U]}class xM extends ve{constructor(e){super(),be(this,e,QM,XM,_e,{record:3,value:0,uploadedFiles:1,deletedFileNames:2,field:4},null,[-1,-1])}}function Wp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function e5(n,e){e=Wp(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=Wp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Yp(n,e,t){const i=n.slice();i[6]=e[t];const s=W.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Kp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Jp(n){let e,t;return e=new pu({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Zp(n){let e=!W.isEmpty(n[10]),t,i,s=e&&Jp(n);return{c(){s&&s.c(),t=we()},m(l,o){s&&s.m(l,o),S(l,t,o),i=!0},p(l,o){o&3&&(e=!W.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&I(s,1)):(s=Jp(l),s.c(),I(s,1),s.m(t.parentNode,t)):s&&(ue(),P(s,1,1,()=>{s=null}),fe())},i(l){i||(I(s),i=!0)},o(l){P(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function Gp(n){let e,t,i=n[7],s=[];for(let o=0;o<i.length;o+=1)s[o]=Zp(Kp(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&3){i=o[7];let a;for(a=0;a<i.length;a+=1){const u=Kp(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=Zp(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function t5(n){let e,t,i,s,l,o,r=W.truncate(W.displayValue(n[0],n[2]),70)+"",a,u,f,d,p=n[1],h=[];for(let _=0;_<p.length;_+=1)h[_]=Gp(Yp(n,p,_));const g=_=>P(h[_],1,1,()=>{h[_]=null});return{c(){e=y("div"),t=y("i"),s=D();for(let _=0;_<h.length;_+=1)h[_].c();l=D(),o=y("span"),a=Y(r),m(t,"class","link-hint txt-sm ri-information-line svelte-fhw3qk"),m(o,"class","txt txt-ellipsis svelte-fhw3qk"),m(e,"class","record-info svelte-fhw3qk")},m(_,b){S(_,e,b),v(e,t),v(e,s);for(let k=0;k<h.length;k+=1)h[k]&&h[k].m(e,null);v(e,l),v(e,o),v(o,a),u=!0,f||(d=Ee(i=Be.call(null,t,{text:W.truncate(JSON.stringify(W.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),f=!0)},p(_,[b]){if(i&&jt(i.update)&&b&1&&i.update.call(null,{text:W.truncate(JSON.stringify(W.truncateObject(_[0]),null,2),800,!0),class:"code",position:"left"}),b&3){p=_[1];let k;for(k=0;k<p.length;k+=1){const $=Yp(_,p,k);h[k]?(h[k].p($,b),I(h[k],1)):(h[k]=Gp($),h[k].c(),I(h[k],1),h[k].m(e,l))}for(ue(),k=p.length;k<h.length;k+=1)g(k);fe()}(!u||b&5)&&r!==(r=W.truncate(W.displayValue(_[0],_[2]),70)+"")&&le(a,r)},i(_){if(!u){for(let b=0;b<p.length;b+=1)I(h[b]);u=!0}},o(_){h=h.filter(Boolean);for(let b=0;b<h.length;b+=1)P(h[b]);u=!1},d(_){_&&w(e),ht(h,_),f=!1,d()}}}function n5(n,e,t){let i,s,l,o;Ze(n,di,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(d=>d.name==u&&d.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 ir extends ve{constructor(e){super(),be(this,e,n5,t5,_e,{record:0,displayFields:3})}}function Xp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Qp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function xp(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<div class="txt">New record</div>',m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint p-l-sm p-r-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function em(n){let e,t;function i(o,r){return o[12]?s5:i5}let s=i(n),l=s(n);return{c(){e=y("div"),l.c(),t=D(),m(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),v(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 i5(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&tm(n);return{c(){e=y("span"),e.textContent="No records found.",t=D(),s&&s.c(),i=we(),m(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=tm(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 s5(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader loader-sm active"></span>',m(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function tm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[35]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function l5(n){let e;return{c(){e=y("i"),m(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function o5(n){let e;return{c(){e=y("i"),m(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nm(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-pencil-line"></i>',m(t,"type","button"),m(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),m(e,"class","actions nonintrusive")},m(o,r){S(o,e,r),v(e,t),i||(s=[Ee(Be.call(null,t,"Edit")),J(t,"keydown",In(n[27])),J(t,"click",In(l))],i=!0)},p(o,r){n=o},d(o){o&&w(e),i=!1,De(s)}}}function im(n,e){var k;let t,i,s,l,o,r,a,u,f;function d($,C){return $[6]?o5:l5}let p=d(e),h=p(e);l=new ir({props:{record:e[49],displayFields:e[13]}});let g=!((k=e[10])!=null&&k.$isView)&&nm(e);function _(){return e[33](e[49])}function b(...$){return e[34](e[49],...$)}return{key:n,first:null,c(){t=y("div"),h.c(),i=D(),s=y("div"),B(l.$$.fragment),o=D(),g&&g.c(),r=D(),m(s,"class","content"),m(t,"tabindex","0"),m(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m($,C){S($,t,C),h.m(t,null),v(t,i),v(t,s),z(l,s,null),v(t,o),g&&g.m(t,null),v(t,r),a=!0,u||(f=[J(t,"click",_),J(t,"keydown",b)],u=!0)},p($,C){var O;e=$,p!==(p=d(e))&&(h.d(1),h=p(e),h&&(h.c(),h.m(t,i)));const T={};C[0]&8&&(T.record=e[49]),C[0]&8192&&(T.displayFields=e[13]),l.$set(T),(O=e[10])!=null&&O.$isView?g&&(g.d(1),g=null):g?g.p(e,C):(g=nm(e),g.c(),g.m(t,r)),(!a||C[0]&264)&&x(t,"selected",e[6]),(!a||C[0]&808)&&x(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i($){a||(I(l.$$.fragment,$),a=!0)},o($){P(l.$$.fragment,$),a=!1},d($){$&&w(t),h.d(),H(l),g&&g.d(),u=!1,De(f)}}}function sm(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=Y("("),i=Y(t),s=Y(" of MAX "),l=Y(n[5]),o=Y(")")},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 r5(n){let e;return{c(){e=y("p"),e.textContent="No selected records.",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function a5(n){let e,t,i=n[6],s=[];for(let o=0;o<i.length;o+=1)s[o]=lm(Xp(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=y("div");for(let o=0;o<s.length;o+=1)s[o].c();m(e,"class","selected-list svelte-1u8jhky")},m(o,r){S(o,e,r);for(let a=0;a<s.length;a+=1)s[a]&&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=Xp(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=lm(u),s[a].c(),I(s[a],1),s[a].m(e,null))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){o&&w(e),ht(s,o)}}}function u5(n){let e,t,i,s,l,o,r,a;t=new ir({props:{record:n[49],displayFields:n[13]}});function u(){return n[37](n[49])}return{c(){e=y("span"),B(t.$$.fragment),i=D(),s=y("button"),s.innerHTML='<i class="ri-close-line"></i>',l=D(),m(s,"type","button"),m(s,"title","Remove"),m(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),m(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,d){S(f,e,d),z(t,e,null),v(e,i),v(e,s),S(f,l,d),o=!0,r||(a=J(s,"click",u),r=!0)},p(f,d){n=f;const p={};d[0]&64&&(p.record=n[49]),d[0]&8192&&(p.displayFields=n[13]),t.$set(p),(!o||d[1]&2097152)&&x(e,"label-danger",n[52]),(!o||d[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(I(t.$$.fragment,f),o=!0)},o(f){P(t.$$.fragment,f),o=!1},d(f){f&&w(e),H(t),f&&w(l),r=!1,a()}}}function lm(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[u5,({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 nr({props:l}),ne.push(()=>pe(e,"list",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function f5(n){var R;let e,t,i,s,l,o=[],r=new Map,a,u,f,d,p,h,g,_,b,k,$;t=new Jo({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let C=!((R=n[10])!=null&&R.$isView)&&xp(n),T=n[3];const O=F=>F[49].id;for(let F=0;F<T.length;F+=1){let q=Qp(n,T,F),V=O(q);r.set(V,o[F]=im(V,q))}let M=null;T.length||(M=em(n));let E=n[5]>1&&sm(n);const A=[a5,r5],L=[];function N(F,q){return F[6].length?0:1}return h=N(n),g=L[h]=A[h](n),{c(){e=y("div"),B(t.$$.fragment),i=D(),C&&C.c(),s=D(),l=y("div");for(let F=0;F<o.length;F+=1)o[F].c();M&&M.c(),u=D(),f=y("h5"),d=Y(`Selected
`),E&&E.c(),p=D(),g.c(),_=we(),m(e,"class","flex m-b-base flex-gap-10"),m(l,"class","list picker-list m-b-base svelte-1u8jhky"),m(f,"class","section-title")},m(F,q){S(F,e,q),z(t,e,null),v(e,i),C&&C.m(e,null),S(F,s,q),S(F,l,q);for(let V=0;V<o.length;V+=1)o[V]&&o[V].m(l,null);M&&M.m(l,null),S(F,u,q),S(F,f,q),v(f,d),E&&E.m(f,null),S(F,p,q),L[h].m(F,q),S(F,_,q),b=!0,k||($=Ee(a=e5.call(null,l,n[36])),k=!0)},p(F,q){var j;const V={};q[0]&4&&(V.value=F[2]),q[0]&1024&&(V.autocompleteCollection=F[10]),t.$set(V),(j=F[10])!=null&&j.$isView?C&&(C.d(1),C=null):C?C.p(F,q):(C=xp(F),C.c(),C.m(e,null)),q[0]&145324&&(T=F[3],ue(),o=vt(o,q,O,1,F,T,r,l,Ut,im,null,Qp),fe(),!T.length&&M?M.p(F,q):T.length?M&&(M.d(1),M=null):(M=em(F),M.c(),M.m(l,null))),a&&jt(a.update)&&q[0]&2064&&a.update.call(null,F[36]),F[5]>1?E?E.p(F,q):(E=sm(F),E.c(),E.m(f,null)):E&&(E.d(1),E=null);let U=h;h=N(F),h===U?L[h].p(F,q):(ue(),P(L[U],1,1,()=>{L[U]=null}),fe(),g=L[h],g?g.p(F,q):(g=L[h]=A[h](F),g.c()),I(g,1),g.m(_.parentNode,_))},i(F){if(!b){I(t.$$.fragment,F);for(let q=0;q<T.length;q+=1)I(o[q]);I(g),b=!0}},o(F){P(t.$$.fragment,F);for(let q=0;q<o.length;q+=1)P(o[q]);P(g),b=!1},d(F){F&&w(e),H(t),C&&C.d(),F&&w(s),F&&w(l);for(let q=0;q<o.length;q+=1)o[q].d();M&&M.d(),F&&w(u),F&&w(f),E&&E.d(),F&&w(p),L[h].d(F),F&&w(_),k=!1,$()}}}function c5(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=Y("Select "),i=y("strong"),l=Y(s),o=Y(" records")},m(a,u){S(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function d5(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Set selection</span>',m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function p5(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[d5],header:[c5],default:[f5]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=je(o,l[a]);e=new on({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new T1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),s=!0},p(a,u){const f=u[0]&524288?Ot(l,[l[0],l[1],Qt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(I(e.$$.fragment,a),I(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),H(e,a),a&&w(t),n[42](null),H(i,a)}}}const Rr=100;function m5(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=tt(e,d),h;Ze(n,di,Ne=>t(26,h=Ne));const g=Tt(),_="picker_"+W.randomString(5);let{value:b}=e,{field:k}=e,$,C,T="",O=[],M=[],E=1,A=0,L=!1,N=!1;function R(){return t(2,T=""),t(3,O=[]),t(6,M=[]),q(),V(!0),$==null?void 0:$.show()}function F(){return $==null?void 0:$.hide()}async function q(){const Ne=W.toArray(b);if(!s||!Ne.length)return;t(24,N=!0);let Ce=[];const it=Ne.slice(),It=[];for(;it.length>0;){const Vt=[];for(const Wt of it.splice(0,Rr))Vt.push(`id="${Wt}"`);It.push(de.collection(s).getFullList(Rr,{filter:Vt.join("||"),$autoCancel:!1}))}try{await Promise.all(It).then(Vt=>{Ce=Ce.concat(...Vt)}),t(6,M=[]);for(const Vt of Ne){const Wt=W.findByKey(Ce,"id",Vt);Wt&&M.push(Wt)}T.trim()||t(3,O=W.filterDuplicatesByKey(M.concat(O)))}catch(Vt){de.error(Vt)}t(24,N=!1)}async function V(Ne=!1){if(s){t(4,L=!0),Ne&&(T.trim()?t(3,O=[]):t(3,O=W.toArray(M).slice()));try{const Ce=Ne?1:E+1,it=W.getAllCollectionIdentifiers(o),It=await de.collection(s).getList(Ce,Rr,{filter:W.normalizeSearchFilter(T,it),sort:o!=null&&o.$isView?"":"-created",$cancelKey:_+"loadList"});t(3,O=W.filterDuplicatesByKey(O.concat(It.items))),E=It.page,t(23,A=It.totalItems)}catch(Ce){de.error(Ce)}t(4,L=!1)}}function U(Ne){i==1?t(6,M=[Ne]):u&&(W.pushOrReplaceByKey(M,Ne),t(6,M))}function j(Ne){W.removeByKey(M,"id",Ne.id),t(6,M)}function Q(Ne){f(Ne)?j(Ne):U(Ne)}function X(){var Ne;i!=1?t(20,b=M.map(Ce=>Ce.id)):t(20,b=((Ne=M==null?void 0:M[0])==null?void 0:Ne.id)||""),g("save",M),F()}function Z(Ne){he.call(this,n,Ne)}const re=()=>F(),ee=()=>X(),se=Ne=>t(2,T=Ne.detail),ye=()=>C==null?void 0:C.show(),$e=Ne=>C==null?void 0:C.show(Ne),ze=Ne=>Q(Ne),Ue=(Ne,Ce)=>{(Ce.code==="Enter"||Ce.code==="Space")&&(Ce.preventDefault(),Ce.stopPropagation(),Q(Ne))},Se=()=>t(2,T=""),Oe=()=>{a&&!L&&V()},Ge=Ne=>j(Ne);function _t(Ne){M=Ne,t(6,M)}function Xe(Ne){ne[Ne?"unshift":"push"](()=>{$=Ne,t(1,$)})}function Ke(Ne){he.call(this,n,Ne)}function Te(Ne){he.call(this,n,Ne)}function ce(Ne){ne[Ne?"unshift":"push"](()=>{C=Ne,t(7,C)})}const He=Ne=>{W.removeByKey(O,"id",Ne.detail.id),O.unshift(Ne.detail),t(3,O),U(Ne.detail)},At=Ne=>{W.removeByKey(O,"id",Ne.detail.id),t(3,O),j(Ne.detail)};return n.$$set=Ne=>{e=je(je({},e),Gt(Ne)),t(19,p=tt(e,d)),"value"in Ne&&t(20,b=Ne.value),"field"in Ne&&t(21,k=Ne.field)},n.$$.update=()=>{var Ne,Ce,it;n.$$.dirty[0]&2097152&&t(5,i=((Ne=k==null?void 0:k.options)==null?void 0:Ne.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(Ce=k==null?void 0:k.options)==null?void 0:Ce.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(it=k==null?void 0:k.options)==null?void 0:it.displayFields),n.$$.dirty[0]&100663296&&t(10,o=h.find(It=>It.id==s)||null),n.$$.dirty[0]&16777222&&typeof T<"u"&&!N&&$!=null&&$.isActive()&&V(!0),n.$$.dirty[0]&16777232&&t(12,r=L||N),n.$$.dirty[0]&8388616&&t(11,a=A>O.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>M.length),n.$$.dirty[0]&64&&t(8,f=function(It){return W.findByKey(M,"id",It.id)})},[F,$,T,O,L,i,M,C,f,u,o,a,r,l,V,U,j,Q,X,p,b,k,R,A,N,s,h,Z,re,ee,se,ye,$e,ze,Ue,Se,Oe,Ge,_t,Xe,Ke,Te,ce,He,At]}class h5 extends ve{constructor(e){super(),be(this,e,m5,p5,_e,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function om(n,e,t){const i=n.slice();return i[20]=e[t],i[22]=t,i}function rm(n,e,t){const i=n.slice();return i[25]=e[t],i}function am(n){let e,t=n[5]&&um(n);return{c(){t&&t.c(),e=we()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=um(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function um(n){let e,t=W.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=fm(rm(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&1){t=W.toArray(s[0]).slice(0,10);let o;for(o=0;o<t.length;o+=1){const r=rm(s,t,o);i[o]?i[o].p(r,l):(i[o]=fm(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function fm(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,m(e,"class","list-item")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function _5(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new ir({props:{record:n[20],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[10](n[20])}return{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),m(t,"class","content"),m(o,"type","button"),m(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(l,"class","actions"),m(e,"class","list-item"),x(e,"dragging",n[23]),x(e,"dragover",n[24])},m(h,g){S(h,e,g),v(e,t),z(i,t,null),v(e,s),v(e,l),v(l,o),S(h,r,g),a=!0,u||(f=[Ee(Be.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(h,g){var b;n=h;const _={};g&16&&(_.record=n[20]),g&4&&(_.displayFields=(b=n[2].options)==null?void 0:b.displayFields),i.$set(_),(!a||g&8388608)&&x(e,"dragging",n[23]),(!a||g&16777216)&&x(e,"dragover",n[24])},i(h){a||(I(i.$$.fragment,h),a=!0)},o(h){P(i.$$.fragment,h),a=!1},d(h){h&&w(e),H(i),h&&w(r),u=!1,De(f)}}}function cm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[_5,({dragging:a,dragover:u})=>({23:a,24:u}),({dragging:a,dragover:u})=>(a?8388608:0)|(u?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new nr({props:r}),ne.push(()=>pe(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),z(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[22]),u&64&&(f.disabled=!e[6]),u&293601300&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],ge(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function g5(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p=[],h=new Map,g,_,b,k,$,C,T=n[4];const O=E=>E[20].id;for(let E=0;E<T.length;E+=1){let A=om(n,T,E),L=O(A);h.set(L,p[E]=cm(L,A))}let M=null;return T.length||(M=am(n)),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),f=y("div"),d=y("div");for(let E=0;E<p.length;E+=1)p[E].c();M&&M.c(),g=D(),_=y("div"),b=y("button"),b.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=os(W.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[19]),m(d,"class","relations-list svelte-1ynw0pc"),m(b,"type","button"),m(b,"class","btn btn-transparent btn-sm btn-block"),m(_,"class","list-item list-item-btn"),m(f,"class","list")},m(E,A){S(E,e,A),v(e,t),v(e,s),v(e,l),v(l,r),S(E,u,A),S(E,f,A),v(f,d);for(let L=0;L<p.length;L+=1)p[L]&&p[L].m(d,null);M&&M.m(d,null),v(f,g),v(f,_),v(_,b),k=!0,$||(C=J(b,"click",n[13]),$=!0)},p(E,A){(!k||A&4&&i!==(i=os(W.getFieldTypeIcon(E[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!k||A&4)&&o!==(o=E[2].name+"")&&le(r,o),(!k||A&524288&&a!==(a=E[19]))&&m(e,"for",a),A&25166325&&(T=E[4],ue(),p=vt(p,A,O,1,E,T,h,d,Ut,cm,null,om),fe(),!T.length&&M?M.p(E,A):T.length?M&&(M.d(1),M=null):(M=am(E),M.c(),M.m(d,null)))},i(E){if(!k){for(let A=0;A<T.length;A+=1)I(p[A]);k=!0}},o(E){for(let A=0;A<p.length;A+=1)P(p[A]);k=!1},d(E){E&&w(e),E&&w(u),E&&w(f);for(let A=0;A<p.length;A+=1)p[A].d();M&&M.d(),$=!1,C()}}}function b5(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[g5,({uniqueId:r})=>({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new me({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new h5({props:o}),n[15](i),i.$on("save",n[16]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&268959863&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[14](null),H(e,r),r&&w(t),n[15](null),H(i,r)}}}const dm=100;function v5(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1,f;function d(){if(u)return!1;const M=W.toArray(s);return t(4,a=a.filter(E=>M.includes(E.id))),M.length!=a.length}async function p(){var L,N;const M=W.toArray(s);if(t(4,a=[]),!((L=o==null?void 0:o.options)!=null&&L.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const E=M.slice(),A=[];for(;E.length>0;){const R=[];for(const F of E.splice(0,dm))R.push(`id="${F}"`);A.push(de.collection((N=o==null?void 0:o.options)==null?void 0:N.collectionId).getFullList(dm,{filter:R.join("||"),$autoCancel:!1}))}try{let R=[];await Promise.all(A).then(F=>{R=R.concat(...F)});for(const F of M){const q=W.findByKey(R,"id",F);q&&a.push(q)}t(4,a)}catch(R){de.error(R)}t(5,u=!1)}function h(M){W.removeByKey(a,"id",M.id),t(4,a),g()}function g(){var M;i?t(0,s=a.map(E=>E.id)):t(0,s=((M=a[0])==null?void 0:M.id)||"")}jo(()=>{clearTimeout(f)});const _=M=>h(M);function b(M){a=M,t(4,a)}const k=()=>{g()},$=()=>l==null?void 0:l.show();function C(M){ne[M?"unshift":"push"](()=>{r=M,t(3,r)})}function T(M){ne[M?"unshift":"push"](()=>{l=M,t(1,l)})}const O=M=>{var E;t(4,a=M.detail||[]),t(0,s=i?a.map(A=>A.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=M=>{"value"in M&&t(0,s=M.value),"picker"in M&&t(1,l=M.picker),"field"in M&&t(2,o=M.field)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(6,i=((M=o.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&529&&d()&&(clearTimeout(f),t(9,f=setTimeout(p,0)))},[s,l,o,r,a,u,i,h,g,f,_,b,k,$,C,T,O]}class y5 extends ve{constructor(e){super(),be(this,e,v5,b5,_e,{value:0,picker:1,field:2})}}const k5=["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"],w5=(n,e)=>{k5.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function S5(n){let e;return{c(){e=y("textarea"),m(e,"id",n[0]),Hr(e,"visibility","hidden")},m(t,i){S(t,e,i),n[18](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[18](null)}}}function $5(n){let e;return{c(){e=y("div"),m(e,"id",n[0])},m(t,i){S(t,e,i),n[17](e)},p(t,i){i&1&&m(e,"id",t[0])},d(t){t&&w(e),n[17](null)}}}function T5(n){let e;function t(l,o){return l[1]?$5:S5}let i=t(n),s=i(n);return{c(){e=y("div"),s.c(),m(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&&m(e,"class",l[2])},i:te,o:te,d(l){l&&w(e),s.d(),n[19](null)}}}const $1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),C5=()=>{let n={listeners:[],scriptId:$1("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 M5=C5();function O5(n,e,t){var i;let{id:s=$1("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:d="change input undo redo"}=e,{value:p=""}=e,{text:h=""}=e,{cssClass:g="tinymce-wrapper"}=e,_,b,k,$=p,C=o;const T=Tt(),O=()=>{const R=(()=>typeof window<"u"?window:global)();return R&&R.tinymce?R.tinymce:null},M=()=>{const N=Object.assign(Object.assign({},f),{target:b,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:R=>{t(14,k=R),R.on("init",()=>{R.setContent(p),R.on(d,()=>{t(15,$=R.getContent()),$!==p&&(t(5,p=$),t(6,h=R.getContent({format:"text"})))})}),w5(R,T),typeof f.setup=="function"&&f.setup(R)}});t(4,b.style.visibility="",b),O().init(N)};Xt(()=>{if(O()!==null)M();else{const N=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;M5.load(_.ownerDocument,N,()=>{M()})}}),jo(()=>{var N;k&&((N=O())===null||N===void 0||N.remove(k))});function E(N){ne[N?"unshift":"push"](()=>{b=N,t(4,b)})}function A(N){ne[N?"unshift":"push"](()=>{b=N,t(4,b)})}function L(N){ne[N?"unshift":"push"](()=>{_=N,t(3,_)})}return n.$$set=N=>{"id"in N&&t(0,s=N.id),"inline"in N&&t(1,l=N.inline),"disabled"in N&&t(7,o=N.disabled),"apiKey"in N&&t(8,r=N.apiKey),"channel"in N&&t(9,a=N.channel),"scriptSrc"in N&&t(10,u=N.scriptSrc),"conf"in N&&t(11,f=N.conf),"modelEvents"in N&&t(12,d=N.modelEvents),"value"in N&&t(5,p=N.value),"text"in N&&t(6,h=N.text),"cssClass"in N&&t(2,g=N.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(k&&$!==p&&(k.setContent(p),t(6,h=k.getContent({format:"text"}))),k&&o!==C&&(t(16,C=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,g,_,b,p,h,o,r,a,u,f,d,i,k,$,C,E,A,L]}class mu extends ve{constructor(e){super(),be(this,e,O5,T5,_e,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function E5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,d,p;function h(_){n[2](_)}let g={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:W.defaultEditorOptions()};return n[0]!==void 0&&(g.value=n[0]),f=new mu({props:g}),ne.push(()=>pe(f,"value",h)),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=Y(o),u=D(),B(f.$$.fragment),m(t,"class",i=W.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3])},m(_,b){S(_,e,b),v(e,t),v(e,s),v(e,l),v(l,r),S(_,u,b),z(f,_,b),p=!0},p(_,b){(!p||b&2&&i!==(i=W.getFieldTypeIcon(_[1].type)))&&m(t,"class",i),(!p||b&2)&&o!==(o=_[1].name+"")&&le(r,o),(!p||b&8&&a!==(a=_[3]))&&m(e,"for",a);const k={};b&8&&(k.id=_[3]),!d&&b&1&&(d=!0,k.value=_[0],ge(()=>d=!1)),f.$set(k)},i(_){p||(I(f.$$.fragment,_),p=!0)},o(_){P(f.$$.fragment,_),p=!1},d(_){_&&w(e),_&&w(u),H(f,_)}}}function D5(n){let e,t;return e=new me({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function A5(n,e,t){let{field:i=new wn}=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 I5 extends ve{constructor(e){super(),be(this,e,A5,D5,_e,{field:1,value:0})}}function L5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Auth URL"),s=D(),l=y("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].authUrl),r||(a=J(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&m(e,"for",i),f&32&&o!==(o=u[5])&&m(l,"id",o),f&1&&l.value!==u[0].authUrl&&ae(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function P5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Token URL"),s=D(),l=y("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].tokenUrl),r||(a=J(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&m(e,"for",i),f&32&&o!==(o=u[5])&&m(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&ae(l,u[0].tokenUrl)},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=y("label"),t=Y("User API URL"),s=D(),l=y("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].userApiUrl),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&m(e,"for",i),f&32&&o!==(o=u[5])&&m(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&ae(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function F5(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[L5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[P5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[N5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Selfhosted endpoints (optional)",t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment),o=D(),B(r.$$.fragment),m(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),z(i,u,f),S(u,s,f),z(l,u,f),S(u,o,f),z(r,u,f),a=!0},p(u,[f]){const d={};f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const h={};f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(I(i.$$.fragment,u),I(l.$$.fragment,u),I(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function R5(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 pm extends ve{constructor(e){super(),be(this,e,R5,F5,_e,{key:1,config:0})}}function q5(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("Auth URL"),s=D(),l=y("input"),a=D(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",m(e,"for",i=n[4]),m(l,"type","url"),m(l,"id",o=n[4]),l.required=r=n[0].enabled,m(u,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0].authUrl),S(p,a,h),S(p,u,h),f||(d=J(l,"input",n[2]),f=!0)},p(p,h){h&16&&i!==(i=p[4])&&m(e,"for",i),h&16&&o!==(o=p[4])&&m(l,"id",o),h&1&&r!==(r=p[0].enabled)&&(l.required=r),h&1&&l.value!==p[0].authUrl&&ae(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function j5(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("Token URL"),s=D(),l=y("input"),a=D(),u=y("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",m(e,"for",i=n[4]),m(l,"type","url"),m(l,"id",o=n[4]),l.required=r=n[0].enabled,m(u,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0].tokenUrl),S(p,a,h),S(p,u,h),f||(d=J(l,"input",n[3]),f=!0)},p(p,h){h&16&&i!==(i=p[4])&&m(e,"for",i),h&16&&o!==(o=p[4])&&m(l,"id",o),h&1&&r!==(r=p[0].enabled)&&(l.required=r),h&1&&l.value!==p[0].tokenUrl&&ae(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function V5(n){let e,t,i,s,l,o;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[q5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[j5,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Azure AD endpoints",t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment),m(e,"class","section-title")},m(r,a){S(r,e,a),S(r,t,a),z(i,r,a),S(r,s,a),z(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&w(e),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function z5(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 H5 extends ve{constructor(e){super(),be(this,e,z5,V5,_e,{key:1,config:0})}}function B5(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("Auth URL"),s=D(),l=y("input"),a=D(),u=y("div"),u.textContent="Eg. https://example.com/authorize/",m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5]),l.required=r=n[0].enabled,m(u,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0].authUrl),S(p,a,h),S(p,u,h),f||(d=J(l,"input",n[2]),f=!0)},p(p,h){h&32&&i!==(i=p[5])&&m(e,"for",i),h&32&&o!==(o=p[5])&&m(l,"id",o),h&1&&r!==(r=p[0].enabled)&&(l.required=r),h&1&&l.value!==p[0].authUrl&&ae(l,p[0].authUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function U5(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("Token URL"),s=D(),l=y("input"),a=D(),u=y("div"),u.textContent="Eg. https://example.com/token/",m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5]),l.required=r=n[0].enabled,m(u,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0].tokenUrl),S(p,a,h),S(p,u,h),f||(d=J(l,"input",n[3]),f=!0)},p(p,h){h&32&&i!==(i=p[5])&&m(e,"for",i),h&32&&o!==(o=p[5])&&m(l,"id",o),h&1&&r!==(r=p[0].enabled)&&(l.required=r),h&1&&l.value!==p[0].tokenUrl&&ae(l,p[0].tokenUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function W5(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("User API URL"),s=D(),l=y("input"),a=D(),u=y("div"),u.textContent="Eg. https://example.com/userinfo/",m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5]),l.required=r=n[0].enabled,m(u,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0].userApiUrl),S(p,a,h),S(p,u,h),f||(d=J(l,"input",n[4]),f=!0)},p(p,h){h&32&&i!==(i=p[5])&&m(e,"for",i),h&32&&o!==(o=p[5])&&m(l,"id",o),h&1&&r!==(r=p[0].enabled)&&(l.required=r),h&1&&l.value!==p[0].userApiUrl&&ae(l,p[0].userApiUrl)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(a),p&&w(u),f=!1,d()}}}function Y5(n){let e,t,i,s,l,o,r,a;return i=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[B5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[U5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[W5,({uniqueId:u})=>({5:u}),({uniqueId:u})=>u?32:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.textContent="Endpoints",t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment),o=D(),B(r.$$.fragment),m(e,"class","section-title")},m(u,f){S(u,e,f),S(u,t,f),z(i,u,f),S(u,s,f),z(l,u,f),S(u,o,f),z(r,u,f),a=!0},p(u,[f]){const d={};f&1&&(d.class="form-field "+(u[0].enabled?"required":"")),f&2&&(d.name=u[1]+".authUrl"),f&97&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(u[0].enabled?"required":"")),f&2&&(p.name=u[1]+".tokenUrl"),f&97&&(p.$$scope={dirty:f,ctx:u}),l.$set(p);const h={};f&1&&(h.class="form-field "+(u[0].enabled?"required":"")),f&2&&(h.name=u[1]+".userApiUrl"),f&97&&(h.$$scope={dirty:f,ctx:u}),r.$set(h)},i(u){a||(I(i.$$.fragment,u),I(l.$$.fragment,u),I(r.$$.fragment,u),a=!0)},o(u){P(i.$$.fragment,u),P(l.$$.fragment,u),P(r.$$.fragment,u),a=!1},d(u){u&&w(e),u&&w(t),H(i,u),u&&w(s),H(l,u),u&&w(o),H(r,u)}}}function K5(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}function r(){s.userApiUrl=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"config"in a&&t(0,s=a.config)},[s,i,l,o,r]}class qr extends ve{constructor(e){super(),be(this,e,K5,Y5,_e,{key:1,config:0})}}function J5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Client ID"),s=D(),l=y("input"),m(e,"for",i=n[23]),m(l,"type","text"),m(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[2]),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&m(e,"for",i),f&8388608&&o!==(o=u[23])&&m(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Z5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Team ID"),s=D(),l=y("input"),m(e,"for",i=n[23]),m(l,"type","text"),m(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[3]),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&m(e,"for",i),f&8388608&&o!==(o=u[23])&&m(l,"id",o),f&8&&l.value!==u[3]&&ae(l,u[3])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function G5(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Key ID"),s=D(),l=y("input"),m(e,"for",i=n[23]),m(l,"type","text"),m(l,"id",o=n[23]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[4]),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&m(e,"for",i),f&8388608&&o!==(o=u[23])&&m(l,"id",o),f&16&&l.value!==u[4]&&ae(l,u[4])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function X5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("span"),t.textContent="Duration (in seconds)",i=D(),s=y("i"),o=D(),r=y("input"),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[23]),m(r,"type","text"),m(r,"id",a=n[23]),m(r,"max",po),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[6]),u||(f=[Ee(Be.call(null,s,{text:`Max ${po} seconds (~${po/(60*60*24*30)<<0} months).`,position:"top"})),J(r,"input",n[15])],u=!0)},p(d,p){p&8388608&&l!==(l=d[23])&&m(e,"for",l),p&8388608&&a!==(a=d[23])&&m(r,"id",a),p&64&&r.value!==d[6]&&ae(r,d[6])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,De(f)}}}function Q5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=Y("Private key"),s=D(),l=y("textarea"),r=D(),a=y("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",m(e,"for",i=n[23]),m(l,"id",o=n[23]),l.required=!0,m(l,"rows","8"),m(l,"placeholder",`-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----`),m(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ae(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&m(e,"for",i),p&8388608&&o!==(o=d[23])&&m(l,"id",o),p&32&&ae(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function x5(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$;return s=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[J5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[Z5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[G5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[X5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Q5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),B(r.$$.fragment),a=D(),u=y("div"),B(f.$$.fragment),d=D(),p=y("div"),B(h.$$.fragment),g=D(),B(_.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(u,"class","col-lg-6"),m(p,"class","col-lg-6"),m(t,"class","grid"),m(e,"id",n[9]),m(e,"autocomplete","off")},m(C,T){S(C,e,T),v(e,t),v(t,i),z(s,i,null),v(t,l),v(t,o),z(r,o,null),v(t,a),v(t,u),z(f,u,null),v(t,d),v(t,p),z(h,p,null),v(t,g),z(_,t,null),b=!0,k||($=J(e,"submit",xe(n[17])),k=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),s.$set(O);const M={};T&25165832&&(M.$$scope={dirty:T,ctx:C}),r.$set(M);const E={};T&25165840&&(E.$$scope={dirty:T,ctx:C}),f.$set(E);const A={};T&25165888&&(A.$$scope={dirty:T,ctx:C}),h.$set(A);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:C}),_.$set(L)},i(C){b||(I(s.$$.fragment,C),I(r.$$.fragment,C),I(f.$$.fragment,C),I(h.$$.fragment,C),I(_.$$.fragment,C),b=!0)},o(C){P(s.$$.fragment,C),P(r.$$.fragment,C),P(f.$$.fragment,C),P(h.$$.fragment,C),P(_.$$.fragment,C),b=!1},d(C){C&&w(e),H(s),H(r),H(f),H(h),H(_),k=!1,$()}}}function eO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function tO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=Y("Close"),i=D(),s=y("button"),l=y("i"),o=D(),r=y("span"),r.textContent="Generate and set secret",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[7],m(l,"class","ri-key-line"),m(r,"class","txt"),m(s,"type","submit"),m(s,"form",n[9]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function nO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[tO],header:[eO],default:[x5]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const po=15777e3;function iO(n,e,t){let i;const s=Tt(),l="apple_secret_"+W.randomString(5);let o,r,a,u,f,d,p=!1;function h(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,d=N.duration||po),tn({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function _(){t(7,p=!0);try{const N=await de.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Ht("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){de.error(N)}t(7,p=!1)}function b(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function $(){u=this.value,t(4,u)}function C(){d=this.value,t(6,d)}function T(){f=this.value,t(5,f)}const O=()=>_(),M=()=>!p;function E(N){ne[N?"unshift":"push"](()=>{o=N,t(1,o)})}function A(N){he.call(this,n,N)}function L(N){he.call(this,n,N)}return t(8,i=!0),[g,o,r,a,u,f,d,p,i,l,_,h,b,k,$,C,T,O,M,E,A,L]}class sO extends ve{constructor(e){super(),be(this,e,iO,nO,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function lO(n){let e,t,i,s,l,o,r,a,u,f,d={};return r=new sO({props:d}),n[4](r),r.$on("submit",n[5]),{c(){e=y("button"),t=y("i"),i=D(),s=y("span"),s.textContent="Generate secret",o=D(),B(r.$$.fragment),m(t,"class","ri-key-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(p,h){S(p,e,h),v(e,t),v(e,i),v(e,s),S(p,o,h),z(r,p,h),a=!0,u||(f=J(e,"click",n[3]),u=!0)},p(p,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+p[1]))&&m(e,"class",l);const g={};r.$set(g)},i(p){a||(I(r.$$.fragment,p),a=!0)},o(p){P(r.$$.fragment,p),a=!1},d(p){p&&w(e),p&&w(o),n[4](null),H(r,p),u=!1,f()}}}function oO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){ne[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class rO extends ve{constructor(e){super(),be(this,e,oO,lO,_e,{key:1,config:0})}}const mo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:rO},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:H5},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:pm},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:pm},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:qr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:qr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:qr}];function mm(n,e,t){const i=n.slice();return i[9]=e[t],i}function aO(n){let e;return{c(){e=y("h6"),e.textContent="No linked OAuth2 providers.",m(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function uO(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=hm(mm(n,t,s));return{c(){e=y("div");for(let s=0;s<i.length;s+=1)i[s].c();m(e,"class","list")},m(s,l){S(s,e,l);for(let o=0;o<i.length;o+=1)i[o]&&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=mm(s,t,o);i[o]?i[o].p(r,l):(i[o]=hm(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){s&&w(e),ht(i,s)}}}function fO(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function hm(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,d,p=n[9].providerId+"",h,g,_,b,k,$;function C(){return n[6](n[9])}return{c(){var T;e=y("div"),t=y("figure"),i=y("img"),l=D(),o=y("span"),a=Y(r),u=D(),f=y("div"),d=Y("ID: "),h=Y(p),g=D(),_=y("button"),_.innerHTML='<i class="ri-close-line"></i>',b=D(),_n(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||m(i,"src",s),m(i,"alt","Provider logo"),m(t,"class","provider-logo"),m(o,"class","txt"),m(f,"class","txt-hint"),m(_,"type","button"),m(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),m(e,"class","list-item")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(e,l),v(e,o),v(o,a),v(e,u),v(e,f),v(f,d),v(f,h),v(e,g),v(e,_),v(e,b),k||($=J(_,"click",C),k=!0)},p(T,O){var M;n=T,O&2&&!_n(i.src,s="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&m(i,"src",s),O&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),O&2&&p!==(p=n[9].providerId+"")&&le(h,p)},d(T){T&&w(e),k=!1,$()}}}function cO(n){let e;function t(l,o){var r;return l[2]?fO:(r=l[0])!=null&&r.id&&l[1].length?uO:aO}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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:te,o:te,d(l){s.d(l),l&&w(e)}}}function dO(n,e,t){const i=Tt();let{record:s}=e,l=[],o=!1;function r(p){return mo.find(h=>h.key==p+"Auth")||{}}function a(p){var h;return((h=r(p))==null?void 0:h.title)||W.sentenize(p,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await de.collection(s.collectionId).listExternalAuths(s.id))}catch(p){de.error(p)}t(2,o=!1)}function f(p){!(s!=null&&s.id)||!p||mn(`Do you really want to unlink the ${a(p)} provider?`,()=>de.collection(s.collectionId).unlinkExternalAuth(s.id,p).then(()=>{Ht(`Successfully unlinked the ${a(p)} provider.`),i("unlink",p),u()}).catch(h=>{de.error(h)}))}u();const d=p=>f(p.provider);return n.$$set=p=>{"record"in p&&t(0,s=p.record)},[s,l,o,r,a,f,d]}class pO extends ve{constructor(e){super(),be(this,e,dO,cO,_e,{record:0})}}function _m(n,e,t){const i=n.slice();return i[66]=e[t],i[67]=e,i[68]=t,i}function gm(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='<i class="ri-information-line"></i>',s=D(),l=y("div"),o=Y(`The record has previous unsaved changes.
`),r=y("button"),r.textContent="Restore draft",a=D(),u=y("button"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),d=y("div"),m(i,"class","icon"),m(r,"type","button"),m(r,"class","btn btn-sm btn-secondary"),m(l,"class","flex flex-gap-xs"),m(u,"type","button"),m(u,"class","close"),m(u,"aria-label","Discard draft"),m(t,"class","alert alert-info m-0"),m(d,"class","clearfix p-b-base"),m(e,"class","block")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(t,a),v(t,u),v(e,f),v(e,d),h=!0,g||(_=[J(r,"click",n[36]),Ee(Be.call(null,u,"Discard draft")),J(u,"click",xe(n[37]))],g=!0)},p:te,i(b){h||(p&&p.end(1),h=!0)},o(b){p=Ta(e,rt,{duration:150}),h=!1},d(b){b&&w(e),b&&p&&p.end(),g=!1,De(_)}}}function bm(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),m(t,"class","ri-calendar-event-line txt-disabled"),m(e,"class","form-field-addon")},m(o,r){S(o,e,r),v(e,t),s||(l=Ee(i=Be.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function mO(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_=!n[6]&&bm(n);return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",l=D(),o=y("span"),a=D(),_&&_.c(),u=D(),f=y("input"),m(t,"class",os(W.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),m(s,"class","txt"),m(o,"class","flex-fill"),m(e,"for",r=n[69]),m(f,"type","text"),m(f,"id",d=n[69]),m(f,"placeholder","Leave empty to auto generate..."),m(f,"minlength","15"),f.readOnly=p=!n[6]},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),S(b,a,k),_&&_.m(b,k),S(b,u,k),S(b,f,k),ae(f,n[3].id),h||(g=J(f,"input",n[38]),h=!0)},p(b,k){k[2]&128&&r!==(r=b[69])&&m(e,"for",r),b[6]?_&&(_.d(1),_=null):_?_.p(b,k):(_=bm(b),_.c(),_.m(u.parentNode,u)),k[2]&128&&d!==(d=b[69])&&m(f,"id",d),k[0]&64&&p!==(p=!b[6])&&(f.readOnly=p),k[0]&8&&f.value!==b[3].id&&ae(f,b[3].id)},d(b){b&&w(e),b&&w(a),_&&_.d(b),b&&w(u),b&&w(f),h=!1,g()}}}function vm(n){var u,f;let e,t,i,s,l;function o(d){n[39](d)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new z6({props:r}),ne.push(()=>pe(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&ym();return{c(){B(e.$$.fragment),i=D(),a&&a.c(),s=we()},m(d,p){z(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var g,_;const h={};p[0]&64&&(h.isNew=d[6]),p[0]&1&&(h.collection=d[0]),!t&&p[0]&8&&(t=!0,h.record=d[3],ge(()=>t=!1)),e.$set(h),(_=(g=d[0])==null?void 0:g.schema)!=null&&_.length?a||(a=ym(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(I(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){H(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function ym(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function hO(n){let e,t,i;function s(o){n[52](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new y5({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _O(n){let e,t,i,s,l;function o(f){n[49](f,n[66])}function r(f){n[50](f,n[66])}function a(f){n[51](f,n[66])}let u={field:n[66],record:n[3]};return n[3][n[66].name]!==void 0&&(u.value=n[3][n[66].name]),n[4][n[66].name]!==void 0&&(u.uploadedFiles=n[4][n[66].name]),n[5][n[66].name]!==void 0&&(u.deletedFileNames=n[5][n[66].name]),e=new xM({props:u}),ne.push(()=>pe(e,"value",o)),ne.push(()=>pe(e,"uploadedFiles",r)),ne.push(()=>pe(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,d){z(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[66]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[66].name],ge(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[66].name],ge(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileNames=n[5][n[66].name],ge(()=>s=!1)),e.$set(p)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function gO(n){let e,t,i;function s(o){n[48](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new wM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function bO(n){let e,t,i;function s(o){n[47](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new bM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function vO(n){let e,t,i;function s(o){n[46](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new mM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function yO(n){let e,t,i;function s(o){n[45](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new I5({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kO(n){let e,t,i;function s(o){n[44](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new fM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function wO(n){let e,t,i;function s(o){n[43](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new oM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function SO(n){let e,t,i;function s(o){n[42](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new nM({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $O(n){let e,t,i;function s(o){n[41](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new Q6({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function TO(n){let e,t,i;function s(o){n[40](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new J6({props:l}),ne.push(()=>pe(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function km(n,e){let t,i,s,l,o;const r=[TO,$O,SO,wO,kO,yO,vO,bO,gO,_O,hO],a=[];function u(f,d){return f[66].type==="text"?0:f[66].type==="number"?1:f[66].type==="bool"?2:f[66].type==="email"?3:f[66].type==="url"?4:f[66].type==="editor"?5:f[66].type==="date"?6:f[66].type==="select"?7:f[66].type==="json"?8:f[66].type==="file"?9:f[66].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=we(),s&&s.c(),l=we(),this.first=t},m(f,d){S(f,t,d),~i&&a[i].m(f,d),S(f,l,d),o=!0},p(f,d){e=f;let p=i;i=u(e),i===p?~i&&a[i].p(e,d):(s&&(ue(),P(a[p],1,1,()=>{a[p]=null}),fe()),~i?(s=a[i],s?s.p(e,d):(s=a[i]=r[i](e),s.c()),I(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(I(s),o=!0)},o(f){P(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function wm(n){let e,t,i;return t=new pO({props:{record:n[3]}}),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","tab-item"),x(e,"active",n[12]===Sl)},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&4096)&&x(e,"active",s[12]===Sl)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function CO(n){var $,C;let e,t,i,s,l,o,r=[],a=new Map,u,f,d,p,h=!n[7]&&n[9]&&gm(n);s=new me({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[mO,({uniqueId:T})=>({69:T}),({uniqueId:T})=>[0,0,T?128:0]]},$$scope:{ctx:n}}});let g=(($=n[0])==null?void 0:$.isAuth)&&vm(n),_=((C=n[0])==null?void 0:C.schema)||[];const b=T=>T[66].name;for(let T=0;T<_.length;T+=1){let O=_m(n,_,T),M=b(O);a.set(M,r[T]=km(M,O))}let k=n[0].$isAuth&&!n[6]&&wm(n);return{c(){e=y("div"),t=y("form"),h&&h.c(),i=D(),B(s.$$.fragment),l=D(),g&&g.c(),o=D();for(let T=0;T<r.length;T+=1)r[T].c();u=D(),k&&k.c(),m(t,"id",n[15]),m(t,"class","tab-item"),x(t,"active",n[12]===ls),m(e,"class","tabs-content")},m(T,O){S(T,e,O),v(e,t),h&&h.m(t,null),v(t,i),z(s,t,null),v(t,l),g&&g.m(t,null),v(t,o);for(let M=0;M<r.length;M+=1)r[M]&&r[M].m(t,null);v(e,u),k&&k.m(e,null),f=!0,d||(p=[J(t,"submit",xe(n[18])),J(t,"keydown",n[23])],d=!0)},p(T,O){var E,A;!T[7]&&T[9]?h?(h.p(T,O),O[0]&640&&I(h,1)):(h=gm(T),h.c(),I(h,1),h.m(t,i)):h&&(ue(),P(h,1,1,()=>{h=null}),fe());const M={};O[0]&64&&(M.class="form-field "+(T[6]?"":"readonly")),O[0]&72|O[2]&384&&(M.$$scope={dirty:O,ctx:T}),s.$set(M),(E=T[0])!=null&&E.isAuth?g?(g.p(T,O),O[0]&1&&I(g,1)):(g=vm(T),g.c(),I(g,1),g.m(t,o)):g&&(ue(),P(g,1,1,()=>{g=null}),fe()),O[0]&57&&(_=((A=T[0])==null?void 0:A.schema)||[],ue(),r=vt(r,O,b,1,T,_,a,t,Ut,km,null,_m),fe()),(!f||O[0]&4096)&&x(t,"active",T[12]===ls),T[0].$isAuth&&!T[6]?k?(k.p(T,O),O[0]&65&&I(k,1)):(k=wm(T),k.c(),I(k,1),k.m(e,null)):k&&(ue(),P(k,1,1,()=>{k=null}),fe())},i(T){if(!f){I(h),I(s.$$.fragment,T),I(g);for(let O=0;O<_.length;O+=1)I(r[O]);I(k),f=!0}},o(T){P(h),P(s.$$.fragment,T),P(g);for(let O=0;O<r.length;O+=1)P(r[O]);P(k),f=!1},d(T){T&&w(e),h&&h.d(),H(s),g&&g.d();for(let O=0;O<r.length;O+=1)r[O].d();k&&k.d(),d=!1,De(p)}}}function Sm(n){let e,t,i,s,l,o,r;return o=new Jn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[MO]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),i=y("button"),s=y("i"),l=D(),B(o.$$.fragment),m(e,"class","flex-fill"),m(s,"class","ri-more-line"),m(i,"type","button"),m(i,"aria-label","More"),m(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),v(i,s),v(i,l),z(o,i,null),r=!0},p(a,u){const f={};u[0]&5|u[2]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(I(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),H(o)}}}function $m(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[30]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Tm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function MO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&$m(n),u=n[0].$isAuth&&n[2].email&&Tm(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[32]),J(l,"click",In(xe(n[33])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=$m(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=Tm(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,De(r)}}}function Cm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=D(),s=y("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),x(t,"active",n[12]===ls),m(s,"type","button"),m(s,"class","tab-item"),x(s,"active",n[12]===Sl),m(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[34]),J(s,"click",n[35])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===ls),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,De(o)}}}function OO(n){var _;let e,t=n[6]?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,d,p,h=!n[6]&&Sm(n),g=n[0].$isAuth&&!n[6]&&Cm(n);return{c(){e=y("h4"),i=Y(t),s=D(),l=y("strong"),r=Y(o),a=Y(" record"),u=D(),h&&h.c(),f=D(),g&&g.c(),d=we(),m(e,"class","panel-title svelte-qc5ngu")},m(b,k){S(b,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),S(b,u,k),h&&h.m(b,k),S(b,f,k),g&&g.m(b,k),S(b,d,k),p=!0},p(b,k){var $;(!p||k[0]&64)&&t!==(t=b[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=(($=b[0])==null?void 0:$.name)+"")&&le(r,o),b[6]?h&&(ue(),P(h,1,1,()=>{h=null}),fe()):h?(h.p(b,k),k[0]&64&&I(h,1)):(h=Sm(b),h.c(),I(h,1),h.m(f.parentNode,f)),b[0].$isAuth&&!b[6]?g?g.p(b,k):(g=Cm(b),g.c(),g.m(d.parentNode,d)):g&&(g.d(1),g=null)},i(b){p||(I(h),p=!0)},o(b){P(h),p=!1},d(b){b&&w(e),b&&w(u),h&&h.d(b),b&&w(f),g&&g.d(b),b&&w(d)}}}function EO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),r=Y(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[10],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[15]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[29]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&9216&&a!==(a=!d[13]||d[10])&&(s.disabled=a),p[0]&1024&&x(s,"btn-loading",d[10])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function DO(n){var s;let e,t,i={class:`
record-panel
`+(n[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.$isAuth&&!n[6]?"colored-header":"")+`
`,beforeHide:n[53],$$slots:{footer:[EO],header:[OO],default:[CO]},$$scope:{ctx:n}};return e=new on({props:i}),n[54](e),e.$on("hide",n[55]),e.$on("show",n[56]),{c(){B(e.$$.fragment)},m(l,o){z(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=`
record-panel
`+(l[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.$isAuth&&!l[6]?"colored-header":"")+`
`),o[0]&2176&&(r.beforeHide=l[53]),o[0]&14077|o[2]&256&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[54](null),H(e,l)}}}const ls="form",Sl="providers";function AO(n,e,t){let i,s,l,o;const r=Tt(),a="record_"+W.randomString(5);let{collection:u}=e,f,d=null,p=null,h=null,g=!1,_=!1,b={},k={},$=JSON.stringify(null),C=$,T=ls,O=!0,M=!1;function E(ke){return L(ke),t(11,_=!0),t(12,T=ls),f==null?void 0:f.show()}function A(){return f==null?void 0:f.hide()}async function L(ke){t(27,M=!1),tn({}),t(2,d=ke||new wi),t(3,p=d.$clone()),t(4,b={}),t(5,k={}),await cn(),t(9,h=F()),!h||U(p,h)?t(9,h=null):(delete h.password,delete h.passwordConfirm),t(25,$=JSON.stringify(p)),t(27,M=!0)}async function N(ke){var Re,Qe;tn({}),t(2,d=ke||new wi),t(4,b={}),t(5,k={});const Ie=((Qe=(Re=u==null?void 0:u.schema)==null?void 0:Re.filter(Et=>Et.type!="file"))==null?void 0:Qe.map(Et=>Et.name))||[];for(let Et in ke.$export())Ie.includes(Et)||t(3,p[Et]=ke[Et],p);await cn(),t(25,$=JSON.stringify(p)),j()}function R(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function F(ke){try{const Ie=window.localStorage.getItem(R());if(Ie)return new wi(JSON.parse(Ie))}catch{}return ke}function q(ke){window.localStorage.setItem(R(),ke)}function V(){h&&(t(3,p=h),t(9,h=null))}function U(ke,Ie){var Tn;const Re=ke==null?void 0:ke.$clone(),Qe=Ie==null?void 0:Ie.$clone(),Et=(Tn=u==null?void 0:u.schema)==null?void 0:Tn.filter(Fn=>Fn.type==="file");for(let Fn of Et)Re==null||delete Re[Fn.name],Qe==null||delete Qe[Fn.name];return Re==null||delete Re.password,Re==null||delete Re.passwordConfirm,Qe==null||delete Qe.password,Qe==null||delete Qe.passwordConfirm,JSON.stringify(Re)==JSON.stringify(Qe)}function j(){t(9,h=null),window.localStorage.removeItem(R())}function Q(ke=!0){if(g||!o||!(u!=null&&u.id))return;t(10,g=!0);const Ie=Z();let Re;O?Re=de.collection(u.id).create(Ie):Re=de.collection(u.id).update(p.id,Ie),Re.then(Qe=>{Ht(O?"Successfully created record.":"Successfully updated record."),j(),ke?(t(11,_=!1),A()):N(Qe),r("save",Qe)}).catch(Qe=>{de.error(Qe)}).finally(()=>{t(10,g=!1)})}function X(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>de.collection(d.collectionId).delete(d.id).then(()=>{A(),Ht("Successfully deleted record."),r("delete",d)}).catch(ke=>{de.error(ke)}))}function Z(){const ke=(p==null?void 0:p.$export())||{},Ie=new FormData,Re={id:ke.id};for(const Qe of(u==null?void 0:u.schema)||[])Re[Qe.name]=!0;u!=null&&u.isAuth&&(Re.username=!0,Re.email=!0,Re.emailVisibility=!0,Re.password=!0,Re.passwordConfirm=!0,Re.verified=!0);for(const Qe in ke)Re[Qe]&&(typeof ke[Qe]>"u"&&(ke[Qe]=null),W.addValueToFormData(Ie,Qe,ke[Qe]));for(const Qe in b){const Et=W.toArray(b[Qe]);for(const Tn of Et)Ie.append(Qe,Tn)}for(const Qe in k){const Et=W.toArray(k[Qe]);for(const Tn of Et)Ie.append(Qe+"."+Tn,"")}return Ie}function re(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>de.collection(u.id).requestVerification(d.email).then(()=>{Ht(`Successfully sent verification email to ${d.email}.`)}).catch(ke=>{de.error(ke)}))}function ee(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>de.collection(u.id).requestPasswordReset(d.email).then(()=>{Ht(`Successfully sent password reset email to ${d.email}.`)}).catch(ke=>{de.error(ke)}))}function se(){l?mn("You have unsaved changes. Do you really want to discard them?",()=>{ye()}):ye()}async function ye(){const ke=d==null?void 0:d.$clone();if(ke){ke.id="",ke.created="",ke.updated="";const Ie=(u==null?void 0:u.schema)||[];for(const Re of Ie)Re.type==="file"&&delete ke[Re.name]}j(),E(ke),await cn(),t(25,$="")}function $e(ke){(ke.ctrlKey||ke.metaKey)&&ke.code=="KeyS"&&(ke.preventDefault(),ke.stopPropagation(),Q(!1))}const ze=()=>A(),Ue=()=>re(),Se=()=>ee(),Oe=()=>se(),Ge=()=>X(),_t=()=>t(12,T=ls),Xe=()=>t(12,T=Sl),Ke=()=>V(),Te=()=>j();function ce(){p.id=this.value,t(3,p)}function He(ke){p=ke,t(3,p)}function At(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function Ne(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function Ce(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function it(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function It(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function Vt(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function Wt(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function Pn(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function ti(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function $n(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}function gt(ke,Ie){n.$$.not_equal(b[Ie.name],ke)&&(b[Ie.name]=ke,t(4,b))}function Nn(ke,Ie){n.$$.not_equal(k[Ie.name],ke)&&(k[Ie.name]=ke,t(5,k))}function ps(ke,Ie){n.$$.not_equal(p[Ie.name],ke)&&(p[Ie.name]=ke,t(3,p))}const ni=()=>l&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(11,_=!1),A()}),!1):(tn({}),j(),!0);function Oi(ke){ne[ke?"unshift":"push"](()=>{f=ke,t(8,f)})}function ms(ke){he.call(this,n,ke)}function mi(ke){he.call(this,n,ke)}return n.$$set=ke=>{"collection"in ke&&t(0,u=ke.collection)},n.$$.update=()=>{var ke;n.$$.dirty[0]&1&&t(14,i=!!((ke=u==null?void 0:u.schema)!=null&&ke.find(Ie=>Ie.type==="editor"))),n.$$.dirty[0]&48&&t(28,s=W.hasNonEmptyProps(b)||W.hasNonEmptyProps(k)),n.$$.dirty[0]&8&&t(26,C=JSON.stringify(p)),n.$$.dirty[0]&369098752&&t(7,l=s||$!=C),n.$$.dirty[0]&4&&t(6,O=!d||d.$isNew),n.$$.dirty[0]&192&&t(13,o=O||l),n.$$.dirty[0]&201326592&&M&&q(C)},[u,A,d,p,b,k,O,l,f,h,g,_,T,o,i,a,V,j,Q,X,re,ee,se,$e,E,$,C,M,s,ze,Ue,Se,Oe,Ge,_t,Xe,Ke,Te,ce,He,At,Ne,Ce,it,It,Vt,Wt,Pn,ti,$n,gt,Nn,ps,ni,Oi,ms,mi]}class T1 extends ve{constructor(e){super(),be(this,e,AO,DO,_e,{collection:0,show:24,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[24]}get hide(){return this.$$.ctx[1]}}function IO(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[Ee(i=Be.call(null,e,n[2]?"":"Copy")),J(e,"click",In(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&m(e,"class",t),i&&jt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:te,o:te,d(o){o&&w(e),s=!1,De(l)}}}function LO(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&&(W.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Xt(()=>()=>{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 Fl extends ve{constructor(e){super(),be(this,e,LO,IO,_e,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Mm(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Om(n,e,t){const i=n.slice();return i[13]=e[t],i}function Em(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Dm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function PO(n){const e=n.slice(),t=W.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function NO(n){const e=n.slice(),t=W.toArray(e[3]);e[9]=t;const i=W.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function FO(n){const e=n.slice(),t=W.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function RO(n){let e,t;return{c(){e=y("div"),t=Y(n[3]),m(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:te,o:te,d(i){i&&w(e)}}}function qO(n){let e,t=W.truncate(n[3])+"",i,s;return{c(){e=y("span"),i=Y(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=W.truncate(n[3]))},m(l,o){S(l,e,o),v(e,i)},p(l,o){o&8&&t!==(t=W.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=W.truncate(l[3]))&&m(e,"title",s)},i:te,o:te,d(l){l&&w(e)}}}function jO(n){let e,t=[],i=new Map,s,l,o=n[16].slice(0,n[17]);const r=u=>u[8]+u[18];for(let u=0;u<o.length;u+=1){let f=Mm(n,o,u),d=r(f);i.set(d,t[u]=Am(d,f))}let a=n[16].length>n[17]&&Im();return{c(){e=y("div");for(let u=0;u<t.length;u+=1)t[u].c();s=D(),a&&a.c(),m(e,"class","inline-flex")},m(u,f){S(u,e,f);for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(e,null);v(e,s),a&&a.m(e,null),l=!0},p(u,f){f&13&&(o=u[16].slice(0,u[17]),ue(),t=vt(t,f,r,1,u,o,i,e,Ut,Am,s,Mm),fe()),u[16].length>u[17]?a||(a=Im(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){if(!l){for(let f=0;f<o.length;f+=1)I(t[f]);l=!0}},o(u){for(let f=0;f<t.length;f+=1)P(t[f]);l=!1},d(u){u&&w(e);for(let f=0;f<t.length;f+=1)t[f].d();a&&a.d()}}}function VO(n){let e,t,i,s,l;const o=[GO,ZO],r=[];function a(f,d){return f[10].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[9].length>n[11]&&Nm();return{c(){e=y("div"),i.c(),s=D(),u&&u.c(),m(e,"class","inline-flex")},m(f,d){S(f,e,d),r[t].m(e,null),v(e,s),u&&u.m(e,null),l=!0},p(f,d){let p=t;t=a(f),t===p?r[t].p(f,d):(ue(),P(r[p],1,1,()=>{r[p]=null}),fe(),i=r[t],i?i.p(f,d):(i=r[t]=o[t](f),i.c()),I(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=Nm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(I(i),l=!0)},o(f){P(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function zO(n){let e,t=[],i=new Map,s=W.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o<s.length;o+=1){let r=Dm(n,s,o),a=l(r);i.set(a,t[o]=Fm(a,r))}return{c(){e=y("div");for(let o=0;o<t.length;o+=1)t[o].c();m(e,"class","inline-flex")},m(o,r){S(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(s=W.toArray(o[3]),t=vt(t,r,l,1,o,s,i,e,us,Fm,null,Dm))},i:te,o:te,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function HO(n){let e,t;return e=new $i({props:{date:n[3]}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.date=i[3]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function BO(n){let e,t,i,s;const l=[QO,XO],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},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):(ue(),P(o[f],1,1,()=>{o[f]=null}),fe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function UO(n){let e,t=W.truncate(n[3])+"",i,s,l;return{c(){e=y("a"),i=Y(t),m(e,"class","txt-ellipsis"),m(e,"href",n[3]),m(e,"target","_blank"),m(e,"rel","noopener noreferrer")},m(o,r){S(o,e,r),v(e,i),s||(l=[Ee(Be.call(null,e,"Open in new tab")),J(e,"click",In(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=W.truncate(o[3])+"")&&le(i,t),r&8&&m(e,"href",o[3])},i:te,o:te,d(o){o&&w(e),s=!1,De(l)}}}function WO(n){let e,t;return{c(){e=y("span"),t=Y(n[3]),m(e,"class","txt")},m(i,s){S(i,e,s),v(e,t)},p(i,s){s&8&&le(t,i[3])},i:te,o:te,d(i){i&&w(e)}}}function YO(n){let e,t=n[3]?"True":"False",i;return{c(){e=y("span"),i=Y(t),m(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:te,o:te,d(s){s&&w(e)}}}function KO(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function JO(n){let e,t,i,s;const l=[eE,xO],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},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):(ue(),P(o[f],1,1,()=>{o[f]=null}),fe(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function Am(n,e){let t,i,s;return i=new pu({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),z(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function Im(n){let e;return{c(){e=Y("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ZO(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Lm(Om(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[9].slice(0,s[11]);let o;for(o=0;o<t.length;o+=1){const r=Om(s,t,o);i[o]?i[o].p(r,l):(i[o]=Lm(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(s){ht(i,s),s&&w(e)}}}function GO(n){let e=[],t=new Map,i,s,l=n[10].slice(0,n[11]);const o=r=>r[8]+r[6];for(let r=0;r<l.length;r+=1){let a=Em(n,l,r),u=o(a);t.set(u,e[r]=Pm(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=we()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);S(r,i,a),s=!0},p(r,a){a&7&&(l=r[10].slice(0,r[11]),ue(),e=vt(e,a,o,1,r,l,t,i.parentNode,Ut,Pm,i,Em),fe())},i(r){if(!s){for(let a=0;a<l.length;a+=1)I(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function Lm(n){let e,t=n[13]+"",i;return{c(){e=y("span"),i=Y(t),m(e,"class","label")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&12&&t!==(t=s[13]+"")&&le(i,t)},d(s){s&&w(e)}}}function Pm(n,e){var o;let t,i,s,l;return i=new ir({props:{record:e[6],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=y("span"),B(i.$$.fragment),s=D(),m(t,"class","label"),this.first=t},m(r,a){S(r,t,a),z(i,t,null),v(t,s),l=!0},p(r,a){var f;e=r;const u={};a&7&&(u.record=e[6]),a&2&&(u.displayFields=(f=e[1].options)==null?void 0:f.displayFields),i.$set(u)},i(r){l||(I(i.$$.fragment,r),l=!0)},o(r){P(i.$$.fragment,r),l=!1},d(r){r&&w(t),H(i)}}}function Nm(n){let e;return{c(){e=Y("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Fm(n,e){let t,i=e[6]+"",s;return{key:n,first:null,c(){t=y("span"),s=Y(i),m(t,"class","label"),this.first=t},m(l,o){S(l,t,o),v(t,s)},p(l,o){e=l,o&8&&i!==(i=e[6]+"")&&le(s,i)},d(l){l&&w(t)}}}function XO(n){let e,t;return e=new mu({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(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=i[3]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function QO(n){let e,t=W.truncate(W.plainText(n[3]),250)+"",i;return{c(){e=y("span"),i=Y(t),m(e,"class","txt")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=W.truncate(W.plainText(s[3]),250)+"")&&le(i,t)},i:te,o:te,d(s){s&&w(e)}}}function xO(n){let e,t=W.truncate(n[5],500,!0)+"",i,s,l,o,r=n[5].length>500&&Rm(n);return{c(){e=y("span"),i=Y(t),s=D(),r&&r.c(),l=we(),m(e,"class","txt")},m(a,u){S(a,e,u),v(e,i),S(a,s,u),r&&r.m(a,u),S(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=W.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&I(r,1)):(r=Rm(a),r.c(),I(r,1),r.m(l.parentNode,l)):r&&(ue(),P(r,1,1,()=>{r=null}),fe())},i(a){o||(I(r),o=!0)},o(a){P(r),o=!1},d(a){a&&w(e),a&&w(s),r&&r.d(a),a&&w(l)}}}function eE(n){let e,t=W.truncate(n[5])+"",i;return{c(){e=y("span"),i=Y(t),m(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=W.truncate(s[5])+"")&&le(i,t)},i:te,o:te,d(s){s&&w(e)}}}function Rm(n){let e,t;return e=new Fl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function tE(n){let e,t,i,s,l;const o=[JO,KO,YO,WO,UO,BO,HO,zO,VO,jO,qO,RO],r=[];function a(f,d){return d&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!W.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,d){return d===0?FO(f):d===8?NO(f):d===9?PO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=we()},m(f,d){r[t].m(f,d),S(f,s,d),l=!0},p(f,[d]){let p=t;t=a(f,d),t===p?r[t].p(u(f,t),d):(ue(),P(r[p],1,1,()=>{r[p]=null}),fe(),i=r[t],i?i.p(u(f,t),d):(i=r[t]=o[t](u(f,t)),i.c()),I(i,1),i.m(s.parentNode,s))},i(f){l||(I(i),l=!0)},o(f){P(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function nE(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){he.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 C1 extends ve{constructor(e){super(),be(this,e,nE,tE,_e,{record:0,field:1,short:2})}}function qm(n,e,t){const i=n.slice();return i[10]=e[t],i}function jm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new C1({props:{field:n[10],record:n[3]}}),{c(){e=y("tr"),t=y("td"),s=Y(i),l=D(),o=y("td"),B(r.$$.fragment),m(t,"class","min-width txt-hint txt-bold"),m(o,"class","col-field svelte-1nt58f7")},m(u,f){S(u,e,f),v(e,t),v(t,s),v(e,l),v(e,o),z(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const d={};f&1&&(d.field=u[10]),f&8&&(d.record=u[3]),r.$set(d)},i(u){a||(I(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&w(e),H(r)}}}function Vm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].created}}),{c(){e=y("tr"),t=y("td"),t.textContent="created",i=D(),s=y("td"),B(l.$$.fragment),m(t,"class","min-width txt-hint txt-bold"),m(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),z(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(I(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function zm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].updated}}),{c(){e=y("tr"),t=y("td"),t.textContent="updated",i=D(),s=y("td"),B(l.$$.fragment),m(t,"class","min-width txt-hint txt-bold"),m(s,"class","col-field svelte-1nt58f7")},m(r,a){S(r,e,a),v(e,t),v(e,i),v(e,s),z(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(I(l.$$.fragment,r),o=!0)},o(r){P(l.$$.fragment,r),o=!1},d(r){r&&w(e),H(l)}}}function iE(n){var M;let e,t,i,s,l,o,r,a,u,f,d=n[3].id+"",p,h,g,_,b;a=new Fl({props:{value:n[3].id}});let k=(M=n[0])==null?void 0:M.schema,$=[];for(let E=0;E<k.length;E+=1)$[E]=jm(qm(n,k,E));const C=E=>P($[E],1,1,()=>{$[E]=null});let T=n[3].created&&Vm(n),O=n[3].updated&&zm(n);return{c(){e=y("table"),t=y("tbody"),i=y("tr"),s=y("td"),s.textContent="id",l=D(),o=y("td"),r=y("div"),B(a.$$.fragment),u=D(),f=y("span"),p=Y(d),h=D();for(let E=0;E<$.length;E+=1)$[E].c();g=D(),T&&T.c(),_=D(),O&&O.c(),m(s,"class","min-width txt-hint txt-bold"),m(f,"class","txt"),m(r,"class","label"),m(o,"class","col-field svelte-1nt58f7"),m(e,"class","table-border preview-table")},m(E,A){S(E,e,A),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(o,r),z(a,r,null),v(r,u),v(r,f),v(f,p),v(t,h);for(let L=0;L<$.length;L+=1)$[L]&&$[L].m(t,null);v(t,g),T&&T.m(t,null),v(t,_),O&&O.m(t,null),b=!0},p(E,A){var N;const L={};if(A&8&&(L.value=E[3].id),a.$set(L),(!b||A&8)&&d!==(d=E[3].id+"")&&le(p,d),A&9){k=(N=E[0])==null?void 0:N.schema;let R;for(R=0;R<k.length;R+=1){const F=qm(E,k,R);$[R]?($[R].p(F,A),I($[R],1)):($[R]=jm(F),$[R].c(),I($[R],1),$[R].m(t,g))}for(ue(),R=k.length;R<$.length;R+=1)C(R);fe()}E[3].created?T?(T.p(E,A),A&8&&I(T,1)):(T=Vm(E),T.c(),I(T,1),T.m(t,_)):T&&(ue(),P(T,1,1,()=>{T=null}),fe()),E[3].updated?O?(O.p(E,A),A&8&&I(O,1)):(O=zm(E),O.c(),I(O,1),O.m(t,null)):O&&(ue(),P(O,1,1,()=>{O=null}),fe())},i(E){if(!b){I(a.$$.fragment,E);for(let A=0;A<k.length;A+=1)I($[A]);I(T),I(O),b=!0}},o(E){P(a.$$.fragment,E),$=$.filter(Boolean);for(let A=0;A<$.length;A+=1)P($[A]);P(T),P(O),b=!1},d(E){E&&w(e),H(a),ht($,E),T&&T.d(),O&&O.d()}}}function sE(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",s,l;return{c(){e=y("h4"),t=y("strong"),s=Y(i),l=Y(" record preview")},m(r,a){S(r,e,a),v(e,t),v(t,s),v(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 lE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Close</span>',m(e,"type","button"),m(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[6]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function oE(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[lE],header:[sE],default:[iE]},$$scope:{ctx:n}};return e=new on({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){B(e.$$.fragment)},m(s,l){z(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||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[7](null),H(e,s)}}}function rE(n,e,t){let i,{collection:s}=e,l,o=new wi;function r(h){return t(3,o=h),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(h){ne[h?"unshift":"push"](()=>{l=h,t(2,l)})}function d(h){he.call(this,n,h)}function p(h){he.call(this,n,h)}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{var h;n.$$.dirty&1&&t(4,i=!!((h=s==null?void 0:s.schema)!=null&&h.find(g=>g.type==="editor")))},[s,a,l,o,i,r,u,f,d,p]}class aE extends ve{constructor(e){super(),be(this,e,rE,oE,_e,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Hm(n,e,t){const i=n.slice();return i[55]=e[t],i}function Bm(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 Wm(n,e,t){const i=n.slice();return i[51]=e[t],i}function Ym(n){let e;function t(l,o){return l[12]?fE:uE}let i=t(n),s=i(n);return{c(){e=y("th"),s.c(),m(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 uE(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("input"),s=D(),l=y("label"),m(t,"type","checkbox"),m(t,"id","checkbox_0"),t.disabled=i=!n[4].length,t.checked=n[16],m(l,"for","checkbox_0"),m(e,"class","form-field")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),o||(r=J(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 fE(n){let e;return{c(){e=y("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function Km(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[cE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),ne.push(()=>pe(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function cE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="id",m(t,"class",W.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function Jm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Zm(n),r=i&&Gm(n);return{c(){o&&o.c(),t=D(),r&&r.c(),s=we()},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&&I(o,1)):(o=Zm(a),o.c(),I(o,1),o.m(t.parentNode,t)):o&&(ue(),P(o,1,1,()=>{o=null}),fe()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&I(r,1)):(r=Gm(a),r.c(),I(r,1),r.m(s.parentNode,s)):r&&(ue(),P(r,1,1,()=>{r=null}),fe())},i(a){l||(I(o),I(r),l=!0)},o(a){P(o),P(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function Zm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[dE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),ne.push(()=>pe(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function dE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="username",m(t,"class",W.getFieldTypeIcon("user")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function Gm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[pE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),ne.push(()=>pe(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="email",m(t,"class",W.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function mE(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=y("div"),t=y("i"),s=D(),l=y("span"),r=Y(o),m(t,"class",i=W.getFieldTypeIcon(n[58].type)),m(l,"class","txt"),m(e,"class","col-header-content")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),v(l,r)},p(a,u){u[0]&262144&&i!==(i=W.getFieldTypeIcon(a[58].type))&&m(t,"class",i),u[0]&262144&&o!==(o=a[58].name+"")&&le(r,o)},d(a){a&&w(e)}}}function Xm(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:[mE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new un({props:r}),ne.push(()=>pe(i,"sort",o)),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),z(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],ge(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&w(t),H(i,a)}}}function Qm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[hE]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),ne.push(()=>pe(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function hE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="created",m(t,"class",W.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function xm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[_E]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new un({props:l}),ne.push(()=>pe(e,"sort",s)),{c(){B(e.$$.fragment)},m(o,r){z(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],ge(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _E(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="updated",m(t,"class",W.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function eh(n){let e;return{c(){e=y("button"),e.innerHTML='<i class="ri-more-line"></i>',m(e,"type","button"),m(e,"aria-label","Toggle columns"),m(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){S(t,e,i),n[35](e)},p:te,d(t){t&&w(e),n[35](null)}}}function th(n){let e;function t(l,o){return l[12]?bE:gE}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 gE(n){let e,t,i,s,l;function o(u,f){var d,p;if((d=u[1])!=null&&d.length)return yE;if(!((p=u[2])!=null&&p.$isView))return vE}let r=o(n),a=r&&r(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No records found.",s=D(),a&&a.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(u,f){S(u,e,f),v(e,t),v(t,i),v(t,s),a&&a.m(t,null),v(e,l)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a&&a.d(1),a=r&&r(u),a&&(a.c(),a.m(t,null)))},d(u){u&&w(e),a&&a.d()}}}function bE(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function vE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function yE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function nh(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=D(),r=y("label"),m(i,"type","checkbox"),m(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],m(r,"for",a="checkbox_"+n[55].id),m(t,"class","form-field"),m(e,"class","bulk-select-col min-width")},m(p,h){S(p,e,h),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",In(n[26]))],u=!0)},p(p,h){n=p,h[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),h[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),h[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(p){p&&w(e),u=!1,De(f)}}}function ih(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Fl({props:{value:n[55].id}});let d=n[2].$isAuth&&sh(n);return{c(){e=y("td"),t=y("div"),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),a=Y(r),u=D(),d&&d.c(),m(o,"class","txt"),m(i,"class","label"),m(t,"class","flex flex-gap-5"),m(e,"class","col-type-text col-field-id")},m(p,h){S(p,e,h),v(e,t),v(t,i),z(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,h){const g={};h[0]&16&&(g.value=p[55].id),s.$set(g),(!f||h[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].$isAuth?d?d.p(p,h):(d=sh(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(I(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&w(e),H(s),d&&d.d()}}}function sh(n){let e;function t(l,o){return l[55].verified?wE:kE}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 kE(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Ee(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function wE(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Ee(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function lh(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&oh(n),o=i&&rh(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=we()},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=oh(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=rh(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 oh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!W.isEmpty(o[55].username)),t?$E:SE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),m(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 SE(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=Y(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&m(e,"title",s)},d(l){l&&w(e)}}}function $E(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function rh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!W.isEmpty(o[55].email)),t?CE:TE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),m(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 TE(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=Y(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){S(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")&&le(i,t),o[0]&16&&s!==(s=l[55].email)&&m(e,"title",s)},d(l){l&&w(e)}}}function CE(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function ah(n,e){let t,i,s,l;return i=new C1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=y("td"),B(i.$$.fragment),m(t,"class",s="col-type-"+e[58].type+" col-field-"+e[58].name),this.first=t},m(o,r){S(o,t,r),z(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))&&m(t,"class",s)},i(o){l||(I(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&w(t),H(i)}}}function uh(n){let e,t,i;return t=new $i({props:{date:n[55].created}}),{c(){e=y("td"),B(t.$$.fragment),m(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function fh(n){let e,t,i;return t=new $i({props:{date:n[55].updated}}),{c(){e=y("td"),B(t.$$.fragment),m(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function ch(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),d,p=e[9]&&!e[7].includes("@updated"),h,g,_,b,k,$,C=!e[2].$isView&&nh(e),T=s&&ih(e),O=e[2].$isAuth&&lh(e),M=e[18];const E=F=>F[58].name;for(let F=0;F<M.length;F+=1){let q=Bm(e,M,F),V=E(q);a.set(V,r[F]=ah(V,q))}let A=f&&uh(e),L=p&&fh(e);function N(){return e[37](e[55])}function R(...F){return e[38](e[55],...F)}return{key:n,first:null,c(){t=y("tr"),C&&C.c(),i=D(),T&&T.c(),l=D(),O&&O.c(),o=D();for(let F=0;F<r.length;F+=1)r[F].c();u=D(),A&&A.c(),d=D(),L&&L.c(),h=D(),g=y("td"),g.innerHTML='<i class="ri-arrow-right-line"></i>',_=D(),m(g,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(F,q){S(F,t,q),C&&C.m(t,null),v(t,i),T&&T.m(t,null),v(t,l),O&&O.m(t,null),v(t,o);for(let V=0;V<r.length;V+=1)r[V]&&r[V].m(t,null);v(t,u),A&&A.m(t,null),v(t,d),L&&L.m(t,null),v(t,h),v(t,g),v(t,_),b=!0,k||($=[J(t,"click",N),J(t,"keydown",R)],k=!0)},p(F,q){e=F,e[2].$isView?C&&(C.d(1),C=null):C?C.p(e,q):(C=nh(e),C.c(),C.m(t,i)),q[0]&128&&(s=!e[7].includes("@id")),s?T?(T.p(e,q),q[0]&128&&I(T,1)):(T=ih(e),T.c(),I(T,1),T.m(t,l)):T&&(ue(),P(T,1,1,()=>{T=null}),fe()),e[2].$isAuth?O?O.p(e,q):(O=lh(e),O.c(),O.m(t,o)):O&&(O.d(1),O=null),q[0]&262160&&(M=e[18],ue(),r=vt(r,q,E,1,e,M,a,t,Ut,ah,u,Bm),fe()),q[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?A?(A.p(e,q),q[0]&1152&&I(A,1)):(A=uh(e),A.c(),I(A,1),A.m(t,d)):A&&(ue(),P(A,1,1,()=>{A=null}),fe()),q[0]&640&&(p=e[9]&&!e[7].includes("@updated")),p?L?(L.p(e,q),q[0]&640&&I(L,1)):(L=fh(e),L.c(),I(L,1),L.m(t,h)):L&&(ue(),P(L,1,1,()=>{L=null}),fe())},i(F){if(!b){I(T);for(let q=0;q<M.length;q+=1)I(r[q]);I(A),I(L),b=!0}},o(F){P(T);for(let q=0;q<r.length;q+=1)P(r[q]);P(A),P(L),b=!1},d(F){F&&w(t),C&&C.d(),T&&T.d(),O&&O.d();for(let q=0;q<r.length;q+=1)r[q].d();A&&A.d(),L&&L.d(),k=!1,De($)}}}function ME(n){let e,t,i,s,l=!n[7].includes("@id"),o,r,a=[],u=new Map,f,d=n[10]&&!n[7].includes("@created"),p,h=n[9]&&!n[7].includes("@updated"),g,_,b,k,$=[],C=new Map,T,O=!n[2].$isView&&Ym(n),M=l&&Km(n),E=n[2].$isAuth&&Jm(n),A=n[18];const L=j=>j[58].name;for(let j=0;j<A.length;j+=1){let Q=Um(n,A,j),X=L(Q);u.set(X,a[j]=Xm(X,Q))}let N=d&&Qm(n),R=h&&xm(n),F=n[15].length&&eh(n),q=n[4];const V=j=>j[2].$isView?j[55]:j[55].id;for(let j=0;j<q.length;j+=1){let Q=Hm(n,q,j),X=V(Q);C.set(X,$[j]=ch(X,Q))}let U=null;return q.length||(U=th(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),O&&O.c(),s=D(),M&&M.c(),o=D(),E&&E.c(),r=D();for(let j=0;j<a.length;j+=1)a[j].c();f=D(),N&&N.c(),p=D(),R&&R.c(),g=D(),_=y("th"),F&&F.c(),b=D(),k=y("tbody");for(let j=0;j<$.length;j+=1)$[j].c();U&&U.c(),m(_,"class","col-type-action min-width"),m(e,"class","table"),x(e,"table-loading",n[12])},m(j,Q){S(j,e,Q),v(e,t),v(t,i),O&&O.m(i,null),v(i,s),M&&M.m(i,null),v(i,o),E&&E.m(i,null),v(i,r);for(let X=0;X<a.length;X+=1)a[X]&&a[X].m(i,null);v(i,f),N&&N.m(i,null),v(i,p),R&&R.m(i,null),v(i,g),v(i,_),F&&F.m(_,null),v(e,b),v(e,k);for(let X=0;X<$.length;X+=1)$[X]&&$[X].m(k,null);U&&U.m(k,null),T=!0},p(j,Q){j[2].$isView?O&&(O.d(1),O=null):O?O.p(j,Q):(O=Ym(j),O.c(),O.m(i,s)),Q[0]&128&&(l=!j[7].includes("@id")),l?M?(M.p(j,Q),Q[0]&128&&I(M,1)):(M=Km(j),M.c(),I(M,1),M.m(i,o)):M&&(ue(),P(M,1,1,()=>{M=null}),fe()),j[2].$isAuth?E?(E.p(j,Q),Q[0]&4&&I(E,1)):(E=Jm(j),E.c(),I(E,1),E.m(i,r)):E&&(ue(),P(E,1,1,()=>{E=null}),fe()),Q[0]&262145&&(A=j[18],ue(),a=vt(a,Q,L,1,j,A,u,i,Ut,Xm,f,Um),fe()),Q[0]&1152&&(d=j[10]&&!j[7].includes("@created")),d?N?(N.p(j,Q),Q[0]&1152&&I(N,1)):(N=Qm(j),N.c(),I(N,1),N.m(i,p)):N&&(ue(),P(N,1,1,()=>{N=null}),fe()),Q[0]&640&&(h=j[9]&&!j[7].includes("@updated")),h?R?(R.p(j,Q),Q[0]&640&&I(R,1)):(R=xm(j),R.c(),I(R,1),R.m(i,g)):R&&(ue(),P(R,1,1,()=>{R=null}),fe()),j[15].length?F?F.p(j,Q):(F=eh(j),F.c(),F.m(_,null)):F&&(F.d(1),F=null),Q[0]&4986582&&(q=j[4],ue(),$=vt($,Q,V,1,j,q,C,k,Ut,ch,null,Hm),fe(),!q.length&&U?U.p(j,Q):q.length?U&&(U.d(1),U=null):(U=th(j),U.c(),U.m(k,null))),(!T||Q[0]&4096)&&x(e,"table-loading",j[12])},i(j){if(!T){I(M),I(E);for(let Q=0;Q<A.length;Q+=1)I(a[Q]);I(N),I(R);for(let Q=0;Q<q.length;Q+=1)I($[Q]);T=!0}},o(j){P(M),P(E);for(let Q=0;Q<a.length;Q+=1)P(a[Q]);P(N),P(R);for(let Q=0;Q<$.length;Q+=1)P($[Q]);T=!1},d(j){j&&w(e),O&&O.d(),M&&M.d(),E&&E.d();for(let Q=0;Q<a.length;Q+=1)a[Q].d();N&&N.d(),R&&R.d(),F&&F.d();for(let Q=0;Q<$.length;Q+=1)$[Q].d();U&&U.d()}}}function dh(n){let e,t;return e=new Jn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[14],$$slots:{default:[EE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function OE(n){let e,t,i,s,l,o=n[51].name+"",r,a,u,f,d;function p(...h){return n[27](n[51],...h)}return{c(){e=y("input"),s=D(),l=y("label"),r=Y(o),u=D(),m(e,"type","checkbox"),m(e,"id",t=n[54]),e.checked=i=!n[7].includes(n[51].id),m(l,"for",a=n[54])},m(h,g){S(h,e,g),S(h,s,g),S(h,l,g),v(l,r),S(h,u,g),f||(d=J(e,"change",p),f=!0)},p(h,g){n=h,g[1]&8388608&&t!==(t=n[54])&&m(e,"id",t),g[0]&32896&&i!==(i=!n[7].includes(n[51].id))&&(e.checked=i),g[0]&32768&&o!==(o=n[51].name+"")&&le(r,o),g[1]&8388608&&a!==(a=n[54])&&m(l,"for",a)},d(h){h&&w(e),h&&w(s),h&&w(l),h&&w(u),f=!1,d()}}}function ph(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:[OE,({uniqueId:l})=>({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),z(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||(I(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&w(t),H(i,l)}}}function EE(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=Wm(n,r,u),d=a(f);s.set(d,i[u]=ph(d,f))}return{c(){e=y("div"),e.textContent="Toggle columns",t=D();for(let u=0;u<i.length;u+=1)i[u].c();l=we(),m(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){S(u,e,f),S(u,t,f);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(u,f);S(u,l,f),o=!0},p(u,f){f[0]&32896|f[1]&8388608&&(r=u[15],ue(),i=vt(i,f,a,1,u,r,s,l.parentNode,Ut,ph,l,Wm),fe())},i(u){if(!o){for(let f=0;f<r.length;f+=1)I(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)P(i[f]);o=!1},d(u){u&&w(e),u&&w(t);for(let f=0;f<i.length;f+=1)i[f].d(u);u&&w(l)}}}function DE(n){let e,t,i=n[14]&&dh(n);return{c(){i&&i.c(),e=we()},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&&I(i,1)):(i=dh(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(ue(),P(i,1,1,()=>{i=null}),fe())},i(s){t||(I(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function mh(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=y("small"),t=Y("Showing "),s=Y(i),l=Y(" of "),o=Y(n[5]),m(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),v(e,t),v(e,s),v(e,l),v(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 hh(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=y("div"),t=y("button"),i=y("span"),s=Y("Load more ("),o=Y(l),r=Y(")"),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[12]),x(t,"btn-disabled",n[12]),m(e,"class","block txt-center m-t-xs")},m(f,d){S(f,e,d),v(e,t),v(t,i),v(i,s),v(i,o),v(i,r),a||(u=J(t,"click",n[41]),a=!0)},p(f,d){d[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),d[0]&4096&&x(t,"btn-loading",f[12]),d[0]&4096&&x(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function _h(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,d,p,h,g,_,b,k,$;return{c(){e=y("div"),t=y("div"),i=Y("Selected "),s=y("strong"),l=Y(n[8]),o=D(),a=Y(r),u=D(),f=y("button"),f.innerHTML='<span class="txt">Reset</span>',d=D(),p=y("div"),h=D(),g=y("button"),g.innerHTML='<span class="txt">Delete selected</span>',m(t,"class","txt"),m(f,"type","button"),m(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[13]),m(p,"class","flex-fill"),m(g,"type","button"),m(g,"class","btn btn-sm btn-transparent btn-danger"),x(g,"btn-loading",n[13]),x(g,"btn-disabled",n[13]),m(e,"class","bulkbar")},m(C,T){S(C,e,T),v(e,t),v(t,i),v(t,s),v(s,l),v(t,o),v(t,a),v(e,u),v(e,f),v(e,d),v(e,p),v(e,h),v(e,g),b=!0,k||($=[J(f,"click",n[42]),J(g,"click",n[43])],k=!0)},p(C,T){(!b||T[0]&256)&&le(l,C[8]),(!b||T[0]&256)&&r!==(r=C[8]===1?"record":"records")&&le(a,r),(!b||T[0]&8192)&&x(f,"btn-disabled",C[13]),(!b||T[0]&8192)&&x(g,"btn-loading",C[13]),(!b||T[0]&8192)&&x(g,"btn-disabled",C[13])},i(C){b||(C&&et(()=>{b&&(_||(_=Ve(e,ci,{duration:150,y:5},!0)),_.run(1))}),b=!0)},o(C){C&&(_||(_=Ve(e,ci,{duration:150,y:5},!1)),_.run(0)),b=!1},d(C){C&&w(e),C&&_&&_.end(),k=!1,De($)}}}function AE(n){let e,t,i,s,l,o;e=new Va({props:{class:"table-wrapper",$$slots:{before:[DE],default:[ME]},$$scope:{ctx:n}}});let r=n[4].length&&mh(n),a=n[4].length&&n[17]&&hh(n),u=n[8]&&_h(n);return{c(){B(e.$$.fragment),t=D(),r&&r.c(),i=D(),a&&a.c(),s=D(),u&&u.c(),l=we()},m(f,d){z(e,f,d),S(f,t,d),r&&r.m(f,d),S(f,i,d),a&&a.m(f,d),S(f,s,d),u&&u.m(f,d),S(f,l,d),o=!0},p(f,d){const p={};d[0]&382679|d[2]&2&&(p.$$scope={dirty:d,ctx:f}),e.$set(p),f[4].length?r?r.p(f,d):(r=mh(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,d):(a=hh(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,d),d[0]&256&&I(u,1)):(u=_h(f),u.c(),I(u,1),u.m(l.parentNode,l)):u&&(ue(),P(u,1,1,()=>{u=null}),fe())},i(f){o||(I(e.$$.fragment,f),I(u),o=!0)},o(f){P(e.$$.fragment,f),P(u),o=!1},d(f){H(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 IE=/^([\+\-])?(\w+)$/;function LE(n,e,t){let i,s,l,o,r,a,u,f;const d=Tt();let{collection:p}=e,{sort:h=""}=e,{filter:g=""}=e,_=[],b=1,k=0,$={},C=!0,T=!1,O=0,M,E=[],A=[];function L(){p!=null&&p.id&&localStorage.setItem((p==null?void 0:p.id)+"@hiddenCollumns",JSON.stringify(E))}function N(){if(t(7,E=[]),!!(p!=null&&p.id))try{const Ce=localStorage.getItem(p.id+"@hiddenCollumns");Ce&&t(7,E=JSON.parse(Ce)||[])}catch{}}async function R(){const Ce=b;for(let it=1;it<=Ce;it++)(it===1||o)&&await F(it,!1)}async function F(Ce=1,it=!0){var ti,$n;if(!(p!=null&&p.id))return;t(12,C=!0);let It=h;const Vt=It.match(IE),Wt=Vt?s.find(gt=>gt.name===Vt[2]):null;if(Vt&&(($n=(ti=Wt==null?void 0:Wt.options)==null?void 0:ti.displayFields)==null?void 0:$n.length)>0){const gt=[];for(const Nn of Wt.options.displayFields)gt.push((Vt[1]||"")+Vt[2]+"."+Nn);It=gt.join(",")}const Pn=W.getAllCollectionIdentifiers(p);return de.collection(p.id).getList(Ce,30,{sort:It,filter:W.normalizeSearchFilter(g,Pn),expand:s.map(gt=>gt.name).join(","),$cancelKey:"records_list"}).then(async gt=>{if(Ce<=1&&q(),t(12,C=!1),t(11,b=gt.page),t(5,k=gt.totalItems),d("load",_.concat(gt.items)),it){const Nn=++O;for(;gt.items.length&&O==Nn;)t(4,_=_.concat(gt.items.splice(0,15))),await W.yieldToMain()}else t(4,_=_.concat(gt.items))}).catch(gt=>{gt!=null&&gt.isAbort||(t(12,C=!1),console.warn(gt),q(),de.error(gt,!1))})}function q(){t(4,_=[]),t(11,b=1),t(5,k=0),t(6,$={})}function V(){a?U():j()}function U(){t(6,$={})}function j(){for(const Ce of _)t(6,$[Ce.id]=Ce,$);t(6,$)}function Q(Ce){$[Ce.id]?delete $[Ce.id]:t(6,$[Ce.id]=Ce,$),t(6,$)}function X(){mn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,Z)}async function Z(){if(T||!r||!(p!=null&&p.id))return;let Ce=[];for(const it of Object.keys($))Ce.push(de.collection(p.id).delete(it));return t(13,T=!0),Promise.all(Ce).then(()=>{Ht(`Successfully deleted the selected ${r===1?"record":"records"}.`),U()}).catch(it=>{de.error(it)}).finally(()=>(t(13,T=!1),R()))}function re(Ce){he.call(this,n,Ce)}const ee=(Ce,it)=>{it.target.checked?W.removeByValue(E,Ce.id):W.pushUnique(E,Ce.id),t(7,E)},se=()=>V();function ye(Ce){h=Ce,t(0,h)}function $e(Ce){h=Ce,t(0,h)}function ze(Ce){h=Ce,t(0,h)}function Ue(Ce){h=Ce,t(0,h)}function Se(Ce){h=Ce,t(0,h)}function Oe(Ce){h=Ce,t(0,h)}function Ge(Ce){ne[Ce?"unshift":"push"](()=>{M=Ce,t(14,M)})}const _t=Ce=>Q(Ce),Xe=Ce=>d("select",Ce),Ke=(Ce,it)=>{it.code==="Enter"&&(it.preventDefault(),d("select",Ce))},Te=()=>t(1,g=""),ce=()=>d("new"),He=()=>F(b+1),At=()=>U(),Ne=()=>X();return n.$$set=Ce=>{"collection"in Ce&&t(2,p=Ce.collection),"sort"in Ce&&t(0,h=Ce.sort),"filter"in Ce&&t(1,g=Ce.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&p!=null&&p.id&&(N(),q()),n.$$.dirty[0]&4&&t(25,i=(p==null?void 0:p.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(Ce=>Ce.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(Ce=>!E.includes(Ce.id))),n.$$.dirty[0]&7&&p!=null&&p.id&&h!==-1&&g!==-1&&F(1),n.$$.dirty[0]&48&&t(17,o=k>_.length),n.$$.dirty[0]&64&&t(8,r=Object.keys($).length),n.$$.dirty[0]&272&&t(16,a=_.length&&r===_.length),n.$$.dirty[0]&128&&E!==-1&&L(),n.$$.dirty[0]&20&&t(10,u=!(p!=null&&p.$isView)||_.length>0&&_[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(p!=null&&p.$isView)||_.length>0&&_[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,A=[].concat(p.$isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(Ce=>({id:Ce.id,name:Ce.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[h,g,p,F,_,k,$,E,r,f,u,b,C,T,M,A,a,o,l,d,V,U,Q,X,R,i,re,ee,se,ye,$e,ze,Ue,Se,Oe,Ge,_t,Xe,Ke,Te,ce,He,At,Ne]}class PE extends ve{constructor(e){super(),be(this,e,LE,AE,_e,{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 NE(n){let e,t,i,s;return e=new $6({}),i=new Sn({props:{$$slots:{default:[qE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(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||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function FE(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[zE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function RE(n){let e,t;return e=new Sn({props:{center:!0,$$slots:{default:[HE]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',m(e,"type","button"),m(e,"aria-label","Edit collection"),m(e,"class","btn btn-transparent btn-circle")},m(s,l){S(s,e,l),t||(i=[Ee(Be.call(null,e,{text:"Edit collection",position:"right"})),J(e,"click",n[15])],t=!0)},p:te,d(s){s&&w(e),t=!1,De(i)}}}function bh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function qE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L,N,R=!n[10]&&gh(n);d=new Zo({}),d.$on("refresh",n[16]);let F=!n[2].$isView&&bh(n);k=new Jo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(j){n[21](j)}function V(j){n[22](j)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),O=new PE({props:U}),n[20](O),ne.push(()=>pe(O,"filter",q)),ne.push(()=>pe(O,"sort",V)),O.$on("select",n[23]),O.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=D(),l=y("div"),r=Y(o),a=D(),u=y("div"),R&&R.c(),f=D(),B(d.$$.fragment),p=D(),h=y("div"),g=y("button"),g.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=D(),F&&F.c(),b=D(),B(k.$$.fragment),$=D(),C=y("div"),T=D(),B(O.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(g,"type","button"),m(g,"class","btn btn-outline"),m(h,"class","btns-group"),m(e,"class","page-header"),m(C,"class","clearfix m-b-base")},m(j,Q){S(j,e,Q),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),z(d,u,null),v(e,p),v(e,h),v(h,g),v(h,_),F&&F.m(h,null),S(j,b,Q),z(k,j,Q),S(j,$,Q),S(j,C,Q),S(j,T,Q),z(O,j,Q),A=!0,L||(N=J(g,"click",n[17]),L=!0)},p(j,Q){(!A||Q[0]&4)&&o!==(o=j[2].name+"")&&le(r,o),j[10]?R&&(R.d(1),R=null):R?R.p(j,Q):(R=gh(j),R.c(),R.m(u,f)),j[2].$isView?F&&(F.d(1),F=null):F?F.p(j,Q):(F=bh(j),F.c(),F.m(h,null));const X={};Q[0]&1&&(X.value=j[0]),Q[0]&4&&(X.autocompleteCollection=j[2]),k.$set(X);const Z={};Q[0]&4&&(Z.collection=j[2]),!M&&Q[0]&1&&(M=!0,Z.filter=j[0],ge(()=>M=!1)),!E&&Q[0]&2&&(E=!0,Z.sort=j[1],ge(()=>E=!1)),O.$set(Z)},i(j){A||(I(d.$$.fragment,j),I(k.$$.fragment,j),I(O.$$.fragment,j),A=!0)},o(j){P(d.$$.fragment,j),P(k.$$.fragment,j),P(O.$$.fragment,j),A=!1},d(j){j&&w(e),R&&R.d(),H(d),F&&F.d(),j&&w(b),H(k,j),j&&w($),j&&w(C),j&&w(T),n[20](null),H(O,j),L=!1,N()}}}function jE(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=D(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,m(e,"class","m-b-10"),m(i,"type","button"),m(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=J(i,"click",n[14]),s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function VE(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function zE(n){let e,t,i;function s(r,a){return r[10]?VE:jE}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),v(e,t),v(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function HE(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function BE(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[RE,FE,NE],h=[];function g(C,T){return C[3]&&!C[9].length?0:C[9].length?2:1}e=g(n),t=h[e]=p[e](n);let _={};s=new du({props:_}),n[25](s);let b={};o=new I6({props:b}),n[26](o);let k={collection:n[2]};a=new T1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new aE({props:$}),n[30](f),{c(){t.c(),i=D(),B(s.$$.fragment),l=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),u=D(),B(f.$$.fragment)},m(C,T){h[e].m(C,T),S(C,i,T),z(s,C,T),S(C,l,T),z(o,C,T),S(C,r,T),z(a,C,T),S(C,u,T),z(f,C,T),d=!0},p(C,T){let O=e;e=g(C),e===O?h[e].p(C,T):(ue(),P(h[O],1,1,()=>{h[O]=null}),fe(),t=h[e],t?t.p(C,T):(t=h[e]=p[e](C),t.c()),I(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const E={};o.$set(E);const A={};T[0]&4&&(A.collection=C[2]),a.$set(A);const L={};T[0]&4&&(L.collection=C[2]),f.$set(L)},i(C){d||(I(t),I(s.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(f.$$.fragment,C),d=!0)},o(C){P(t),P(s.$$.fragment,C),P(o.$$.fragment,C),P(a.$$.fragment,C),P(f.$$.fragment,C),d=!1},d(C){h[e].d(C),C&&w(i),n[25](null),H(s,C),C&&w(l),n[26](null),H(o,C),C&&w(r),n[27](null),H(a,C),C&&w(u),n[30](null),H(f,C)}}}function UE(n,e,t){let i,s,l,o,r,a,u;Ze(n,fi,ee=>t(2,s=ee)),Ze(n,Mt,ee=>t(31,l=ee)),Ze(n,ko,ee=>t(3,o=ee)),Ze(n,Ca,ee=>t(13,r=ee)),Ze(n,di,ee=>t(9,a=ee)),Ze(n,Is,ee=>t(10,u=ee));const f=new URLSearchParams(r);let d,p,h,g,_,b=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function C(){t(11,$=s==null?void 0:s.id),t(0,b=""),t(1,k="-created"),s!=null&&s.$isView&&!W.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ny($);const T=()=>d==null?void 0:d.show(),O=()=>d==null?void 0:d.show(s),M=()=>_==null?void 0:_.load(),E=()=>p==null?void 0:p.show(s),A=()=>h==null?void 0:h.show(),L=ee=>t(0,b=ee.detail);function N(ee){ne[ee?"unshift":"push"](()=>{_=ee,t(8,_)})}function R(ee){b=ee,t(0,b)}function F(ee){k=ee,t(1,k)}const q=ee=>{s.$isView?g.show(ee==null?void 0:ee.detail):h==null||h.show(ee==null?void 0:ee.detail)},V=()=>h==null?void 0:h.show();function U(ee){ne[ee?"unshift":"push"](()=>{d=ee,t(4,d)})}function j(ee){ne[ee?"unshift":"push"](()=>{p=ee,t(5,p)})}function Q(ee){ne[ee?"unshift":"push"](()=>{h=ee,t(6,h)})}const X=()=>_==null?void 0:_.reloadLoadedPages(),Z=()=>_==null?void 0:_.reloadLoadedPages();function re(ee){ne[ee?"unshift":"push"](()=>{g=ee,t(7,g)})}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")!=$&&Iy(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&C(),n.$$.dirty[0]&7&&(k||b||s!=null&&s.id)){const ee=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:b,sort:k}).toString();Vi("/collections?"+ee)}n.$$.dirty[0]&4&&ln(Mt,l=(s==null?void 0:s.name)||"Collections",l)},[b,k,s,o,d,p,h,g,_,a,u,$,i,r,T,O,M,E,A,L,N,R,F,q,V,U,j,Q,X,Z,re]}class WE extends ve{constructor(e){super(),be(this,e,UE,BE,_e,{},null,[-1,-1])}}function YE(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L,N,R;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=D(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),d=y("a"),d.innerHTML=`<i class="ri-archive-line"></i>
<span class="txt">Backups</span>`,p=D(),h=y("div"),h.innerHTML='<span class="txt">Sync</span>',g=D(),_=y("a"),_.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,b=D(),k=y("a"),k.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,$=D(),C=y("div"),C.textContent="Authentication",T=D(),O=y("a"),O.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,M=D(),E=y("a"),E.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,A=D(),L=y("a"),L.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,m(i,"class","sidebar-title"),m(l,"href","/settings"),m(l,"class","sidebar-list-item"),m(r,"href","/settings/mail"),m(r,"class","sidebar-list-item"),m(u,"href","/settings/storage"),m(u,"class","sidebar-list-item"),m(d,"href","/settings/backups"),m(d,"class","sidebar-list-item"),m(h,"class","sidebar-title"),m(_,"href","/settings/export-collections"),m(_,"class","sidebar-list-item"),m(k,"href","/settings/import-collections"),m(k,"class","sidebar-list-item"),m(C,"class","sidebar-title"),m(O,"href","/settings/auth-providers"),m(O,"class","sidebar-list-item"),m(E,"href","/settings/tokens"),m(E,"class","sidebar-list-item"),m(L,"href","/settings/admins"),m(L,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(F,q){S(F,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,h),v(t,g),v(t,_),v(t,b),v(t,k),v(t,$),v(t,C),v(t,T),v(t,O),v(t,M),v(t,E),v(t,A),v(t,L),N||(R=[Ee(zn.call(null,l,{path:"/settings"})),Ee(rn.call(null,l)),Ee(zn.call(null,r,{path:"/settings/mail/?.*"})),Ee(rn.call(null,r)),Ee(zn.call(null,u,{path:"/settings/storage/?.*"})),Ee(rn.call(null,u)),Ee(zn.call(null,d,{path:"/settings/backups/?.*"})),Ee(rn.call(null,d)),Ee(zn.call(null,_,{path:"/settings/export-collections/?.*"})),Ee(rn.call(null,_)),Ee(zn.call(null,k,{path:"/settings/import-collections/?.*"})),Ee(rn.call(null,k)),Ee(zn.call(null,O,{path:"/settings/auth-providers/?.*"})),Ee(rn.call(null,O)),Ee(zn.call(null,E,{path:"/settings/tokens/?.*"})),Ee(rn.call(null,E)),Ee(zn.call(null,L,{path:"/settings/admins/?.*"})),Ee(rn.call(null,L))],N=!0)},p:te,i:te,o:te,d(F){F&&w(e),N=!1,De(R)}}}class Mi extends ve{constructor(e){super(),be(this,e,null,YE,_e,{})}}function vh(n,e,t){const i=n.slice();return i[30]=e[t],i}function yh(n){let e,t;return e=new me({props:{class:"form-field readonly",name:"id",$$slots:{default:[KE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",o=D(),r=y("div"),a=y("i"),f=D(),d=y("input"),m(t,"class",W.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"for",l=n[29]),m(a,"class","ri-calendar-event-line txt-disabled"),m(r,"class","form-field-addon"),m(d,"type","text"),m(d,"id",p=n[29]),d.value=h=n[1].id,d.readOnly=!0},m(b,k){S(b,e,k),v(e,t),v(e,i),v(e,s),S(b,o,k),S(b,r,k),v(r,a),S(b,f,k),S(b,d,k),g||(_=Ee(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),g=!0)},p(b,k){k[0]&536870912&&l!==(l=b[29])&&m(e,"for",l),u&&jt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${b[1].created}
Updated: ${b[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=b[29])&&m(d,"id",p),k[0]&2&&h!==(h=b[1].id)&&d.value!==h&&(d.value=h)},d(b){b&&w(e),b&&w(o),b&&w(r),b&&w(f),b&&w(d),g=!1,_()}}}function kh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=D(),_n(t.src,i="./images/avatars/avatar"+n[30]+".svg")||m(t,"src",i),m(t,"alt","Avatar "+n[30]),m(e,"type","button"),m(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),v(e,t),v(e,s),o||(r=J(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"))&&m(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Email",o=D(),r=y("input"),m(t,"class",W.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","email"),m(r,"autocomplete","off"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&m(r,"id",a),p[0]&8&&r.value!==d[3]&&ae(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function wh(n){let e,t;return e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[ZE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ZE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&m(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Sh(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"password",$$slots:{default:[GE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[XE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),B(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),m(e,"class","col-12")},m(f,d){S(f,e,d),v(e,t),v(t,i),z(s,i,null),v(t,l),v(t,o),z(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const h={};d[0]&536871424|d[1]&4&&(h.$$scope={dirty:d,ctx:f}),r.$set(h)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=Ve(t,rt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,rt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function GE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&m(r,"id",a),p[0]&256&&r.value!==d[8]&&ae(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password confirm",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),S(d,o,p),S(d,r,p),ae(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&m(r,"id",a),p[0]&512&&r.value!==d[9]&&ae(r,d[9])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function QE(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g=!n[1].$isNew&&yh(n),_=[0,1,2,3,4,5,6,7,8,9],b=[];for(let C=0;C<10;C+=1)b[C]=kh(vh(n,_,C));a=new me({props:{class:"form-field required",name:"email",$$slots:{default:[JE,({uniqueId:C})=>({29:C}),({uniqueId:C})=>[C?536870912:0]]},$$scope:{ctx:n}}});let k=!n[1].$isNew&&wh(n),$=(n[1].$isNew||n[4])&&Sh(n);return{c(){e=y("form"),g&&g.c(),t=D(),i=y("div"),s=y("p"),s.textContent="Avatar",l=D(),o=y("div");for(let C=0;C<10;C+=1)b[C].c();r=D(),B(a.$$.fragment),u=D(),k&&k.c(),f=D(),$&&$.c(),m(s,"class","section-title"),m(o,"class","flex flex-gap-xs flex-wrap"),m(i,"class","content"),m(e,"id",n[11]),m(e,"class","grid"),m(e,"autocomplete","off")},m(C,T){S(C,e,T),g&&g.m(e,null),v(e,t),v(e,i),v(i,s),v(i,l),v(i,o);for(let O=0;O<10;O+=1)b[O]&&b[O].m(o,null);v(e,r),z(a,e,null),v(e,u),k&&k.m(e,null),v(e,f),$&&$.m(e,null),d=!0,p||(h=J(e,"submit",xe(n[12])),p=!0)},p(C,T){if(C[1].$isNew?g&&(ue(),P(g,1,1,()=>{g=null}),fe()):g?(g.p(C,T),T[0]&2&&I(g,1)):(g=yh(C),g.c(),I(g,1),g.m(e,t)),T[0]&4){_=[0,1,2,3,4,5,6,7,8,9];let M;for(M=0;M<10;M+=1){const E=vh(C,_,M);b[M]?b[M].p(E,T):(b[M]=kh(E),b[M].c(),b[M].m(o,null))}for(;M<10;M+=1)b[M].d(1)}const O={};T[0]&536870920|T[1]&4&&(O.$$scope={dirty:T,ctx:C}),a.$set(O),C[1].$isNew?k&&(ue(),P(k,1,1,()=>{k=null}),fe()):k?(k.p(C,T),T[0]&2&&I(k,1)):(k=wh(C),k.c(),I(k,1),k.m(e,f)),C[1].$isNew||C[4]?$?($.p(C,T),T[0]&18&&I($,1)):($=Sh(C),$.c(),I($,1),$.m(e,null)):$&&(ue(),P($,1,1,()=>{$=null}),fe())},i(C){d||(I(g),I(a.$$.fragment,C),I(k),I($),d=!0)},o(C){P(g),P(a.$$.fragment,C),P(k),P($),d=!1},d(C){C&&w(e),g&&g.d(),ht(b,C),H(a),k&&k.d(),$&&$.d(),p=!1,h()}}}function xE(n){let e,t=n[1].$isNew?"New admin":"Edit admin",i;return{c(){e=y("h4"),i=Y(t)},m(s,l){S(s,e,l),v(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 $h(n){let e,t,i,s,l,o,r,a,u;return o=new Jn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[eD]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("span"),i=D(),s=y("i"),l=D(),B(o.$$.fragment),r=D(),a=y("div"),m(s,"class","ri-more-line"),m(e,"type","button"),m(e,"aria-label","More"),m(e,"class","btn btn-sm btn-circle btn-transparent"),m(a,"class","flex-fill")},m(f,d){S(f,e,d),v(e,t),v(e,i),v(e,s),v(e,l),z(o,e,null),S(f,r,d),S(f,a,d),u=!0},p(f,d){const p={};d[1]&4&&(p.$$scope={dirty:d,ctx:f}),o.$set(p)},i(f){u||(I(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&w(e),H(o),f&&w(r),f&&w(a)}}}function eD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,h=!n[1].$isNew&&$h(n);return{c(){h&&h.c(),e=D(),t=y("button"),i=y("span"),i.textContent="Cancel",s=D(),l=y("button"),o=y("span"),a=Y(r),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-transparent"),t.disabled=n[6],m(o,"class","txt"),m(l,"type","submit"),m(l,"form",n[11]),m(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(g,_){h&&h.m(g,_),S(g,e,_),S(g,t,_),v(t,i),S(g,s,_),S(g,l,_),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(g,_){g[1].$isNew?h&&(ue(),P(h,1,1,()=>{h=null}),fe()):h?(h.p(g,_),_[0]&2&&I(h,1)):(h=$h(g),h.c(),I(h,1),h.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=g[6]),(!f||_[0]&2)&&r!==(r=g[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||_[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),(!f||_[0]&64)&&x(l,"btn-loading",g[6])},i(g){f||(I(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&w(e),g&&w(t),g&&w(s),g&&w(l),d=!1,p()}}}function nD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[tD],header:[xE],default:[QE]},$$scope:{ctx:n}};return e=new on({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){B(e.$$.fragment)},m(s,l){z(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||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),H(e,s)}}}function iD(n,e,t){let i;const s=Tt(),l="admin_"+W.randomString(5);let o,r=new rs,a=!1,u=!1,f=0,d="",p="",h="",g=!1;function _(j){return k(j),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function k(j){t(1,r=j!=null&&j.$clone?j.$clone():new rs),$()}function $(){t(4,g=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,h=""),tn({})}function C(){if(a||!i)return;t(6,a=!0);const j={email:d,avatar:f};(r.$isNew||g)&&(j.password=p,j.passwordConfirm=h);let Q;r.$isNew?Q=de.admins.create(j):Q=de.admins.update(r.id,j),Q.then(async X=>{var Z;t(7,u=!1),b(),Ht(r.$isNew?"Successfully created admin.":"Successfully updated admin."),((Z=de.authStore.model)==null?void 0:Z.id)===X.id&&de.authStore.save(de.authStore.token,X),s("save",X)}).catch(X=>{de.error(X)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&mn("Do you really want to delete the selected admin?",()=>de.admins.delete(r.id).then(()=>{t(7,u=!1),b(),Ht("Successfully deleted admin."),s("delete",r)}).catch(j=>{de.error(j)}))}const O=()=>T(),M=()=>b(),E=j=>t(2,f=j);function A(){d=this.value,t(3,d)}function L(){g=this.checked,t(4,g)}function N(){p=this.value,t(8,p)}function R(){h=this.value,t(9,h)}const F=()=>i&&u?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function q(j){ne[j?"unshift":"push"](()=>{o=j,t(5,o)})}function V(j){he.call(this,n,j)}function U(j){he.call(this,n,j)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||g||d!==r.email||f!==r.avatar)},[b,r,f,d,g,o,a,u,p,h,i,l,C,T,_,O,M,E,A,L,N,R,F,q,V,U]}class sD extends ve{constructor(e){super(),be(this,e,iD,nD,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Th(n,e,t){const i=n.slice();return i[24]=e[t],i}function lD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="id",m(t,"class",W.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function oD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="email",m(t,"class",W.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function rD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="created",m(t,"class",W.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function aD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="updated",m(t,"class",W.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(e,s)},p:te,d(l){l&&w(e)}}}function Ch(n){let e;function t(l,o){return l[5]?fD:uD}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 uD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Mh(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No admins found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Mh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function fD(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function Mh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Oh(n){let e;return{c(){e=y("span"),e.textContent="You",m(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Eh(n,e){let t,i,s,l,o,r,a,u,f,d,p,h=e[24].id+"",g,_,b,k,$,C=e[24].email+"",T,O,M,E,A,L,N,R,F,q,V,U,j,Q;f=new Fl({props:{value:e[24].id}});let X=e[24].id===e[7].id&&Oh();A=new $i({props:{date:e[24].created}}),R=new $i({props:{date:e[24].updated}});function Z(){return e[15](e[24])}function re(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=D(),a=y("td"),u=y("div"),B(f.$$.fragment),d=D(),p=y("span"),g=Y(h),_=D(),X&&X.c(),b=D(),k=y("td"),$=y("span"),T=Y(C),M=D(),E=y("td"),B(A.$$.fragment),L=D(),N=y("td"),B(R.$$.fragment),F=D(),q=y("td"),q.innerHTML='<i class="ri-arrow-right-line"></i>',V=D(),_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||m(l,"src",o),m(l,"alt","Admin avatar"),m(s,"class","thumb thumb-sm thumb-circle"),m(i,"class","min-width"),m(p,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m($,"class","txt txt-ellipsis"),m($,"title",O=e[24].email),m(k,"class","col-type-email col-field-email"),m(E,"class","col-type-date col-field-created"),m(N,"class","col-type-date col-field-updated"),m(q,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(ee,se){S(ee,t,se),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),z(f,u,null),v(u,d),v(u,p),v(p,g),v(a,_),X&&X.m(a,null),v(t,b),v(t,k),v(k,$),v($,T),v(t,M),v(t,E),z(A,E,null),v(t,L),v(t,N),z(R,N,null),v(t,F),v(t,q),v(t,V),U=!0,j||(Q=[J(t,"click",Z),J(t,"keydown",re)],j=!0)},p(ee,se){e=ee,(!U||se&16&&!_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const ye={};se&16&&(ye.value=e[24].id),f.$set(ye),(!U||se&16)&&h!==(h=e[24].id+"")&&le(g,h),e[24].id===e[7].id?X||(X=Oh(),X.c(),X.m(a,null)):X&&(X.d(1),X=null),(!U||se&16)&&C!==(C=e[24].email+"")&&le(T,C),(!U||se&16&&O!==(O=e[24].email))&&m($,"title",O);const $e={};se&16&&($e.date=e[24].created),A.$set($e);const ze={};se&16&&(ze.date=e[24].updated),R.$set(ze)},i(ee){U||(I(f.$$.fragment,ee),I(A.$$.fragment,ee),I(R.$$.fragment,ee),U=!0)},o(ee){P(f.$$.fragment,ee),P(A.$$.fragment,ee),P(R.$$.fragment,ee),U=!1},d(ee){ee&&w(t),H(f),X&&X.d(),H(A),H(R),j=!1,De(Q)}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O=[],M=new Map,E;function A(Z){n[11](Z)}let L={class:"col-type-text",name:"id",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new un({props:L}),ne.push(()=>pe(o,"sort",A));function N(Z){n[12](Z)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[oD]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new un({props:R}),ne.push(()=>pe(u,"sort",N));function F(Z){n[13](Z)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[rD]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new un({props:q}),ne.push(()=>pe(p,"sort",F));function V(Z){n[14](Z)}let U={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[aD]},$$scope:{ctx:n}};n[2]!==void 0&&(U.sort=n[2]),_=new un({props:U}),ne.push(()=>pe(_,"sort",V));let j=n[4];const Q=Z=>Z[24].id;for(let Z=0;Z<j.length;Z+=1){let re=Th(n,j,Z),ee=Q(re);M.set(ee,O[Z]=Eh(ee,re))}let X=null;return j.length||(X=Ch(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=D(),B(o.$$.fragment),a=D(),B(u.$$.fragment),d=D(),B(p.$$.fragment),g=D(),B(_.$$.fragment),k=D(),$=y("th"),C=D(),T=y("tbody");for(let Z=0;Z<O.length;Z+=1)O[Z].c();X&&X.c(),m(s,"class","min-width"),m($,"class","col-type-action min-width"),m(e,"class","table"),x(e,"table-loading",n[5])},m(Z,re){S(Z,e,re),v(e,t),v(t,i),v(i,s),v(i,l),z(o,i,null),v(i,a),z(u,i,null),v(i,d),z(p,i,null),v(i,g),z(_,i,null),v(i,k),v(i,$),v(e,C),v(e,T);for(let ee=0;ee<O.length;ee+=1)O[ee]&&O[ee].m(T,null);X&&X.m(T,null),E=!0},p(Z,re){const ee={};re&134217728&&(ee.$$scope={dirty:re,ctx:Z}),!r&&re&4&&(r=!0,ee.sort=Z[2],ge(()=>r=!1)),o.$set(ee);const se={};re&134217728&&(se.$$scope={dirty:re,ctx:Z}),!f&&re&4&&(f=!0,se.sort=Z[2],ge(()=>f=!1)),u.$set(se);const ye={};re&134217728&&(ye.$$scope={dirty:re,ctx:Z}),!h&&re&4&&(h=!0,ye.sort=Z[2],ge(()=>h=!1)),p.$set(ye);const $e={};re&134217728&&($e.$$scope={dirty:re,ctx:Z}),!b&&re&4&&(b=!0,$e.sort=Z[2],ge(()=>b=!1)),_.$set($e),re&186&&(j=Z[4],ue(),O=vt(O,re,Q,1,Z,j,M,T,Ut,Eh,null,Th),fe(),!j.length&&X?X.p(Z,re):j.length?X&&(X.d(1),X=null):(X=Ch(Z),X.c(),X.m(T,null))),(!E||re&32)&&x(e,"table-loading",Z[5])},i(Z){if(!E){I(o.$$.fragment,Z),I(u.$$.fragment,Z),I(p.$$.fragment,Z),I(_.$$.fragment,Z);for(let re=0;re<j.length;re+=1)I(O[re]);E=!0}},o(Z){P(o.$$.fragment,Z),P(u.$$.fragment,Z),P(p.$$.fragment,Z),P(_.$$.fragment,Z);for(let re=0;re<O.length;re+=1)P(O[re]);E=!1},d(Z){Z&&w(e),H(o),H(u),H(p),H(_);for(let re=0;re<O.length;re+=1)O[re].d();X&&X.d()}}}function Dh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=y("small"),t=Y("Showing "),s=Y(i),l=Y(" of "),r=Y(o),m(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),v(e,t),v(e,s),v(e,l),v(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 dD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E;a=new Zo({}),a.$on("refresh",n[8]),g=new Jo({props:{value:n[1],placeholder:"Search term or filter like email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]),$=new Va({props:{class:"table-wrapper",$$slots:{default:[cD]},$$scope:{ctx:n}}});let A=n[4].length&&Dh(n);return{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[6]),r=D(),B(a.$$.fragment),u=D(),f=y("div"),d=D(),p=y("button"),p.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,h=D(),B(g.$$.fragment),_=D(),b=y("div"),k=D(),B($.$$.fragment),C=D(),A&&A.c(),T=we(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(p,"type","button"),m(p,"class","btn btn-expanded"),m(e,"class","page-header"),m(b,"class","clearfix m-b-base")},m(L,N){S(L,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),z(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),S(L,h,N),z(g,L,N),S(L,_,N),S(L,b,N),S(L,k,N),z($,L,N),S(L,C,N),A&&A.m(L,N),S(L,T,N),O=!0,M||(E=J(p,"click",n[9]),M=!0)},p(L,N){(!O||N&64)&&le(o,L[6]);const R={};N&2&&(R.value=L[1]),g.$set(R);const F={};N&134217918&&(F.$$scope={dirty:N,ctx:L}),$.$set(F),L[4].length?A?A.p(L,N):(A=Dh(L),A.c(),A.m(T.parentNode,T)):A&&(A.d(1),A=null)},i(L){O||(I(a.$$.fragment,L),I(g.$$.fragment,L),I($.$$.fragment,L),O=!0)},o(L){P(a.$$.fragment,L),P(g.$$.fragment,L),P($.$$.fragment,L),O=!1},d(L){L&&w(e),H(a),L&&w(h),H(g,L),L&&w(_),L&&w(b),L&&w(k),H($,L),L&&w(C),A&&A.d(L),L&&w(T),M=!1,E()}}}function pD(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[dD]},$$scope:{ctx:n}}});let r={};return l=new sD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[18](null),H(l,a)}}}function mD(n,e,t){let i,s,l;Ze(n,Ca,R=>t(21,i=R)),Ze(n,Mt,R=>t(6,s=R)),Ze(n,qa,R=>t(7,l=R)),ln(Mt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){t(5,u=!0),t(4,a=[]);const R=W.normalizeSearchFilter(f,["id","email","created","updated"]);return de.admins.getFullList(100,{sort:d||"-created",filter:R}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),de.error(F,!1))})}function h(){t(4,a=[])}const g=()=>p(),_=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function $(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}const O=R=>r==null?void 0:r.show(R),M=(R,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(R))},E=()=>t(1,f="");function A(R){ne[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>p(),N=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Vi("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,g,_,b,k,$,C,T,O,M,E,A,L,N]}class hD extends ve{constructor(e){super(),be(this,e,mD,pD,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function _D(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Email"),s=D(),l=y("input"),m(e,"for",i=n[8]),m(l,"type","email"),m(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&m(e,"for",i),f&256&&o!==(o=u[8])&&m(l,"id",o),f&1&&l.value!==u[0]&&ae(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gD(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=Y("Password"),s=D(),l=y("input"),r=D(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",m(e,"for",i=n[8]),m(l,"type","password"),m(l,"id",o=n[8]),l.required=!0,m(u,"href","/request-password-reset"),m(u,"class","link-hint"),m(a,"class","help-block")},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[1]),S(p,r,h),S(p,a,h),v(a,u),f||(d=[J(l,"input",n[5]),Ee(rn.call(null,u))],f=!0)},p(p,h){h&256&&i!==(i=p[8])&&m(e,"for",i),h&256&&o!==(o=p[8])&&m(l,"id",o),h&2&&l.value!==p[1]&&ae(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,De(d)}}}function bD(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new me({props:{class:"form-field required",name:"identity",$$slots:{default:[_D,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[gD,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),B(s.$$.fragment),l=D(),B(o.$$.fragment),r=D(),a=y("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(a,"type","submit"),m(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),m(e,"class","block")},m(p,h){S(p,e,h),v(e,t),v(e,i),z(s,e,null),v(e,l),z(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",xe(n[3])),f=!0)},p(p,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:p}),s.$set(g);const _={};h&770&&(_.$$scope={dirty:h,ctx:p}),o.$set(_),(!u||h&4)&&x(a,"btn-disabled",p[2]),(!u||h&4)&&x(a,"btn-loading",p[2])},i(p){u||(I(s.$$.fragment,p),I(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&w(e),H(s),H(o),f=!1,d()}}}function vD(n){let e,t;return e=new bb({props:{$$slots:{default:[bD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yD(n,e,t){let i;Ze(n,Ca,d=>t(6,i=d));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),de.admins.authWithPassword(l,o).then(()=>{Fa(),Vi("/")}).catch(()=>{As("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 kD extends ve{constructor(e){super(),be(this,e,yD,vD,_e,{})}}function wD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O;i=new me({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[$D,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[TD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[CD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[MD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Ah(n);return{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),B(a.$$.fragment),u=D(),B(f.$$.fragment),d=D(),p=y("div"),h=y("div"),g=D(),M&&M.c(),_=D(),b=y("button"),k=y("span"),k.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(h,"class","flex-fill"),m(k,"class","txt"),m(b,"type","submit"),m(b,"class","btn btn-expanded"),b.disabled=$=!n[3]||n[2],x(b,"btn-loading",n[2]),m(p,"class","col-lg-12 flex"),m(e,"class","grid")},m(E,A){S(E,e,A),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),z(a,e,null),v(e,u),z(f,e,null),v(e,d),v(e,p),v(p,h),v(p,g),M&&M.m(p,null),v(p,_),v(p,b),v(b,k),C=!0,T||(O=J(b,"click",n[13]),T=!0)},p(E,A){const L={};A&1572865&&(L.$$scope={dirty:A,ctx:E}),i.$set(L);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:E}),o.$set(N);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:E}),a.$set(R);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:E}),f.$set(F),E[3]?M?M.p(E,A):(M=Ah(E),M.c(),M.m(p,_)):M&&(M.d(1),M=null),(!C||A&12&&$!==($=!E[3]||E[2]))&&(b.disabled=$),(!C||A&4)&&x(b,"btn-loading",E[2])},i(E){C||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(a.$$.fragment,E),I(f.$$.fragment,E),C=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(a.$$.fragment,E),P(f.$$.fragment,E),C=!1},d(E){E&&w(e),H(i),H(o),H(a),H(f),M&&M.d(),T=!1,O()}}}function SD(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function $D(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Application name"),s=D(),l=y("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ae(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function TD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Application url"),s=D(),l=y("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].meta.appUrl),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&ae(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Logs max days retention"),s=D(),l=y("input"),m(e,"for",i=n[19]),m(l,"type","number"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].logs.maxDays),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].logs.maxDays&&ae(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function MD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Hide collection create and edit controls",o=D(),r=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[19]),m(l,"class","txt"),m(r,"class","ri-information-line link-hint"),m(s,"for",a=n[19])},m(d,p){S(d,e,p),e.checked=n[0].meta.hideControls,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Be.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(d,p){p&524288&&t!==(t=d[19])&&m(e,"id",t),p&1&&(e.checked=d[0].meta.hideControls),p&524288&&a!==(a=d[19])&&m(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Ah(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function OD(n){let e,t,i,s,l,o,r,a,u;const f=[SD,wD],d=[];function p(h,g){return h[1]?0:1}return l=p(n),o=d[l]=f[l](n),{c(){e=y("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=y("div"),s=y("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(h,g){S(h,e,g),S(h,t,g),S(h,i,g),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",xe(n[4])),a=!0)},p(h,g){let _=l;l=p(h),l===_?d[l].p(h,g):(ue(),P(d[_],1,1,()=>{d[_]=null}),fe(),o=d[l],o?o.p(h,g):(o=d[l]=f[l](h),o.c()),I(o,1),o.m(s,null))},i(h){r||(I(o),r=!0)},o(h){P(o),r=!1},d(h){h&&w(e),h&&w(t),h&&w(i),d[l].d(),a=!1,u()}}}function ED(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[OD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function DD(n,e,t){let i,s,l,o;Ze(n,Is,M=>t(14,s=M)),Ze(n,So,M=>t(15,l=M)),Ze(n,Mt,M=>t(16,o=M)),ln(Mt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const M=await de.settings.getAll()||{};g(M)}catch(M){de.error(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await de.settings.update(W.filterRedactedProps(a));g(M),Ht("Successfully saved application settings.")}catch(M){de.error(M)}t(2,f=!1)}}function g(M={}){var E,A;ln(So,l=(E=M==null?void 0:M.meta)==null?void 0:E.appName,l),ln(Is,s=!!((A=M==null?void 0:M.meta)!=null&&A.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){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 $(){a.logs.maxDays=pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),O=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,h,_,r,d,b,k,$,C,T,O]}class AD extends ve{constructor(e){super(),be(this,e,DD,ED,_e,{})}}function ID(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=y("input"),ai(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ae(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ai(e,l=Ot(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ae(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function LD(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=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=y("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),ai(s,a)},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(Be.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ai(s,a=Ot(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,De(o)}}}function PD(n){let e;function t(l,o){return l[3]?LD:ID}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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:te,o:te,d(l){s.d(l),l&&w(e)}}}function ND(n,e,t){const i=["value","mask"];let s=tt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await cn(),r==null||r.focus()}const f=()=>u();function d(h){ne[h?"unshift":"push"](()=>{r=h,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),Gt(h)),t(5,s=tt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class hu extends ve{constructor(e){super(),be(this,e,ND,PD,_e,{value:0,mask:1})}}function FD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;return{c(){e=y("label"),t=Y("Subject"),s=D(),l=y("input"),r=D(),a=y("div"),u=Y(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=Y(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=Y("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(b,k){S(b,e,k),v(e,t),S(b,s,k),S(b,l,k),ae(l,n[0].subject),S(b,r,k),S(b,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,h),g||(_=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],g=!0)},p(b,k){k[1]&1&&i!==(i=b[31])&&m(e,"for",i),k[1]&1&&o!==(o=b[31])&&m(l,"id",o),k[0]&1&&l.value!==b[0].subject&&ae(l,b[0].subject)},d(b){b&&w(e),b&&w(s),b&&w(l),b&&w(r),b&&w(a),g=!1,De(_)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k;return{c(){e=y("label"),t=Y("Action URL"),s=D(),l=y("input"),r=D(),a=y("div"),u=Y(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=Y(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=Y(`,
`),g=y("button"),g.textContent=`{TOKEN}
`,_=Y("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(g,"type","button"),m(g,"class","label label-sm link-primary txt-mono"),m(g,"title","Required parameter"),m(a,"class","help-block")},m($,C){S($,e,C),v(e,t),S($,s,C),S($,l,C),ae(l,n[0].actionUrl),S($,r,C),S($,a,C),v(a,u),v(a,f),v(a,d),v(a,p),v(a,h),v(a,g),v(a,_),b||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(g,"click",n[19])],b=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&m(e,"for",i),C[1]&1&&o!==(o=$[31])&&m(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&ae(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),b=!1,De(k)}}}function qD(n){let e,t,i,s;return{c(){e=y("textarea"),m(e,"id",t=n[31]),m(e,"class","txt-mono"),m(e,"spellcheck","false"),m(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ae(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&ae(e,l[0].body)},i:te,o:te,d(l){l&&w(e),i=!1,s()}}}function jD(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=Rt(o,r(n)),ne.push(()=>pe(e,"value",l))),{c(){e&&B(e.$$.fragment),i=we()},m(a,u){e&&z(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,ge(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ue();const d=e;P(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}o?(e=Rt(o,r(a)),ne.push(()=>pe(e,"value",l)),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&H(e,a)}}}function VD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T;const O=[jD,qD],M=[];function E(A,L){return A[4]&&!A[5]?0:1}return l=E(n),o=M[l]=O[l](n),{c(){e=y("label"),t=Y("Body (HTML)"),s=D(),o.c(),r=D(),a=y("div"),u=Y(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=Y(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=Y(`,
`),g=y("button"),g.textContent=`{TOKEN}
`,_=Y(`,
`),b=y("button"),b.textContent=`{ACTION_URL}
`,k=Y("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(g,"type","button"),m(g,"class","label label-sm link-primary txt-mono"),m(b,"type","button"),m(b,"class","label label-sm link-primary txt-mono"),m(b,"title","Required parameter"),m(a,"class","help-block")},m(A,L){S(A,e,L),v(e,t),S(A,s,L),M[l].m(A,L),S(A,r,L),S(A,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,h),v(a,g),v(a,_),v(a,b),v(a,k),$=!0,C||(T=[J(f,"click",n[22]),J(p,"click",n[23]),J(g,"click",n[24]),J(b,"click",n[25])],C=!0)},p(A,L){(!$||L[1]&1&&i!==(i=A[31]))&&m(e,"for",i);let N=l;l=E(A),l===N?M[l].p(A,L):(ue(),P(M[N],1,1,()=>{M[N]=null}),fe(),o=M[l],o?o.p(A,L):(o=M[l]=O[l](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){$||(I(o),$=!0)},o(A){P(o),$=!1},d(A){A&&w(e),A&&w(s),M[l].d(A),A&&w(r),A&&w(a),C=!1,De(T)}}}function zD(n){let e,t,i,s,l,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[FD,({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:[RD,({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:[VD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(i,r,a),S(r,s,a),z(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 d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&w(t),H(i,r),r&&w(s),H(l,r)}}}function Ih(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Ee(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function HD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ih();return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),l=Y(n[2]),o=D(),r=y("div"),a=D(),f&&f.c(),u=we(),m(t,"class","ri-draft-line"),m(s,"class","txt"),m(e,"class","inline-flex"),m(r,"class","flex-fill")},m(d,p){S(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&I(f,1):(f=Ih(),f.c(),I(f,1),f.m(u.parentNode,u)):f&&(ue(),P(f,1,1,()=>{f=null}),fe())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function BD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[HD],default:[zD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=je(s,i[l]);return e=new co({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){B(e.$$.fragment)},m(l,o){z(e,l,o),t=!0},p(l,o){const r=o[0]&256?Ot(i,[Qt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Lh;function UD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=tt(e,s),o;Ze(n,Ti,Z=>t(12,o=Z));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=Lh,p=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function b(){d||p||(t(5,p=!0),t(4,d=(await ut(()=>import("./CodeEditor-cdb3aab1.js"),["./CodeEditor-cdb3aab1.js","./index-8b57b6cd.js"],import.meta.url)).default),Lh=d,t(5,p=!1))}function k(Z){W.copyToClipboard(Z),yo(`Copied ${Z} to clipboard`,2e3)}b();function $(){u.subject=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function O(){u.actionUrl=this.value,t(0,u)}const M=()=>k("{APP_NAME}"),E=()=>k("{APP_URL}"),A=()=>k("{TOKEN}");function L(Z){n.$$.not_equal(u.body,Z)&&(u.body=Z,t(0,u))}function N(){u.body=this.value,t(0,u)}const R=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),q=()=>k("{TOKEN}"),V=()=>k("{ACTION_URL}");function U(Z){ne[Z?"unshift":"push"](()=>{f=Z,t(3,f)})}function j(Z){he.call(this,n,Z)}function Q(Z){he.call(this,n,Z)}function X(Z){he.call(this,n,Z)}return n.$$set=Z=>{e=je(je({},e),Gt(Z)),t(8,l=tt(e,s)),"key"in Z&&t(1,r=Z.key),"title"in Z&&t(2,a=Z.title),"config"in Z&&t(0,u=Z.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!W.isEmpty(W.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ui(r))},[u,r,a,f,d,p,i,k,l,h,g,_,o,$,C,T,O,M,E,A,L,N,R,F,q,V,U,j,Q,X]}class jr extends ve{constructor(e){super(),be(this,e,UD,BD,_e,{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 Ph(n,e,t){const i=n.slice();return i[21]=e[t],i}function Nh(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,d,p,h;return d=Y1(e[11][0]),{key:n,first:null,c(){t=y("div"),i=y("input"),l=D(),o=y("label"),a=Y(r),f=D(),m(i,"type","radio"),m(i,"name","template"),m(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,i.value=i.__value,m(o,"for",u=e[20]+e[21].value),m(t,"class","form-field-block"),d.p(i),this.first=t},m(g,_){S(g,t,_),v(t,i),i.checked=i.__value===e[2],v(t,l),v(t,o),v(o,a),v(t,f),p||(h=J(i,"change",e[10]),p=!0)},p(g,_){e=g,_&1048576&&s!==(s=e[20]+e[21].value)&&m(i,"id",s),_&4&&(i.checked=i.__value===e[2]),_&1048576&&u!==(u=e[20]+e[21].value)&&m(o,"for",u)},d(g){g&&w(t),d.r(),p=!1,h()}}}function WD(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[21].value;for(let o=0;o<s.length;o+=1){let r=Ph(n,s,o),a=l(r);t.set(a,e[o]=Nh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r&1048708&&(s=o[7],e=vt(e,r,l,1,o,s,t,i.parentNode,us,Nh,i,Ph))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function YD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("To email address"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","email"),m(l,"id",o=n[20]),l.autofocus=!0,l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[1]),l.focus(),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&m(e,"for",i),f&1048576&&o!==(o=u[20])&&m(l,"id",o),f&2&&l.value!==u[1]&&ae(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function KD(n){let e,t,i,s,l,o,r;return t=new me({props:{class:"form-field required",name:"template",$$slots:{default:[WD,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new me({props:{class:"form-field required m-0",name:"email",$$slots:{default:[YD,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),B(t.$$.fragment),i=D(),B(s.$$.fragment),m(e,"id",n[6]),m(e,"autocomplete","off")},m(a,u){S(a,e,u),z(t,e,null),v(e,i),z(s,e,null),l=!0,o||(r=J(e,"submit",xe(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const d={};u&17825794&&(d.$$scope={dirty:u,ctx:a}),s.$set(d)},i(a){l||(I(t.$$.fragment,a),I(s.$$.fragment,a),l=!0)},o(a){P(t.$$.fragment,a),P(s.$$.fragment,a),l=!1},d(a){a&&w(e),H(t),H(s),o=!1,r()}}}function JD(n){let e;return{c(){e=y("h4"),e.textContent="Send test email",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function ZD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=Y("Close"),i=D(),s=y("button"),l=y("i"),o=D(),r=y("span"),r.textContent="Send",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","ri-mail-send-line"),m(r,"class","txt"),m(s,"type","submit"),m(s,"form",n[6]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],x(s,"btn-loading",n[4])},m(d,p){S(d,e,p),v(e,t),S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&16&&(e.disabled=d[4]),p&48&&a!==(a=!d[5]||d[4])&&(s.disabled=a),p&16&&x(s,"btn-loading",d[4])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function GD(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[ZD],header:[JD],default:[KD]},$$scope:{ctx:n}};return e=new on({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[15](null),H(e,s)}}}const Vr="last_email_test",Fh="email_test_request";function XD(n,e,t){let i;const s=Tt(),l="email_test_"+W.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(Vr),u=o[0].value,f=!1,d=null;function p(E="",A=""){t(1,a=E||localStorage.getItem(Vr)),t(2,u=A||o[0].value),tn({}),r==null||r.show()}function h(){return clearTimeout(d),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Vr,a),clearTimeout(d),d=setTimeout(()=>{de.cancelRequest(Fh),As("Test email send timeout.")},3e4);try{await de.settings.testEmail(a,u,{$cancelKey:Fh}),Ht("Successfully sent test email."),s("submit"),t(4,f=!1),await cn(),h()}catch(E){t(4,f=!1),de.error(E)}clearTimeout(d)}}const _=[[]];function b(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const $=()=>g(),C=()=>!f;function T(E){ne[E?"unshift":"push"](()=>{r=E,t(3,r)})}function O(E){he.call(this,n,E)}function M(E){he.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,g,p,b,_,k,$,C,T,O,M]}class QD extends ve{constructor(e){super(),be(this,e,XD,GD,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function xD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L,N;i=new me({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[tA,({uniqueId:ee})=>({31:ee}),({uniqueId:ee})=>[0,ee?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[nA,({uniqueId:ee})=>({31:ee}),({uniqueId:ee})=>[0,ee?1:0]]},$$scope:{ctx:n}}});function R(ee){n[14](ee)}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 jr({props:F}),ne.push(()=>pe(u,"config",R));function q(ee){n[15](ee)}let V={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(V.config=n[0].meta.resetPasswordTemplate),p=new jr({props:V}),ne.push(()=>pe(p,"config",q));function U(ee){n[16](ee)}let j={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(j.config=n[0].meta.confirmEmailChangeTemplate),_=new jr({props:j}),ne.push(()=>pe(_,"config",U)),T=new me({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[iA,({uniqueId:ee})=>({31:ee}),({uniqueId:ee})=>[0,ee?1:0]]},$$scope:{ctx:n}}});let Q=n[0].smtp.enabled&&Rh(n);function X(ee,se){return ee[4]?cA:fA}let Z=X(n),re=Z(n);return{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),a=y("div"),B(u.$$.fragment),d=D(),B(p.$$.fragment),g=D(),B(_.$$.fragment),k=D(),$=y("hr"),C=D(),B(T.$$.fragment),O=D(),Q&&Q.c(),M=D(),E=y("div"),A=y("div"),L=D(),re.c(),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid m-b-base"),m(a,"class","accordions"),m(A,"class","flex-fill"),m(E,"class","flex")},m(ee,se){S(ee,e,se),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),S(ee,r,se),S(ee,a,se),z(u,a,null),v(a,d),z(p,a,null),v(a,g),z(_,a,null),S(ee,k,se),S(ee,$,se),S(ee,C,se),z(T,ee,se),S(ee,O,se),Q&&Q.m(ee,se),S(ee,M,se),S(ee,E,se),v(E,A),v(E,L),re.m(E,null),N=!0},p(ee,se){const ye={};se[0]&1|se[1]&3&&(ye.$$scope={dirty:se,ctx:ee}),i.$set(ye);const $e={};se[0]&1|se[1]&3&&($e.$$scope={dirty:se,ctx:ee}),o.$set($e);const ze={};!f&&se[0]&1&&(f=!0,ze.config=ee[0].meta.verificationTemplate,ge(()=>f=!1)),u.$set(ze);const Ue={};!h&&se[0]&1&&(h=!0,Ue.config=ee[0].meta.resetPasswordTemplate,ge(()=>h=!1)),p.$set(Ue);const Se={};!b&&se[0]&1&&(b=!0,Se.config=ee[0].meta.confirmEmailChangeTemplate,ge(()=>b=!1)),_.$set(Se);const Oe={};se[0]&1|se[1]&3&&(Oe.$$scope={dirty:se,ctx:ee}),T.$set(Oe),ee[0].smtp.enabled?Q?(Q.p(ee,se),se[0]&1&&I(Q,1)):(Q=Rh(ee),Q.c(),I(Q,1),Q.m(M.parentNode,M)):Q&&(ue(),P(Q,1,1,()=>{Q=null}),fe()),Z===(Z=X(ee))&&re?re.p(ee,se):(re.d(1),re=Z(ee),re&&(re.c(),re.m(E,null)))},i(ee){N||(I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(p.$$.fragment,ee),I(_.$$.fragment,ee),I(T.$$.fragment,ee),I(Q),N=!0)},o(ee){P(i.$$.fragment,ee),P(o.$$.fragment,ee),P(u.$$.fragment,ee),P(p.$$.fragment,ee),P(_.$$.fragment,ee),P(T.$$.fragment,ee),P(Q),N=!1},d(ee){ee&&w(e),H(i),H(o),ee&&w(r),ee&&w(a),H(u),H(p),H(_),ee&&w(k),ee&&w($),ee&&w(C),H(T,ee),ee&&w(O),Q&&Q.d(ee),ee&&w(M),ee&&w(E),re.d()}}}function eA(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function tA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Sender name"),s=D(),l=y("input"),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].meta.senderName),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&m(e,"for",i),f[1]&1&&o!==(o=u[31])&&m(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&ae(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function nA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Sender address"),s=D(),l=y("input"),m(e,"for",i=n[31]),m(l,"type","email"),m(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].meta.senderAddress),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&m(e,"for",i),f[1]&1&&o!==(o=u[31])&&m(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&ae(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=D(),r=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[31]),e.required=!0,m(l,"class","txt"),m(r,"class","ri-information-line link-hint"),m(s,"for",a=n[31])},m(d,p){S(d,e,p),e.checked=n[0].smtp.enabled,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[17]),Ee(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(d,p){p[1]&1&&t!==(t=d[31])&&m(e,"id",t),p[0]&1&&(e.checked=d[0].smtp.enabled),p[1]&1&&a!==(a=d[31])&&m(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function Rh(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M;return i=new me({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[sA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[lA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[oA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),p=new me({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[rA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field",name:"smtp.username",$$slots:{default:[aA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),$=new me({props:{class:"form-field",name:"smtp.password",$$slots:{default:[uA,({uniqueId:E})=>({31:E}),({uniqueId:E})=>[0,E?1:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),a=y("div"),B(u.$$.fragment),f=D(),d=y("div"),B(p.$$.fragment),h=D(),g=y("div"),B(_.$$.fragment),b=D(),k=y("div"),B($.$$.fragment),C=D(),T=y("div"),m(t,"class","col-lg-4"),m(l,"class","col-lg-2"),m(a,"class","col-lg-3"),m(d,"class","col-lg-3"),m(g,"class","col-lg-6"),m(k,"class","col-lg-6"),m(T,"class","col-lg-12"),m(e,"class","grid")},m(E,A){S(E,e,A),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),v(e,a),z(u,a,null),v(e,f),v(e,d),z(p,d,null),v(e,h),v(e,g),z(_,g,null),v(e,b),v(e,k),z($,k,null),v(e,C),v(e,T),M=!0},p(E,A){const L={};A[0]&1|A[1]&3&&(L.$$scope={dirty:A,ctx:E}),i.$set(L);const N={};A[0]&1|A[1]&3&&(N.$$scope={dirty:A,ctx:E}),o.$set(N);const R={};A[0]&1|A[1]&3&&(R.$$scope={dirty:A,ctx:E}),u.$set(R);const F={};A[0]&1|A[1]&3&&(F.$$scope={dirty:A,ctx:E}),p.$set(F);const q={};A[0]&1|A[1]&3&&(q.$$scope={dirty:A,ctx:E}),_.$set(q);const V={};A[0]&1|A[1]&3&&(V.$$scope={dirty:A,ctx:E}),$.$set(V)},i(E){M||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(u.$$.fragment,E),I(p.$$.fragment,E),I(_.$$.fragment,E),I($.$$.fragment,E),E&&et(()=>{M&&(O||(O=Ve(e,rt,{duration:150},!0)),O.run(1))}),M=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(p.$$.fragment,E),P(_.$$.fragment,E),P($.$$.fragment,E),E&&(O||(O=Ve(e,rt,{duration:150},!1)),O.run(0)),M=!1},d(E){E&&w(e),H(i),H(o),H(u),H(p),H(_),H($),E&&O&&O.end()}}}function sA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("SMTP server host"),s=D(),l=y("input"),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].smtp.host),r||(a=J(l,"input",n[18]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&m(e,"for",i),f[1]&1&&o!==(o=u[31])&&m(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&ae(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function lA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Port"),s=D(),l=y("input"),m(e,"for",i=n[31]),m(l,"type","number"),m(l,"id",o=n[31]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].smtp.port),r||(a=J(l,"input",n[19]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&m(e,"for",i),f[1]&1&&o!==(o=u[31])&&m(l,"id",o),f[0]&1&&pt(l.value)!==u[0].smtp.port&&ae(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function oA(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 Bi({props:u}),ne.push(()=>pe(l,"keyOfSelected",a)),{c(){e=y("label"),t=Y("TLS encryption"),s=D(),B(l.$$.fragment),m(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.tls,ge(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function rA(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 Bi({props:u}),ne.push(()=>pe(l,"keyOfSelected",a)),{c(){e=y("label"),t=Y("AUTH method"),s=D(),B(l.$$.fragment),m(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.keyOfSelected=f[0].smtp.authMethod,ge(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Username"),s=D(),l=y("input"),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31])},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].smtp.username),r||(a=J(l,"input",n[22]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&m(e,"for",i),f[1]&1&&o!==(o=u[31])&&m(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&ae(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function uA(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 hu({props:u}),ne.push(()=>pe(l,"value",a)),{c(){e=y("label"),t=Y("Password"),s=D(),B(l.$$.fragment),m(e,"for",i=n[31])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const p={};d[1]&1&&(p.id=f[31]),!o&&d[0]&1&&(o=!0,p.value=f[0].smtp.password,ge(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function fA(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function cA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),l.textContent="Save changes",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(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&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function dA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b;const k=[eA,xD],$=[];function C(T,O){return T[2]?0:1}return p=C(n),h=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[5]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(T,r,O),S(T,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),g=!0,_||(b=J(u,"submit",xe(n[27])),_=!0)},p(T,O){(!g||O[0]&32)&&le(o,T[5]);let M=p;p=C(T),p===M?$[p].p(T,O):(ue(),P($[M],1,1,()=>{$[M]=null}),fe(),h=$[p],h?h.p(T,O):(h=$[p]=k[p](T),h.c()),I(h,1),h.m(u,null))},i(T){g||(I(h),g=!0)},o(T){P(h),g=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),_=!1,b()}}}function pA(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[dA]},$$scope:{ctx:n}}});let r={};return l=new QD({props:r}),n[28](l),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(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 d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[28](null),H(l,a)}}}function mA(n,e,t){let i,s,l;Ze(n,Mt,X=>t(5,l=X));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];ln(Mt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;h();async function h(){t(2,d=!0);try{const X=await de.settings.getAll()||{};_(X)}catch(X){de.error(X)}t(2,d=!1)}async function g(){if(!(p||!s)){t(3,p=!0);try{const X=await de.settings.update(W.filterRedactedProps(f));_(X),tn({}),Ht("Successfully saved mail settings.")}catch(X){de.error(X)}t(3,p=!1)}}function _(X={}){t(0,f={meta:(X==null?void 0:X.meta)||{},smtp:(X==null?void 0:X.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 $(){f.meta.senderAddress=this.value,t(0,f)}function C(X){n.$$.not_equal(f.meta.verificationTemplate,X)&&(f.meta.verificationTemplate=X,t(0,f))}function T(X){n.$$.not_equal(f.meta.resetPasswordTemplate,X)&&(f.meta.resetPasswordTemplate=X,t(0,f))}function O(X){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,X)&&(f.meta.confirmEmailChangeTemplate=X,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function L(X){n.$$.not_equal(f.smtp.tls,X)&&(f.smtp.tls=X,t(0,f))}function N(X){n.$$.not_equal(f.smtp.authMethod,X)&&(f.smtp.authMethod=X,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function F(X){n.$$.not_equal(f.smtp.password,X)&&(f.smtp.password=X,t(0,f))}const q=()=>b(),V=()=>g(),U=()=>a==null?void 0:a.show(),j=()=>g();function Q(X){ne[X?"unshift":"push"](()=>{a=X,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,d,p,s,l,o,r,g,b,u,i,k,$,C,T,O,M,E,A,L,N,R,F,q,V,U,j,Q]}class hA extends ve{constructor(e){super(),be(this,e,mA,pA,_e,{},null,[-1,-1])}}const _A=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),qh=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function gA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y(n[4]),m(e,"type","checkbox"),m(e,"id",t=n[20]),e.required=!0,m(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),v(s,l),r||(a=J(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&m(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&le(l,u[4]),f&1048576&&o!==(o=u[20])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function jh(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M;return i=new me({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[bA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[vA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[yA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),p=new me({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[kA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[wA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),$=new me({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[SA,({uniqueId:E})=>({20:E}),({uniqueId:E})=>E?1048576:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),B(i.$$.fragment),s=D(),l=y("div"),B(o.$$.fragment),r=D(),a=y("div"),B(u.$$.fragment),f=D(),d=y("div"),B(p.$$.fragment),h=D(),g=y("div"),B(_.$$.fragment),b=D(),k=y("div"),B($.$$.fragment),C=D(),T=y("div"),m(t,"class","col-lg-6"),m(l,"class","col-lg-3"),m(a,"class","col-lg-3"),m(d,"class","col-lg-6"),m(g,"class","col-lg-6"),m(k,"class","col-lg-12"),m(T,"class","col-lg-12"),m(e,"class","grid")},m(E,A){S(E,e,A),v(e,t),z(i,t,null),v(e,s),v(e,l),z(o,l,null),v(e,r),v(e,a),z(u,a,null),v(e,f),v(e,d),z(p,d,null),v(e,h),v(e,g),z(_,g,null),v(e,b),v(e,k),z($,k,null),v(e,C),v(e,T),M=!0},p(E,A){const L={};A&8&&(L.name=E[3]+".endpoint"),A&1081345&&(L.$$scope={dirty:A,ctx:E}),i.$set(L);const N={};A&8&&(N.name=E[3]+".bucket"),A&1081345&&(N.$$scope={dirty:A,ctx:E}),o.$set(N);const R={};A&8&&(R.name=E[3]+".region"),A&1081345&&(R.$$scope={dirty:A,ctx:E}),u.$set(R);const F={};A&8&&(F.name=E[3]+".accessKey"),A&1081345&&(F.$$scope={dirty:A,ctx:E}),p.$set(F);const q={};A&8&&(q.name=E[3]+".secret"),A&1081345&&(q.$$scope={dirty:A,ctx:E}),_.$set(q);const V={};A&8&&(V.name=E[3]+".forcePathStyle"),A&1081345&&(V.$$scope={dirty:A,ctx:E}),$.$set(V)},i(E){M||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(u.$$.fragment,E),I(p.$$.fragment,E),I(_.$$.fragment,E),I($.$$.fragment,E),E&&et(()=>{M&&(O||(O=Ve(e,rt,{duration:150},!0)),O.run(1))}),M=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(p.$$.fragment,E),P(_.$$.fragment,E),P($.$$.fragment,E),E&&(O||(O=Ve(e,rt,{duration:150},!1)),O.run(0)),M=!1},d(E){E&&w(e),H(i),H(o),H(u),H(p),H(_),H($),E&&O&&O.end()}}}function bA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Endpoint"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].endpoint),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&m(e,"for",i),f&1048576&&o!==(o=u[20])&&m(l,"id",o),f&1&&l.value!==u[0].endpoint&&ae(l,u[0].endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function vA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Bucket"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].bucket),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&m(e,"for",i),f&1048576&&o!==(o=u[20])&&m(l,"id",o),f&1&&l.value!==u[0].bucket&&ae(l,u[0].bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function yA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Region"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].region),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&m(e,"for",i),f&1048576&&o!==(o=u[20])&&m(l,"id",o),f&1&&l.value!==u[0].region&&ae(l,u[0].region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function kA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Access key"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[0].accessKey),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&m(e,"for",i),f&1048576&&o!==(o=u[20])&&m(l,"id",o),f&1&&l.value!==u[0].accessKey&&ae(l,u[0].accessKey)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new hu({props:u}),ne.push(()=>pe(l,"value",a)),{c(){e=y("label"),t=Y("Secret"),s=D(),B(l.$$.fragment),m(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&m(e,"for",i);const p={};d&1048576&&(p.id=f[20]),!o&&d&1&&(o=!0,p.value=f[0].secret,ge(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function SA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Force path-style addressing",o=D(),r=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[20]),m(l,"class","txt"),m(r,"class","ri-information-line link-hint"),m(s,"for",a=n[20])},m(d,p){S(d,e,p),e.checked=n[0].forcePathStyle,S(d,i,p),S(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[14]),Ee(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(d,p){p&1048576&&t!==(t=d[20])&&m(e,"id",t),p&1&&(e.checked=d[0].forcePathStyle),p&1048576&&a!==(a=d[20])&&m(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function $A(n){let e,t,i,s,l;e=new me({props:{class:"form-field form-field-toggle",$$slots:{default:[gA,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=kt(o,n,n[15],qh);let a=n[0].enabled&&jh(n);return{c(){B(e.$$.fragment),t=D(),r&&r.c(),i=D(),a&&a.c(),s=we()},m(u,f){z(e,u,f),S(u,t,f),r&&r.m(u,f),S(u,i,f),a&&a.m(u,f),S(u,s,f),l=!0},p(u,[f]){const d={};f&1081361&&(d.$$scope={dirty:f,ctx:u}),e.$set(d),r&&r.p&&(!l||f&32775)&&St(r,o,u,u[15],l?wt(o,u[15],f,_A):$t(u[15]),qh),u[0].enabled?a?(a.p(u,f),f&1&&I(a,1)):(a=jh(u),a.c(),I(a,1),a.m(s.parentNode,s)):a&&(ue(),P(a,1,1,()=>{a=null}),fe())},i(u){l||(I(e.$$.fragment,u),I(r,u),I(a),l=!0)},o(u){P(e.$$.fragment,u),P(r,u),P(a),l=!1},d(u){H(e,u),u&&w(t),r&&r.d(u),u&&w(i),a&&a.d(u),u&&w(s)}}}const zr="s3_test_request";function TA(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:d=!1}=e,p=null,h=null;function g(E){t(2,d=!0),clearTimeout(h),h=setTimeout(()=>{_()},E)}async function _(){if(t(1,f=null),!o.enabled)return t(2,d=!1),f;de.cancelRequest(zr),clearTimeout(p),p=setTimeout(()=>{de.cancelRequest(zr),t(1,f=new Error("S3 test connection timeout.")),t(2,d=!1)},3e4),t(2,d=!0);let E;try{await de.settings.testS3(u,{$cancelKey:zr})}catch(A){E=A}return E!=null&&E.isAbort||(t(1,f=E),t(2,d=!1),clearTimeout(p)),f}Xt(()=>()=>{clearTimeout(p),clearTimeout(h)});function b(){o.enabled=this.checked,t(0,o)}function k(){o.endpoint=this.value,t(0,o)}function $(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function O(E){n.$$.not_equal(o.secret,E)&&(o.secret=E,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=E=>{"originalConfig"in E&&t(5,l=E.originalConfig),"config"in E&&t(0,o=E.config),"configKey"in E&&t(3,r=E.configKey),"toggleLabel"in E&&t(4,a=E.toggleLabel),"testFilesystem"in E&&t(6,u=E.testFilesystem),"testError"in E&&t(1,f=E.testError),"isTesting"in E&&t(2,d=E.isTesting),"$$scope"in E&&t(15,s=E.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ui(r))},[o,f,d,r,a,l,u,i,b,k,$,C,T,O,M,s]}class M1 extends ve{constructor(e){super(),be(this,e,TA,$A,_e,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function CA(n){var E;let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b;function k(A){n[11](A)}function $(A){n[12](A)}function C(A){n[13](A)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[OA]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new M1({props:T}),ne.push(()=>pe(e,"config",k)),ne.push(()=>pe(e,"isTesting",$)),ne.push(()=>pe(e,"testError",C));let O=((E=n[1].s3)==null?void 0:E.enabled)&&!n[6]&&!n[3]&&zh(n),M=n[6]&&Hh(n);return{c(){B(e.$$.fragment),l=D(),o=y("div"),r=y("div"),a=D(),O&&O.c(),u=D(),M&&M.c(),f=D(),d=y("button"),p=y("span"),p.textContent="Save changes",m(r,"class","flex-fill"),m(p,"class","txt"),m(d,"type","submit"),m(d,"class","btn btn-expanded"),d.disabled=h=!n[6]||n[3],x(d,"btn-loading",n[3]),m(o,"class","flex")},m(A,L){z(e,A,L),S(A,l,L),S(A,o,L),v(o,r),v(o,a),O&&O.m(o,null),v(o,u),M&&M.m(o,null),v(o,f),v(o,d),v(d,p),g=!0,_||(b=J(d,"click",n[15]),_=!0)},p(A,L){var R;const N={};L&1&&(N.originalConfig=A[0].s3),L&524291&&(N.$$scope={dirty:L,ctx:A}),!t&&L&2&&(t=!0,N.config=A[1].s3,ge(()=>t=!1)),!i&&L&16&&(i=!0,N.isTesting=A[4],ge(()=>i=!1)),!s&&L&32&&(s=!0,N.testError=A[5],ge(()=>s=!1)),e.$set(N),(R=A[1].s3)!=null&&R.enabled&&!A[6]&&!A[3]?O?O.p(A,L):(O=zh(A),O.c(),O.m(o,u)):O&&(O.d(1),O=null),A[6]?M?M.p(A,L):(M=Hh(A),M.c(),M.m(o,f)):M&&(M.d(1),M=null),(!g||L&72&&h!==(h=!A[6]||A[3]))&&(d.disabled=h),(!g||L&8)&&x(d,"btn-loading",A[3])},i(A){g||(I(e.$$.fragment,A),g=!0)},o(A){P(e.$$.fragment,A),g=!1},d(A){H(e,A),A&&w(l),A&&w(o),O&&O.d(),M&&M.d(),_=!1,b()}}}function MA(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Vh(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,d,p=n[1].s3.enabled?"S3 storage":"local file system",h,g,_,b,k,$,C,T,O,M,E,A;return{c(){e=y("div"),t=y("div"),i=y("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=D(),l=y("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually
from the
`),r=y("strong"),u=Y(a),f=Y(`
to the
`),d=y("strong"),h=Y(p),g=Y(`.
`),_=y("br"),b=Y(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
`,$=Y(`,
`),C=y("a"),C.textContent=`s5cmd
`,T=Y(", etc."),O=D(),M=y("div"),m(i,"class","icon"),m(k,"href","https://github.com/rclone/rclone"),m(k,"target","_blank"),m(k,"rel","noopener noreferrer"),m(k,"class","txt-bold"),m(C,"href","https://github.com/peak/s5cmd"),m(C,"target","_blank"),m(C,"rel","noopener noreferrer"),m(C,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m(M,"class","clearfix m-t-base")},m(N,R){S(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,h),v(l,g),v(l,_),v(l,b),v(l,k),v(l,$),v(l,C),v(l,T),v(e,O),v(e,M),A=!0},p(N,R){var F;(!A||R&1)&&a!==(a=(F=N[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!A||R&2)&&p!==(p=N[1].s3.enabled?"S3 storage":"local file system")&&le(h,p)},i(N){A||(N&&et(()=>{A&&(E||(E=Ve(e,rt,{duration:150},!0)),E.run(1))}),A=!0)},o(N){N&&(E||(E=Ve(e,rt,{duration:150},!1)),E.run(0)),A=!1},d(N){N&&w(e),N&&E&&E.end()}}}function OA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Vh(n);return{c(){t&&t.c(),e=we()},m(s,l){t&&t.m(s,l),S(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&I(t,1)):(t=Vh(s),t.c(),I(t,1),t.m(e.parentNode,e)):t&&(ue(),P(t,1,1,()=>{t=null}),fe())},d(s){t&&t.d(s),s&&w(e)}}}function zh(n){let e;function t(l,o){return l[4]?AA:l[5]?DA:EA}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 EA(n){let e;return{c(){e=y("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function DA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(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 AA(n){let e;return{c(){e=y("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function Hh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Reset",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function IA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b;const k=[MA,CA],$=[];function C(T,O){return T[2]?0:1}return p=C(n),h=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[7]),r=D(),a=y("div"),u=y("form"),f=y("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>`,d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(T,r,O),S(T,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),g=!0,_||(b=J(u,"submit",xe(n[16])),_=!0)},p(T,O){(!g||O&128)&&le(o,T[7]);let M=p;p=C(T),p===M?$[p].p(T,O):(ue(),P($[M],1,1,()=>{$[M]=null}),fe(),h=$[p],h?h.p(T,O):(h=$[p]=k[p](T),h.c()),I(h,1),h.m(u,null))},i(T){g||(I(h),g=!0)},o(T){P(h),g=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),_=!1,b()}}}function LA(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[IA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}const PA="s3_test_request";function NA(n,e,t){let i,s,l;Ze(n,Mt,M=>t(7,l=M)),ln(Mt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null;p();async function p(){t(2,a=!0);try{const M=await de.settings.getAll()||{};g(M)}catch(M){de.error(M)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{de.cancelRequest(PA);const M=await de.settings.update(W.filterRedactedProps(r));tn({}),await g(M),Fa(),d?Ay("Successfully saved but failed to establish S3 connection."):Ht("Successfully saved files storage settings.")}catch(M){de.error(M)}t(3,u=!1)}}async function g(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function b(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function k(M){f=M,t(4,f)}function $(M){d=M,t(5,d)}const C=()=>_(),T=()=>h(),O=()=>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,d,s,l,h,_,i,b,k,$,C,T,O]}class FA extends ve{constructor(e){super(),be(this,e,NA,LA,_e,{})}}function RA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[20]),m(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&m(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function qA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=Y("Client ID"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),v(e,t),S(f,s,d),S(f,l,d),ae(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&m(e,"for",i),d&1048576&&o!==(o=f[20])&&m(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&ae(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function jA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new hu({props:u}),ne.push(()=>pe(l,"value",a)),{c(){e=y("label"),t=Y("Client secret"),s=D(),B(l.$$.fragment),m(e,"for",i=n[20])},m(f,d){S(f,e,d),v(e,t),S(f,s,d),z(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&m(e,"for",i);const p={};d&1048576&&(p.id=f[20]),d&2&&(p.required=f[1].enabled),!o&&d&2&&(o=!0,p.value=f[1].clientSecret,ge(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),H(l,f)}}}function Bh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Rt(o,r(n)),ne.push(()=>pe(t,"config",l))),{c(){e=y("div"),t&&B(t.$$.fragment),m(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&z(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[1],ge(()=>i=!1)),u&8&&o!==(o=a[3].optionsComponent)){if(t){ue();const d=t;P(d.$$.fragment,1,0,()=>{H(d,1)}),fe()}o?(t=Rt(o,r(a)),ne.push(()=>pe(t,"config",l)),B(t.$$.fragment),I(t.$$.fragment,1),z(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&I(t.$$.fragment,a),s=!0)},o(a){t&&P(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&H(t)}}}function VA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;i=new me({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[RA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[qA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),u=new me({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[jA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&Bh(n);return{c(){e=y("form"),t=y("div"),B(i.$$.fragment),s=D(),l=y("button"),l.innerHTML='<span class="txt">Clear all fields</span>',o=D(),B(r.$$.fragment),a=D(),B(u.$$.fragment),f=D(),g&&g.c(),m(l,"type","button"),m(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),m(t,"class","flex m-b-base"),m(e,"id",n[6]),m(e,"autocomplete","off")},m(_,b){S(_,e,b),v(e,t),z(i,t,null),v(t,s),v(t,l),v(e,o),z(r,e,null),v(e,a),z(u,e,null),v(e,f),g&&g.m(e,null),d=!0,p||(h=[J(l,"click",n[8]),J(e,"submit",xe(n[15]))],p=!0)},p(_,b){const k={};b&8&&(k.name=_[3].key+".enabled"),b&3145730&&(k.$$scope={dirty:b,ctx:_}),i.$set(k);const $={};b&2&&($.class="form-field "+(_[1].enabled?"required":"")),b&8&&($.name=_[3].key+".clientId"),b&3145730&&($.$$scope={dirty:b,ctx:_}),r.$set($);const C={};b&2&&(C.class="form-field "+(_[1].enabled?"required":"")),b&8&&(C.name=_[3].key+".clientSecret"),b&3145730&&(C.$$scope={dirty:b,ctx:_}),u.$set(C),_[3].optionsComponent?g?(g.p(_,b),b&8&&I(g,1)):(g=Bh(_),g.c(),I(g,1),g.m(e,null)):g&&(ue(),P(g,1,1,()=>{g=null}),fe())},i(_){d||(I(i.$$.fragment,_),I(r.$$.fragment,_),I(u.$$.fragment,_),I(g),d=!0)},o(_){P(i.$$.fragment,_),P(r.$$.fragment,_),P(u.$$.fragment,_),P(g),d=!1},d(_){_&&w(e),H(i),H(r),H(u),g&&g.d(),p=!1,De(h)}}}function zA(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=y("h4"),i=Y(t),s=Y(" provider"),m(e,"class","center txt-break")},m(l,o){S(l,e,o),v(e,i),v(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&w(e)}}}function HA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=Y("Close"),i=D(),s=y("button"),l=y("span"),l.textContent="Save changes",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[6]),m(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function BA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[HA],header:[zA],default:[VA]},$$scope:{ctx:n}};return e=new on({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[16](null),H(e,s)}}}function UA(n,e,t){let i;const s=Tt(),l="provider_popup_"+W.randomString(5);let o,r={},a={},u=!1,f="";function d(E,A){tn({}),t(3,r=Object.assign({},E)),t(1,a=Object.assign({enabled:!0},A)),t(10,f=JSON.stringify(a)),o==null||o.show()}function p(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const E={};E[r.key]=W.filterRedactedProps(a);const A=await de.settings.update(E);tn({}),Ht("Successfully updated provider settings."),s("submit",A),p()}catch(E){de.error(E)}t(4,u=!1)}function g(){for(let E in a)t(1,a[E]="",a);t(1,a.enabled=!1,a)}function _(){a.enabled=this.checked,t(1,a)}function b(){a.clientId=this.value,t(1,a)}function k(E){n.$$.not_equal(a.clientSecret,E)&&(a.clientSecret=E,t(1,a))}function $(E){a=E,t(1,a)}const C=()=>h();function T(E){ne[E?"unshift":"push"](()=>{o=E,t(2,o)})}function O(E){he.call(this,n,E)}function M(E){he.call(this,n,E)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[p,a,o,r,u,i,l,h,g,d,f,_,b,k,$,C,T,O,M]}class WA extends ve{constructor(e){super(),be(this,e,UA,BA,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function Uh(n){let e,t,i;return{c(){e=y("img"),_n(e.src,t="./images/oauth2/"+n[1].logo)||m(e,"src",t),m(e,"alt",i=n[1].title+" logo")},m(s,l){S(s,e,l)},p(s,l){l&2&&!_n(e.src,t="./images/oauth2/"+s[1].logo)&&m(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&m(e,"alt",i)},d(s){s&&w(e)}}}function Wh(n){let e;return{c(){e=y("div"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function YA(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",d,p,h,g,_,b,k,$,C,T,O=n[1].logo&&Uh(n),M=n[0].enabled&&Wh(),E={};return k=new WA({props:E}),n[4](k),k.$on("submit",n[5]),{c(){e=y("div"),t=y("figure"),O&&O.c(),i=D(),s=y("div"),o=Y(l),r=D(),a=y("em"),u=Y("("),d=Y(f),p=Y(")"),h=D(),M&&M.c(),g=D(),_=y("button"),_.innerHTML='<i class="ri-settings-4-line"></i>',b=D(),B(k.$$.fragment),m(t,"class","provider-logo"),m(s,"class","title"),m(a,"class","txt-hint txt-sm m-r-auto"),m(_,"type","button"),m(_,"class","btn btn-circle btn-hint btn-transparent"),m(_,"aria-label","Provider settings"),m(e,"class","provider-card")},m(A,L){S(A,e,L),v(e,t),O&&O.m(t,null),v(e,i),v(e,s),v(s,o),v(e,r),v(e,a),v(a,u),v(a,d),v(a,p),v(e,h),M&&M.m(e,null),v(e,g),v(e,_),S(A,b,L),z(k,A,L),$=!0,C||(T=J(_,"click",n[3]),C=!0)},p(A,[L]){A[1].logo?O?O.p(A,L):(O=Uh(A),O.c(),O.m(t,null)):O&&(O.d(1),O=null),(!$||L&2)&&l!==(l=A[1].title+"")&&le(o,l),(!$||L&2)&&f!==(f=A[1].key.slice(0,-4)+"")&&le(d,f),A[0].enabled?M||(M=Wh(),M.c(),M.m(e,g)):M&&(M.d(1),M=null);const N={};k.$set(N)},i(A){$||(I(k.$$.fragment,A),$=!0)},o(A){P(k.$$.fragment,A),$=!1},d(A){A&&w(e),O&&O.d(),M&&M.d(),A&&w(b),n[4](null),H(k,A),C=!1,T()}}}function KA(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){ne[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class O1 extends ve{constructor(e){super(),be(this,e,KA,YA,_e,{provider:1,config:0})}}function Yh(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Kh(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function JA(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=n[3];const d=_=>_[9].key;for(let _=0;_<f.length;_+=1){let b=Kh(n,f,_),k=d(b);i.set(k,t[_]=Jh(k,b))}let p=n[3].length>0&&n[2].length>0&&Zh(),h=n[2];const g=_=>_[9].key;for(let _=0;_<h.length;_+=1){let b=Yh(n,h,_),k=g(b);a.set(k,r[_]=Gh(k,b))}return{c(){e=y("div");for(let _=0;_<t.length;_+=1)t[_].c();s=D(),p&&p.c(),l=D(),o=y("div");for(let _=0;_<r.length;_+=1)r[_].c();m(e,"class","grid grid-sm"),m(o,"class","grid grid-sm")},m(_,b){S(_,e,b);for(let k=0;k<t.length;k+=1)t[k]&&t[k].m(e,null);S(_,s,b),p&&p.m(_,b),S(_,l,b),S(_,o,b);for(let k=0;k<r.length;k+=1)r[k]&&r[k].m(o,null);u=!0},p(_,b){b&9&&(f=_[3],ue(),t=vt(t,b,d,1,_,f,i,e,Ut,Jh,null,Kh),fe()),_[3].length>0&&_[2].length>0?p||(p=Zh(),p.c(),p.m(l.parentNode,l)):p&&(p.d(1),p=null),b&5&&(h=_[2],ue(),r=vt(r,b,g,1,_,h,a,o,Ut,Gh,null,Yh),fe())},i(_){if(!u){for(let b=0;b<f.length;b+=1)I(t[b]);for(let b=0;b<h.length;b+=1)I(r[b]);u=!0}},o(_){for(let b=0;b<t.length;b+=1)P(t[b]);for(let b=0;b<r.length;b+=1)P(r[b]);u=!1},d(_){_&&w(e);for(let b=0;b<t.length;b+=1)t[b].d();_&&w(s),p&&p.d(_),_&&w(l),_&&w(o);for(let b=0;b<r.length;b+=1)r[b].d()}}}function ZA(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Jh(n,e){let t,i,s,l,o;function r(u){e[5](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new O1({props:a}),ne.push(()=>pe(i,"config",r)),{key:n,first:null,c(){t=y("div"),B(i.$$.fragment),l=D(),m(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),z(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&8&&(d.provider=e[9]),!s&&f&9&&(s=!0,d.config=e[0][e[9].key],ge(()=>s=!1)),i.$set(d)},i(u){o||(I(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function Zh(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Gh(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new O1({props:a}),ne.push(()=>pe(i,"config",r)),{key:n,first:null,c(){t=y("div"),B(i.$$.fragment),l=D(),m(t,"class","col-lg-6"),this.first=t},m(u,f){S(u,t,f),z(i,t,null),v(t,l),o=!0},p(u,f){e=u;const d={};f&4&&(d.provider=e[9]),!s&&f&5&&(s=!0,d.config=e[0][e[9].key],ge(()=>s=!1)),i.$set(d)},i(u){o||(I(i.$$.fragment,u),o=!0)},o(u){P(i.$$.fragment,u),o=!1},d(u){u&&w(t),H(i)}}}function GA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g;const _=[ZA,JA],b=[];function k($,C){return $[1]?0:1}return p=k(n),h=b[p]=_[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[4]),r=D(),a=y("div"),u=y("div"),f=y("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","m-b-base"),m(u,"class","panel"),m(a,"class","wrapper")},m($,C){S($,e,C),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S($,r,C),S($,a,C),v(a,u),v(u,f),v(u,d),b[p].m(u,null),g=!0},p($,C){(!g||C&16)&&le(o,$[4]);let T=p;p=k($),p===T?b[p].p($,C):(ue(),P(b[T],1,1,()=>{b[T]=null}),fe(),h=b[p],h?h.p($,C):(h=b[p]=_[p]($),h.c()),I(h,1),h.m(u,null))},i($){g||(I(h),g=!0)},o($){P(h),g=!1},d($){$&&w(e),$&&w(r),$&&w(a),b[p].d()}}}function XA(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[GA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function QA(n,e,t){let i,s,l;Ze(n,Mt,p=>t(4,l=p)),ln(Mt,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const p=await de.settings.getAll()||{};u(p)}catch(p){de.error(p)}t(1,o=!1)}function u(p){p=p||{},t(0,r={});for(const h of mo)t(0,r[h.key]=Object.assign({enabled:!1},p[h.key]),r)}function f(p,h){n.$$.not_equal(r[h.key],p)&&(r[h.key]=p,t(0,r))}function d(p,h){n.$$.not_equal(r[h.key],p)&&(r[h.key]=p,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=mo.filter(p=>{var h;return(h=r[p.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=mo.filter(p=>{var h;return!((h=r[p.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,d]}class xA extends ve{constructor(e){super(),be(this,e,QA,XA,_e,{})}}function e8(n){let e,t,i,s,l,o,r,a,u,f,d,p;return{c(){e=y("label"),t=Y(n[3]),i=Y(" duration (in seconds)"),l=D(),o=y("input"),a=D(),u=y("div"),f=y("span"),f.textContent="Invalidate all previously issued tokens",m(e,"for",s=n[6]),m(o,"type","number"),m(o,"id",r=n[6]),o.required=!0,m(f,"class","link-primary"),x(f,"txt-success",!!n[1]),m(u,"class","help-block")},m(h,g){S(h,e,g),v(e,t),v(e,i),S(h,l,g),S(h,o,g),ae(o,n[0]),S(h,a,g),S(h,u,g),v(u,f),d||(p=[J(o,"input",n[4]),J(f,"click",n[5])],d=!0)},p(h,g){g&8&&le(t,h[3]),g&64&&s!==(s=h[6])&&m(e,"for",s),g&64&&r!==(r=h[6])&&m(o,"id",r),g&1&&pt(o.value)!==h[0]&&ae(o,h[0]),g&2&&x(f,"txt-success",!!h[1])},d(h){h&&w(e),h&&w(l),h&&w(o),h&&w(a),h&&w(u),d=!1,De(p)}}}function t8(n){let e,t;return e=new me({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[e8,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){z(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function n8(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=pt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=W.randomString(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class E1 extends ve{constructor(e){super(),be(this,e,n8,t8,_e,{key:2,label:3,duration:0,secret:1})}}function Xh(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Qh(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function i8(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],d=new Map,p,h,g,_,b,k,$,C,T,O,M,E=n[5];const A=F=>F[19].key;for(let F=0;F<E.length;F+=1){let q=Qh(n,E,F),V=A(q);s.set(V,i[F]=xh(V,q))}let L=n[6];const N=F=>F[19].key;for(let F=0;F<L.length;F+=1){let q=Xh(n,L,F),V=N(q);d.set(V,f[F]=e_(V,q))}let R=n[3]&&t_(n);return{c(){e=y("h3"),e.textContent="Record tokens",t=D();for(let F=0;F<i.length;F+=1)i[F].c();l=D(),o=y("hr"),r=D(),a=y("h3"),a.textContent="Admin tokens",u=D();for(let F=0;F<f.length;F+=1)f[F].c();p=D(),h=y("div"),g=y("div"),_=D(),R&&R.c(),b=D(),k=y("button"),$=y("span"),$.textContent="Save changes",m(e,"class","section-title"),m(a,"class","section-title"),m(g,"class","flex-fill"),m($,"class","txt"),m(k,"type","submit"),m(k,"class","btn btn-expanded"),k.disabled=C=!n[3]||n[2],x(k,"btn-loading",n[2]),m(h,"class","flex")},m(F,q){S(F,e,q),S(F,t,q);for(let V=0;V<i.length;V+=1)i[V]&&i[V].m(F,q);S(F,l,q),S(F,o,q),S(F,r,q),S(F,a,q),S(F,u,q);for(let V=0;V<f.length;V+=1)f[V]&&f[V].m(F,q);S(F,p,q),S(F,h,q),v(h,g),v(h,_),R&&R.m(h,null),v(h,b),v(h,k),v(k,$),T=!0,O||(M=J(k,"click",n[16]),O=!0)},p(F,q){q&33&&(E=F[5],ue(),i=vt(i,q,A,1,F,E,s,l.parentNode,Ut,xh,l,Qh),fe()),q&65&&(L=F[6],ue(),f=vt(f,q,N,1,F,L,d,p.parentNode,Ut,e_,p,Xh),fe()),F[3]?R?R.p(F,q):(R=t_(F),R.c(),R.m(h,b)):R&&(R.d(1),R=null),(!T||q&12&&C!==(C=!F[3]||F[2]))&&(k.disabled=C),(!T||q&4)&&x(k,"btn-loading",F[2])},i(F){if(!T){for(let q=0;q<E.length;q+=1)I(i[q]);for(let q=0;q<L.length;q+=1)I(f[q]);T=!0}},o(F){for(let q=0;q<i.length;q+=1)P(i[q]);for(let q=0;q<f.length;q+=1)P(f[q]);T=!1},d(F){F&&w(e),F&&w(t);for(let q=0;q<i.length;q+=1)i[q].d(F);F&&w(l),F&&w(o),F&&w(r),F&&w(a),F&&w(u);for(let q=0;q<f.length;q+=1)f[q].d(F);F&&w(p),F&&w(h),R&&R.d(),O=!1,M()}}}function s8(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function xh(n,e){let t,i,s,l,o;function r(f){e[11](f,e[19])}function a(f){e[12](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new E1({props:u}),ne.push(()=>pe(i,"duration",r)),ne.push(()=>pe(i,"secret",a)),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),z(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&33&&(s=!0,p.duration=e[0][e[19].key].duration,ge(()=>s=!1)),!l&&d&33&&(l=!0,p.secret=e[0][e[19].key].secret,ge(()=>l=!1)),i.$set(p)},i(f){o||(I(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function e_(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new E1({props:u}),ne.push(()=>pe(i,"duration",r)),ne.push(()=>pe(i,"secret",a)),{key:n,first:null,c(){t=we(),B(i.$$.fragment),this.first=t},m(f,d){S(f,t,d),z(i,f,d),o=!0},p(f,d){e=f;const p={};!s&&d&65&&(s=!0,p.duration=e[0][e[19].key].duration,ge(()=>s=!1)),!l&&d&65&&(l=!0,p.secret=e[0][e[19].key].secret,ge(()=>l=!1)),i.$set(p)},i(f){o||(I(i.$$.fragment,f),o=!0)},o(f){P(i.$$.fragment,f),o=!1},d(f){f&&w(t),H(i,f)}}}function t_(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){S(l,e,o),v(e,t),i||(s=J(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function l8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b;const k=[s8,i8],$=[];function C(T,O){return T[1]?0:1}return p=C(n),h=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[4]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Adjust common token options.</p>",d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content m-b-sm txt-xl"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(T,r,O),S(T,a,O),v(a,u),v(u,f),v(u,d),$[p].m(u,null),g=!0,_||(b=J(u,"submit",xe(n[7])),_=!0)},p(T,O){(!g||O&16)&&le(o,T[4]);let M=p;p=C(T),p===M?$[p].p(T,O):(ue(),P($[M],1,1,()=>{$[M]=null}),fe(),h=$[p],h?h.p(T,O):(h=$[p]=k[p](T),h.c()),I(h,1),h.m(u,null))},i(T){g||(I(h),g=!0)},o(T){P(h),g=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),_=!1,b()}}}function o8(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[l8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function r8(n,e,t){let i,s,l;Ze(n,Mt,M=>t(4,l=M));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:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];ln(Mt,l="Token options",l);let a={},u={},f=!1,d=!1;p();async function p(){t(1,f=!0);try{const M=await de.settings.getAll()||{};g(M)}catch(M){de.error(M)}t(1,f=!1)}async function h(){if(!(d||!s)){t(2,d=!0);try{const M=await de.settings.update(W.filterRedactedProps(u));g(M),Ht("Successfully saved tokens options.")}catch(M){de.error(M)}t(2,d=!1)}}function g(M){var A;M=M||{},t(0,u={});const E=o.concat(r);for(const L of E)t(0,u[L.key]={duration:((A=M[L.key])==null?void 0:A.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function _(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function b(M,E){n.$$.not_equal(u[E.key].duration,M)&&(u[E.key].duration=M,t(0,u))}function k(M,E){n.$$.not_equal(u[E.key].secret,M)&&(u[E.key].secret=M,t(0,u))}function $(M,E){n.$$.not_equal(u[E.key].duration,M)&&(u[E.key].duration=M,t(0,u))}function C(M,E){n.$$.not_equal(u[E.key].secret,M)&&(u[E.key].secret=M,t(0,u))}const T=()=>_(),O=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,d,s,l,o,r,h,_,a,i,b,k,$,C,T,O]}class a8 extends ve{constructor(e){super(),be(this,e,r8,o8,_e,{})}}function u8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g;return o=new b1({props:{content:n[2]}}),{c(){e=y("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=D(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),B(o.$$.fragment),r=D(),a=y("div"),u=y("div"),f=D(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,m(e,"class","content txt-xl m-b-base"),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),m(i,"tabindex","0"),m(i,"class","export-preview svelte-jm5c4z"),m(u,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(_,b){S(_,e,b),S(_,t,b),S(_,i,b),v(i,s),v(i,l),z(o,i,null),n[8](i),S(_,r,b),S(_,a,b),v(a,u),v(a,f),v(a,d),p=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],h=!0)},p(_,b){const k={};b&4&&(k.content=_[2]),o.$set(k)},i(_){p||(I(o.$$.fragment,_),p=!0)},o(_){P(o.$$.fragment,_),p=!1},d(_){_&&w(e),_&&w(t),_&&w(i),H(o),n[8](null),_&&w(r),_&&w(a),h=!1,De(g)}}}function f8(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function c8(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=[f8,u8],g=[];function _(b,k){return b[1]?0:1}return f=_(n),d=g[f]=h[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[3]),r=D(),a=y("div"),u=y("div"),d.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),g[f].m(u,null),p=!0},p(b,k){(!p||k&8)&&le(o,b[3]);let $=f;f=_(b),f===$?g[f].p(b,k):(ue(),P(g[$],1,1,()=>{g[$]=null}),fe(),d=g[f],d?d.p(b,k):(d=g[f]=h[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),g[f].d()}}}function d8(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[c8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function p8(n,e,t){let i,s;Ze(n,Mt,b=>t(3,s=b)),ln(Mt,s="Export collections",s);const l="export_"+W.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await de.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let b of r)delete b.created,delete b.updated}catch(b){de.error(b)}t(1,a=!1)}function f(){W.downloadJson(r,"pb_schema")}function d(){W.copyToClipboard(i),yo("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function h(b){ne[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,h,g,_]}class m8 extends ve{constructor(e){super(),be(this,e,p8,d8,_e,{})}}function n_(n,e,t){const i=n.slice();return i[14]=e[t],i}function i_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function s_(n,e,t){const i=n.slice();return i[14]=e[t],i}function l_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function o_(n,e,t){const i=n.slice();return i[14]=e[t],i}function r_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function a_(n,e,t){const i=n.slice();return i[30]=e[t],i}function h8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&u_(),a=n[0].name!==n[1].name&&f_(n);return{c(){e=y("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=y("strong"),o=Y(l),m(s,"class","txt"),m(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=u_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=f_(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 _8(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=D(),i=y("strong"),l=Y(s),m(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 g8(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Added",t=D(),i=y("strong"),l=Y(s),m(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),v(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 u_(n){let e;return{c(){e=y("span"),e.textContent="Changed",m(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function f_(n){let e,t=n[0].name+"",i,s,l;return{c(){e=y("strong"),i=Y(t),s=D(),l=y("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(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 c_(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,d,p,h,g=n[12]((k=n[1])==null?void 0:k[n[30]])+"",_;return{c(){var $,C,T,O,M,E;e=y("tr"),t=y("td"),i=y("span"),l=Y(s),o=D(),r=y("td"),a=y("pre"),f=Y(u),d=D(),p=y("td"),h=y("pre"),_=Y(g),m(t,"class","min-width svelte-lmkr38"),m(a,"class","txt"),m(r,"class","svelte-lmkr38"),x(r,"changed-old-col",!n[10]&&bn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]])),x(r,"changed-none-col",n[10]),m(h,"class","txt"),m(p,"class","svelte-lmkr38"),x(p,"changed-new-col",!n[5]&&bn((T=n[0])==null?void 0:T[n[30]],(O=n[1])==null?void 0:O[n[30]])),x(p,"changed-none-col",n[5]),m(e,"class","svelte-lmkr38"),x(e,"txt-primary",bn((M=n[0])==null?void 0:M[n[30]],(E=n[1])==null?void 0:E[n[30]]))},m($,C){S($,e,C),v(e,t),v(t,i),v(i,l),v(e,o),v(e,r),v(r,a),v(a,f),v(e,d),v(e,p),v(p,h),v(h,_)},p($,C){var T,O,M,E,A,L,N,R;C[0]&1&&u!==(u=$[12]((T=$[0])==null?void 0:T[$[30]])+"")&&le(f,u),C[0]&3075&&x(r,"changed-old-col",!$[10]&&bn((O=$[0])==null?void 0:O[$[30]],(M=$[1])==null?void 0:M[$[30]])),C[0]&1024&&x(r,"changed-none-col",$[10]),C[0]&2&&g!==(g=$[12]((E=$[1])==null?void 0:E[$[30]])+"")&&le(_,g),C[0]&2083&&x(p,"changed-new-col",!$[5]&&bn((A=$[0])==null?void 0:A[$[30]],(L=$[1])==null?void 0:L[$[30]])),C[0]&32&&x(p,"changed-none-col",$[5]),C[0]&2051&&x(e,"txt-primary",bn((N=$[0])==null?void 0:N[$[30]],(R=$[1])==null?void 0:R[$[30]]))},d($){$&&w(e)}}}function d_(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=m_(o_(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&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=o_(s,t,o);i[o]?i[o].p(r,l):(i[o]=m_(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function p_(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,d,p;return{c(){e=y("tr"),t=y("td"),s=Y(i),l=D(),o=y("td"),r=y("pre"),u=Y(a),f=D(),d=y("td"),p=D(),m(t,"class","min-width field-key-col svelte-lmkr38"),m(r,"class","txt"),m(o,"class","changed-old-col svelte-lmkr38"),m(d,"class","changed-none-col svelte-lmkr38"),m(e,"class","txt-primary svelte-lmkr38")},m(h,g){S(h,e,g),v(e,t),v(t,s),v(e,l),v(e,o),v(o,r),v(r,u),v(e,f),v(e,d),v(e,p)},p(h,g){g[0]&64&&i!==(i=h[17]+"")&&le(s,i),g[0]&64&&a!==(a=h[12](h[18])+"")&&le(u,a)},d(h){h&&w(e)}}}function m_(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,d,p,h=n[14].name+"",g,_,b,k,$=Object.entries(n[14]),C=[];for(let T=0;T<$.length;T+=1)C[T]=p_(r_(n,$,T));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=Y("field: "),o=Y(l),r=D(),a=y("span"),u=Y("Deleted - "),f=y("small"),d=Y("All stored data related to "),p=y("strong"),g=Y(h),_=Y(" will be deleted!"),b=D();for(let T=0;T<C.length;T+=1)C[T].c();k=we(),m(i,"class","txt"),m(a,"class","label label-danger m-l-5 svelte-lmkr38"),m(t,"class","min-width svelte-lmkr38"),m(t,"colspan","3"),m(e,"class","svelte-lmkr38")},m(T,O){S(T,e,O),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),v(t,a),v(a,u),v(a,f),v(f,d),v(f,p),v(p,g),v(f,_),S(T,b,O);for(let M=0;M<C.length;M+=1)C[M]&&C[M].m(T,O);S(T,k,O)},p(T,O){if(O[0]&64&&l!==(l=T[14].name+"")&&le(o,l),O[0]&64&&h!==(h=T[14].name+"")&&le(g,h),O[0]&4160){$=Object.entries(T[14]);let M;for(M=0;M<$.length;M+=1){const E=r_(T,$,M);C[M]?C[M].p(E,O):(C[M]=p_(E),C[M].c(),C[M].m(k.parentNode,k))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},d(T){T&&w(e),T&&w(b),ht(C,T),T&&w(k)}}}function h_(n){let e;return{c(){e=y("span"),e.textContent="Changed",m(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function __(n){var _;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((_=Hn(n[3],n[14].id))==null?void 0:_[n[17]])+"",u,f,d,p,h=n[12](n[23])+"",g;return{c(){var b,k,$;e=y("tr"),t=y("td"),s=Y(i),l=D(),o=y("td"),r=y("pre"),u=Y(a),f=D(),d=y("td"),p=y("pre"),g=Y(h),m(t,"class","min-width field-key-col svelte-lmkr38"),m(r,"class","txt"),m(o,"class","svelte-lmkr38"),x(o,"changed-old-col",bn((b=Hn(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),m(p,"class","txt"),m(d,"class","svelte-lmkr38"),x(d,"changed-new-col",bn((k=Hn(n[3],n[14].id))==null?void 0:k[n[17]],n[23])),m(e,"class","svelte-lmkr38"),x(e,"txt-primary",bn(($=Hn(n[3],n[14].id))==null?void 0:$[n[17]],n[23]))},m(b,k){S(b,e,k),v(e,t),v(t,s),v(e,l),v(e,o),v(o,r),v(r,u),v(e,f),v(e,d),v(d,p),v(p,g)},p(b,k){var $,C,T,O;k[0]&128&&i!==(i=b[17]+"")&&le(s,i),k[0]&136&&a!==(a=b[12](($=Hn(b[3],b[14].id))==null?void 0:$[b[17]])+"")&&le(u,a),k[0]&136&&x(o,"changed-old-col",bn((C=Hn(b[3],b[14].id))==null?void 0:C[b[17]],b[23])),k[0]&128&&h!==(h=b[12](b[23])+"")&&le(g,h),k[0]&136&&x(d,"changed-new-col",bn((T=Hn(b[3],b[14].id))==null?void 0:T[b[17]],b[23])),k[0]&136&&x(e,"txt-primary",bn((O=Hn(b[3],b[14].id))==null?void 0:O[b[17]],b[23]))},d(b){b&&w(e)}}}function g_(n){let e,t,i,s,l=n[14].name+"",o,r,a=bn(Hn(n[3],n[14].id),Hn(n[4],n[14].id)),u,f,d=a&&h_(),p=Object.entries(n[14]),h=[];for(let g=0;g<p.length;g+=1)h[g]=__(l_(n,p,g));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=Y("field: "),o=Y(l),r=D(),d&&d.c(),u=D();for(let g=0;g<h.length;g+=1)h[g].c();f=we(),m(i,"class","txt"),m(t,"class","min-width svelte-lmkr38"),m(t,"colspan","3"),m(e,"class","svelte-lmkr38")},m(g,_){S(g,e,_),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),d&&d.m(t,null),S(g,u,_);for(let b=0;b<h.length;b+=1)h[b]&&h[b].m(g,_);S(g,f,_)},p(g,_){if(_[0]&128&&l!==(l=g[14].name+"")&&le(o,l),_[0]&152&&(a=bn(Hn(g[3],g[14].id),Hn(g[4],g[14].id))),a?d||(d=h_(),d.c(),d.m(t,null)):d&&(d.d(1),d=null),_[0]&4232){p=Object.entries(g[14]);let b;for(b=0;b<p.length;b+=1){const k=l_(g,p,b);h[b]?h[b].p(k,_):(h[b]=__(k),h[b].c(),h[b].m(f.parentNode,f))}for(;b<h.length;b+=1)h[b].d(1);h.length=p.length}},d(g){g&&w(e),d&&d.d(),g&&w(u),ht(h,g),g&&w(f)}}}function b_(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",d,p;return{c(){e=y("tr"),t=y("td"),s=Y(i),l=D(),o=y("td"),r=D(),a=y("td"),u=y("pre"),d=Y(f),p=D(),m(t,"class","min-width field-key-col svelte-lmkr38"),m(o,"class","changed-none-col svelte-lmkr38"),m(u,"class","txt"),m(a,"class","changed-new-col svelte-lmkr38"),m(e,"class","txt-primary svelte-lmkr38")},m(h,g){S(h,e,g),v(e,t),v(t,s),v(e,l),v(e,o),v(e,r),v(e,a),v(a,u),v(u,d),v(e,p)},p(h,g){g[0]&256&&i!==(i=h[17]+"")&&le(s,i),g[0]&256&&f!==(f=h[12](h[18])+"")&&le(d,f)},d(h){h&&w(e)}}}function v_(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,d=Object.entries(n[14]),p=[];for(let h=0;h<d.length;h+=1)p[h]=b_(i_(n,d,h));return{c(){e=y("tr"),t=y("th"),i=y("span"),s=Y("field: "),o=Y(l),r=D(),a=y("span"),a.textContent="Added",u=D();for(let h=0;h<p.length;h+=1)p[h].c();f=we(),m(i,"class","txt"),m(a,"class","label label-success m-l-5 svelte-lmkr38"),m(t,"class","min-width svelte-lmkr38"),m(t,"colspan","3"),m(e,"class","svelte-lmkr38")},m(h,g){S(h,e,g),v(e,t),v(t,i),v(i,s),v(i,o),v(t,r),v(t,a),S(h,u,g);for(let _=0;_<p.length;_+=1)p[_]&&p[_].m(h,g);S(h,f,g)},p(h,g){if(g[0]&256&&l!==(l=h[14].name+"")&&le(o,l),g[0]&4352){d=Object.entries(h[14]);let _;for(_=0;_<d.length;_+=1){const b=i_(h,d,_);p[_]?p[_].p(b,g):(p[_]=b_(b),p[_].c(),p[_].m(f.parentNode,f))}for(;_<p.length;_+=1)p[_].d(1);p.length=d.length}},d(h){h&&w(e),h&&w(u),ht(p,h),h&&w(f)}}}function b8(n){let e,t,i,s,l,o,r,a,u;function f(T,O){var M,E;return(M=T[0])!=null&&M.id?(E=T[1])!=null&&E.id?h8:_8:g8}let d=f(n),p=d(n),h=n[11],g=[];for(let T=0;T<h.length;T+=1)g[T]=c_(a_(n,h,T));let _=(n[2]||n[5])&&d_(n),b=n[7],k=[];for(let T=0;T<b.length;T+=1)k[T]=g_(s_(n,b,T));let $=n[8],C=[];for(let T=0;T<$.length;T+=1)C[T]=v_(n_(n,$,T));return{c(){e=y("div"),p.c(),t=D(),i=y("table"),s=y("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=y("tbody");for(let T=0;T<g.length;T+=1)g[T].c();r=D(),_&&_.c(),a=D();for(let T=0;T<k.length;T+=1)k[T].c();u=D();for(let T=0;T<C.length;T+=1)C[T].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,O){S(T,e,O),p.m(e,null),S(T,t,O),S(T,i,O),v(i,s),v(i,l),v(i,o);for(let M=0;M<g.length;M+=1)g[M]&&g[M].m(o,null);v(o,r),_&&_.m(o,null),v(o,a);for(let M=0;M<k.length;M+=1)k[M]&&k[M].m(o,null);v(o,u);for(let M=0;M<C.length;M+=1)C[M]&&C[M].m(o,null)},p(T,O){if(d===(d=f(T))&&p?p.p(T,O):(p.d(1),p=d(T),p&&(p.c(),p.m(e,null))),O[0]&7203){h=T[11];let M;for(M=0;M<h.length;M+=1){const E=a_(T,h,M);g[M]?g[M].p(E,O):(g[M]=c_(E),g[M].c(),g[M].m(o,r))}for(;M<g.length;M+=1)g[M].d(1);g.length=h.length}if(T[2]||T[5]?_?_.p(T,O):(_=d_(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),O[0]&4248){b=T[7];let M;for(M=0;M<b.length;M+=1){const E=s_(T,b,M);k[M]?k[M].p(E,O):(k[M]=g_(E),k[M].c(),k[M].m(o,u))}for(;M<k.length;M+=1)k[M].d(1);k.length=b.length}if(O[0]&4352){$=T[8];let M;for(M=0;M<$.length;M+=1){const E=n_(T,$,M);C[M]?C[M].p(E,O):(C[M]=v_(E),C[M].c(),C[M].m(o,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=$.length}},i:te,o:te,d(T){T&&w(e),p.d(),T&&w(t),T&&w(i),ht(g,T),_&&_.d(),ht(k,T),ht(C,T)}}}function Hn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function bn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function v8(n,e,t){let i,s,l,{collectionA:o=new kn}=e,{collectionB:r=new kn}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],h=[];const g=Object.keys(new kn().$export()).filter(k=>!["schema","created","updated"].includes(k));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function b(k){return typeof k>"u"?"":W.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=W.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,h,l,s,g,b]}class y8 extends ve{constructor(e){super(),be(this,e,v8,b8,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function y_(n,e,t){const i=n.slice();return i[17]=e[t],i}function k_(n){let e,t;return e=new y8({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,s){z(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||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function k8(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=k_(y_(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&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=y_(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=k_(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function w8(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function S8(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=Y("Close"),i=D(),s=y("button"),l=y("span"),l.textContent="Confirm and import",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","button"),m(s,"class","btn btn-expanded"),s.disabled=n[4],x(s,"btn-loading",n[4])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),o||(r=[J(e,"click",n[0]),J(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&x(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,De(r)}}}function $8(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[S8],header:[w8],default:[k8]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(s,l){z(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||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function T8(n,e,t){const i=Tt();let s,l=[],o=[],r=[],a=!1,u=!1;function f(T,O,M=!1){t(7,l=T),t(8,o=O),t(3,a=M),s==null||s.show()}function d(){return s==null?void 0:s.hide()}function p(){t(2,r=[]);for(const T of l){const O=W.findByKey(o,"id",T.id)||null;(a&&!(O!=null&&O.id)||O!=null&&O.id&&W.hasCollectionChanges(T,O,a))&&r.push({old:T,new:O})}for(const T of o){const O=W.findByKey(l,"id",T.id)||null;O!=null&&O.id||r.push({old:O,new:T})}}function h(){const T=[];if(a)for(const O of l){const M=W.findByKey(o,"id",O.id);if(!M)T.push(O.name+".*");else{const E=Array.isArray(O.schema)?O.schema:[];for(const A of E)W.findByKey(M.schema,"id",A.id)||T.push(`${O.name}.${A.name} (${A.id})`)}}T.length?mn(`Do you really want to delete the following collection fields and their related records data:
- ${T.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await de.collections.import(o,a),Ht("Successfully imported collections configuration."),i("submit")}catch(T){de.error(T)}t(4,u=!1),d()}}const _=()=>h(),b=()=>!u;function k(T){ne[T?"unshift":"push"](()=>{s=T,t(1,s)})}function $(T){he.call(this,n,T)}function C(T){he.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,h,f,l,o,_,b,k,$,C]}class C8 extends ve{constructor(e){super(),be(this,e,T8,$8,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function w_(n,e,t){const i=n.slice();return i[32]=e[t],i}function S_(n,e,t){const i=n.slice();return i[35]=e[t],i}function $_(n,e,t){const i=n.slice();return i[32]=e[t],i}function M8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[E8,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let A=!1,L=n[6]&&n[1].length&&!n[7]&&C_(),N=n[6]&&n[1].length&&n[7]&&M_(n),R=n[13].length&&q_(n),F=!!n[0]&&j_(n);return{c(){e=y("input"),t=D(),i=y("div"),s=y("p"),l=Y(`Paste below the collections configuration you want to import or
`),o=y("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),B(a.$$.fragment),u=D(),f=D(),L&&L.c(),d=D(),N&&N.c(),p=D(),R&&R.c(),h=D(),g=y("div"),F&&F.c(),_=D(),b=y("div"),k=D(),$=y("button"),C=y("span"),C.textContent="Review",m(e,"type","file"),m(e,"class","hidden"),m(e,"accept",".json"),m(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(b,"class","flex-fill"),m(C,"class","txt"),m($,"type","button"),m($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=T=!n[14],m(g,"class","flex m-t-base")},m(q,V){S(q,e,V),n[19](e),S(q,t,V),S(q,i,V),v(i,s),v(s,l),v(s,o),S(q,r,V),z(a,q,V),S(q,u,V),S(q,f,V),L&&L.m(q,V),S(q,d,V),N&&N.m(q,V),S(q,p,V),R&&R.m(q,V),S(q,h,V),S(q,g,V),F&&F.m(g,null),v(g,_),v(g,b),v(g,k),v(g,$),v($,C),O=!0,M||(E=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],M=!0)},p(q,V){(!O||V[0]&4096)&&x(o,"btn-loading",q[12]);const U={};V[0]&64&&(U.class="form-field "+(q[6]?"":"field-error")),V[0]&65|V[1]&1536&&(U.$$scope={dirty:V,ctx:q}),a.$set(U),q[6]&&q[1].length&&!q[7]?L||(L=C_(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),q[6]&&q[1].length&&q[7]?N?N.p(q,V):(N=M_(q),N.c(),N.m(p.parentNode,p)):N&&(N.d(1),N=null),q[13].length?R?R.p(q,V):(R=q_(q),R.c(),R.m(h.parentNode,h)):R&&(R.d(1),R=null),q[0]?F?F.p(q,V):(F=j_(q),F.c(),F.m(g,_)):F&&(F.d(1),F=null),(!O||V[0]&16384&&T!==(T=!q[14]))&&($.disabled=T)},i(q){O||(I(a.$$.fragment,q),I(A),O=!0)},o(q){P(a.$$.fragment,q),P(A),O=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),H(a,q),q&&w(u),q&&w(f),L&&L.d(q),q&&w(d),N&&N.d(q),q&&w(p),R&&R.d(q),q&&w(h),q&&w(g),F&&F.d(),M=!1,De(E)}}}function O8(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function T_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",m(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function E8(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&T_();return{c(){e=y("label"),t=Y("Collections"),s=D(),l=y("textarea"),r=D(),d&&d.c(),a=we(),m(e,"for",i=n[40]),m(e,"class","p-b-10"),m(l,"id",o=n[40]),m(l,"class","code"),m(l,"spellcheck","false"),m(l,"rows","15"),l.required=!0},m(p,h){S(p,e,h),v(e,t),S(p,s,h),S(p,l,h),ae(l,n[0]),S(p,r,h),d&&d.m(p,h),S(p,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(p,h){h[1]&512&&i!==(i=p[40])&&m(e,"for",i),h[1]&512&&o!==(o=p[40])&&m(l,"id",o),h[0]&1&&ae(l,p[0]),p[0]&&!p[6]?d||(d=T_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function C_(n){let e;return{c(){e=y("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>`,m(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function M_(n){let e,t,i,s,l,o=n[9].length&&O_(n),r=n[4].length&&A_(n),a=n[8].length&&N_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=D(),i=y("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),m(e,"class","section-title"),m(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=O_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=A_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=N_(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 O_(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=$_(n,s,o),a=l(r);t.set(a,e[o]=D_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=vt(e,r,l,1,o,s,t,i.parentNode,us,D_,i,$_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function E_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=Y("("),s=Y(i),l=Y(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function D_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&E_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=D(),l=y("strong"),r=Y(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-danger list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=E_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function A_(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=S_(n,s,o),a=l(r);t.set(a,e[o]=P_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=vt(e,r,l,1,o,s,t,i.parentNode,us,P_,i,S_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function I_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=Y(t),s=D(),l=y("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),v(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 L_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=Y("("),s=Y(i),l=Y(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function P_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&I_(e),h=e[35].new.id&&L_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=D(),l=y("div"),p&&p.c(),o=D(),r=y("strong"),u=Y(a),f=D(),h&&h.c(),d=D(),m(i,"class","label label-warning list-label svelte-1jx20fl"),m(l,"class","inline-flex flex-gap-5"),m(t,"class","list-item"),this.first=t},m(g,_){S(g,t,_),v(t,i),v(t,s),v(t,l),p&&p.m(l,null),v(l,o),v(l,r),v(r,u),v(l,f),h&&h.m(l,null),v(t,d)},p(g,_){e=g,e[35].old.name!==e[35].new.name?p?p.p(e,_):(p=I_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),_[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?h?h.p(e,_):(h=L_(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&w(t),p&&p.d(),h&&h.d()}}}function N_(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=w_(n,s,o),a=l(r);t.set(a,e[o]=R_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=vt(e,r,l,1,o,s,t,i.parentNode,us,R_,i,w_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function F_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=Y("("),s=Y(i),l=Y(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function R_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&F_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Added",s=D(),l=y("strong"),r=Y(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-success list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=F_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function q_(n){let e,t,i,s,l,o,r,a;return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=y("div"),s.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',m(t,"class","icon"),m(s,"class","content"),m(o,"type","button"),m(o,"class","btn btn-warning btn-sm btn-outline"),m(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:te,d(u){u&&w(e),r=!1,a()}}}function j_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function D8(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=[O8,M8],g=[];function _(b,k){return b[5]?0:1}return f=_(n),d=g[f]=h[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[15]),r=D(),a=y("div"),u=y("div"),d.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(b,k){S(b,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(b,r,k),S(b,a,k),v(a,u),g[f].m(u,null),p=!0},p(b,k){(!p||k[0]&32768)&&le(o,b[15]);let $=f;f=_(b),f===$?g[f].p(b,k):(ue(),P(g[$],1,1,()=>{g[$]=null}),fe(),d=g[f],d?d.p(b,k):(d=g[f]=h[f](b),d.c()),I(d,1),d.m(u,null))},i(b){p||(I(d),p=!0)},o(b){P(d),p=!1},d(b){b&&w(e),b&&w(r),b&&w(a),g[f].d()}}}function A8(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[D8]},$$scope:{ctx:n}}});let r={};return l=new C8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),s=D(),B(l.$$.fragment)},m(a,u){z(e,a,u),S(a,t,u),z(i,a,u),S(a,s,u),z(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 d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&w(t),H(i,a),a&&w(s),n[27](null),H(l,a)}}}function I8(n,e,t){let i,s,l,o,r,a,u;Ze(n,Mt,Z=>t(15,u=Z)),ln(Mt,u="Import collections",u);let f,d,p="",h=!1,g=[],_=[],b=!0,k=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,_=await de.collections.getFullList(200));for(let Z of _)delete Z.created,delete Z.updated}catch(Z){de.error(Z)}t(5,$=!1)}function T(){if(t(4,k=[]),!!i)for(let Z of g){const re=W.findByKey(_,"id",Z.id);!(re!=null&&re.id)||!W.hasCollectionChanges(re,Z,b)||k.push({new:Z,old:re})}}function O(){t(1,g=[]);try{t(1,g=JSON.parse(p))}catch{}Array.isArray(g)?t(1,g=W.filterDuplicatesByKey(g)):t(1,g=[]);for(let Z of g)delete Z.created,delete Z.updated,Z.schema=W.filterDuplicatesByKey(Z.schema)}function M(){var Z,re;for(let ee of g){const se=W.findByKey(_,"name",ee.name)||W.findByKey(_,"id",ee.id);if(!se)continue;const ye=ee.id,$e=se.id;ee.id=$e;const ze=Array.isArray(se.schema)?se.schema:[],Ue=Array.isArray(ee.schema)?ee.schema:[];for(const Se of Ue){const Oe=W.findByKey(ze,"name",Se.name);Oe&&Oe.id&&(Se.id=Oe.id)}for(let Se of g)if(Array.isArray(Se.schema))for(let Oe of Se.schema)(Z=Oe.options)!=null&&Z.collectionId&&((re=Oe.options)==null?void 0:re.collectionId)===ye&&(Oe.options.collectionId=$e)}t(0,p=JSON.stringify(g,null,4))}function E(Z){t(12,h=!0);const re=new FileReader;re.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,p=ee.target.result),await cn(),g.length||(As("Invalid collections configuration."),A())},re.onerror=ee=>{console.warn(ee),As("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},re.readAsText(Z)}function A(){t(0,p=""),t(10,f.value="",f),tn({})}function L(Z){ne[Z?"unshift":"push"](()=>{f=Z,t(10,f)})}const N=()=>{f.files.length&&E(f.files[0])},R=()=>{f.click()};function F(){p=this.value,t(0,p)}function q(){b=this.checked,t(3,b)}const V=()=>M(),U=()=>A(),j=()=>d==null?void 0:d.show(_,g,b);function Q(Z){ne[Z?"unshift":"push"](()=>{d=Z,t(11,d)})}const X=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&O(),n.$$.dirty[0]&3&&t(6,i=!!p&&g.length&&g.length===g.filter(Z=>!!Z.id&&!!Z.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(Z=>i&&b&&!W.findByKey(g,"id",Z.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(Z=>i&&!W.findByKey(_,"id",Z.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof b<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!p&&(s.length||l.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!$&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(Z=>{let re=W.findByKey(_,"name",Z.name)||W.findByKey(_,"id",Z.id);if(!re)return!1;if(re.id!=Z.id)return!0;const ee=Array.isArray(re.schema)?re.schema:[],se=Array.isArray(Z.schema)?Z.schema:[];for(const ye of se){if(W.findByKey(ee,"id",ye.id))continue;const ze=W.findByKey(ee,"name",ye.name);if(ze&&ye.id!=ze.id)return!0}return!1}))},[p,g,_,b,k,$,i,o,l,s,f,d,h,a,r,u,M,E,A,L,N,R,F,q,V,U,j,Q,X]}class L8 extends ve{constructor(e){super(),be(this,e,I8,A8,_e,{},null,[-1,-1])}}function P8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=Y("Backup name"),s=D(),l=y("input"),r=D(),a=y("em"),a.textContent="Must be in the format [a-z0-9_-].zip",m(e,"for",i=n[15]),m(l,"type","text"),m(l,"id",o=n[15]),m(l,"placeholder","Leave empty to autogenerate"),m(l,"pattern","^[a-z0-9_-]+\\.zip$"),m(a,"class","help-block")},m(d,p){S(d,e,p),v(e,t),S(d,s,p),S(d,l,p),ae(l,n[2]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[7]),u=!0)},p(d,p){p&32768&&i!==(i=d[15])&&m(e,"for",i),p&32768&&o!==(o=d[15])&&m(l,"id",o),p&4&&l.value!==d[2]&&ae(l,d[2])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function N8(n){let e,t,i,s,l,o,r;return s=new me({props:{class:"form-field m-0",name:"name",$$slots:{default:[P8,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p>
<p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=D(),i=y("form"),B(s.$$.fragment),m(e,"class","alert alert-info"),m(i,"id",n[4]),m(i,"autocomplete","off")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),z(s,i,null),l=!0,o||(r=J(i,"submit",xe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(I(s.$$.fragment,a),l=!0)},o(a){P(s.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),a&&w(i),H(s),o=!1,r()}}}function F8(n){let e;return{c(){e=y("h4"),e.textContent="Initialize new backup",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function R8(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),l.textContent="Start backup",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[4]),m(s,"class","btn btn-expanded"),s.disabled=n[3],x(s,"btn-loading",n[3])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),o||(r=J(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&x(s,"btn-loading",a[3])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,r()}}}function q8(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[R8],header:[F8],default:[N8]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function j8(n,e,t){const i=Tt(),s="backup_create_"+W.randomString(5);let l,o="",r=!1,a;function u($){tn({}),t(3,r=!1),t(2,o=$||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function d(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await de.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),Ht("Successfully generated new backup.")}catch($){$.isAbort||de.error($)}clearTimeout(a),t(3,r=!1)}}jo(()=>{clearTimeout(a)});function p(){o=this.value,t(2,o)}const h=()=>r?(yo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&yo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _($){ne[$?"unshift":"push"](()=>{l=$,t(1,l)})}function b($){he.call(this,n,$)}function k($){he.call(this,n,$)}return[f,l,o,r,s,d,u,p,h,g,_,b,k]}class V8 extends ve{constructor(e){super(),be(this,e,j8,q8,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function z8(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Backup name"),s=D(),l=y("input"),m(e,"for",i=n[14]),m(l,"type","text"),m(l,"id",o=n[14]),l.required=!0},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[2]),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&m(e,"for",i),f&16384&&o!==(o=u[14])&&m(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function H8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b;return u=new Fl({props:{value:n[1]}}),h=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[z8,({uniqueId:k})=>({14:k}),({uniqueId:k})=>k?16384:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div>
<div class="content"><p>Please proceed with caution.</p>
<p>The restore operation will replace your existing <code>pb_data</code> with the one from the backup
and will restart the application process!</p>
<p class="txt-bold">Backup restore is still experimental and currently works only on UNIX based systems.</p></div>`,t=D(),i=y("div"),s=Y(`Type the backup name
`),l=y("div"),o=y("span"),r=Y(n[1]),a=D(),B(u.$$.fragment),f=Y(`
to confirm:`),d=D(),p=y("form"),B(h.$$.fragment),m(e,"class","alert alert-danger"),m(o,"class","txt"),m(l,"class","label"),m(i,"class","content m-b-sm"),m(p,"id",n[6]),m(p,"autocomplete","off")},m(k,$){S(k,e,$),S(k,t,$),S(k,i,$),v(i,s),v(i,l),v(l,o),v(o,r),v(l,a),z(u,l,null),v(i,f),S(k,d,$),S(k,p,$),z(h,p,null),g=!0,_||(b=J(p,"submit",xe(n[7])),_=!0)},p(k,$){(!g||$&2)&&le(r,k[1]);const C={};$&2&&(C.value=k[1]),u.$set(C);const T={};$&49156&&(T.$$scope={dirty:$,ctx:k}),h.$set(T)},i(k){g||(I(u.$$.fragment,k),I(h.$$.fragment,k),g=!0)},o(k){P(u.$$.fragment,k),P(h.$$.fragment,k),g=!1},d(k){k&&w(e),k&&w(t),k&&w(i),H(u),k&&w(d),k&&w(p),H(h),_=!1,b()}}}function B8(n){let e,t,i,s;return{c(){e=y("h4"),t=Y("Restore "),i=y("strong"),s=Y(n[1]),m(e,"class","center txt-break")},m(l,o){S(l,e,o),v(e,t),v(e,i),v(i,s)},p(l,o){o&2&&le(s,l[1])},d(l){l&&w(e)}}}function U8(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=Y("Cancel"),i=D(),s=y("button"),l=y("span"),l.textContent="Restore backup",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[6]),m(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){S(u,e,f),v(e,t),S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function W8(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[U8],header:[B8],default:[H8]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(s,l){z(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function Y8(n,e,t){let i;const s="backup_restore_"+W.randomString(5);let l,o="",r="",a=!1;function u(k){tn({}),t(2,r=""),t(1,o=k),t(4,a=!1),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function d(){var k;if(!(!i||a)){t(4,a=!0);try{await de.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch($){$!=null&&$.isAbort||(t(4,a=!1),As(((k=$.response)==null?void 0:k.message)||$.message))}}}function p(){r=this.value,t(2,r)}const h=()=>!a;function g(k){ne[k?"unshift":"push"](()=>{l=k,t(3,l)})}function _(k){he.call(this,n,k)}function b(k){he.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[f,o,r,l,a,i,s,d,u,p,h,g,_,b]}class K8 extends ve{constructor(e){super(),be(this,e,Y8,W8,_e,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function V_(n,e,t){const i=n.slice();return i[22]=e[t],i}function z_(n,e,t){const i=n.slice();return i[19]=e[t],i}function J8(n){let e=[],t=new Map,i,s,l=n[3];const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=V_(n,l,a),f=o(u);t.set(f,e[a]=B_(f,u))}let r=null;return l.length||(r=H_()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=we(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);S(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=a[3],ue(),e=vt(e,u,o,1,a,l,t,i.parentNode,Ut,B_,i,V_),fe(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=H_(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)I(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)P(e[u]);s=!1},d(a){for(let u=0;u<e.length;u+=1)e[u].d(a);a&&w(i),r&&r.d(a)}}}function Z8(n){let e,t=Array(n[3].length||1),i=[];for(let s=0;s<t.length;s+=1)i[s]=U_(z_(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&8){t=Array(s[3].length||1);let o;for(o=0;o<t.length;o+=1){const r=z_(s,t,o);i[o]?i[o].p(r,l):(i[o]=U_(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(s){ht(i,s),s&&w(e)}}}function H_(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="txt">No backups yet.</span>
`,m(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function B_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,d,p=W.formattedFileSize(e[22].size)+"",h,g,_,b,k,$,C,T,O,M,E,A,L,N,R,F,q,V,U,j;function Q(){return e[10](e[22])}function X(){return e[11](e[22])}function Z(){return e[12](e[22])}return{key:n,first:null,c(){t=y("div"),i=y("i"),s=D(),l=y("div"),o=y("span"),a=Y(r),u=D(),f=y("span"),d=Y("("),h=Y(p),g=Y(")"),_=D(),b=y("div"),k=y("button"),$=y("i"),T=D(),O=y("button"),M=y("i"),A=D(),L=y("button"),N=y("i"),F=D(),m(i,"class","ri-folder-zip-line"),m(o,"class","name backup-name svelte-1ulbkf5"),m(f,"class","size txt-hint txt-nowrap"),m(l,"class","content"),m($,"class","ri-download-line"),m(k,"type","button"),m(k,"class","btn btn-sm btn-circle btn-hint btn-transparent"),k.disabled=C=e[6][e[22].key]||e[5][e[22].key],m(k,"aria-label","Download"),x(k,"btn-loading",e[5][e[22].key]),m(M,"class","ri-restart-line"),m(O,"type","button"),m(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=E=e[6][e[22].key],m(O,"aria-label","Restore"),m(N,"class","ri-delete-bin-7-line"),m(L,"type","button"),m(L,"class","btn btn-sm btn-circle btn-hint btn-transparent"),L.disabled=R=e[6][e[22].key],m(L,"aria-label","Delete"),x(L,"btn-loading",e[6][e[22].key]),m(b,"class","actions nonintrusive"),m(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(re,ee){S(re,t,ee),v(t,i),v(t,s),v(t,l),v(l,o),v(o,a),v(l,u),v(l,f),v(f,d),v(f,h),v(f,g),v(t,_),v(t,b),v(b,k),v(k,$),v(b,T),v(b,O),v(O,M),v(b,A),v(b,L),v(L,N),v(t,F),V=!0,U||(j=[Ee(Be.call(null,k,"Download")),J(k,"click",xe(Q)),Ee(Be.call(null,O,"Restore")),J(O,"click",xe(X)),Ee(Be.call(null,L,"Delete")),J(L,"click",xe(Z))],U=!0)},p(re,ee){e=re,(!V||ee&8)&&r!==(r=e[22].key+"")&&le(a,r),(!V||ee&8)&&p!==(p=W.formattedFileSize(e[22].size)+"")&&le(h,p),(!V||ee&104&&C!==(C=e[6][e[22].key]||e[5][e[22].key]))&&(k.disabled=C),(!V||ee&40)&&x(k,"btn-loading",e[5][e[22].key]),(!V||ee&72&&E!==(E=e[6][e[22].key]))&&(O.disabled=E),(!V||ee&72&&R!==(R=e[6][e[22].key]))&&(L.disabled=R),(!V||ee&72)&&x(L,"btn-loading",e[6][e[22].key])},i(re){V||(re&&et(()=>{V&&(q||(q=Ve(t,rt,{duration:150},!0)),q.run(1))}),V=!0)},o(re){re&&(q||(q=Ve(t,rt,{duration:150},!1)),q.run(0)),V=!1},d(re){re&&w(t),re&&q&&q.end(),U=!1,De(j)}}}function U_(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="skeleton-loader"></span>
`,m(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function G8(n){let e,t,i;return{c(){e=y("span"),t=D(),i=y("span"),i.textContent="Backup/restore operation is in process",m(e,"class","loader loader-sm"),m(i,"class","txt")},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 X8(n){let e,t,i;return{c(){e=y("i"),t=D(),i=y("span"),i.textContent="Initialize new backup",m(e,"class","ri-play-circle-line"),m(i,"class","txt")},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 Q8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;const b=[Z8,J8],k=[];function $(A,L){return A[4]?0:1}i=$(n),s=k[i]=b[i](n);function C(A,L){return A[7]?X8:G8}let T=C(n),O=T(n),M={};f=new V8({props:M}),n[14](f),f.$on("submit",n[15]);let E={};return p=new K8({props:E}),n[16](p),{c(){e=y("div"),t=y("div"),s.c(),l=D(),o=y("div"),r=y("button"),O.c(),u=D(),B(f.$$.fragment),d=D(),B(p.$$.fragment),m(t,"class","list-content svelte-1ulbkf5"),m(r,"type","button"),m(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],m(o,"class","list-item list-item-btn"),m(e,"class","list list-compact")},m(A,L){S(A,e,L),v(e,t),k[i].m(t,null),v(e,l),v(e,o),v(o,r),O.m(r,null),S(A,u,L),z(f,A,L),S(A,d,L),z(p,A,L),h=!0,g||(_=J(r,"click",n[13]),g=!0)},p(A,[L]){let N=i;i=$(A),i===N?k[i].p(A,L):(ue(),P(k[N],1,1,()=>{k[N]=null}),fe(),s=k[i],s?s.p(A,L):(s=k[i]=b[i](A),s.c()),I(s,1),s.m(t,null)),T!==(T=C(A))&&(O.d(1),O=T(A),O&&(O.c(),O.m(r,null))),(!h||L&144&&a!==(a=A[4]||!A[7]))&&(r.disabled=a);const R={};f.$set(R);const F={};p.$set(F)},i(A){h||(I(s),I(f.$$.fragment,A),I(p.$$.fragment,A),h=!0)},o(A){P(s),P(f.$$.fragment,A),P(p.$$.fragment,A),h=!1},d(A){A&&w(e),k[i].d(),O.d(),A&&w(u),n[14](null),H(f,A),A&&w(d),n[16](null),H(p,A),g=!1,_()}}}function x8(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await de.backups.getFullList()),l.sort((M,E)=>M.modified<E.modified?1:M.modified>E.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(de.error(M),t(4,o=!1))}}async function d(M){if(!r[M]){t(5,r[M]=!0,r);try{const E=await de.getAdminFileToken(),A=de.backups.getDownloadUrl(E,M);W.download(A)}catch(E){E.isAbort||de.error(E)}delete r[M],t(5,r)}}function p(M){mn(`Do you really want to delete ${M}?`,()=>h(M))}async function h(M){if(!a[M]){t(6,a[M]=!0,a);try{await de.backups.delete(M),W.removeByKey(l,"name",M),f(),Ht(`Successfully deleted ${M}.`)}catch(E){E.isAbort||de.error(E)}delete a[M],t(6,a)}}async function g(){var M;try{const E=await de.health.check({$autoCancel:!1}),A=u;t(7,u=((M=E==null?void 0:E.data)==null?void 0:M.canBackup)||!1),A!=u&&u&&f()}catch{}}Xt(()=>{let M=setInterval(()=>{g()},3e3);return()=>{clearInterval(M)}});const _=M=>d(M.key),b=M=>s.show(M.key),k=M=>p(M.key),$=()=>i==null?void 0:i.show();function C(M){ne[M?"unshift":"push"](()=>{i=M,t(1,i)})}const T=()=>{f()};function O(M){ne[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[f,i,s,l,o,r,a,u,d,p,_,b,k,$,C,T,O]}class eI extends ve{constructor(e){super(),be(this,e,x8,Q8,_e,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function tI(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-down-s-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function nI(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-up-s-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function W_(n){var U,j,Q;let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E;t=new me({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[iI,({uniqueId:X})=>({32:X}),({uniqueId:X})=>[0,X?2:0]]},$$scope:{ctx:n}}});let A=n[2]&&Y_(n);function L(X){n[25](X)}function N(X){n[26](X)}function R(X){n[27](X)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new M1({props:F}),ne.push(()=>pe(r,"config",L)),ne.push(()=>pe(r,"isTesting",N)),ne.push(()=>pe(r,"testError",R));let q=((Q=(j=n[1].backups)==null?void 0:j.s3)==null?void 0:Q.enabled)&&!n[9]&&!n[5]&&K_(n),V=n[9]&&J_(n);return{c(){e=y("form"),B(t.$$.fragment),i=D(),A&&A.c(),s=D(),l=y("div"),o=D(),B(r.$$.fragment),d=D(),p=y("div"),h=y("div"),g=D(),q&&q.c(),_=D(),V&&V.c(),b=D(),k=y("button"),$=y("span"),$.textContent="Save changes",m(l,"class","clearfix m-b-base"),m(h,"class","flex-fill"),m($,"class","txt"),m(k,"type","submit"),m(k,"class","btn btn-expanded"),k.disabled=C=!n[9]||n[5],x(k,"btn-loading",n[5]),m(p,"class","flex"),m(e,"class","block"),m(e,"autocomplete","off")},m(X,Z){S(X,e,Z),z(t,e,null),v(e,i),A&&A.m(e,null),v(e,s),v(e,l),v(e,o),z(r,e,null),v(e,d),v(e,p),v(p,h),v(p,g),q&&q.m(p,null),v(p,_),V&&V.m(p,null),v(p,b),v(p,k),v(k,$),O=!0,M||(E=[J(k,"click",n[29]),J(e,"submit",xe(n[11]))],M=!0)},p(X,Z){var se,ye,$e;const re={};Z[0]&4|Z[1]&6&&(re.$$scope={dirty:Z,ctx:X}),t.$set(re),X[2]?A?(A.p(X,Z),Z[0]&4&&I(A,1)):(A=Y_(X),A.c(),I(A,1),A.m(e,s)):A&&(ue(),P(A,1,1,()=>{A=null}),fe());const ee={};Z[0]&1&&(ee.originalConfig=(se=X[0].backups)==null?void 0:se.s3),!a&&Z[0]&2&&(a=!0,ee.config=X[1].backups.s3,ge(()=>a=!1)),!u&&Z[0]&128&&(u=!0,ee.isTesting=X[7],ge(()=>u=!1)),!f&&Z[0]&256&&(f=!0,ee.testError=X[8],ge(()=>f=!1)),r.$set(ee),($e=(ye=X[1].backups)==null?void 0:ye.s3)!=null&&$e.enabled&&!X[9]&&!X[5]?q?q.p(X,Z):(q=K_(X),q.c(),q.m(p,_)):q&&(q.d(1),q=null),X[9]?V?V.p(X,Z):(V=J_(X),V.c(),V.m(p,b)):V&&(V.d(1),V=null),(!O||Z[0]&544&&C!==(C=!X[9]||X[5]))&&(k.disabled=C),(!O||Z[0]&32)&&x(k,"btn-loading",X[5])},i(X){O||(I(t.$$.fragment,X),I(A),I(r.$$.fragment,X),X&&et(()=>{O&&(T||(T=Ve(e,rt,{duration:150},!0)),T.run(1))}),O=!0)},o(X){P(t.$$.fragment,X),P(A),P(r.$$.fragment,X),X&&(T||(T=Ve(e,rt,{duration:150},!1)),T.run(0)),O=!1},d(X){X&&w(e),H(t),A&&A.d(),H(r),q&&q.d(),V&&V.d(),X&&T&&T.end(),M=!1,De(E)}}}function iI(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=Y("Enable auto backups"),m(e,"type","checkbox"),m(e,"id",t=n[32]),e.required=!0,m(s,"for",o=n[32])},m(u,f){S(u,e,f),e.checked=n[2],S(u,i,f),S(u,s,f),v(s,l),r||(a=J(e,"change",n[18]),r=!0)},p(u,f){f[1]&2&&t!==(t=u[32])&&m(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&2&&o!==(o=u[32])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Y_(n){let e,t,i,s,l,o,r,a,u;return s=new me({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[lI,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[oI,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),B(s.$$.fragment),l=D(),o=y("div"),B(r.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(t,"class","grid p-t-base p-b-sm"),m(e,"class","block")},m(f,d){S(f,e,d),v(e,t),v(t,i),z(s,i,null),v(t,l),v(t,o),z(r,o,null),u=!0},p(f,d){const p={};d[0]&3|d[1]&6&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const h={};d[0]&2|d[1]&6&&(h.$$scope={dirty:d,ctx:f}),r.$set(h)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=Ve(e,rt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(e,rt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),H(s),H(r),f&&a&&a.end()}}}function sI(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("button"),e.innerHTML='<span class="txt">Every day at 00:00h</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Every sunday at 00:00h</span>',s=D(),l=y("button"),l.innerHTML='<span class="txt">Every Mon and Wed at 00:00h</span>',o=D(),r=y("button"),r.innerHTML='<span class="txt">Every first day of the month at 00:00h</span>',m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable"),m(r,"type","button"),m(r,"class","dropdown-item closable")},m(f,d){S(f,e,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),S(f,o,d),S(f,r,d),a||(u=[J(e,"click",n[20]),J(i,"click",n[21]),J(l,"click",n[22]),J(r,"click",n[23])],a=!0)},p:te,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,De(u)}}}function lI(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T;return _=new Jn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[sI]},$$scope:{ctx:n}}}),{c(){var O,M;e=y("label"),t=Y("Cron expression"),s=D(),l=y("input"),a=D(),u=y("div"),f=y("button"),d=y("span"),d.textContent="Presets",p=D(),h=y("i"),g=D(),B(_.$$.fragment),b=D(),k=y("div"),k.textContent="Only numeric list, steps or ranges are supported.",m(e,"for",i=n[32]),l.required=!0,m(l,"type","text"),m(l,"id",o=n[32]),m(l,"class","txt-lg txt-mono"),m(l,"placeholder","* * * * *"),l.autofocus=r=!((M=(O=n[0])==null?void 0:O.backups)!=null&&M.cron),m(d,"class","txt"),m(h,"class","ri-arrow-drop-down-fill"),m(f,"type","button"),m(f,"class","btn btn-sm btn-outline p-r-0"),m(u,"class","form-field-addon"),m(k,"class","help-block")},m(O,M){var E,A;S(O,e,M),v(e,t),S(O,s,M),S(O,l,M),ae(l,n[1].backups.cron),S(O,a,M),S(O,u,M),v(u,f),v(f,d),v(f,p),v(f,h),v(f,g),z(_,f,null),S(O,b,M),S(O,k,M),$=!0,(A=(E=n[0])==null?void 0:E.backups)!=null&&A.cron||l.focus(),C||(T=J(l,"input",n[19]),C=!0)},p(O,M){var A,L;(!$||M[1]&2&&i!==(i=O[32]))&&m(e,"for",i),(!$||M[1]&2&&o!==(o=O[32]))&&m(l,"id",o),(!$||M[0]&1&&r!==(r=!((L=(A=O[0])==null?void 0:A.backups)!=null&&L.cron)))&&(l.autofocus=r),M[0]&2&&l.value!==O[1].backups.cron&&ae(l,O[1].backups.cron);const E={};M[0]&2|M[1]&4&&(E.$$scope={dirty:M,ctx:O}),_.$set(E)},i(O){$||(I(_.$$.fragment,O),$=!0)},o(O){P(_.$$.fragment,O),$=!1},d(O){O&&w(e),O&&w(s),O&&w(l),O&&w(a),O&&w(u),H(_),O&&w(b),O&&w(k),C=!1,T()}}}function oI(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=Y("Max @auto backups to keep"),s=D(),l=y("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"min","1")},m(u,f){S(u,e,f),v(e,t),S(u,s,f),S(u,l,f),ae(l,n[1].backups.cronMaxKeep),r||(a=J(l,"input",n[24]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&m(e,"for",i),f[1]&2&&o!==(o=u[32])&&m(l,"id",o),f[0]&2&&pt(l.value)!==u[1].backups.cronMaxKeep&&ae(l,u[1].backups.cronMaxKeep)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function K_(n){let e;function t(l,o){return l[7]?uI:l[8]?aI:rI}let i=t(n),s=i(n);return{c(){s.c(),e=we()},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 rI(n){let e;return{c(){e=y("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function aI(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Ee(t=Be.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function uI(n){let e;return{c(){e=y("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function J_(n){let e,t,i,s,l;return{c(){e=y("button"),t=y("span"),t.textContent="Reset",m(t,"class","txt"),m(e,"type","submit"),m(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){S(o,e,r),v(e,t),s||(l=J(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&w(e),s=!1,l()}}}function fI(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$,C,T,O,M,E,A,L;h=new Zo({props:{class:"btn-sm",tooltip:"Reload backups list"}}),h.$on("refresh",n[15]);let N={};_=new eI({props:N}),n[16](_);function R(U,j){return U[6]?nI:tI}let F=R(n),q=F(n),V=n[6]&&!n[4]&&W_(n);return{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=Y(n[10]),r=D(),a=y("div"),u=y("div"),f=y("div"),d=y("span"),d.textContent="Backup and restore your PocketBase data",p=D(),B(h.$$.fragment),g=D(),B(_.$$.fragment),b=D(),k=y("hr"),$=D(),C=y("button"),T=y("span"),T.textContent="Backups options",O=D(),q.c(),M=D(),V&&V.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(d,"class","txt-xl"),m(f,"class","flex m-b-sm flex-gap-5"),m(T,"class","txt"),m(C,"type","button"),m(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(U,j){S(U,e,j),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),S(U,r,j),S(U,a,j),v(a,u),v(u,f),v(f,d),v(f,p),z(h,f,null),v(u,g),z(_,u,null),v(u,b),v(u,k),v(u,$),v(u,C),v(C,T),v(C,O),q.m(C,null),v(u,M),V&&V.m(u,null),E=!0,A||(L=[J(C,"click",n[17]),J(u,"submit",xe(n[11]))],A=!0)},p(U,j){(!E||j[0]&1024)&&le(o,U[10]);const Q={};_.$set(Q),F!==(F=R(U))&&(q.d(1),q=F(U),q&&(q.c(),q.m(C,null))),(!E||j[0]&16)&&(C.disabled=U[4]),(!E||j[0]&16)&&x(C,"btn-loading",U[4]),U[6]&&!U[4]?V?(V.p(U,j),j[0]&80&&I(V,1)):(V=W_(U),V.c(),I(V,1),V.m(u,null)):V&&(ue(),P(V,1,1,()=>{V=null}),fe())},i(U){E||(I(h.$$.fragment,U),I(_.$$.fragment,U),I(V),E=!0)},o(U){P(h.$$.fragment,U),P(_.$$.fragment,U),P(V),E=!1},d(U){U&&w(e),U&&w(r),U&&w(a),H(h),n[16](null),H(_),q.d(),V&&V.d(),A=!1,De(L)}}}function cI(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[fI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(l,o){z(e,l,o),S(l,t,o),z(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&w(t),H(i,l)}}}function dI(n,e,t){let i,s;Ze(n,Mt,Z=>t(10,s=Z)),ln(Mt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",d=!1,p=!1,h=!1,g=null;_();async function _(){t(4,a=!0);try{const Z=await de.settings.getAll()||{};k(Z)}catch(Z){de.error(Z)}t(4,a=!1)}async function b(){if(!(u||!i)){t(5,u=!0);try{const Z=await de.settings.update(W.filterRedactedProps(r));await C(),k(Z),Ht("Successfully saved application settings.")}catch(Z){de.error(Z)}t(5,u=!1)}}function k(Z={}){t(1,r={backups:(Z==null?void 0:Z.backups)||{}}),t(2,d=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function $(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,d=r.backups.cron!="")}async function C(){await(l==null?void 0:l.loadBackups())}const T=()=>C();function O(Z){ne[Z?"unshift":"push"](()=>{l=Z,t(3,l)})}const M=()=>t(6,p=!p);function E(){d=this.checked,t(2,d)}function A(){r.backups.cron=this.value,t(1,r),t(2,d)}const L=()=>{t(1,r.backups.cron="0 0 * * *",r)},N=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function q(){r.backups.cronMaxKeep=pt(this.value),t(1,r),t(2,d)}function V(Z){n.$$.not_equal(r.backups.s3,Z)&&(r.backups.s3=Z,t(1,r),t(2,d))}function U(Z){h=Z,t(7,h)}function j(Z){g=Z,t(8,g)}const Q=()=>$(),X=()=>b();return n.$$.update=()=>{var Z;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!d&&(Z=r==null?void 0:r.backups)!=null&&Z.cron&&(ui("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,d,l,a,u,p,h,g,i,s,b,$,C,f,T,O,M,E,A,L,N,R,F,q,V,U,j,Q,X]}class pI extends ve{constructor(e){super(),be(this,e,dI,cI,_e,{},null,[-1,-1])}}const zt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Vi("/"):!0}],mI={"/login":Lt({component:kD,conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Lt({asyncComponent:()=>ut(()=>import("./PageAdminRequestPasswordReset-5a34605f.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Lt({asyncComponent:()=>ut(()=>import("./PageAdminConfirmPasswordReset-5ed56449.js"),[],import.meta.url),conditions:zt.concat([n=>!de.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Lt({component:WE,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Lt({component:F$,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Lt({component:AD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Lt({component:hD,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Lt({component:hA,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Lt({component:FA,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Lt({component:xA,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Lt({component:a8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Lt({component:m8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Lt({component:L8,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Lt({component:pI,conditions:zt.concat([n=>de.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-308f35f5.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmPasswordReset-308f35f5.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-7e732de9.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmVerification-7e732de9.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-3974e826.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Lt({asyncComponent:()=>ut(()=>import("./PageRecordConfirmEmailChange-3974e826.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Lt({asyncComponent:()=>ut(()=>import("./PageOAuth2Redirect-e9e525d0.js"),[],import.meta.url),conditions:zt,userData:{showAppSidebar:!1}}),"*":Lt({component:ik,userData:{showAppSidebar:!1}})};function hI(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:d=h=>Math.sqrt(h)*120,easing:p=Ko}=i;return{delay:f,duration:jt(d)?d(Math.sqrt(a*a+u*u)):d,easing:p,css:(h,g)=>{const _=g*a,b=g*u,k=h+g*e.width/t.width,$=h+g*e.height/t.height;return`transform: ${l} translate(${_}px, ${b}px) scale(${k}, ${$});`}}}function Z_(n,e,t){const i=n.slice();return i[2]=e[t],i}function _I(n){let e;return{c(){e=y("i"),m(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function gI(n){let e;return{c(){e=y("i"),m(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function bI(n){let e;return{c(){e=y("i"),m(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function vI(n){let e;return{c(){e=y("i"),m(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function G_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,d,p,h,g=te,_,b,k;function $(M,E){return M[2].type==="info"?vI:M[2].type==="success"?bI:M[2].type==="warning"?gI:_I}let C=$(e),T=C(e);function O(){return e[1](e[2])}return{key:n,first:null,c(){t=y("div"),i=y("div"),T.c(),s=D(),l=y("div"),r=Y(o),a=D(),u=y("button"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),m(i,"class","icon"),m(l,"class","content"),m(u,"type","button"),m(u,"class","close"),m(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,E){S(M,t,E),v(t,i),T.m(i,null),v(t,s),v(t,l),v(l,r),v(t,a),v(t,u),v(t,f),_=!0,b||(k=J(u,"click",xe(O)),b=!0)},p(M,E){e=M,C!==(C=$(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!_||E&1)&&o!==(o=e[2].message+"")&&le(r,o),(!_||E&1)&&x(t,"alert-info",e[2].type=="info"),(!_||E&1)&&x(t,"alert-success",e[2].type=="success"),(!_||E&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||E&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){Q1(t),g(),lg(t,h)},a(){g(),g=X1(t,h,hI,{duration:150})},i(M){_||(et(()=>{_&&(p&&p.end(1),d=ag(t,rt,{duration:150}),d.start())}),_=!0)},o(M){d&&d.invalidate(),p=Ta(t,na,{duration:150}),_=!1},d(M){M&&w(t),T.d(),M&&p&&p.end(),b=!1,k()}}}function yI(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=Z_(n,l,r),u=o(a);i.set(u,t[r]=G_(u,a))}return{c(){e=y("div");for(let r=0;r<t.length;r+=1)t[r].c();m(e,"class","toasts-wrapper")},m(r,a){S(r,e,a);for(let u=0;u<t.length;u+=1)t[u]&&t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],ue();for(let u=0;u<t.length;u+=1)t[u].r();t=vt(t,a,o,1,r,l,i,e,i0,G_,null,Z_);for(let u=0;u<t.length;u+=1)t[u].a();fe()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)I(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function kI(n,e,t){let i;return Ze(n,Wo,l=>t(0,i=l)),[i,l=>_b(l)]}class wI extends ve{constructor(e){super(),be(this,e,kI,yI,_e,{})}}function SI(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=y("h4"),i=Y(t),m(e,"class","block center txt-break"),m(e,"slot","header")},m(l,o){S(l,e,o),v(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 $I(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="No",i=D(),s=y("button"),l=y("span"),l.textContent="Yes",m(t,"class","txt"),e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],m(l,"class","txt"),m(s,"type","button"),m(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],x(s,"btn-loading",n[2])},m(a,u){S(a,e,u),v(e,t),S(a,i,u),S(a,s,u),v(s,l),e.focus(),o||(r=[J(e,"click",n[4]),J(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&x(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,De(r)}}}function TI(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:[$I],header:[SI]},$$scope:{ctx:n}};return e=new on({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(s,l){z(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||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[6](null),H(e,s)}}}function CI(n,e,t){let i;Ze(n,uu,d=>t(1,i=d));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(d){ne[d?"unshift":"push"](()=>{s=d,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await cn(),t(3,o=!1),y1()};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 MI extends ve{constructor(e){super(),be(this,e,CI,TI,_e,{})}}function X_(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,b,k,$;return _=new Jn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[OI]},$$scope:{ctx:n}}}),{c(){var C;e=y("aside"),t=y("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=D(),s=y("nav"),l=y("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=D(),r=y("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=D(),u=y("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=D(),d=y("figure"),p=y("img"),g=D(),B(_.$$.fragment),m(t,"href","/"),m(t,"class","logo logo-sm"),m(l,"href","/collections"),m(l,"class","menu-item"),m(l,"aria-label","Collections"),m(r,"href","/logs"),m(r,"class","menu-item"),m(r,"aria-label","Logs"),m(u,"href","/settings"),m(u,"class","menu-item"),m(u,"aria-label","Settings"),m(s,"class","main-menu"),_n(p.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||m(p,"src",h),m(p,"alt","Avatar"),m(d,"class","thumb thumb-circle link-hint closable"),m(e,"class","app-sidebar")},m(C,T){S(C,e,T),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(e,f),v(e,d),v(d,p),v(d,g),z(_,d,null),b=!0,k||($=[Ee(rn.call(null,t)),Ee(rn.call(null,l)),Ee(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ee(Be.call(null,l,{text:"Collections",position:"right"})),Ee(rn.call(null,r)),Ee(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ee(Be.call(null,r,{text:"Logs",position:"right"})),Ee(rn.call(null,u)),Ee(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ee(Be.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p(C,T){var M;(!b||T&1&&!_n(p.src,h="./images/avatars/avatar"+(((M=C[0])==null?void 0:M.avatar)||0)+".svg"))&&m(p,"src",h);const O={};T&4096&&(O.$$scope={dirty:T,ctx:C}),_.$set(O)},i(C){b||(I(_.$$.fragment,C),b=!0)},o(C){P(_.$$.fragment,C),b=!1},d(C){C&&w(e),H(_),k=!1,De($)}}}function OI(n){let e,t,i,s,l,o,r;return{c(){e=y("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=D(),i=y("hr"),s=D(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,m(e,"href","/settings/admins"),m(e,"class","dropdown-item closable"),m(l,"type","button"),m(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=[Ee(rn.call(null,e)),J(l,"click",n[7])],o=!0)},p:te,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,De(r)}}}function Q_(n){let e,t,i;return t=new mu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:W.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),B(t.$$.fragment),m(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),z(t,e,null),i=!0},p:te,i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&w(e),H(t)}}}function EI(n){var b;let e,t,i,s,l,o,r,a,u,f,d,p,h;document.title=e=W.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((b=n[0])==null?void 0:b.id)&&n[1]&&X_(n);o=new d0({props:{routes:mI}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new wI({}),f=new MI({});let _=n[1]&&!n[2]&&Q_(n);return{c(){t=D(),i=y("div"),g&&g.c(),s=D(),l=y("div"),B(o.$$.fragment),r=D(),B(a.$$.fragment),u=D(),B(f.$$.fragment),d=D(),_&&_.c(),p=we(),m(l,"class","app-body"),m(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),g&&g.m(i,null),v(i,s),v(i,l),z(o,l,null),v(l,r),z(a,l,null),S(k,u,$),z(f,k,$),S(k,d,$),_&&_.m(k,$),S(k,p,$),h=!0},p(k,[$]){var C;(!h||$&24)&&e!==(e=W.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(C=k[0])!=null&&C.id&&k[1]?g?(g.p(k,$),$&3&&I(g,1)):(g=X_(k),g.c(),I(g,1),g.m(i,s)):g&&(ue(),P(g,1,1,()=>{g=null}),fe()),k[1]&&!k[2]?_?(_.p(k,$),$&6&&I(_,1)):(_=Q_(k),_.c(),I(_,1),_.m(p.parentNode,p)):_&&(ue(),P(_,1,1,()=>{_=null}),fe())},i(k){h||(I(g),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(_),h=!0)},o(k){P(g),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(_),h=!1},d(k){k&&w(t),k&&w(i),g&&g.d(),H(o),H(a),k&&w(u),H(f,k),k&&w(d),_&&_.d(k),k&&w(p)}}}function DI(n,e,t){let i,s,l,o;Ze(n,Is,_=>t(10,i=_)),Ze(n,So,_=>t(3,s=_)),Ze(n,qa,_=>t(0,l=_)),Ze(n,Mt,_=>t(4,o=_));let r,a=!1,u=!1;function f(_){var b,k,$,C;((b=_==null?void 0:_.detail)==null?void 0:b.location)!==r&&(t(1,a=!!(($=(k=_==null?void 0:_.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(C=_==null?void 0:_.detail)==null?void 0:C.location,ln(Mt,o="",o),tn({}),y1())}function d(){Vi("/")}async function p(){var _,b;if(l!=null&&l.id)try{const k=await de.settings.getAll({$cancelKey:"initialAppSettings"});ln(So,s=((_=k==null?void 0:k.meta)==null?void 0:_.appName)||"",s),ln(Is,i=!!((b=k==null?void 0:k.meta)!=null&&b.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function h(){de.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,h,g]}class AI extends ve{constructor(e){super(),be(this,e,DI,EI,_e,{})}}new AI({target:document.getElementById("app")});export{De as A,Ht as B,W as C,Vi as D,we as E,bb as F,hg as G,Xt as H,Ze as I,di as J,Tt as K,ne as L,b1 as M,vt as N,zo as O,us as P,Ut as Q,ht as R,ve as S,kn as T,Hr as U,P as a,D as b,B as c,H as d,y as e,m as f,S as g,v as h,be as i,Ee as j,ue as k,rn as l,z as m,fe as n,w as o,de as p,me as q,x as r,_e as s,I as t,J as u,xe as v,Y as w,le as x,te as y,ae as z};