pocketbase/ui/dist/assets/index-3d43ee7c.js

201 lines
914 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 X(){}const wl=n=>n;function Le(n,e){for(const t in e)n[t]=e[t];return n}function rb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function T_(n){return n()}function ru(){return Object.create(null)}function Ae(n){n.forEach(T_)}function Bt(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 Un(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function ab(n){return Object.keys(n).length===0}function $_(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function We(n,e,t){n.$$.on_destroy.push($_(e,t))}function Et(n,e,t,i){if(n){const s=C_(n,e,t,i);return n[0](s)}}function C_(n,e,t,i){return n[1]&&i?Le(t.ctx.slice(),n[1](i(e))):t.ctx}function At(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 It(n,e,t,i,s,l){if(s){const o=C_(e,t,i,l);n.p(o,s)}}function Pt(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 jt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Je(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 $i(n){return n??""}function Gt(n,e,t){return n.set(t),e}function De(n){return n&&Bt(n.destroy)?n.destroy:X}function au(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const M_=typeof window<"u";let Fo=M_?()=>window.performance.now():()=>Date.now(),pa=M_?n=>requestAnimationFrame(n):X;const bs=new Set;function O_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&pa(O_)}function Ro(n){let e;return bs.size===0&&pa(O_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function b(n,e){n.appendChild(e)}function D_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function ub(n){const e=v("style");return fb(D_(n),e),e.sheet}function fb(n,e){return b(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 at(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function D(){return B(" ")}function we(){return B("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function $n(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)}function xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:m(n,i,e[i])}function cb(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 ht(n){return n===""?null:+n}function db(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ue(n,e){n.value=e??""}function Nr(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function E_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}function $t(n,e){return new n(e)}const mo=new Map;let ho=0;function pb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function mb(n,e){const t={stylesheet:ub(e),rules:{}};return mo.set(n,t),t}function ul(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${pb(f)}_${r}`,d=D_(n),{stylesheet:p,rules:h}=mo.get(d)||mb(d,n);h[c]||(h[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function fl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||hb())}function hb(){pa(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function _b(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=wl,start:a=Fo()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,h;function g(){c&&(h=ul(n,0,1,o,l,r,c)),l||(p=!0)}function _(){c&&fl(n,h),d=!1}return Ro(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),_()),!d)return!1;if(p){const k=y-a,T=0+1*r(k/o);f(T,1-T)}return!0}),g(),f(0,1),_}function gb(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,A_(n,s)}}function A_(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 cl;function ai(n){cl=n}function Sl(){if(!cl)throw new Error("Function called outside component initialization");return cl}function Qt(n){Sl().$$.on_mount.push(n)}function bb(n){Sl().$$.after_update.push(n)}function I_(n){Sl().$$.on_destroy.push(n)}function vt(){const n=Sl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=E_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function de(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],se=[];let vs=[];const Fr=[],P_=Promise.resolve();let Rr=!1;function L_(){Rr||(Rr=!0,P_.then(ma))}function rn(){return L_(),P_}function et(n){vs.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cs=0;function ma(){if(cs!==0)return;const n=cl;do{try{for(;cs<gs.length;){const e=gs[cs];cs++,ai(e),vb(e.$$)}}catch(e){throw gs.length=0,cs=0,e}for(ai(null),gs.length=0,cs=0;se.length;)se.pop()();for(let e=0;e<vs.length;e+=1){const t=vs[e];tr.has(t)||(tr.add(t),t())}vs.length=0}while(gs.length);for(;Fr.length;)Fr.pop()();Rr=!1,tr.clear(),ai(n)}function vb(n){if(n.fragment!==null){n.update(),Ae(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(et)}}function yb(n){const e=[],t=[];vs.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vs=e}let qs;function ha(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Gi(n,e,t){n.dispatchEvent(E_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Gn;function re(){Gn={r:0,c:[],p:Gn}}function ae(){Gn.r||Ae(Gn.c),Gn=Gn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Gn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function kb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&fl(n,o)}function f(){const{delay:d=0,duration:p=300,easing:h=wl,tick:g=X,css:_}=s||_a;_&&(o=ul(n,0,1,p,d,h,_,a++)),g(0,1);const y=Fo()+d,k=y+p;r&&r.abort(),l=!0,et(()=>Gi(n,!0,"start")),r=Ro(T=>{if(l){if(T>=k)return g(1,0),Gi(n,!0,"end"),u(),l=!1;if(T>=y){const $=h((T-y)/p);g($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,fl(n),Bt(s)?(s=s(i),ha().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function wb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Gn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=wl,tick:d=X,css:p}=s||_a;p&&(o=ul(n,1,0,f,u,c,p));const h=Fo()+u,g=h+f;et(()=>Gi(n,!1,"start")),Ro(_=>{if(l){if(_>=g)return d(0,1),Gi(n,!1,"end"),--r.r||Ae(r.c),!1;if(_>=h){const y=c((_-h)/f);d(1-y,y)}}return l})}return Bt(s)?ha().then(()=>{s=s(i),a()}):a(),{end(u){u&&s.tick&&s.tick(1,0),l&&(o&&fl(n,o),l=!1)}}}function qe(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&&fl(n,u)}function c(p,h){const g=p.b-o;return h*=Math.abs(g),{a:o,b:p.b,d:g,duration:h,start:p.start,end:p.start+h,group:p.group}}function d(p){const{delay:h=0,duration:g=300,easing:_=wl,tick:y=X,css:k}=l||_a,T={start:Fo()+h,b:p};p||(T.group=Gn,Gn.r+=1),r||a?a=T:(k&&(f(),u=ul(n,o,p,g,h,_,k)),p&&y(0,1),r=c(T,g),et(()=>Gi(n,p,"start")),Ro($=>{if(a&&$>a.start&&(r=c(a,g),a=null,Gi(n,r.b,"start"),k&&(f(),u=ul(n,o,r.b,r.duration,0,_,l.css))),r){if($>=r.end)y(o=r.b,1-o),Gi(n,r.b,"end"),a||(r.b?f():--r.group.r||Ae(r.group.c)),r=null;else if($>=r.start){const M=$-r.start;o=r.a+r.d*_(M/r.duration),y(o,1-o)}}return!!(r||a)}))}return{run(p){Bt(l)?ha().then(()=>{l=l(s),d(p)}):d(p)},end(){f(),r=a=null}}}function uu(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),I(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ma()}if(rb(n)){const s=Sl();if(n.then(l=>{ai(s),i(e.then,1,e.value,l),ai(null)},l=>{if(ai(s),i(e.catch,2,e.error,l),ai(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 Sb(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 ns(n,e){n.d(1),e.delete(n.key)}function an(n,e){I(n,1,1,()=>{e.delete(n.key)})}function Tb(n,e){n.f(),an(n,e)}function Ct(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,p=l.length,h=d;const g={};for(;h--;)g[n[h].key]=h;const _=[],y=new Map,k=new Map,T=[];for(h=p;h--;){const O=c(s,l,h),E=t(O);let P=o.get(E);P?i&&T.push(()=>P.p(O,e)):(P=u(E,O),P.c()),y.set(E,_[h]=P),E in g&&k.set(E,Math.abs(h-g[E]))}const $=new Set,M=new Set;function C(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,p--}for(;d&&p;){const O=_[p-1],E=n[d-1],P=O.key,L=E.key;O===E?(f=O.first,d--,p--):y.has(L)?!o.has(P)||$.has(P)?C(O):M.has(L)?d--:k.get(P)>k.get(L)?(M.add(P),C(O)):($.add(L),d--):(a(E,o),d--)}for(;d--;){const O=n[d];y.has(O.key)||a(O,o)}for(;p;)C(_[p-1]);return Ae(T),_}function bt(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 Vt(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,after_update:l}=n.$$;s&&s.m(e,t),i||et(()=>{const o=n.$$.on_mount.map(T_).filter(Bt);n.$$.on_destroy?n.$$.on_destroy.push(...o):Ae(o),n.$$.on_mount=[]}),l.forEach(et)}function j(n,e){const t=n.$$;t.fragment!==null&&(yb(t.after_update),Ae(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function $b(n,e){n.$$.dirty[0]===-1&&(gs.push(n),L_(),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=cl;ai(n);const u=n.$$={fragment:null,ctx:[],props:l,update:X,not_equal:s,bound:ru(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:ru(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...p)=>{const h=p.length?p[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&$b(n,c)),d}):[],u.update(),f=!0,Ae(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=db(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),ma()}ai(a)}class ve{$destroy(){j(this,1),this.$destroy=X}$on(e,t){if(!Bt(t))return X;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&&!ab(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Nt(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 ds=[];function N_(n,e){return{subscribe:Rn(n,e).subscribe}}function Rn(n,e=X){let t;const i=new Set;function s(r){if(_e(n,r)&&(n=r,t)){const a=!ds.length;for(const u of i)u[1](),ds.push(u,n);if(a){for(let u=0;u<ds.length;u+=2)ds[u][0](ds[u+1]);ds.length=0}}}function l(r){s(r(n))}function o(r,a=X){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||X),r(n),()=>{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function F_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return N_(t,o=>{let r=!1;const a=[];let u=0,f=X;const c=()=>{if(u)return;f();const p=e(i?a[0]:a,o);l?o(p):f=Bt(p)?p:X},d=s.map((p,h)=>$_(p,g=>{a[h]=g,u&=~(1<<h),r&&c()},()=>{u|=1<<h}));return r=!0,c(),function(){Ae(d),f(),r=!1}})}function R_(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 Cb(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=Le(a,s[u]);return{props:a}}return l&&(e=$t(l,o()),e.$on("routeEvent",n[7])),{c(){e&&V(e.$$.fragment),t=we()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&4?bt(s,[Vt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{j(f,1)}),ae()}l?(e=$t(l,o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Mb(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=Le(a,s[u]);return{props:a}}return l&&(e=$t(l,o()),e.$on("routeEvent",n[6])),{c(){e&&V(e.$$.fragment),t=we()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a&6?bt(s,[a&2&&{params:r[1]},a&4&&Vt(r[2])]):{};if(a&1&&l!==(l=r[0])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{j(f,1)}),ae()}l?(e=$t(l,o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function Ob(n){let e,t,i,s;const l=[Mb,Cb],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):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function fu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const qo=N_(null,function(e){e(fu());const t=()=>{e(fu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});F_(qo,n=>n.location);const ga=F_(qo,n=>n.querystring),cu=Rn(void 0);async function Ei(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await rn();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 nn(n,e){if(e=pu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return du(n,e),{update(t){t=pu(t),du(n,t)}}}function Db(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function du(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||Eb(i.currentTarget.getAttribute("href"))})}function pu(n){return n&&typeof n=="string"?{href:n}:n||{}}function Eb(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function Ab(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,C){if(!C||typeof C!="function"&&(typeof C!="object"||C._sveltesparouter!==!0))throw Error("Invalid component object");if(!M||typeof M=="string"&&(M.length<1||M.charAt(0)!="/"&&M.charAt(0)!="*")||typeof M=="object"&&!(M instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:E}=R_(M);this.path=M,typeof C=="object"&&C._sveltesparouter===!0?(this.component=C.component,this.conditions=C.conditions||[],this.userData=C.userData,this.props=C.props||{}):(this.component=()=>Promise.resolve(C),this.conditions=[],this.props={}),this._pattern=O,this._keys=E}match(M){if(s){if(typeof s=="string")if(M.startsWith(s))M=M.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const P=M.match(s);if(P&&P[0])M=M.substr(P[0].length)||"/";else return null}}const C=this._pattern.exec(M);if(C===null)return null;if(this._keys===!1)return C;const O={};let E=0;for(;E<this._keys.length;){try{O[this._keys[E]]=decodeURIComponent(C[E+1]||"")||null}catch{O[this._keys[E]]=null}E++}return O}async checkConditions(M){for(let C=0;C<this.conditions.length;C++)if(!await this.conditions[C](M))return!1;return!0}}const r=[];i instanceof Map?i.forEach(($,M)=>{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=vt();async function d($,M){await rn(),c($,M)}let p=null,h=null;l&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?p=$.state:p=null},window.addEventListener("popstate",h),bb(()=>{Db(p)}));let g=null,_=null;const y=qo.subscribe(async $=>{g=$;let M=0;for(;M<r.length;){const C=r[M].match($.location);if(!C){M++;continue}const O={route:r[M].path,location:$.location,querystring:$.querystring,userData:r[M].userData,params:C&&typeof C=="object"&&Object.keys(C).length?C:null};if(!await r[M].checkConditions(O)){t(0,a=null),_=null,d("conditionsFailed",O);return}d("routeLoading",Object.assign({},O));const E=r[M].component;if(_!=E){E.loading?(t(0,a=E.loading),_=E,t(1,u=E.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u}))):(t(0,a=null),_=null);const P=await E();if($!=g)return;t(0,a=P&&P.default||P),_=E}C&&typeof C=="object"&&Object.keys(C).length?t(1,u=C):t(1,u=null),t(2,f=r[M].props),d("routeLoaded",Object.assign({},O,{component:a,name:a.name,params:u})).then(()=>{cu.set(u)});return}t(0,a=null),_=null,cu.set(void 0)});I_(()=>{y(),h&&window.removeEventListener("popstate",h)});function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,k,T]}class Ib extends ve{constructor(e){super(),be(this,e,Ab,Ob,_e,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let q_;function j_(n){const e=n.pattern.test(q_);mu(n,n.className,e),mu(n,n.inactiveClassName,!e)}function mu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}qo.subscribe(n=>{q_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(j_)});function Hn(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"?R_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),j_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const Pb="modulepreload",Lb=function(n,e){return new URL(n,e).href},hu={},rt=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=Lb(l,i),l in hu)return;hu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Pb,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e())};var qr=function(n,e){return qr=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])},qr(n,e)};function Xt(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}qr(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var jr=function(){return jr=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},jr.apply(this,arguments)};function sn(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}function ln(n,e){var t,i,s,l,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(a){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&c[0]?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[2&c[0],s.value]),c[0]){case 0:case 1:s=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,i=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){o.label=c[1];break}if(c[0]===6&&o.label<s[1]){o.label=s[1],s=c;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(c);break}s[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(n,o)}catch(d){c=[6,d],i=0}finally{t=s=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([a,u])}}}var V_,dl=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 Xt(e,n),Object.defineProperty(e.prototype,"data",{get:function(){return this.response},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return jr({},this)},e}(Error),jl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function _u(n,e,t){var i=Object.assign({},t||{}),s=i.encode||Fb;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 Nb(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function Fb(n){return encodeURIComponent(n)}function gu(n){if(n)try{var e=decodeURIComponent(V_(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}V_=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 Tl=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){for(var t=0,i=Object.entries(e);t<i.length;t++){var s=i[t],l=s[0],o=s[1];this[l]=o}this.id=e.id!==void 0?e.id:"",this.created=e.created!==void 0?e.created:"",this.updated=e.updated!==void 0?e.updated:""},Object.defineProperty(n.prototype,"isNew",{get:function(){return!this.id},enumerable:!1,configurable:!0}),n.prototype.clone=function(){var e=typeof structuredClone=="function"?structuredClone(this):JSON.parse(JSON.stringify(this));return new this.constructor(e)},n.prototype.export=function(){return Object.assign({},this)},n}(),Ci=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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}(Tl),es=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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}(Tl),Rb=function(){function n(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!function(t,i){i===void 0&&(i=0);var s=gu(t);return!(Object.keys(s).length>0&&(!s.exp||s.exp-i>Date.now()/1e3))}(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e||"",this.baseModel=t!==null&&typeof t=="object"?t.collectionId!==void 0?new Ci(t):new es(t):null,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel=null,this.triggerChange()},n.prototype.loadFromCookie=function(e,t){t===void 0&&(t="pb_auth");var i=function(o,r){var a={};if(typeof o!="string")return a;for(var u=Object.assign({},r||{}).decode||Nb,f=0;f<o.length;){var c=o.indexOf("=",f);if(c===-1)break;var d=o.indexOf(";",f);if(d===-1)d=o.length;else if(d<c){f=o.lastIndexOf(";",c-1)+1;continue}var p=o.slice(f,c).trim();if(a[p]===void 0){var h=o.slice(c+1,d).trim();h.charCodeAt(0)===34&&(h=h.slice(1,-1));try{a[p]=u(h)}catch{a[p]=h}}f=d+1}return a}(e||"")[t]||"",s={};try{(typeof(s=JSON.parse(i))===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)},n.prototype.exportToCookie=function(e,t){var i,s,l;t===void 0&&(t="pb_auth");var o={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},r=gu(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=_u(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 Ci&&(a.model.username=this.model.username,a.model.verified=this.model.verified,a.model.collectionId=this.model.collectionId),u=_u(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}(),H_=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 Xt(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 es(i.model):new Ci(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}(Rb),$l=function(e){this.client=e},qb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(e,n),e.prototype.getAll=function(t){return t===void 0&&(t={}),this.client.send("/api/settings",{method:"GET",params:t}).then(function(i){return i||{}})},e.prototype.update=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send("/api/settings",{method:"PATCH",params:i,body:t}).then(function(s){return s||{}})},e.prototype.testS3=function(t){return t===void 0&&(t={}),this.client.send("/api/settings/test/s3",{method:"POST",params:t}).then(function(){return!0})},e.prototype.testEmail=function(t,i,s){s===void 0&&(s={});var l={email:t,template:i};return this.client.send("/api/settings/test/email",{method:"POST",params:s,body:l}).then(function(){return!0})},e}($l),z_=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||[]},ba=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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 Xt(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 sn(l,void 0,void 0,function(){return ln(this,function(u){return[2,this._getList(t,a,i||200,s).then(function(f){var c=f,d=c.items,p=c.totalItems;return o=o.concat(d),d.length&&p>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u<f.length;u++){var c=f[u];a.push(o.decode(c))}}return new z_((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 dl({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return l.items[0]})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s){return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}($l)),jb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(e,n),e.prototype.decode=function(t){return new es(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}(ba),Vb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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}(Tl),Hb=function(n){function e(t,i){var s=n.call(this,t)||this;return s.collectionIdOrName=i,s}return Xt(e,n),e.prototype.decode=function(t){return new Ci(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 sn(this,void 0,void 0,function(){return ln(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 sn(this,void 0,void 0,function(){var s;return ln(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 sn(this,void 0,void 0,function(){return ln(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.authWithOAuth2=function(t,i,s,l,o,r,a){var u=this;return o===void 0&&(o={}),r===void 0&&(r={}),a===void 0&&(a={}),r=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l,createData:o},r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",{method:"POST",params:a,body:r}).then(function(f){return u.authResponse(f)})},e.prototype.authRefresh=function(t,i){var s=this;return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCollectionPath+"/auth-refresh",{method:"POST",params:i,body:t}).then(function(l){return s.authResponse(l)})},e.prototype.requestPasswordReset=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-password-reset",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmPasswordReset=function(t,i,s,l,o){return l===void 0&&(l={}),o===void 0&&(o={}),l=Object.assign({token:t,password:i,passwordConfirm:s},l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",{method:"POST",params:o,body:l}).then(function(){return!0})},e.prototype.requestVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({email:t},i),this.client.send(this.baseCollectionPath+"/request-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmVerification=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({token:t},i),this.client.send(this.baseCollectionPath+"/confirm-verification",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.requestEmailChange=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),i=Object.assign({newEmail:t},i),this.client.send(this.baseCollectionPath+"/request-email-change",{method:"POST",params:s,body:i}).then(function(){return!0})},e.prototype.confirmEmailChange=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({token:t,password:i},s),this.client.send(this.baseCollectionPath+"/confirm-email-change",{method:"POST",params:l,body:s}).then(function(){return!0})},e.prototype.listExternalAuths=function(t,i){return i===void 0&&(i={}),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/external-auths",{method:"GET",params:i}).then(function(s){var l=[];if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];l.push(new Vb(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}(ba),gn=function(){function n(e){e===void 0&&(e={}),this.load(e||{})}return n.prototype.load=function(e){this.id=e.id!==void 0?e.id:"",this.name=e.name!==void 0?e.name:"",this.type=e.type!==void 0?e.type:"text",this.system=!!e.system,this.required=!!e.required,this.unique=!!e.unique,this.options=typeof e.options=="object"&&e.options!==null?e.options:{}},n}(),hn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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 gn(l))}},Object.defineProperty(e.prototype,"isBase",{get:function(){return this.type==="base"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAuth",{get:function(){return this.type==="auth"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isView",{get:function(){return this.type==="view"},enumerable:!1,configurable:!0}),e}(Tl),zb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(e,n),e.prototype.decode=function(t){return new hn(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={}),sn(this,void 0,void 0,function(){return ln(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}(ba),Vr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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}(Tl),Bb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(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 Vr(u))}}return new z_((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 Vr(s)})},e.prototype.getRequestsStats=function(t){return t===void 0&&(t={}),this.client.send("/api/logs/requests/stats",{method:"GET",params:t}).then(function(i){return i})},e}($l),Ub=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 Xt(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 sn(this,void 0,void 0,function(){var l,o=this;return ln(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 sn(o,void 0,void 0,function(){return ln(this,function(a){return[2,this.unsubscribeByTopicAndListener(t,l)]})})}]}})})},e.prototype.unsubscribe=function(t){var i;return sn(this,void 0,void 0,function(){var s,l,o;return ln(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 sn(this,void 0,void 0,function(){var s,l,o,r,a;return ln(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 sn(this,void 0,void 0,function(){var l,o;return ln(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 sn(this,void 0,void 0,function(){return ln(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 sn(this,void 0,void 0,function(){var t=this;return ln(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 sn(t,void 0,void 0,function(){var l;return ln(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 dl(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 dl(new Error("Realtime disconnected.")),l=0,o=this.pendingConnects;l<o.length;l++)o[l].reject(s);this.pendingConnects=[]}},e}($l),Wb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return Xt(e,n),e.prototype.check=function(t){return t===void 0&&(t={}),this.client.send("/api/health",{method:"GET",params:t})},e}($l),va=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 H_,this.admins=new jb(this),this.collections=new zb(this),this.logs=new Bb(this),this.settings=new qb(this),this.realtime=new Ub(this),this.health=new Wb(this)}return n.prototype.collection=function(e){return this.recordServices[e]||(this.recordServices[e]=new Hb(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 sn(this,void 0,void 0,function(){var c,d,p,h,g,_,y,k,T,$=this;return ln(this,function(M){switch(M.label){case 0:return c=Object.assign({method:"GET"},t),this.isFormData(c.body)||(c.body&&typeof c.body!="string"&&(c.body=JSON.stringify(c.body)),((i=c==null?void 0:c.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(c.headers=Object.assign({},c.headers,{"Content-Type":"application/json"}))),((s=c==null?void 0:c.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(c.headers=Object.assign({},c.headers,{"Accept-Language":this.lang})),!((l=this.authStore)===null||l===void 0)&&l.token&&((o=c==null?void 0:c.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(c.headers=Object.assign({},c.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&((r=c.params)===null||r===void 0?void 0:r.$autoCancel)!==!1&&(d=((a=c.params)===null||a===void 0?void 0:a.$cancelKey)||(c.method||"GET")+e,this.cancelRequest(d),p=new AbortController,this.cancelControllers[d]=p,c.signal=p.signal),(u=c.params)===null||u===void 0||delete u.$autoCancel,(f=c.params)===null||f===void 0||delete f.$cancelKey,h=this.buildUrl(e),c.params!==void 0&&((g=this.serializeQueryParams(c.params))&&(h+=(h.includes("?")?"&":"?")+g),delete c.params),this.beforeSend?(k=(y=Object).assign,T=[{}],[4,this.beforeSend(h,c)]):[3,2];case 1:(_=k.apply(y,T.concat([M.sent()]))).url!==void 0||_.options!==void 0?(h=_.url||h,c=_.options||c):Object.keys(_).length&&(c=_,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`.")),M.label=2;case 2:return[2,fetch(h,c).then(function(C){return sn($,void 0,void 0,function(){var O;return ln(this,function(E){switch(E.label){case 0:O={},E.label=1;case 1:return E.trys.push([1,3,,4]),[4,C.json()];case 2:return O=E.sent(),[3,4];case 3:return E.sent(),[3,4];case 4:return this.afterSend?[4,this.afterSend(C,O)]:[3,6];case 5:O=E.sent(),E.label=6;case 6:if(C.status>=400)throw new dl({url:C.url,status:C.status,data:O});return[2,O]}})})}).catch(function(C){throw new dl(C)})]}})})},n.prototype.getFileUrl=function(e,t,i){i===void 0&&(i={});var s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));var l=this.buildUrl(s.join("/"));if(Object.keys(i).length){var o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.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 is extends Error{}class Yb extends is{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Kb extends is{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Jb extends is{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gs extends is{}class B_ extends is{constructor(e){super(`Invalid unit ${e}`)}}class In extends is{}class _i extends is{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Wn="short",Tn="long",Hr={year:Oe,month:Oe,day:Oe},U_={year:Oe,month:Wn,day:Oe},Zb={year:Oe,month:Wn,day:Oe,weekday:Wn},W_={year:Oe,month:Tn,day:Oe},Y_={year:Oe,month:Tn,day:Oe,weekday:Tn},K_={hour:Oe,minute:Oe},J_={hour:Oe,minute:Oe,second:Oe},Z_={hour:Oe,minute:Oe,second:Oe,timeZoneName:Wn},G_={hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn},X_={hour:Oe,minute:Oe,hourCycle:"h23"},Q_={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},x_={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Wn},eg={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Tn},tg={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},ng={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},ig={year:Oe,month:Wn,day:Oe,hour:Oe,minute:Oe},sg={year:Oe,month:Wn,day:Oe,hour:Oe,minute:Oe,second:Oe},Gb={year:Oe,month:Wn,day:Oe,weekday:Wn,hour:Oe,minute:Oe},lg={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Wn},og={year:Oe,month:Tn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Wn},rg={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,timeZoneName:Tn},ag={year:Oe,month:Tn,day:Oe,weekday:Tn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Tn};function Xe(n){return typeof n>"u"}function Xi(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function Xb(n){return typeof n=="string"}function Qb(n){return Object.prototype.toString.call(n)==="[object Date]"}function ug(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function xb(n){return Array.isArray(n)?n:[n]}function bu(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 e0(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function $s(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ui(n,e,t){return jo(n)&&n>=e&&n<=t}function t0(n,e){return n-e*Math.floor(n/e)}function Ft(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function bi(n){if(!(Xe(n)||n===null||n===""))return parseInt(n,10)}function ji(n){if(!(Xe(n)||n===null||n===""))return parseFloat(n)}function ya(n){if(!(Xe(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ka(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function Cl(n){return n%4===0&&(n%100!==0||n%400===0)}function el(n){return Cl(n)?366:365}function _o(n,e){const t=t0(e-1,12)+1,i=n+(e-t)/12;return t===2?Cl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function wa(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function go(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function zr(n){return n>99?n:n>60?1900+n:2e3+n}function fg(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 Vo(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 cg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new In(`Invalid unit value ${n}`);return e}function bo(n,e){const t={};for(const i in n)if($s(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=cg(s)}return t}function tl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Ft(t,2)}:${Ft(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Ft(t,2)}${Ft(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ho(n){return e0(n,["hour","minute","second","millisecond"])}const dg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,n0=["January","February","March","April","May","June","July","August","September","October","November","December"],pg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i0=["J","F","M","A","M","J","J","A","S","O","N","D"];function mg(n){switch(n){case"narrow":return[...i0];case"short":return[...pg];case"long":return[...n0];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 hg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],_g=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],s0=["M","T","W","T","F","S","S"];function gg(n){switch(n){case"narrow":return[...s0];case"short":return[..._g];case"long":return[...hg];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const bg=["AM","PM"],l0=["Before Christ","Anno Domini"],o0=["BC","AD"],r0=["B","A"];function vg(n){switch(n){case"narrow":return[...r0];case"short":return[...o0];case"long":return[...l0];default:return null}}function a0(n){return bg[n.hour<12?0:1]}function u0(n,e){return gg(e)[n.weekday-1]}function f0(n,e){return mg(e)[n.month-1]}function c0(n,e){return vg(e)[n.year<0?0:1]}function d0(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function vu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const p0={D:Hr,DD:U_,DDD:W_,DDDD:Y_,t:K_,tt:J_,ttt:Z_,tttt:G_,T:X_,TT:Q_,TTT:x_,TTTT:eg,f:tg,ff:ig,fff:lg,ffff:rg,F:ng,FF:sg,FFF:og,FFFF:ag};class mn{static create(e,t={}){return new mn(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 p0[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 Ft(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=(p,h)=>this.loc.extract(e,p,h),o=p=>e.isOffsetFixed&&e.offset===0&&p.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,p.format):"",r=()=>i?a0(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(p,h)=>i?f0(e,p):l(h?{month:p}:{month:p,day:"numeric"},"month"),u=(p,h)=>i?u0(e,p):l(h?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const h=mn.macroTokenToFormatOpts(p);return h?this.formatWithSystemDefault(e,h):p},c=p=>i?c0(e,p):l({era:p},"era"),d=p=>{switch(p){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(p)}};return vu(mn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=mn.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 vu(l,s(r))}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ml{get type(){throw new _i}get name(){throw new _i}get ianaName(){return this.name}get isUniversal(){throw new _i}offsetName(e,t){throw new _i}formatOffset(e,t){throw new _i}offset(e){throw new _i}equals(e){throw new _i}get isValid(){throw new _i}}let nr=null;class Sa extends Ml{static get instance(){return nr===null&&(nr=new Sa),nr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return fg(e,t,i)}formatOffset(e,t){return tl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function m0(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const h0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _0(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 g0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=h0[l];l==="era"?i[r]=o:Xe(r)||(i[r]=parseInt(o,10))}return i}let Vl={};class fi extends Ml{static create(e){return Vl[e]||(Vl[e]=new fi(e)),Vl[e]}static resetCache(){Vl={},uo={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=fi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return fg(e,t,i,this.name)}formatOffset(e,t){return tl(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=m0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?g0(i,t):_0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=wa({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let p=+t;const h=p%1e3;return p-=h>=0?h:1e3+h,(d-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ir=null;class on extends Ml{static get utcInstance(){return ir===null&&(ir=new on(0)),ir}static instance(e){return e===0?on.utcInstance:new on(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new on(Vo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${tl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${tl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return tl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class b0 extends Ml{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 vi(n,e){if(Xe(n)||n===null)return e;if(n instanceof Ml)return n;if(Xb(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?on.utcInstance:on.parseSpecifier(t)||fi.create(n)}else return Xi(n)?on.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new b0(n)}let yu=()=>Date.now(),ku="system",wu=null,Su=null,Tu=null,$u;class zt{static get now(){return yu}static set now(e){yu=e}static set defaultZone(e){ku=e}static get defaultZone(){return vi(ku,Sa.instance)}static get defaultLocale(){return wu}static set defaultLocale(e){wu=e}static get defaultNumberingSystem(){return Su}static set defaultNumberingSystem(e){Su=e}static get defaultOutputCalendar(){return Tu}static set defaultOutputCalendar(e){Tu=e}static get throwOnInvalid(){return $u}static set throwOnInvalid(e){$u=e}static resetCaches(){yt.resetCache(),fi.resetCache()}}let Cu={};function v0(n,e={}){const t=JSON.stringify([n,e]);let i=Cu[t];return i||(i=new Intl.ListFormat(n,e),Cu[t]=i),i}let Br={};function Ur(n,e={}){const t=JSON.stringify([n,e]);let i=Br[t];return i||(i=new Intl.DateTimeFormat(n,e),Br[t]=i),i}let Wr={};function y0(n,e={}){const t=JSON.stringify([n,e]);let i=Wr[t];return i||(i=new Intl.NumberFormat(n,e),Wr[t]=i),i}let Yr={};function k0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Yr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Yr[s]=l),l}let Xs=null;function w0(){return Xs||(Xs=new Intl.DateTimeFormat().resolvedOptions().locale,Xs)}function S0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Ur(n).resolvedOptions()}catch{t=Ur(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function T0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function $0(n){const e=[];for(let t=1;t<=12;t++){const i=Ve.utc(2016,t,1);e.push(n(i))}return e}function C0(n){const e=[];for(let t=1;t<=7;t++){const i=Ve.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function M0(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 O0{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=y0(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):ka(e,3);return Ft(t,this.padTo)}}}class D0{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&&fi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Ve.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=Ur(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class E0{constructor(e,t,i){this.opts={style:"long",...i},!t&&ug()&&(this.rtf=k0(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):d0(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class yt{static fromOpts(e){return yt.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":w0()),r=t||zt.defaultNumberingSystem,a=i||zt.defaultOutputCalendar;return new yt(o,r,a,l)}static resetCache(){Xs=null,Br={},Wr={},Yr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return yt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=S0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=T0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=M0(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:yt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Hl(this,e,i,mg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=$0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,gg,()=>{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]=C0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>bg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ve.utc(2016,11,13,9),Ve.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,vg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ve.utc(-40,1,1),Ve.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 O0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new D0(e,this.intl,t)}relFormatter(e={}){return new E0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return v0(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Is(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ps(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Ls(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function yg(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=bi(e[t+s]);return[i,null,t+s]}}const kg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,A0=`(?:${kg.source}?(?:\\[(${dg.source})\\])?)?`,Ta=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,wg=RegExp(`${Ta.source}${A0}`),$a=RegExp(`(?:T${wg.source})?`),I0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,P0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,L0=/(\d{4})-?(\d{3})/,N0=yg("weekYear","weekNumber","weekDay"),F0=yg("year","ordinal"),R0=/(\d{4})-(\d\d)-(\d\d)/,Sg=RegExp(`${Ta.source} ?(?:${kg.source}|(${dg.source}))?`),q0=RegExp(`(?: ${Sg.source})?`);function ys(n,e,t){const i=n[e];return Xe(i)?t:bi(i)}function j0(n,e){return[{year:ys(n,e),month:ys(n,e+1,1),day:ys(n,e+2,1)},null,e+3]}function Ns(n,e){return[{hours:ys(n,e,0),minutes:ys(n,e+1,0),seconds:ys(n,e+2,0),milliseconds:ya(n[e+3])},null,e+4]}function Ol(n,e){const t=!n[e]&&!n[e+1],i=Vo(n[e+1],n[e+2]),s=t?null:on.instance(i);return[{},s,e+3]}function Dl(n,e){const t=n[e]?fi.create(n[e]):null;return[{},t,e+1]}const V0=RegExp(`^T?${Ta.source}$`),H0=/^-?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 z0(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(p,h=!1)=>p!==void 0&&(h||p&&f)?-p:p;return[{years:d(ji(t)),months:d(ji(i)),weeks:d(ji(s)),days:d(ji(l)),hours:d(ji(o)),minutes:d(ji(r)),seconds:d(ji(a),a==="-0"),milliseconds:d(ya(u),c)}]}const B0={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 Ca(n,e,t,i,s,l,o){const r={year:e.length===2?zr(bi(e)):bi(e),month:pg.indexOf(t)+1,day:bi(i),hour:bi(s),minute:bi(l)};return o&&(r.second=bi(o)),n&&(r.weekday=n.length>3?hg.indexOf(n)+1:_g.indexOf(n)+1),r}const U0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function W0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Ca(e,s,i,t,l,o,r);let p;return a?p=B0[a]:u?p=0:p=Vo(f,c),[d,new on(p)]}function Y0(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const K0=/^(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$/,J0=/^(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$/,Z0=/^(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 Mu(n){const[,e,t,i,s,l,o,r]=n;return[Ca(e,s,i,t,l,o,r),on.utcInstance]}function G0(n){const[,e,t,i,s,l,o,r]=n;return[Ca(e,r,t,i,s,l,o),on.utcInstance]}const X0=Is(I0,$a),Q0=Is(P0,$a),x0=Is(L0,$a),ev=Is(wg),Tg=Ps(j0,Ns,Ol,Dl),tv=Ps(N0,Ns,Ol,Dl),nv=Ps(F0,Ns,Ol,Dl),iv=Ps(Ns,Ol,Dl);function sv(n){return Ls(n,[X0,Tg],[Q0,tv],[x0,nv],[ev,iv])}function lv(n){return Ls(Y0(n),[U0,W0])}function ov(n){return Ls(n,[K0,Mu],[J0,Mu],[Z0,G0])}function rv(n){return Ls(n,[H0,z0])}const av=Ps(Ns);function uv(n){return Ls(n,[V0,av])}const fv=Is(R0,q0),cv=Is(Sg),dv=Ps(Ns,Ol,Dl);function pv(n){return Ls(n,[fv,Tg],[cv,dv])}const mv="Invalid Duration",$g={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}},hv={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},...$g},Mn=146097/400,ps=146097/4800,_v={years:{quarters:4,months:12,weeks:Mn/7,days:Mn,hours:Mn*24,minutes:Mn*24*60,seconds:Mn*24*60*60,milliseconds:Mn*24*60*60*1e3},quarters:{months:3,weeks:Mn/28,days:Mn/4,hours:Mn*24/4,minutes:Mn*24*60/4,seconds:Mn*24*60*60/4,milliseconds:Mn*24*60*60*1e3/4},months:{weeks:ps/7,days:ps,hours:ps*24,minutes:ps*24*60,seconds:ps*24*60*60,milliseconds:ps*24*60*60*1e3},...$g},Wi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],gv=Wi.slice(0).reverse();function Vi(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 it(i)}function bv(n){return n<0?Math.floor(n):Math.ceil(n)}function Cg(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?bv(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function vv(n,e){gv.reduce((t,i)=>Xe(e[i])?t:(t&&Cg(n,e,t,e,i),i),null)}class it{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||yt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?_v:hv,this.isLuxonDuration=!0}static fromMillis(e,t){return it.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new In(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new it({values:bo(e,it.normalizeUnit),loc:yt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Xi(e))return it.fromMillis(e);if(it.isDuration(e))return e;if(typeof e=="object")return it.fromObject(e);throw new In(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=rv(e);return i?it.fromObject(i,t):it.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=uv(e);return i?it.fromObject(i,t):it.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new In("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(zt.throwOnInvalid)throw new Jb(i);return new it({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 B_(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?mn.create(this.loc,i).formatDurationFromString(this,e):mv}toHuman(e={}){const t=Wi.map(i=>{const s=this.values[i];return Xe(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+=ka(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=it.fromDurationLike(e),i={};for(const s of Wi)($s(t.values,s)||$s(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Vi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=it.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]=cg(e(this.values[i],i));return Vi(this,{values:t},!0)}get(e){return this[it.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...bo(e,it.normalizeUnit)};return Vi(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),Vi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return vv(this.matrix,e),Vi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>it.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Wi)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;Xi(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)Wi.indexOf(u)>Wi.indexOf(o)&&Cg(this.matrix,s,u,t,o)}else Xi(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 Vi(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 Vi(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 Wi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const js="Invalid Interval";function yv(n,e){return!n||!n.isValid?wt.invalid("missing or invalid start"):!e||!e.isValid?wt.invalid("missing or invalid end"):e<n?wt.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 wt{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 In("need to specify a reason the Interval is invalid");const i=e instanceof zn?e:new zn(e,t);if(zt.throwOnInvalid)throw new Kb(i);return new wt({invalid:i})}static fromDateTimes(e,t){const i=zs(e),s=zs(t),l=yv(i,s);return l??new wt({start:i,end:s})}static after(e,t){const i=it.fromDurationLike(t),s=zs(e);return wt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=it.fromDurationLike(t),s=zs(e);return wt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=Ve.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=Ve.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return wt.fromDateTimes(l,r);if(o){const u=it.fromISO(s,t);if(u.isValid)return wt.after(l,u)}else if(a){const u=it.fromISO(i,t);if(u.isValid)return wt.before(r,u)}}return wt.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?wt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(zs).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s<this.e;){const o=t[l]||this.e,r=+o>+this.e?this.e:o;i.push(wt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=it.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(wt.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:wt.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 wt.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(wt.fromDateTimes(t,a.time)),t=null);return wt.merge(s)}difference(...e){return wt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:js}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:js}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:js}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:js}toFormat(e,{separator:t=" "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:js}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):it.invalid(this.invalidReason)}mapEndpoints(e){return wt.fromDateTimes(e(this.s),e(this.e))}}class zl{static hasDST(e=zt.defaultZone){const t=Ve.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return fi.isValidZone(e)}static normalizeZone(e){return vi(e,zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||yt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||yt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||yt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||yt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return yt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return yt.create(t,null,"gregory").eras(e)}static features(){return{relative:ug()}}}function Ou(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(it.fromMillis(i).as("days"))}function kv(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=Ou(r,a);return(u-u%7)/7}],["days",Ou]],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 wv(n,e,t,i){let[s,l,o,r]=kv(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=it.fromObject(l,i);return u.length>0?it.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ma={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},Du={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Sv=Ma.hanidec.replace(/[\[|\]]/g,"").split("");function Tv(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);if(n[t].search(Ma.hanidec)!==-1)e+=Sv.indexOf(n[t]);else for(const s in Du){const[l,o]=Du[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function jn({numberingSystem:n},e=""){return new RegExp(`${Ma[n||"latn"]}${e}`)}const $v="missing Intl.DateTimeFormat.formatToParts support";function lt(n,e=t=>t){return{regex:n,deser:([t])=>e(Tv(t))}}const Cv=String.fromCharCode(160),Mg=`[ ${Cv}]`,Og=new RegExp(Mg,"g");function Mv(n){return n.replace(/\./g,"\\.?").replace(Og,Mg)}function Eu(n){return n.replace(/\./g,"").replace(Og," ").toLowerCase()}function Vn(n,e){return n===null?null:{regex:RegExp(n.map(Mv).join("|")),deser:([t])=>n.findIndex(i=>Eu(t)===Eu(i))+e}}function Au(n,e){return{regex:n,deser:([,t,i])=>Vo(t,i),groups:e}}function sr(n){return{regex:n,deser:([e])=>e}}function Ov(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Dv(n,e){const t=jn(e),i=jn(e,"{2}"),s=jn(e,"{3}"),l=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),u=jn(e,"{1,6}"),f=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),p=_=>({regex:RegExp(Ov(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return p(_);switch(_.val){case"G":return Vn(e.eras("short",!1),0);case"GG":return Vn(e.eras("long",!1),0);case"y":return lt(u);case"yy":return lt(c,zr);case"yyyy":return lt(l);case"yyyyy":return lt(d);case"yyyyyy":return lt(o);case"M":return lt(r);case"MM":return lt(i);case"MMM":return Vn(e.months("short",!0,!1),1);case"MMMM":return Vn(e.months("long",!0,!1),1);case"L":return lt(r);case"LL":return lt(i);case"LLL":return Vn(e.months("short",!1,!1),1);case"LLLL":return Vn(e.months("long",!1,!1),1);case"d":return lt(r);case"dd":return lt(i);case"o":return lt(a);case"ooo":return lt(s);case"HH":return lt(i);case"H":return lt(r);case"hh":return lt(i);case"h":return lt(r);case"mm":return lt(i);case"m":return lt(r);case"q":return lt(r);case"qq":return lt(i);case"s":return lt(r);case"ss":return lt(i);case"S":return lt(a);case"SSS":return lt(s);case"u":return sr(f);case"uu":return sr(r);case"uuu":return lt(t);case"a":return Vn(e.meridiems(),0);case"kkkk":return lt(l);case"kk":return lt(c,zr);case"W":return lt(r);case"WW":return lt(i);case"E":case"c":return lt(t);case"EEE":return Vn(e.weekdays("short",!1,!1),1);case"EEEE":return Vn(e.weekdays("long",!1,!1),1);case"ccc":return Vn(e.weekdays("short",!0,!1),1);case"cccc":return Vn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Au(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Au(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return sr(/[a-z_+-/]{1,256}?/i);default:return p(_)}})(n)||{invalidReason:$v};return g.token=n,g}const Ev={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Av(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Ev[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Iv(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Pv(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if($s(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 Lv(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 Xe(n.z)||(t=fi.create(n.z)),Xe(n.Z)||(t||(t=new on(n.Z)),i=n.Z),Xe(n.q)||(n.M=(n.q-1)*3+1),Xe(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),Xe(n.u)||(n.S=ya(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let lr=null;function Nv(){return lr||(lr=Ve.fromMillis(1555555555555)),lr}function Fv(n,e){if(n.literal)return n;const t=mn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=mn.create(e,t).formatDateTimeParts(Nv()).map(o=>Av(o,e,t));return l.includes(void 0)?n:l}function Rv(n,e){return Array.prototype.concat(...n.map(t=>Fv(t,e)))}function Dg(n,e,t){const i=Rv(mn.parseFormat(t),n),s=i.map(o=>Dv(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Iv(s),a=RegExp(o,"i"),[u,f]=Pv(e,a,r),[c,d,p]=f?Lv(f):[null,null,void 0];if($s(f,"a")&&$s(f,"H"))throw new Gs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:p}}}function qv(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Dg(n,e,t);return[i,s,l,o]}const Eg=[0,31,59,90,120,151,181,212,243,273,304,334],Ag=[0,31,60,91,121,152,182,213,244,274,305,335];function Ln(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Ig(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 Pg(n,e,t){return t+(Cl(n)?Ag:Eg)[e-1]}function Lg(n,e){const t=Cl(n)?Ag:Eg,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Kr(n){const{year:e,month:t,day:i}=n,s=Pg(e,t,i),l=Ig(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=go(r)):o>go(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Ho(n)}}function Iu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Ig(e,1,4),l=el(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=el(r)):o>l?(r=e+1,o-=el(e)):r=e;const{month:a,day:u}=Lg(r,o);return{year:r,month:a,day:u,...Ho(n)}}function or(n){const{year:e,month:t,day:i}=n,s=Pg(e,t,i);return{year:e,ordinal:s,...Ho(n)}}function Pu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Lg(e,t);return{year:e,month:i,day:s,...Ho(n)}}function jv(n){const e=jo(n.weekYear),t=ui(n.weekNumber,1,go(n.weekYear)),i=ui(n.weekday,1,7);return e?t?i?!1:Ln("weekday",n.weekday):Ln("week",n.week):Ln("weekYear",n.weekYear)}function Vv(n){const e=jo(n.year),t=ui(n.ordinal,1,el(n.year));return e?t?!1:Ln("ordinal",n.ordinal):Ln("year",n.year)}function Ng(n){const e=jo(n.year),t=ui(n.month,1,12),i=ui(n.day,1,_o(n.year,n.month));return e?t?i?!1:Ln("day",n.day):Ln("month",n.month):Ln("year",n.year)}function Fg(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ui(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ui(t,0,59),r=ui(i,0,59),a=ui(s,0,999);return l?o?r?a?!1:Ln("millisecond",s):Ln("second",i):Ln("minute",t):Ln("hour",e)}const rr="Invalid DateTime",Lu=864e13;function Bl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function ar(n){return n.weekData===null&&(n.weekData=Kr(n.c)),n.weekData}function Vs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Ve({...t,...e,old:t})}function Rg(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 Nu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function fo(n,e,t){return Rg(wa(n),e,t)}function Fu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,_o(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=it.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=wa(l);let[a,u]=Rg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Hs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Ve.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Ve.invalid(new zn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Ul(n,e,t=!0){return n.isValid?mn.create(yt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ur(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ft(n.c.year,t?6:4),e?(i+="-",i+=Ft(n.c.month),i+="-",i+=Ft(n.c.day)):(i+=Ft(n.c.month),i+=Ft(n.c.day)),i}function Ru(n,e,t,i,s,l){let o=Ft(n.c.hour);return e?(o+=":",o+=Ft(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ft(n.c.minute),(n.c.second!==0||!t)&&(o+=Ft(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ft(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Ft(Math.trunc(-n.o/60)),o+=":",o+=Ft(Math.trunc(-n.o%60))):(o+="+",o+=Ft(Math.trunc(n.o/60)),o+=":",o+=Ft(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const qg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Hv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},zv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},jg=["year","month","day","hour","minute","second","millisecond"],Bv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Uv=["year","ordinal","hour","minute","second","millisecond"];function qu(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 B_(n);return e}function ju(n,e){const t=vi(e.zone,zt.defaultZone),i=yt.fromObject(e),s=zt.now();let l,o;if(Xe(n.year))l=s;else{for(const u of jg)Xe(n[u])&&(n[u]=qg[u]);const r=Ng(n)||Fg(n);if(r)return Ve.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new Ve({ts:l,zone:t,loc:i,o})}function Vu(n,e,t){const i=Xe(t.round)?!0:t.round,s=(o,r)=>(o=ka(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Hu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Ve{constructor(e){const t=e.zone||zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Bl(t));this.ts=Xe(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=Nu(this.ts,r),i=Number.isNaN(s.year)?new zn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||yt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Ve({})}static local(){const[e,t]=Hu(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]=Hu(arguments),[i,s,l,o,r,a,u]=t;return e.zone=on.utcInstance,ju({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Qb(e)?e.valueOf():NaN;if(Number.isNaN(i))return Ve.invalid("invalid input");const s=vi(t.zone,zt.defaultZone);return s.isValid?new Ve({ts:i,zone:s,loc:yt.fromObject(t)}):Ve.invalid(Bl(s))}static fromMillis(e,t={}){if(Xi(e))return e<-Lu||e>Lu?Ve.invalid("Timestamp out of range"):new Ve({ts:e,zone:vi(t.zone,zt.defaultZone),loc:yt.fromObject(t)});throw new In(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Xi(e))return new Ve({ts:e*1e3,zone:vi(t.zone,zt.defaultZone),loc:yt.fromObject(t)});throw new In("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=vi(t.zone,zt.defaultZone);if(!i.isValid)return Ve.invalid(Bl(i));const s=zt.now(),l=Xe(t.specificOffset)?i.offset(s):t.specificOffset,o=bo(e,qu),r=!Xe(o.ordinal),a=!Xe(o.year),u=!Xe(o.month)||!Xe(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=yt.fromObject(t);if((f||r)&&c)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Gs("Can't mix ordinal dates with month/day");const p=c||o.weekday&&!f;let h,g,_=Nu(s,l);p?(h=Bv,g=Hv,_=Kr(_)):r?(h=Uv,g=zv,_=or(_)):(h=jg,g=qg);let y=!1;for(const E of h){const P=o[E];Xe(P)?y?o[E]=g[E]:o[E]=_[E]:y=!0}const k=p?jv(o):r?Vv(o):Ng(o),T=k||Fg(o);if(T)return Ve.invalid(T);const $=p?Iu(o):r?Pu(o):o,[M,C]=fo($,l,i),O=new Ve({ts:M,zone:i,o:C,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?Ve.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=sv(e);return Hs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=lv(e);return Hs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=ov(e);return Hs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Xe(e)||Xe(t))throw new In("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=yt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=qv(o,e,t);return f?Ve.invalid(f):Hs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Ve.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=pv(e);return Hs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new In("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(zt.throwOnInvalid)throw new Yb(i);return new Ve({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?ar(this).weekYear:NaN}get weekNumber(){return this.isValid?ar(this).weekNumber:NaN}get weekday(){return this.isValid?ar(this).weekday:NaN}get ordinal(){return this.isValid?or(this.c).ordinal:NaN}get monthShort(){return this.isValid?zl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?zl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?zl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?zl.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 Cl(this.year)}get daysInMonth(){return _o(this.year,this.month)}get daysInYear(){return this.isValid?el(this.year):NaN}get weeksInWeekYear(){return this.isValid?go(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=mn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(on.instance(e),t)}toLocal(){return this.setZone(zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=vi(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]=fo(o,l,e)}return Vs(this,{ts:s,zone:e})}else return Ve.invalid(Bl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Vs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=bo(e,qu),i=!Xe(t.weekYear)||!Xe(t.weekNumber)||!Xe(t.weekday),s=!Xe(t.ordinal),l=!Xe(t.year),o=!Xe(t.month)||!Xe(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Gs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Gs("Can't mix ordinal dates with month/day");let u;i?u=Iu({...Kr(this.c),...t}):Xe(t.ordinal)?(u={...this.toObject(),...t},Xe(t.day)&&(u.day=Math.min(_o(u.year,u.month),u.day))):u=Pu({...or(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return Vs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=it.fromDurationLike(e);return Vs(this,Fu(this,t))}minus(e){if(!this.isValid)return this;const t=it.fromDurationLike(e).negate();return Vs(this,Fu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=it.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?mn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):rr}toLocaleString(e=Hr,t={}){return this.isValid?mn.create(this.loc.clone(t),e).formatDateTime(this):rr}toLocaleParts(e={}){return this.isValid?mn.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=ur(this,o);return r+="T",r+=Ru(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?ur(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":"")+Ru(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?ur(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():rr}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 it.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=xb(t).map(it.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=wv(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Ve.now(),e,t)}until(e){return this.isValid?wt.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||Ve.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),Vu(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Vu(e.base||Ve.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Ve.isDateTime))throw new In("min requires all arguments be DateTimes");return bu(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Ve.isDateTime))throw new In("max requires all arguments be DateTimes");return bu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=yt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Dg(o,e,t)}static fromStringExplain(e,t,i={}){return Ve.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Hr}static get DATE_MED(){return U_}static get DATE_MED_WITH_WEEKDAY(){return Zb}static get DATE_FULL(){return W_}static get DATE_HUGE(){return Y_}static get TIME_SIMPLE(){return K_}static get TIME_WITH_SECONDS(){return J_}static get TIME_WITH_SHORT_OFFSET(){return Z_}static get TIME_WITH_LONG_OFFSET(){return G_}static get TIME_24_SIMPLE(){return X_}static get TIME_24_WITH_SECONDS(){return Q_}static get TIME_24_WITH_SHORT_OFFSET(){return x_}static get TIME_24_WITH_LONG_OFFSET(){return eg}static get DATETIME_SHORT(){return tg}static get DATETIME_SHORT_WITH_SECONDS(){return ng}static get DATETIME_MED(){return ig}static get DATETIME_MED_WITH_SECONDS(){return sg}static get DATETIME_MED_WITH_WEEKDAY(){return Gb}static get DATETIME_FULL(){return lg}static get DATETIME_FULL_WITH_SECONDS(){return og}static get DATETIME_HUGE(){return rg}static get DATETIME_HUGE_WITH_SECONDS(){return ag}}function zs(n){if(Ve.isDateTime(n))return n;if(n&&n.valueOf&&Xi(n.valueOf()))return Ve.fromJSDate(n);if(n&&typeof n=="object")return Ve.fromObject(n);throw new In(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Wv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Yv=[".mp4",".avi",".mov",".3gp",".wmv"],Kv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Jv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class H{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||H.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 H.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!H.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!H.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){H.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]=H.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(!H.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)(!H.isObject(l)&&!Array.isArray(l)||!H.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)(!H.isObject(s)&&!Array.isArray(s)||!H.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):H.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||H.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||H.isObject(e)&&Object.keys(e).length>0)&&H.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=e||"",e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let s=e[i];typeof s=="string"&&(s=H.truncate(s,150,!0)),t[i]=s}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const s={a:/а|à|á|å|â/gi,b:/б/gi,c:/ц|ç/gi,d:/д/gi,e:/е|è|é|ê|ẽ|ë/gi,f:/ф/gi,g:/г/gi,h:/х/gi,i:/й|и|ì|í|î/gi,j:/ж/gi,k:/к/gi,l:/л/gi,m:/м/gi,n:/н|ñ/gi,o:/о|ò|ó|ô|ø/gi,p:/п/gi,q:/я/gi,r:/р/gi,s:/с/gi,t:/т/gi,u:/ю|ù|ú|ů|û/gi,v:/в/gi,w:/в/gi,x:/ь/gi,y:/ъ/gi,z:/з/gi,ae:/ä|æ/gi,oe:/ö/gi,ue:/ü/gi,Ae:/Ä/gi,Ue:/Ü/gi,Oe:/Ö/gi,ss:/ß/gi,and:/&/gi};for(let o in s)e=e.replace(s[o],o);const l=e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t);return l.charAt(0).toLowerCase()+l.slice(1)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=(e||"").split(t),s=[];for(let l of i)l=l.trim(),H.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",H.isEmpty(s)||i.push(s);return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ssZ",24:"yyyy-MM-dd HH:mm:ss.SSSZ"},i=t[e.length]||t[19];return Ve.fromFormat(e,i,{zone:"UTC"})}return Ve.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return H.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return!!Wv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return!!Yv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return!!Kv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return!!Jv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return H.hasImageExtension(e)?"image":H.hasDocumentExtension(e)?"document":H.hasVideoExtension(e)?"video":H.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(H.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)H.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):H.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var o,r,a,u,f,c,d;const t=(e==null?void 0:e.schema)||[],i={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};e!=null&&e.isAuth&&(i.username="username123",i.verified=!1,i.emailVisibility=!0,i.email="test@example.com"),(!(e!=null&&e.isView)||H.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)||H.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 p of t){let h=null;p.type==="number"?h=123:p.type==="date"?h="2022-01-01 10:00:00.123Z":p.type==="bool"?h=!0:p.type==="email"?h="test@example.com":p.type==="url"?h="https://example.com":p.type==="json"?h="JSON":p.type==="file"?(h="filename.jpg",((a=p.options)==null?void 0:a.maxSelect)!==1&&(h=[h])):p.type==="select"?(h=(f=(u=p.options)==null?void 0:u.values)==null?void 0:f[0],((c=p.options)==null?void 0:c.maxSelect)!==1&&(h=[h])):p.type==="relation"?(h="RELATION_RECORD_ID",((d=p.options)==null?void 0:d.maxSelect)!==1&&(h=[h])):h="test",i[p.name]=h}return i}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!H.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!H.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=H.isObject(u)&&H.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const l of e)l.type==="auth"?t.push(l):l.type==="base"?i.push(l):s.push(l);return[].concat(t,i,s)}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample"],toolbar:"undo redo | styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image table codesample | code fullscreen",file_picker_types:"image",file_picker_callback:(e,t,i)=>{const s=document.createElement("input");s.setAttribute("type","file"),s.setAttribute("accept","image/*"),s.addEventListener("change",l=>{const o=l.target.files[0],r=new FileReader;r.addEventListener("load",()=>{if(!tinymce)return;const a="blobid"+new Date().getTime(),u=tinymce.activeEditor.editorUpload.blobCache,f=r.result.split(",")[1],c=u.create(a,o,f);u.add(c),e(c.blobUri(),{title:o.name})}),r.readAsDataURL(o)}),s.click()}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(H.isEmpty(r)?s.push(i):typeof r=="boolean"?s.push(r?"True":"False"):typeof r=="string"?(r=r.indexOf("<")>=0?H.plainText(r):r,s.push(H.truncate(r))):s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","email","username","heading","label","key","id"];for(const o of l)if(!H.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 H.extractColumnsFromQuery(e.options.query))H.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)H.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],expression:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?([\w\"\'\`\[\]\.]*)\s+on\s+([\w\"\'\`\[\]\.]*)\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=!H.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 p of r){p=p.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(p);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({column:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.expression=s[6]||"",t}static buildIndex(e){let t="CREATE ";return e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`"${e.schemaName}".`),t+=`"${e.indexName||"idx_"+H.randomString(7)}" `,t+=`ON "${e.tableName}" (
`,t+=e.columns.filter(i=>!!(i!=null&&i.column)).map(i=>{let s="";return i.column.includes("(")||i.column.includes(" ")?s+=i.column:s+=`"${i.column}"`,i.collate&&(s+=" COLLATE "+i.collate),i.sort&&(s+=" "+i.sort.toUpperCase()),s}).join(`,
`),t+=`
)`,e.expression&&(t+=` WHERE ${e.expression}`),t}static replaceIndexTableName(e,t){const i=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=H.parseIndex(e);let l=!1;for(let o of s.columns)o.column===t&&(o.column=i,l=!0);return l?H.buildIndex(s):e}}const zo=Rn([]);function Vg(n,e=4e3){return Bo(n,"info",e)}function Ut(n,e=3e3){return Bo(n,"success",e)}function pl(n,e=4500){return Bo(n,"error",e)}function Zv(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Hg(i)},t)};zo.update(s=>(Da(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function Hg(n){zo.update(e=>(Da(e,n),e))}function Oa(){zo.update(n=>{for(let e of n)Da(n,e);return[]})}function Da(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const ti=Rn({});function _n(n){ti.set(n||{})}function ci(n){ti.update(e=>(H.deleteByPath(e,n),e))}const Ea=Rn({});function Jr(n){Ea.set(n||{})}va.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ei("/login")};va.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&pl(l)}if(H.isEmpty(s.data)||_n(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ei("/")};class Gv extends H_{save(e,t){super.save(e,t),t instanceof es&&Jr(t)}clear(){super.clear(),Jr(null)}}const me=new va("../",new Gv("pb_admin_auth"));me.authStore.model instanceof es&&Jr(me.authStore.model);function Xv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=n[3].default,h=Et(p,n,n[2],null);return{c(){e=v("div"),t=v("main"),h&&h.c(),i=D(),s=v("footer"),l=v("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=v("span"),r.textContent="|",a=D(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.14.0",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",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(g,_){S(g,e,_),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(u,f),d=!0},p(g,[_]){h&&h.p&&(!d||_&4)&&It(h,p,g,g[2],d?At(p,g[2],_,null):Pt(g[2]),null),(!d||_&2&&c!==(c="page-wrapper "+g[1]))&&m(e,"class",c),(!d||_&3)&&Q(e,"center-content",g[0])},i(g){d||(A(h,g),d=!0)},o(g){I(h,g),d=!1},d(g){g&&w(e),h&&h.d(g)}}}function Qv(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 Cn extends ve{constructor(e){super(),be(this,e,Qv,Xv,_e,{center:0,class:1})}}function zu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("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 xv(n){let e,t,i,s=!n[0]&&zu();const l=n[1].default,o=Et(l,n,n[2],null);return{c(){e=v("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),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=zu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&It(o,l,r,r[2],i?At(l,r[2],a,null):Pt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function ey(n){let e,t;return e=new Cn({props:{class:"full-page",center:!0,$$slots:{default:[xv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ty(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 zg extends ve{constructor(e){super(),be(this,e,ty,ey,_e,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=wl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ei(n,{delay:e=0,duration:t=400,easing:i=Uo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=au(s),[p,h]=au(l);return{delay:e,duration:t,easing:i,css:(g,_)=>`
transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*p}${h});
opacity: ${a-f*_}`}}function Mt(n,{delay:e=0,duration:t=400,easing:i=Uo,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(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),p=parseFloat(l[`margin${f[0]}`]),h=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*p}px;margin-${u[1]}: ${y*h}px;border-${u[0]}-width: ${y*g}px;border-${u[1]}-width: ${y*_}px;`}}function qt(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let Zr,Hi;const Gr="app-tooltip";function Bu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Si(){return Hi=Hi||document.querySelector("."+Gr),Hi||(Hi=document.createElement("div"),Hi.classList.add(Gr),document.body.appendChild(Hi)),Hi}function Bg(n,e){let t=Si();if(!t.classList.contains("active")||!(e!=null&&e.text)){Xr();return}t.textContent=e.text,t.className=Gr+" 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 Xr(){clearTimeout(Zr),Si().classList.remove("active"),Si().activeNode=void 0}function ny(n,e){Si().activeNode=n,clearTimeout(Zr),Zr=setTimeout(()=>{Si().classList.add("active"),Bg(n,e)},isNaN(e.delay)?0:e.delay)}function ze(n,e){let t=Bu(e);function i(){ny(n,t)}function s(){Xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),Si(),{update(l){var o,r;t=Bu(l),(r=(o=Si())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Bg(n,t)},destroy(){var l,o;(o=(l=Si())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Uu(n,e,t){const i=n.slice();return i[12]=e[t],i}const iy=n=>({}),Wu=n=>({uniqueId:n[4]});function sy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Yu(Uu(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=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=Uu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Yu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function ly(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),m(t,"class","ri-error-warning-fill txt-danger"),m(e,"class","form-field-addon")},m(a,u){S(a,e,u),b(e,t),l=!0,o||(r=De(i=ze.call(null,t,{position:"left",text:n[3].map(yo).join(`
`)})),o=!0)},p(a,u){i&&Bt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
`)})},i(a){l||(a&&et(()=>{l&&(s||(s=qe(t,qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Yu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=B(i),l=D(),m(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&le(s,i)},i(a){r||(a&&et(()=>{r&&(o||(o=qe(e,Mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,Mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function oy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Et(a,n,n[8],Wu),f=[ly,sy],c=[];function d(p,h){return p[0]&&p[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=D(),s.c(),m(e,"class",n[1]),Q(e,"error",n[3].length)},m(p,h){S(p,e,h),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(p,[h]){u&&u.p&&(!l||h&256)&&It(u,a,p,p[8],l?At(a,p[8],h,iy):Pt(p[8]),Wu);let g=i;i=d(p),i===g?c[i].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),s=c[i],s?s.p(p,h):(s=c[i]=f[i](p),s.c()),A(s,1),s.m(e,null)),(!l||h&2)&&m(e,"class",p[1]),(!l||h&10)&&Q(e,"error",p[3].length)},i(p){l||(A(u,p),A(s),l=!0)},o(p){I(u,p),I(s),l=!1},d(p){p&&w(e),u&&u.d(p),c[i].d(),n[11](null),o=!1,r()}}}const Ku="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Ku:n||Ku}function ry(n,e,t){let i;We(n,ti,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Qt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function p(g){de.call(this,n,g)}function h(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=H.toArray(H.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,p,h]}class pe extends ve{constructor(e){super(),be(this,e,ry,oy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function ay(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(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]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function uy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("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(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[1]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&m(e,"for",i),d&512&&o!==(o=c[9])&&m(l,"id",o),d&2&&l.value!==c[1]&&ue(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function fy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Password confirm"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=K(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]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[ay,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[uy,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[fy,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=v("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"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(h,g){S(h,e,g),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),q(a,e,null),b(e,u),b(e,f),c=!0,d||(p=K(e,"submit",ft(n[4])),d=!0)},p(h,[g]){const _={};g&1537&&(_.$$scope={dirty:g,ctx:h}),s.$set(_);const y={};g&1538&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:h}),a.$set(k),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){I(s.$$.fragment,h),I(o.$$.fragment,h),I(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,p()}}}function dy(n,e,t){const i=vt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class py extends ve{constructor(e){super(),be(this,e,dy,cy,_e,{})}}function Ju(n){let e,t;return e=new zg({props:{$$slots:{default:[my]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function my(n){let e,t;return e=new py({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hy(n){let e,t,i=n[0]&&Ju(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&&A(i,1)):(i=Ju(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function _y(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Ei("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await rn(),window.location.search=""}]}class gy extends ve{constructor(e){super(),be(this,e,_y,hy,_e,{})}}const Ot=Rn(""),ko=Rn(""),Cs=Rn(!1);function by(n){let e,t,i,s;return{c(){e=v("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),ue(e,n[7]),i||(s=K(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]&&ue(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function vy(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=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Zu(n){let e,t,i;return{c(){e=v("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=qe(e,ei,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,ei,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Gu(n){let e,t,i,s,l;return{c(){e=v("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=K(e,"click",n[15]),s=!0)},p:X,i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,ei,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,ei,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function yy(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[vy,by],p=[];function h(y,k){return y[4]&&!y[5]?0:1}l=h(n),o=p[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&Zu(),_=(n[0].length||n[7].length)&&Gu(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=D(),o.c(),r=D(),g&&g.c(),a=D(),_&&_.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(y,k){S(y,e,k),b(e,t),b(t,i),b(e,s),p[l].m(e,null),b(e,r),g&&g.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",$n(n[11])),K(e,"submit",ft(n[10]))],f=!0)},p(y,[k]){let T=l;l=h(y),l===T?p[l].p(y,k):(re(),I(p[T],1,1,()=>{p[T]=null}),ae(),o=p[l],o?o.p(y,k):(o=p[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?k&129&&A(g,1):(g=Zu(),g.c(),A(g,1),g.m(e,a)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),y[0].length||y[7].length?_?(_.p(y,k),k&129&&A(_,1)):(_=Gu(y),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(y){u||(A(o),A(g),A(_),u=!0)},o(y){I(o),I(g),I(_),u=!1},d(y){y&&w(e),p[l].d(),g&&g.d(),_&&_.d(),f=!1,Ae(c)}}}function ky(n,e,t){const i=vt(),s="search_"+H.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new hn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function h(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await rt(()=>import("./FilterAutocompleteInput-2b0e39bf.js"),["./FilterAutocompleteInput-2b0e39bf.js","./index-20adcf24.js"],import.meta.url)).default),t(5,f=!1))}Qt(()=>{g()});function _(M){de.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function k(M){se[M?"unshift":"push"](()=>{c=M,t(6,c)})}function T(){d=this.value,t(7,d),t(0,l)}const $=()=>{p(!1),h()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,p,h,_,y,k,T,$]}class Wo extends ve{constructor(e){super(),be(this,e,ky,yy,_e,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function wy(n){let e,t,i,s;return{c(){e=v("button"),e.innerHTML='<i class="ri-refresh-line svelte-1bvelc2"></i>',m(e,"type","button"),m(e,"aria-label","Refresh"),m(e,"class","btn btn-transparent btn-circle svelte-1bvelc2"),Q(e,"refreshing",n[1])},m(l,o){S(l,e,o),i||(s=[De(t=ze.call(null,e,n[0])),K(e,"click",n[2])],i=!0)},p(l,[o]){t&&Bt(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&Q(e,"refreshing",l[1])},i:X,o:X,d(l){l&&w(e),i=!1,Ae(s)}}}function Sy(n,e,t){const i=vt();let{tooltip:s={text:"Refresh",position:"right"}}=e,l=null;function o(){i("refresh");const r=s;t(0,s=null),clearTimeout(l),t(1,l=setTimeout(()=>{t(1,l=null),t(0,s=r)},150))}return Qt(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Aa extends ve{constructor(e){super(),be(this,e,Sy,wy,_e,{tooltip:0})}}function Ty(n){let e,t,i,s,l;const o=n[6].default,r=Et(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),m(e,"tabindex","0"),m(e,"title",n[2]),m(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){S(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"click",n[7]),K(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&It(r,o,a,a[5],i?At(o,a[5],u,null):Pt(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)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&w(e),r&&r.d(a),s=!1,Ae(l)}}}function $y(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class Jt extends ve{constructor(e){super(),be(this,e,$y,Ty,_e,{class:1,name:2,sort:0,disable:3})}}function Cy(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function My(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("div"),i=B(n[2]),s=D(),l=v("div"),o=B(n[1]),r=B(" UTC"),m(t,"class","date"),m(l,"class","time svelte-zdiknu"),m(e,"class","datetime svelte-zdiknu")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r)},p(a,u){u&4&&le(i,a[2]),u&2&&le(o,a[1])},d(a){a&&w(e)}}}function Oy(n){let e;function t(l,o){return l[0]?My:Cy}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:X,o:X,d(l){s.d(l),l&&w(e)}}}function Dy(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 di extends ve{constructor(e){super(),be(this,e,Dy,Oy,_e,{date:0})}}const Ey=n=>({}),Xu=n=>({}),Ay=n=>({}),Qu=n=>({});function Iy(n){let e,t,i,s,l,o,r,a;const u=n[5].before,f=Et(u,n,n[4],Qu),c=n[5].default,d=Et(c,n,n[4],null),p=n[5].after,h=Et(p,n,n[4],Xu);return{c(){e=v("div"),f&&f.c(),t=D(),i=v("div"),d&&d.c(),l=D(),h&&h.c(),m(i,"class",s="horizontal-scroller "+n[0]+" "+n[3]+" svelte-wc2j9h"),m(e,"class","horizontal-scroller-wrapper svelte-wc2j9h")},m(g,_){S(g,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[6](i),b(e,l),h&&h.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&16)&&It(f,u,g,g[4],o?At(u,g[4],_,Ay):Pt(g[4]),Qu),d&&d.p&&(!o||_&16)&&It(d,c,g,g[4],o?At(c,g[4],_,null):Pt(g[4]),null),(!o||_&9&&s!==(s="horizontal-scroller "+g[0]+" "+g[3]+" svelte-wc2j9h"))&&m(i,"class",s),h&&h.p&&(!o||_&16)&&It(h,p,g,g[4],o?At(p,g[4],_,Ey):Pt(g[4]),Xu)},i(g){o||(A(f,g),A(d,g),A(h,g),o=!0)},o(g){I(f,g),I(d,g),I(h,g),o=!1},d(g){g&&w(e),f&&f.d(g),d&&d.d(g),n[6](null),h&&h.d(g),r=!1,Ae(a)}}}function Py(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o=null,r="",a=null,u;function f(){o&&(clearTimeout(a),a=setTimeout(()=>{const d=o.offsetWidth,p=o.scrollWidth;p-d?(t(3,r="scrollable"),o.scrollLeft===0?t(3,r+=" scroll-start"):o.scrollLeft+d==p&&t(3,r+=" scroll-end")):t(3,r="")},100))}Qt(()=>(f(),u=new MutationObserver(()=>{f()}),u.observe(o,{attributeFilter:["width"],childList:!0,subtree:!0}),()=>{u==null||u.disconnect(),clearTimeout(a)}));function c(d){se[d?"unshift":"push"](()=>{o=d,t(2,o)})}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"$$scope"in d&&t(4,s=d.$$scope)},[l,f,o,r,s,i,c]}class Ia extends ve{constructor(e){super(),be(this,e,Py,Iy,_e,{class:0,refresh:1})}get refresh(){return this.$$.ctx[1]}}function xu(n,e,t){const i=n.slice();return i[23]=e[t],i}function Ly(n){let e;return{c(){e=v("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:X,d(t){t&&w(e)}}}function Ny(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="URL",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Fy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Referer",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Ry(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function qy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Status",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function jy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function ef(n){let e;function t(l,o){return l[6]?Hy:Vy}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 Vy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&tf(n);return{c(){e=v("tr"),t=v("td"),i=v("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),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=tf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Hy(n){let e;return{c(){e=v("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:X,d(t){t&&w(e)}}}function tf(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function nf(n){let e;return{c(){e=v("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 sf(n,e){var $e,Ye,dt;let t,i,s,l=(($e=e[23].method)==null?void 0:$e.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,p,h,g,_,y,k=(e[23].referer||"N/A")+"",T,$,M,C,O,E=(e[23].userIp||"N/A")+"",P,L,F,N,R,z=e[23].status+"",W,J,x,ne,G,fe,Z,ce,he,Ce,Re=(((Ye=e[23].meta)==null?void 0:Ye.errorMessage)||((dt=e[23].meta)==null?void 0:dt.errorData))&&nf();ne=new di({props:{date:e[23].created}});function je(){return e[17](e[23])}function ye(...Ke){return e[18](e[23],...Ke)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=B(l),a=D(),u=v("td"),f=v("span"),d=B(c),h=D(),Re&&Re.c(),g=D(),_=v("td"),y=v("span"),T=B(k),M=D(),C=v("td"),O=v("span"),P=B(E),F=D(),N=v("td"),R=v("span"),W=B(z),J=D(),x=v("td"),V(ne.$$.fragment),G=D(),fe=v("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=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",p=e[23].url),m(u,"class","col-type-text col-field-url"),m(y,"class","txt txt-ellipsis"),m(y,"title",$=e[23].referer),Q(y,"txt-hint",!e[23].referer),m(_,"class","col-type-text col-field-referer"),m(O,"class","txt txt-ellipsis"),m(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),m(C,"class","col-type-number col-field-userIp"),m(R,"class","label"),Q(R,"label-danger",e[23].status>=400),m(N,"class","col-type-number col-field-status"),m(x,"class","col-type-date col-field-created"),m(fe,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Ke,Be){S(Ke,t,Be),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,h),Re&&Re.m(u,null),b(t,g),b(t,_),b(_,y),b(y,T),b(t,M),b(t,C),b(C,O),b(O,P),b(t,F),b(t,N),b(N,R),b(R,W),b(t,J),b(t,x),q(ne,x,null),b(t,G),b(t,fe),b(t,Z),ce=!0,he||(Ce=[K(t,"click",je),K(t,"keydown",ye)],he=!0)},p(Ke,Be){var Fe,tt,Wt;e=Ke,(!ce||Be&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!ce||Be&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!ce||Be&8)&&c!==(c=e[23].url+"")&&le(d,c),(!ce||Be&8&&p!==(p=e[23].url))&&m(f,"title",p),(tt=e[23].meta)!=null&&tt.errorMessage||(Wt=e[23].meta)!=null&&Wt.errorData?Re||(Re=nf(),Re.c(),Re.m(u,null)):Re&&(Re.d(1),Re=null),(!ce||Be&8)&&k!==(k=(e[23].referer||"N/A")+"")&&le(T,k),(!ce||Be&8&&$!==($=e[23].referer))&&m(y,"title",$),(!ce||Be&8)&&Q(y,"txt-hint",!e[23].referer),(!ce||Be&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(P,E),(!ce||Be&8&&L!==(L=e[23].userIp))&&m(O,"title",L),(!ce||Be&8)&&Q(O,"txt-hint",!e[23].userIp),(!ce||Be&8)&&z!==(z=e[23].status+"")&&le(W,z),(!ce||Be&8)&&Q(R,"label-danger",e[23].status>=400);const ee={};Be&8&&(ee.date=e[23].created),ne.$set(ee)},i(Ke){ce||(A(ne.$$.fragment,Ke),ce=!0)},o(Ke){I(ne.$$.fragment,Ke),ce=!1},d(Ke){Ke&&w(t),Re&&Re.d(),j(ne),he=!1,Ae(Ce)}}}function zy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=[],L=new Map,F;function N(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ly]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Jt({props:R}),se.push(()=>ge(s,"sort",N));function z(ye){n[12](ye)}let W={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ny]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),r=new Jt({props:W}),se.push(()=>ge(r,"sort",z));function J(ye){n[13](ye)}let x={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Fy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),f=new Jt({props:x}),se.push(()=>ge(f,"sort",J));function ne(ye){n[14](ye)}let G={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Ry]},$$scope:{ctx:n}};n[1]!==void 0&&(G.sort=n[1]),p=new Jt({props:G}),se.push(()=>ge(p,"sort",ne));function fe(ye){n[15](ye)}let Z={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[qy]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),_=new Jt({props:Z}),se.push(()=>ge(_,"sort",fe));function ce(ye){n[16](ye)}let he={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[jy]},$$scope:{ctx:n}};n[1]!==void 0&&(he.sort=n[1]),T=new Jt({props:he}),se.push(()=>ge(T,"sort",ce));let Ce=n[3];const Re=ye=>ye[23].id;for(let ye=0;ye<Ce.length;ye+=1){let $e=xu(n,Ce,ye),Ye=Re($e);L.set(Ye,P[ye]=sf(Ye,$e))}let je=null;return Ce.length||(je=ef(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),V(s.$$.fragment),o=D(),V(r.$$.fragment),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),V(_.$$.fragment),k=D(),V(T.$$.fragment),M=D(),C=v("th"),O=D(),E=v("tbody");for(let ye=0;ye<P.length;ye+=1)P[ye].c();je&&je.c(),m(C,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[6])},m(ye,$e){S(ye,e,$e),b(e,t),b(t,i),q(s,i,null),b(i,o),q(r,i,null),b(i,u),q(f,i,null),b(i,d),q(p,i,null),b(i,g),q(_,i,null),b(i,k),q(T,i,null),b(i,M),b(i,C),b(e,O),b(e,E);for(let Ye=0;Ye<P.length;Ye+=1)P[Ye]&&P[Ye].m(E,null);je&&je.m(E,null),F=!0},p(ye,$e){const Ye={};$e&67108864&&(Ye.$$scope={dirty:$e,ctx:ye}),!l&&$e&2&&(l=!0,Ye.sort=ye[1],ke(()=>l=!1)),s.$set(Ye);const dt={};$e&67108864&&(dt.$$scope={dirty:$e,ctx:ye}),!a&&$e&2&&(a=!0,dt.sort=ye[1],ke(()=>a=!1)),r.$set(dt);const Ke={};$e&67108864&&(Ke.$$scope={dirty:$e,ctx:ye}),!c&&$e&2&&(c=!0,Ke.sort=ye[1],ke(()=>c=!1)),f.$set(Ke);const Be={};$e&67108864&&(Be.$$scope={dirty:$e,ctx:ye}),!h&&$e&2&&(h=!0,Be.sort=ye[1],ke(()=>h=!1)),p.$set(Be);const ee={};$e&67108864&&(ee.$$scope={dirty:$e,ctx:ye}),!y&&$e&2&&(y=!0,ee.sort=ye[1],ke(()=>y=!1)),_.$set(ee);const Fe={};$e&67108864&&(Fe.$$scope={dirty:$e,ctx:ye}),!$&&$e&2&&($=!0,Fe.sort=ye[1],ke(()=>$=!1)),T.$set(Fe),$e&841&&(Ce=ye[3],re(),P=Ct(P,$e,Re,1,ye,Ce,L,E,an,sf,null,xu),ae(),!Ce.length&&je?je.p(ye,$e):Ce.length?je&&(je.d(1),je=null):(je=ef(ye),je.c(),je.m(E,null))),(!F||$e&64)&&Q(e,"table-loading",ye[6])},i(ye){if(!F){A(s.$$.fragment,ye),A(r.$$.fragment,ye),A(f.$$.fragment,ye),A(p.$$.fragment,ye),A(_.$$.fragment,ye),A(T.$$.fragment,ye);for(let $e=0;$e<Ce.length;$e+=1)A(P[$e]);F=!0}},o(ye){I(s.$$.fragment,ye),I(r.$$.fragment,ye),I(f.$$.fragment,ye),I(p.$$.fragment,ye),I(_.$$.fragment,ye),I(T.$$.fragment,ye);for(let $e=0;$e<P.length;$e+=1)I(P[$e]);F=!1},d(ye){ye&&w(e),j(s),j(r),j(f),j(p),j(_),j(T);for(let $e=0;$e<P.length;$e+=1)P[$e].d();je&&je.d()}}}function lf(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[4]),m(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),b(e,t),b(e,s),b(e,l),b(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 of(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=B("Load more ("),o=B(l),r=B(")"),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[6]),Q(t,"btn-disabled",n[6]),m(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),b(e,t),b(t,i),b(i,s),b(i,o),b(i,r),a||(u=K(t,"click",n[20]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&le(o,l),c&64&&Q(t,"btn-loading",f[6]),c&64&&Q(t,"btn-disabled",f[6])},d(f){f&&w(e),a=!1,u()}}}function By(n){let e,t,i,s,l;e=new Ia({props:{class:"table-wrapper",$$slots:{default:[zy]},$$scope:{ctx:n}}});let o=n[3].length&&lf(n),r=n[3].length&&n[7]&&of(n);return{c(){V(e.$$.fragment),t=D(),o&&o.c(),i=D(),r&&r.c(),s=we()},m(a,u){q(e,a,u),S(a,t,u),o&&o.m(a,u),S(a,i,u),r&&r.m(a,u),S(a,s,u),l=!0},p(a,[u]){const f={};u&67108939&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length?o?o.p(a,u):(o=lf(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=of(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){l||(A(e.$$.fragment,a),l=!0)},o(a){I(e.$$.fragment,a),l=!1},d(a){j(e,a),a&&w(t),o&&o.d(a),a&&w(i),r&&r.d(a),a&&w(s)}}}function Uy(n,e,t){let i;const s=vt(),l={get:"label-info",post:"label-success",patch:"label-warning",delete:"label-danger"};let{filter:o=""}=e,{presets:r=""}=e,{sort:a="-rowid"}=e,u=[],f=1,c=0,d=!1,p=0;async function h(L=1,F=!0){return t(6,d=!0),me.logs.getRequestsList(L,30,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(async N=>{if(L<=1&&g(),t(6,d=!1),t(5,f=N.page),t(4,c=N.totalItems),s("load",u.concat(N.items)),F){const R=++p;for(;N.items.length&&p==R;)t(3,u=u.concat(N.items.splice(0,10))),await H.yieldToMain()}else t(3,u=u.concat(N.items))}).catch(N=>{N!=null&&N.isAbort||(t(6,d=!1),console.warn(N),g(),me.errorResponseHandler(N,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(L){a=L,t(1,a)}function y(L){a=L,t(1,a)}function k(L){a=L,t(1,a)}function T(L){a=L,t(1,a)}function $(L){a=L,t(1,a)}function M(L){a=L,t(1,a)}const C=L=>s("select",L),O=(L,F)=>{F.code==="Enter"&&(F.preventDefault(),s("select",L))},E=()=>t(0,o=""),P=()=>h(f+1);return n.$$set=L=>{"filter"in L&&t(0,o=L.filter),"presets"in L&&t(10,r=L.presets),"sort"in L&&t(1,a=L.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,_,y,k,T,$,M,C,O,E,P]}class Wy extends ve{constructor(e){super(),be(this,e,Uy,By,_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 si(){}const Yy=function(){let n=0;return function(){return n++}}();function ut(n){return n===null||typeof n>"u"}function gt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ze(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Lt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Dn(n,e){return Lt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ky=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ug=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function St(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ct(n,e,t,i){let s,l,o;if(gt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ze(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(gt(n))return n.map(So);if(Ze(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Wg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Jy(n,e,t,i){if(!Wg(n))return;const s=e[n],l=t[n];Ze(s)&&Ze(l)?ml(s,l,i):e[n]=So(l)}function ml(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ze(n))return n;t=t||{};const l=t.merger||Jy;for(let o=0;o<s;++o){if(e=i[o],!Ze(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return ml(n,e,{merger:Zy})}function Zy(n,e,t){if(!Wg(n))return;const i=e[n],s=t[n];Ze(i)&&Ze(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const rf={"":n=>n,x:n=>n.x,y:n=>n.y};function Mi(n,e){return(rf[e]||(rf[e]=Gy(e)))(n)}function Gy(n){const e=Xy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Xy(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 Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Nn=n=>typeof n<"u",Oi=n=>typeof n=="function",af=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Qy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Dt=Math.PI,mt=2*Dt,xy=mt+Dt,To=Number.POSITIVE_INFINITY,e2=Dt/180,Tt=Dt/2,Bs=Dt/4,uf=Dt*2/3,Pn=Math.log10,Qn=Math.sign;function ff(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Pn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function t2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function n2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Yg(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 Bn(n){return n*(Dt/180)}function La(n){return n*(180/Dt)}function cf(n){if(!Lt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Kg(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*Dt&&(l+=mt),{angle:l,distance:s}}function Qr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function i2(n,e){return(n-e+xy)%mt-Dt}function wn(n){return(n%mt+mt)%mt}function hl(n,e,t,i){const s=wn(n),l=wn(e),o=wn(t),r=wn(l-s),a=wn(o-s),u=wn(s-l),f=wn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Zt(n,e,t){return Math.max(e,Math.min(t,n))}function s2(n){return Zt(n,-32768,32767)}function _l(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Na(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 Zi=(n,e,t,i)=>Na(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),l2=(n,e,t)=>Na(n,t,i=>n[i][e]>=t);function o2(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 Jg=["push","pop","shift","splice","unshift"];function r2(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Jg.forEach(t=>{const i="_onData"+Pa(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 df(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)&&(Jg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Zg(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 Gg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Xg(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,Gg.call(window,()=>{s=!1,n.apply(e,l)}))}}function a2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const u2=n=>n==="start"?"left":n==="end"?"right":"center",pf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Qg(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=Zt(Math.min(Zi(r,o.axis,u).lo,t?i:Zi(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=Zt(Math.max(Zi(r,o.axis,f,!0).hi+1,t?0:Zi(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function xg(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,mf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*mt/t)),hf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*mt/t)+1,sl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Tt)+1,easeOutSine:n=>Math.sin(n*Tt),easeInOutSine:n=>-.5*(Math.cos(Dt*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:mf(n,.075,.3),easeOutElastic:n=>Wl(n)?n:hf(n,.075,.3),easeInOutElastic(n){return Wl(n)?n:n<.5?.5*mf(n*2,.1125,.45):.5+.5*hf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-sl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?sl.easeInBounce(n*2)*.5:sl.easeOutBounce(n*2-1)*.5+.5};/*!
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function El(n){return n+.5|0}const yi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return yi(El(n*2.55),0,255)}function Ti(n){return yi(El(n*255),0,255)}function ri(n){return yi(El(n/2.55)/100,0,1)}function _f(n){return yi(El(n*100),0,100)}const On={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},xr=[..."0123456789ABCDEF"],f2=n=>xr[n&15],c2=n=>xr[(n&240)>>4]+xr[n&15],Yl=n=>(n&240)>>4===(n&15),d2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function p2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&On[n[1]]*17,g:255&On[n[2]]*17,b:255&On[n[3]]*17,a:e===5?On[n[4]]*17:255}:(e===7||e===9)&&(t={r:On[n[1]]<<4|On[n[2]],g:On[n[3]]<<4|On[n[4]],b:On[n[5]]<<4|On[n[6]],a:e===9?On[n[7]]<<4|On[n[8]]:255})),t}const m2=(n,e)=>n<255?e(n):"";function h2(n){var e=d2(n)?f2:c2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+m2(n.a,e):void 0}const _2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function e1(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 g2(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 b2(n,e,t){const i=e1(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 v2(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 Fa(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=v2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ra(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ti)}function qa(n,e,t){return Ra(e1,n,e,t)}function y2(n,e,t){return Ra(b2,n,e,t)}function k2(n,e,t){return Ra(g2,n,e,t)}function t1(n){return(n%360+360)%360}function w2(n){const e=_2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):Ti(+e[5]));const s=t1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(s,l,o):e[1]==="hsv"?i=k2(s,l,o):i=qa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function S2(n,e){var t=Fa(n);t[0]=t1(t[0]+e),t=qa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function T2(n){if(!n)return;const e=Fa(n),t=e[0],i=_f(e[1]),s=_f(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ri(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const gf={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"},bf={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 $2(){const n={},e=Object.keys(bf),t=Object.keys(gf);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,gf[l]);l=parseInt(bf[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let Kl;function C2(n){Kl||(Kl=$2(),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 M2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function O2(n){const e=M2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Qs(o):yi(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Qs(i):yi(i,0,255)),s=255&(e[4]?Qs(s):yi(s,0,255)),l=255&(e[6]?Qs(l):yi(l,0,255)),{r:i,g:s,b:l,a:t}}}function D2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ri(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const fr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function E2(n,e,t){const i=ms(ri(n.r)),s=ms(ri(n.g)),l=ms(ri(n.b));return{r:Ti(fr(i+t*(ms(ri(e.r))-i))),g:Ti(fr(s+t*(ms(ri(e.g))-s))),b:Ti(fr(l+t*(ms(ri(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Jl(n,e,t){if(n){let i=Fa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=qa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function n1(n,e){return n&&Object.assign(e||{},n)}function vf(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=Ti(n[3]))):(e=n1(n,{r:0,g:0,b:0,a:1}),e.a=Ti(e.a)),e}function A2(n){return n.charAt(0)==="r"?O2(n):w2(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=vf(e):t==="string"&&(i=p2(e)||C2(e)||A2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=n1(this._rgb);return e&&(e.a=ri(e.a)),e}set rgb(e){this._rgb=vf(e)}rgbString(){return this._valid?D2(this._rgb):void 0}hexString(){return this._valid?h2(this._rgb):void 0}hslString(){return this._valid?T2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=E2(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Ti(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=El(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 S2(this._rgb,e),this}}function i1(n){return new $o(n)}function s1(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function yf(n){return s1(n)?n:i1(n)}function cr(n){return s1(n)?n:i1(n).saturate(.5).darken(.1).hexString()}const ts=Object.create(null),ea=Object.create(null);function ll(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function dr(n,e,t){return typeof e=="string"?ml(ll(n,e),t):ml(ll(n,""),e)}class I2{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)=>cr(i.backgroundColor),this.hoverBorderColor=(t,i)=>cr(i.borderColor),this.hoverColor=(t,i)=>cr(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 dr(this,e,t)}get(e){return ll(this,e)}describe(e,t){return dr(ea,e,t)}override(e,t){return dr(ts,e,t)}route(e,t,i,s){const l=ll(this,e),o=ll(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return Ze(a)?Object.assign({},u,a):Qe(a,u)},set(a){this[r]=a}}})}}var xe=new I2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function P2(n){return!n||ut(n.size)||ut(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Co(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function L2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;a<r;a++)if(c=t[a],c!=null&&gt(c)!==!0)o=Co(n,s,l,o,c);else if(gt(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!gt(d)&&(o=Co(n,s,l,o,d));n.restore();const p=l.length/2;if(p>t.length){for(a=0;a<p;a++)delete s[l[a]];l.splice(0,p)}return o}function zi(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 kf(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function ta(n,e,t,i){N2(n,e,t,i,null)}function N2(n,e,t,i,s){let l,o,r,a,u,f;const c=e.pointStyle,d=e.rotation,p=e.radius;let h=(d||0)*e2;if(c&&typeof c=="object"&&(l=c.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(h),n.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),n.restore();return}if(!(isNaN(p)||p<=0)){switch(n.beginPath(),c){default:s?n.ellipse(t,i,s/2,p,0,0,mt):n.arc(t,i,p,0,mt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(h)*p,i-Math.cos(h)*p),h+=uf,n.lineTo(t+Math.sin(h)*p,i-Math.cos(h)*p),h+=uf,n.lineTo(t+Math.sin(h)*p,i-Math.cos(h)*p),n.closePath();break;case"rectRounded":u=p*.516,a=p-u,o=Math.cos(h+Bs)*a,r=Math.sin(h+Bs)*a,n.arc(t-o,i-r,u,h-Dt,h-Tt),n.arc(t+r,i-o,u,h-Tt,h),n.arc(t+o,i+r,u,h,h+Tt),n.arc(t-r,i+o,u,h+Tt,h+Dt),n.closePath();break;case"rect":if(!d){a=Math.SQRT1_2*p,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}h+=Bs;case"rectRot":o=Math.cos(h)*p,r=Math.sin(h)*p,n.moveTo(t-o,i-r),n.lineTo(t+r,i-o),n.lineTo(t+o,i+r),n.lineTo(t-r,i+o),n.closePath();break;case"crossRot":h+=Bs;case"cross":o=Math.cos(h)*p,r=Math.sin(h)*p,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"star":o=Math.cos(h)*p,r=Math.sin(h)*p,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),h+=Bs,o=Math.cos(h)*p,r=Math.sin(h)*p,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"line":o=s?s/2:Math.cos(h)*p,r=Math.sin(h)*p,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(h)*p,i+Math.sin(h)*p);break}n.fill(),e.borderWidth>0&&n.stroke()}}function gl(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 ja(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Va(n){n.restore()}function F2(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 R2(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function Mo(n,e,t,i,s,l={}){const o=gt(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,q2(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),ut(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),j2(n,t,i,u,l),i+=s.lineHeight;n.restore()}function q2(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),ut(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 j2(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 Oo(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-Tt,Dt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Dt,Tt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,Tt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-Tt,!0),n.lineTo(t+o.topLeft,i)}const V2=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),H2=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function z2(n,e){const t=(""+n).match(V2);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 B2=n=>+n||0;function Ha(n,e){const t={},i=Ze(e),s=i?Object.keys(e):e,l=Ze(n)?i?o=>Qe(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=B2(l(o));return t}function l1(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ks(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Fn(n){const e=l1(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Sn(n,e){n=n||{},e=e||xe.font;let t=Qe(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=Qe(n.style,e.style);i&&!(""+i).match(H2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:Qe(n.family,e.family),lineHeight:z2(Qe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:Qe(n.weight,e.weight),string:""};return s.string=P2(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&&gt(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function U2(n,e,t){const{min:i,max:s}=n,l=Ug(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 Ai(n,e){return Object.assign(Object.create(n),e)}function za(n,e=[""],t=n,i,s=()=>n[0]){Nn(i)||(i=u1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>za([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 r1(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 Sf(o).includes(r)},ownKeys(o){return Sf(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Os(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:o1(n,i),setContext:l=>Os(n,l,t,i),override:l=>Os(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return r1(l,o,()=>Y2(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 o1(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:Oi(t)?t:()=>t,isIndexable:Oi(i)?i:()=>i}}const W2=(n,e)=>n?n+Pa(e):e,Ba=(n,e)=>Ze(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function r1(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function Y2(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Oi(r)&&o.isScriptable(e)&&(r=K2(e,r,n,t)),gt(r)&&r.length&&(r=J2(e,r,n,o.isIndexable)),Ba(e,r)&&(r=Os(r,s,l&&l[e],o)),r}function K2(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),Ba(n,e)&&(e=Ua(s._scopes,s,n,e)),e}function J2(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Nn(l.index)&&i(n))e=e[l.index%e.length];else if(Ze(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ua(u,s,n,f);e.push(Os(c,l,o&&o[n],r))}}return e}function a1(n,e,t){return Oi(n)?n(e,t):n}const Z2=(n,e)=>n===!0?e:typeof n=="string"?Mi(e,n):void 0;function G2(n,e,t,i,s){for(const l of e){const o=Z2(t,l);if(o){n.add(o);const r=a1(o._fallback,t,s);if(Nn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Nn(i)&&t!==i)return null}return!1}function Ua(n,e,t,i){const s=e._rootScopes,l=a1(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=wf(r,o,t,l||t,i);return a===null||Nn(l)&&l!==t&&(a=wf(r,o,l,a,i),a===null)?!1:za(Array.from(r),[""],s,l,()=>X2(e,t,i))}function wf(n,e,t,i,s){for(;t;)t=G2(n,e,t,i,s);return t}function X2(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return gt(s)&&Ze(t)?t:s}function Q2(n,e,t,i){let s;for(const l of e)if(s=u1(W2(l,n),t),Nn(s))return Ba(n,s)?Ua(t,i,n,s):s}function u1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Nn(i))return i}}function Sf(n){let e=n._keys;return e||(e=n._keys=x2(n._scopes)),e}function x2(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 f1(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(Mi(f,l),u)};return o}const ek=Number.EPSILON||1e-14,Ds=(n,e)=>e<n.length&&!n[e].skip&&n[e],c1=n=>n==="x"?"y":"x";function tk(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Qr(l,s),a=Qr(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function nk(n,e,t){const i=n.length;let s,l,o,r,a,u=Ds(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Ds(n,f+1),!(!a||!u)){if(il(e[f],0,ek)){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 ik(n,e,t="x"){const i=c1(t),s=n.length;let l,o,r,a=Ds(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Ds(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(l=(f-o[t])/3,r[`cp1${t}`]=f-l,r[`cp1${i}`]=c-l*e[u]),a&&(l=(a[t]-f)/3,r[`cp2${t}`]=f+l,r[`cp2${i}`]=c+l*e[u])}}function sk(n,e="x"){const t=c1(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Ds(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Ds(n,o+1),!!a){if(u){const f=u[e]-a[e];s[o]=f!==0?(u[t]-a[t])/f:0}l[o]=r?u?Qn(s[o-1])!==Qn(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}nk(n,s,l),ik(n,l,e)}function Gl(n,e,t){return Math.max(Math.min(n,t),e)}function lk(n,e){let t,i,s,l,o,r=gl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&gl(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 ok(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")sk(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=tk(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&&lk(n,t)}function d1(){return typeof window<"u"&&typeof document<"u"}function Wa(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Do(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Yo=n=>window.getComputedStyle(n,null);function rk(n,e){return Yo(n).getPropertyValue(e)}const ak=["top","right","bottom","left"];function Qi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=ak[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const uk=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function fk(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(uk(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 Yi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Yo(t),l=s.boxSizing==="border-box",o=Qi(s,"padding"),r=Qi(s,"border","width"),{x:a,y:u,box:f}=fk(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:p,height:h}=e;return l&&(p-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/p*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function ck(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Wa(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Yo(l),a=Qi(r,"border","width"),u=Qi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Do(r.maxWidth,l,"clientWidth"),s=Do(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||To,maxHeight:s||To}}const pr=n=>Math.round(n*10)/10;function dk(n,e,t,i){const s=Yo(n),l=Qi(s,"margin"),o=Do(s.maxWidth,n,"clientWidth")||To,r=Do(s.maxHeight,n,"clientHeight")||To,a=ck(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=Qi(s,"border","width"),d=Qi(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=pr(Math.min(u,o,a.maxWidth)),f=pr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=pr(u/2)),{width:u,height:f}}function Tf(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 pk=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 $f(n,e){const t=rk(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ki(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function mk(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 hk(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Ki(n,s,t),r=Ki(s,l,t),a=Ki(l,e,t),u=Ki(o,r,t),f=Ki(r,a,t);return Ki(u,f,t)}const Cf=new Map;function _k(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Cf.get(t);return i||(i=new Intl.NumberFormat(n,e),Cf.set(t,i)),i}function Al(n,e,t){return _k(e,t).format(n)}const gk=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}}},bk=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function mr(n,e,t){return n?gk(e,t):bk()}function vk(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 yk(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function p1(n){return n==="angle"?{between:hl,compare:i2,normalize:wn}:{between:_l,compare:(e,t)=>e-t,normalize:e=>e}}function Mf({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 kk(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=p1(i),a=e.length;let{start:u,end:f,loop:c}=n,d,p;if(c){for(u+=a,f+=a,d=0,p=a;d<p&&o(r(e[u%a][i]),s,l);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function m1(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=p1(i),{start:f,end:c,loop:d,style:p}=kk(n,e,t),h=[];let g=!1,_=null,y,k,T;const $=()=>a(s,T,y)&&r(s,T)!==0,M=()=>r(l,y)===0||a(l,T,y),C=()=>g||$(),O=()=>!g||M();for(let E=f,P=f;E<=c;++E)k=e[E%o],!k.skip&&(y=u(k[i]),y!==T&&(g=a(y,s,l),_===null&&C()&&(_=r(y,s)===0?E:P),_!==null&&O()&&(h.push(Mf({start:_,end:E,loop:d,count:o,style:p})),_=null),P=E,T=y));return _!==null&&h.push(Mf({start:_,end:c,loop:d,count:o,style:p})),h}function h1(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=m1(i[s],n.points,e);l.length&&t.push(...l)}return t}function wk(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 Sk(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Tk(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=wk(t,s,l,i);if(i===!0)return Of(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 Of(n,Sk(t,o,a,u),t,e)}function Of(n,e,t,i){return!i||!i.setContext||!t?e:$k(n,e,t,i)}function $k(n,e,t,i){const s=n._chart.getContext(),l=Df(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function p(h,g,_,y){const k=r?-1:1;if(h!==g){for(h+=a;t[h%a].skip;)h-=k;for(;t[g%a].skip;)g+=k;h%a!==g%a&&(u.push({start:h%a,end:g%a,loop:_,style:y}),f=y,c=g%a)}}for(const h of e){c=r?c:h.start;let g=t[c%a],_;for(d=c+1;d<=h.end;d++){const y=t[d%a];_=Df(i.setContext(Ai(s,{type:"segment",p0:g,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),Ck(_,f)&&p(c,d-1,h.loop,f),g=y,f=_}c<d-1&&p(c,d-1,h.loop,f)}return u}function Df(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Ck(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 Mk{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=Gg.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 li=new Mk;const Ef="transparent",Ok={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yf(n||Ef),s=i.valid&&yf(e||Ef);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Dk{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||Ok[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=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 Ek=["x","y","borderWidth","radius","tension"],Ak=["color","borderColor","backgroundColor"];xe.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 Ik=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:Ak},numbers:{type:"number",properties:Ek}});xe.describe("animations",{_fallback:"animation"});xe.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 _1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ze(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ze(s))return;const l={};for(const o of Ik)l[o]=s[o];(gt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=Lk(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Pk(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Dk(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return li.add(this._chart,i),!0}}function Pk(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 Lk(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 Af(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 Nk(n,e,t){if(t===!1)return!1;const i=Af(n,t),s=Af(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Fk(n){let e,t,i,s;return Ze(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 g1(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 If(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],Lt(u)&&(l||e===0||Qn(e)===Qn(u))&&(e+=u)}return e}}function Rk(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 Pf(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function qk(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function jk(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 Vk(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Lf(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 Nf(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=qk(l,o,i),c=e.length;let d;for(let p=0;p<c;++p){const h=e[p],{[a]:g,[u]:_}=h,y=h._stacks||(h._stacks={});d=y[u]=Vk(s,f,g),d[r]=_,d._top=Lf(d,o,!0,i.type),d._bottom=Lf(d,o,!1,i.type)}}function hr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function Hk(n,e){return Ai(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function zk(n,e,t){return Ai(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Us(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const _r=n=>n==="reset"||n==="none",Ff=(n,e)=>e?n:Object.assign({},n),Bk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:g1(t,!0),values:null};class Yn{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=Pf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Us(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,p,h)=>c==="x"?d:c==="r"?h:p,l=t.xAxisID=Qe(i.xAxisID,hr(e,"x")),o=t.yAxisID=Qe(i.yAxisID,hr(e,"y")),r=t.rAxisID=Qe(i.rAxisID,hr(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&&df(this._data,this),e._stacked&&Us(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(Ze(t))this._data=Rk(t);else if(i!==t){if(i){df(i,this);const s=this._cachedMeta;Us(s),s._parsed=[]}t&&Object.isExtensible(t)&&r2(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=Pf(t.vScale,t),t.stack!==i.stack&&(s=!0,Us(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&Nf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{gt(s[e])?d=this.parseArrayData(i,s,e,t):Ze(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const p=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(p()&&(a=!1),u=c);i._sorted=a}o&&Nf(this,d)}parsePrimitiveData(e,t,i,s){const{iScale:l,vScale:o}=e,r=l.axis,a=o.axis,u=l.getLabels(),f=l===o,c=new Array(s);let d,p,h;for(d=0,p=s;d<p;++d)h=d+i,c[d]={[r]:f||l.parse(u[h],h),[a]:o.parse(t[h],h)};return c}parseArrayData(e,t,i,s){const{xScale:l,yScale:o}=e,r=new Array(s);let a,u,f,c;for(a=0,u=s;a<u;++a)f=a+i,c=t[f],r[a]={x:l.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,s){const{xScale:l,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(s);let f,c,d,p;for(f=0,c=s;f<c;++f)d=f+i,p=t[d],u[f]={x:l.parse(Mi(p,r),d),y:o.parse(Mi(p,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const s=this.chart,l=this._cachedMeta,o=t[e.axis],r={keys:g1(s,!0),values:t._stacks[e.axis]};return If(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=If(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=Bk(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=jk(r);let d,p;function h(){p=s[d];const g=p[r.axis];return!Lt(p[e.axis])||f>g||c<g}for(d=0;d<o&&!(!h()&&(this.updateRangeFromParsed(u,e,p,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!h()){this.updateRangeFromParsed(u,e,p,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],Lt(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=Fk(Qe(this.options.clip,Nk(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,s=i.data||[],l=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||s.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,l,r,a),f=r;f<r+a;++f){const c=s[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,l))}for(f=0;f<o.length;++f)o[f].draw(e,l)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const s=this.getDataset();let l;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];l=o.$context||(o.$context=zk(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=Hk(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&&Nn(i);if(r)return Ff(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=s?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),p=Object.keys(xe.elements[e]),h=()=>this.getContext(i,s),g=u.resolveNamedOptions(d,p,h,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(Ff(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new _1(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||_r(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){_r(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!_r(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&Us(i,s)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,s]=e;this[t](i,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Yn.defaults={};Yn.prototype.datasetElementType=null;Yn.prototype.dataElementType=null;function Uk(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=Zg(i.sort((s,l)=>s-l))}return n._cache.$bar}function Wk(n){const e=n.iScale,t=Uk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Nn(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 Yk(n,e,t,i){const s=t.barThickness;let l,o;return ut(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 Kk(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 Jk(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 b1(n,e,t,i){return gt(n)?Jk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Rf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(b1(d,c,l,u));return a}function gr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Zk(n,e,t){return n!==0?Qn(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Gk(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 Xk(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}=Gk(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[qf(f,o,r,a)]=!0,s=u)),l[qf(s,o,r,a)]=!0,n.borderSkipped=l}function qf(n,e,t,i){return i?(n=Qk(n,e,t),n=jf(n,t,e)):n=jf(n,e,t),n}function Qk(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 xk(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ya extends Yn{parsePrimitiveData(e,t,i,s){return Rf(e,t,i,s)}parseArrayData(e,t,i,s){return Rf(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,c=[];let d,p,h,g;for(d=i,p=i+s;d<p;++d)g=t[d],h={},h[l.axis]=l.parse(Mi(g,u),d),c.push(b1(Mi(g,f),h,o,d));return c}updateRangeFromParsed(e,t,i,s){super.updateRangeFromParsed(e,t,i,s);const l=i._custom;l&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,l.min),e.max=Math.max(e.max,l.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:s}=t,l=this.getParsed(e),o=l._custom,r=gr(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s);for(let p=t;p<t+i;p++){const h=this.getParsed(p),g=l||ut(h[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(p),_=this._calculateBarIndexPixels(p,f),y=(h._stacks||{})[r.axis],k={horizontal:u,base:g.base,enableBorderRadius:!y||gr(h._custom)||o===y._top||o===y._bottom,x:u?g.head:_.center,y:u?_.center:g.head,height:u?_.size:Math.abs(g.size),width:u?Math.abs(g.size):_.size};d&&(k.options=c||this.resolveDataElementOptions(p,e[p].active?"active":s));const T=k.options||e[p].options;Xk(k,T,y,o),xk(k,T,f.ratio),this.updateElement(e[p],p,k,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(ut(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||Wk(t),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:s,minBarLength:l}}=this,o=s||0,r=this.getParsed(e),a=r._custom,u=gr(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,p,h;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&Qn(f)!==Qn(a.barEnd)&&(c=0),c+=f);const g=!ut(s)&&!u?s:c;let _=t.getPixelForValue(g);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(c+d):p=_,h=p-_,Math.abs(h)<l){h=Zk(h,t,o)*l,f===o&&(_-=h/2);const y=t.getPixelForDecimal(0),k=t.getPixelForDecimal(1),T=Math.min(y,k),$=Math.max(y,k);_=Math.max(Math.min(_,$),T),p=_+h}if(_===t.getPixelForValue(o)){const y=Qn(h)*t.getLineWidthForValue(o)/2;_+=y,h-=y}return{size:h,base:_,head:p,center:p+h/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=Qe(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?Kk(e,t,s,u):Yk(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Ya.id="bar";Ya.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ya.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ka extends Yn{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=Qe(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=Qe(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;d<t+i;d++){const p=e[d],h=!l&&this.getParsed(d),g={},_=g[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(h[f]),y=g[c]=l?r.getBasePixel():r.getPixelForValue(h[c]);g.skip=isNaN(_)||isNaN(y),u&&(g.options=a||this.resolveDataElementOptions(d,p.active?"active":s),l&&(g.options.radius=0)),this.updateElement(p,d,g,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=Qe(i&&i._custom,l),s}}Ka.id="bubble";Ka.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ka.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function ew(n,e,t){let i=1,s=1,l=0,o=0;if(e<mt){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),p=(T,$,M)=>hl(T,r,a,!0)?1:Math.max($,$*t,M,M*t),h=(T,$,M)=>hl(T,r,a,!0)?-1:Math.min($,$*t,M,M*t),g=p(0,u,c),_=p(Tt,f,d),y=h(Dt,u,c),k=h(Dt+Tt,f,d);i=(g-y)/2,s=(_-k)/2,l=-(g+y)/2,o=-(_+k)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Il extends Yn{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(Ze(i[e])){const{key:a="value"}=this._parsing;l=u=>+Mi(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Bn(this.options.rotation-90)}_getCircumference(){return Bn(this.options.circumference)}_getRotationExtents(){let e=mt,t=-mt;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(Ky(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:h,offsetY:g}=ew(c,f,a),_=(i.width-o)/d,y=(i.height-o)/p,k=Math.max(Math.min(_,y)/2,0),T=Ug(this.options.radius,k),$=Math.max(T*a,0),M=(T-$)/this._getVisibleDatasetWeightTotal();this.offsetX=h*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/mt)}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,r=o.chartArea,u=o.options.animation,f=(r.left+r.right)/2,c=(r.top+r.bottom)/2,d=l&&u.animateScale,p=d?0:this.innerRadius,h=d?0:this.outerRadius,{sharedOptions:g,includeOptions:_}=this._getSharedOptions(t,s);let y=this._getRotation(),k;for(k=0;k<t;++k)y+=this._circumference(k,l);for(k=t;k<t+i;++k){const T=this._circumference(k,l),$=e[k],M={x:f+this.offsetX,y:c+this.offsetY,startAngle:y,endAngle:y+T,circumference:T,outerRadius:h,innerRadius:p};_&&(M.options=g||this.resolveDataElementOptions(k,$.active?"active":s)),y+=T,this.updateElement($,k,M,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?mt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Al(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(Qe(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Il.id="doughnut";Il.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"};Il.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Il.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return gt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Ko extends Yn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Qg(t,s,o);this._drawStart=r,this._drawCount=a,xg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,p=r.axis,{spanGaps:h,segment:g}=this.options,_=Ms(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let k=t>0&&this.getParsed(t-1);for(let T=t;T<t+i;++T){const $=e[T],M=this.getParsed(T),C=y?$:{},O=ut(M[p]),E=C[d]=o.getPixelForValue(M[d],T),P=C[p]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[p],T);C.skip=isNaN(E)||isNaN(P)||O,C.stop=T>0&&Math.abs(M[d]-k[d])>_,g&&(C.parsed=M,C.raw=u.data[T]),c&&(C.options=f||this.resolveDataElementOptions(T,$.active?"active":s)),y||this.updateElement($,T,C,s),k=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ko.id="line";Ko.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Ko.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ja extends Yn{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=Al(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return f1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(l<t.min&&(t.min=l),l>t.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Dt;let p=d,h;const g=360/this.countVisibleElements();for(h=0;h<t;++h)p+=this._computeAngle(h,s,g);for(h=t;h<t+i;h++){const _=e[h];let y=p,k=p+this._computeAngle(h,s,g),T=o.getDataVisibility(h)?u.getDistanceFromCenterForValue(this.getParsed(h).r):0;p=k,l&&(a.animateScale&&(T=0),a.animateRotate&&(y=k=d));const $={x:f,y:c,innerRadius:0,outerRadius:T,startAngle:y,endAngle:k,options:this.resolveDataElementOptions(h,_.active?"active":s)};this.updateElement(_,h,$,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Bn(this.resolveDataElementOptions(e,t).angle||i):0}}Ja.id="polarArea";Ja.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ja.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 v1 extends Il{}v1.id="pie";v1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Za extends Yn{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 f1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r<t+i;r++){const a=e[r],u=this.resolveDataElementOptions(r,a.active?"active":s),f=l.getPointPositionForValue(r,this.getParsed(r).r),c=o?l.xCenter:f.x,d=o?l.yCenter:f.y,p={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,p,s)}}}Za.id="radar";Za.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Za.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};let pi=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Ms(this.x)&&Ms(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};pi.defaults={};pi.defaultRoutes=void 0;const y1={values(n){return gt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=tw(n,t)}const o=Pn(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),Al(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Pn(n)));return i===1||i===2||i===5?y1.numeric.call(this,n,e,t):""}};function tw(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Jo={formatters:y1};xe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Jo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});xe.route("scale.ticks","color","","color");xe.route("scale.grid","color","","borderColor");xe.route("scale.grid","borderColor","","borderColor");xe.route("scale.title","color","","color");xe.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});xe.describe("scales",{_fallback:"scale"});xe.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function nw(n,e){const t=n.options.ticks,i=t.maxTicksLimit||iw(n),s=t.major.enabled?lw(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return ow(e,a,s,l/i),a;const u=sw(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Xl(e,a,u,ut(d)?0:o-d,o),f=0,c=l-1;f<c;f++)Xl(e,a,u,s[f],s[f+1]);return Xl(e,a,u,r,ut(d)?e.length:r+d),a}return Xl(e,a,u),a}function iw(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 sw(n,e,t){const i=rw(n),s=e.length/t;if(!i)return Math.max(s,1);const l=t2(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 lw(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function ow(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=Qe(i,0),o=Math.min(Qe(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 rw(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 aw=n=>n==="left"?"right":n==="right"?"left":n,Vf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Hf(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 uw(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 fw(n,e){ct(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;l<s;++l)delete t.data[i[l]];i.splice(0,s)}})}function Ws(n){return n.drawTicks?n.tickLength:0}function zf(n,e){if(!n.display)return 0;const t=Sn(n.font,e),i=Fn(n.padding);return(gt(n.text)?n.text.length:1)*t.lineHeight+i.height}function cw(n,e){return Ai(n,{scale:e,type:"scale"})}function dw(n,e,t){return Ai(n,{tick:t,index:e,type:"tick"})}function pw(n,e,t){let i=u2(n);return(t&&e!=="right"||!t&&e==="right")&&(i=aw(i)),i}function mw(n,e,t,i){const{top:s,left:l,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,p,h;const g=o-s,_=r-l;if(n.isHorizontal()){if(p=pf(i,l,r),Ze(t)){const y=Object.keys(t)[0],k=t[y];h=f[y].getPixelForValue(k)+g-e}else t==="center"?h=(u.bottom+u.top)/2+g-e:h=Vf(n,t,e);d=r-l}else{if(Ze(t)){const y=Object.keys(t)[0],k=t[y];p=f[y].getPixelForValue(k)-_+e}else t==="center"?p=(u.left+u.right)/2-_+e:p=Vf(n,t,e);h=pf(i,o,s),c=t==="left"?-Tt:Tt}return{titleX:p,titleY:h,maxWidth:d,rotation:c}}class ss extends pi{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=Dn(e,Number.POSITIVE_INFINITY),t=Dn(t,Number.NEGATIVE_INFINITY),i=Dn(i,Number.POSITIVE_INFINITY),s=Dn(s,Number.NEGATIVE_INFINITY),{min:Dn(e,i),max:Dn(t,s),minDefined:Lt(e),maxDefined:Lt(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:Dn(t,Dn(i,t)),max:Dn(i,Dn(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(){St(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=U2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Hf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=nw(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(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(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(){St(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),St(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(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=St(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=this.ticks.length,s=t.minRotation||0,l=t.maxRotation;let o=s,r,a,u;if(!this._isVisible()||!t.display||s>=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,p=Zt(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:p/(i-1),c+6>r&&(r=p/(i-(e.offset?.5:1)),a=this.maxHeight-Ws(e.grid)-t.padding-zf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=La(Math.min(Math.asin(Zt((f.highest.height+6)/r,-1,1)),Math.asin(Zt(a/u,-1,1))-Math.asin(Zt(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(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=zf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Ws(l)+a):(e.height=this.maxHeight,e.width=Ws(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),p=i.padding*2,h=Bn(this.labelRotation),g=Math.cos(h),_=Math.sin(h);if(r){const y=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+y+p)}else{const y=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+p)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,p=0;a?u?(d=s*e.width,p=i*t.height):(d=i*e.height,p=s*t.width):l==="start"?p=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,p=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((p-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){St(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++)ut(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=Hf(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length)}return e}_computeLabelSizes(e,t){const{ctx:i,_longestTextCache:s}=this,l=[],o=[];let r=0,a=0,u,f,c,d,p,h,g,_,y,k,T;for(u=0;u<t;++u){if(d=e[u].label,p=this._resolveTickFontOptions(u),i.font=h=p.string,g=s[h]=s[h]||{data:{},gc:[]},_=p.lineHeight,y=k=0,!ut(d)&&!gt(d))y=Co(i,g.data,g.gc,y,d),k=_;else if(gt(d))for(f=0,c=d.length;f<c;++f)T=d[f],!ut(T)&&!gt(T)&&(y=Co(i,g.data,g.gc,y,T),k+=_);l.push(y),o.push(k),r=Math.max(y,r),a=Math.max(k,a)}fw(s,t);const $=l.indexOf(r),M=o.indexOf(a),C=O=>({width:l[O]||0,height:o[O]||0});return{first:C(0),last:C(t-1),widest:C($),highest:C(M),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return s2(this._alignToPixels?zi(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=dw(this.getContext(),e,i))}return this.$context||(this.$context=cw(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Bn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Ws(l),d=[],p=l.setContext(this.getContext()),h=p.drawBorder?p.borderWidth:0,g=h/2,_=function(W){return zi(i,W,h)};let y,k,T,$,M,C,O,E,P,L,F,N;if(o==="top")y=_(this.bottom),C=this.bottom-c,E=y-g,L=_(e.top)+g,N=e.bottom;else if(o==="bottom")y=_(this.top),L=e.top,N=_(e.bottom)-g,C=y+g,E=this.top+c;else if(o==="left")y=_(this.right),M=this.right-c,O=y-g,P=_(e.left)+g,F=e.right;else if(o==="right")y=_(this.left),P=e.left,F=_(e.right)-g,M=y+g,O=this.left+c;else if(t==="x"){if(o==="center")y=_((e.top+e.bottom)/2+.5);else if(Ze(o)){const W=Object.keys(o)[0],J=o[W];y=_(this.chart.scales[W].getPixelForValue(J))}L=e.top,N=e.bottom,C=y+g,E=C+c}else if(t==="y"){if(o==="center")y=_((e.left+e.right)/2);else if(Ze(o)){const W=Object.keys(o)[0],J=o[W];y=_(this.chart.scales[W].getPixelForValue(J))}M=y-g,O=M-c,P=e.left,F=e.right}const R=Qe(s.ticks.maxTicksLimit,f),z=Math.max(1,Math.ceil(f/R));for(k=0;k<f;k+=z){const W=l.setContext(this.getContext(k)),J=W.lineWidth,x=W.color,ne=W.borderDash||[],G=W.borderDashOffset,fe=W.tickWidth,Z=W.tickColor,ce=W.tickBorderDash||[],he=W.tickBorderDashOffset;T=uw(this,k,r),T!==void 0&&($=zi(i,T,J),a?M=O=P=F=$:C=E=L=N=$,d.push({tx1:M,ty1:C,tx2:O,ty2:E,x1:P,y1:L,x2:F,y2:N,width:J,color:x,borderDash:ne,borderDashOffset:G,tickWidth:fe,tickColor:Z,tickBorderDash:ce,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=y,d}_computeLabelItems(e){const t=this.axis,i=this.options,{position:s,ticks:l}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=l,d=Ws(i.grid),p=d+f,h=c?-f:p,g=-Bn(this.labelRotation),_=[];let y,k,T,$,M,C,O,E,P,L,F,N,R="middle";if(s==="top")C=this.bottom-h,O=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+h,O=this._getXAxisLabelAlignment();else if(s==="left"){const W=this._getYAxisLabelAlignment(d);O=W.textAlign,M=W.x}else if(s==="right"){const W=this._getYAxisLabelAlignment(d);O=W.textAlign,M=W.x}else if(t==="x"){if(s==="center")C=(e.top+e.bottom)/2+p;else if(Ze(s)){const W=Object.keys(s)[0],J=s[W];C=this.chart.scales[W].getPixelForValue(J)+p}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-p;else if(Ze(s)){const W=Object.keys(s)[0],J=s[W];M=this.chart.scales[W].getPixelForValue(J)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?R="top":a==="end"&&(R="bottom"));const z=this._getLabelSizes();for(y=0,k=r.length;y<k;++y){T=r[y],$=T.label;const W=l.setContext(this.getContext(y));E=this.getPixelForTick(y)+l.labelOffset,P=this._resolveTickFontOptions(y),L=P.lineHeight,F=gt($)?$.length:1;const J=F/2,x=W.color,ne=W.textStrokeColor,G=W.textStrokeWidth;let fe=O;o?(M=E,O==="inner"&&(y===k-1?fe=this.options.reverse?"left":"right":y===0?fe=this.options.reverse?"right":"left":fe="center"),s==="top"?u==="near"||g!==0?N=-F*L+L/2:u==="center"?N=-z.highest.height/2-J*L+L:N=-z.highest.height+L/2:u==="near"||g!==0?N=L/2:u==="center"?N=z.highest.height/2-J*L:N=z.highest.height-F*L,c&&(N*=-1)):(C=E,N=(1-F)*L/2);let Z;if(W.showLabelBackdrop){const ce=Fn(W.backdropPadding),he=z.heights[y],Ce=z.widths[y];let Re=C+N-ce.top,je=M-ce.left;switch(R){case"middle":Re-=he/2;break;case"bottom":Re-=he;break}switch(O){case"center":je-=Ce/2;break;case"right":je-=Ce;break}Z={left:je,top:Re,width:Ce+ce.width,height:he+ce.height,color:W.backdropColor}}_.push({rotation:g,label:$,font:P,color:x,strokeColor:ne,strokeWidth:G,textOffset:N,textAlign:fe,textBaseline:R,translation:[M,C],backdrop:Z})}return _}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Bn(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?s?(f=this.left+l,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,c;this.isHorizontal()?(a=zi(e,this.left,l)-l/2,u=zi(e,this.right,o)+o/2,f=c=r):(f=zi(e,this.top,l)-l/2,c=zi(e,this.bottom,o)+o/2,a=u=r),t.save(),t.lineWidth=s.borderWidth,t.strokeStyle=s.borderColor,t.beginPath(),t.moveTo(a,f),t.lineTo(u,c),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ja(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;Mo(i,f,0,c,u,a)}s&&Va(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Sn(i.font),o=Fn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||Ze(t)?(a+=o.bottom,gt(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=mw(this,a,t,r);Mo(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:pw(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=Qe(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==ss.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 Sn(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;gw(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,hw(e,o,i),this.override&&xe.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 xe[s]&&(delete xe[s][i],this.override&&delete ts[i])}}function hw(n,e,t){const i=ml(Object.create(null),[t?xe.get(t):{},xe.get(e),n.defaults]);xe.set(e,i),n.defaultRoutes&&_w(e,n.defaultRoutes),n.descriptors&&xe.describe(e,n.descriptors)}function _w(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(".");xe.route(l,s,a,r)})}function gw(n){return"id"in n&&"defaults"in n}class bw{constructor(){this.controllers=new Ql(Yn,"datasets",!0),this.elements=new Ql(pi,"elements"),this.plugins=new Ql(Object,"plugins"),this.scales=new Ql(ss,"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):ct(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Pa(e);St(i["before"+s],[],i),t[e](i),St(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 Xn=new bw;class Ga extends Yn{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=Qg(t,i,s);if(this._drawStart=l,this._drawCount=o,xg(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=Xn.getElement("line")),super.addElements()}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),p=o.axis,h=r.axis,{spanGaps:g,segment:_}=this.options,y=Ms(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||l||s==="none";let T=t>0&&this.getParsed(t-1);for(let $=t;$<t+i;++$){const M=e[$],C=this.getParsed($),O=k?M:{},E=ut(C[h]),P=O[p]=o.getPixelForValue(C[p],$),L=O[h]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,C,a):C[h],$);O.skip=isNaN(P)||isNaN(L)||E,O.stop=$>0&&Math.abs(C[p]-T[p])>y,_&&(O.parsed=C,O.raw=u.data[$]),d&&(O.options=c||this.resolveDataElementOptions($,M.active?"active":s)),k||this.updateElement(M,$,O,s),T=C}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Ga.id="scatter";Ga.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ga.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Bi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class na{constructor(e){this.options=e||{}}init(e){}formats(){return Bi()}parse(e,t){return Bi()}format(e,t){return Bi()}add(e,t,i){return Bi()}diff(e,t,i){return Bi()}startOf(e,t,i){return Bi()}endOf(e,t){return Bi()}}na.override=function(n){Object.assign(na.prototype,n)};var k1={_date:na};function vw(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?l2:Zi;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function 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:c,hi:d}=vw(l[r],e,o,s);for(let p=c;p<=d;++p){const h=f[p];h.skip||i(h,u,p)}}}function yw(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 br(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Pl(n,t,e,function(r,a,u){!s&&!gl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function kw(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=Kg(o,{x:e.x,y:e.y});hl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Pl(n,t,e,l),s}function ww(n,e,t,i,s,l){let o=[];const r=yw(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const p=f.inRange(e.x,e.y,s);if(i&&!p)return;const h=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(h))&&!p)return;const _=r(e,h);_<a?(o=[{element:f,datasetIndex:c,index:d}],a=_):_===a&&o.push({element:f,datasetIndex:c,index:d})}return Pl(n,t,e,u),o}function vr(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?kw(n,e,t,s):ww(n,e,t,i,s,l)}function Bf(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 Sw={evaluateInteractionItems:Pl,modes:{index(n,e,t,i){const s=Yi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?br(n,s,l,i,o):vr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Yi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?br(n,s,l,i,o):vr(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=Yi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return br(n,s,l,i,o)},nearest(n,e,t,i){const s=Yi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return vr(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Yi(e,n);return Bf(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Yi(e,n);return Bf(n,s,"y",t.intersect,i)}}};const w1=["left","top","right","bottom"];function Ys(n,e){return n.filter(t=>t.pos===e)}function Uf(n,e){return n.filter(t=>w1.indexOf(t.pos)===-1&&t.box.axis===e)}function Ks(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function Tw(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;t<i;++t)s=n[t],{position:l,options:{stack:o,stackWeight:r=1}}=s,e.push({index:t,box:s,pos:l,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&l+o,stackWeight:r});return e}function $w(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!w1.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 Cw(n,e){const t=$w(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 Mw(n){const e=Tw(n),t=Ks(e.filter(u=>u.box.fullSize),!0),i=Ks(Ys(e,"left"),!0),s=Ks(Ys(e,"right")),l=Ks(Ys(e,"top"),!0),o=Ks(Ys(e,"bottom")),r=Uf(e,"x"),a=Uf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Ys(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Wf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function S1(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 Ow(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!Ze(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&S1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Wf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Wf(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 Dw(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 Ew(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function xs(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l<o;++l){r=n[l],a=r.box,a.update(r.width||e.w,r.height||e.h,Ew(r.horizontal,e));const{same:c,other:d}=Ow(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&xs(s,e,t,i)||f}function 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 Yf(n,e,t,i){const s=t.padding;let{x:l,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{count:1,placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;Nn(u.start)&&(o=u.start),a.fullSize?xl(a,s.left,o,t.outerWidth-s.right-s.left,d):xl(a,e.left+u.placed,o,c,d),u.start=o,u.placed+=c,o=a.bottom}else{const c=e.h*f,d=u.size||a.width;Nn(u.start)&&(l=u.start),a.fullSize?xl(a,l,s.top,d,t.outerHeight-s.bottom-s.top):xl(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}xe.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=Fn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Mw(n.boxes),a=r.vertical,u=r.horizontal;ct(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);S1(d,Fn(i));const p=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),h=Cw(a.concat(u),c);xs(r.fullSize,p,c,h),xs(a,p,c,h),xs(u,p,c,h)&&xs(a,p,c,h),Dw(p),Yf(r.leftAndTop,p,c,h),p.x+=p.w,p.y+=p.h,Yf(r.rightAndBottom,p,c,h),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},ct(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class T1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class Aw extends T1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",Iw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Kf=n=>n===null||n==="";function Pw(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Kf(s)){const l=$f(n,"width");l!==void 0&&(n.width=l)}if(Kf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=$f(n,"height");l!==void 0&&(n.height=l)}return n}const $1=pk?{passive:!0}:!1;function Lw(n,e,t){n.addEventListener(e,t,$1)}function Nw(n,e,t){n.canvas.removeEventListener(e,t,$1)}function Fw(n,e){const t=Iw[n.type]||n.type,{x:i,y:s}=Yi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Eo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Rw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.addedNodes,i),o=o&&!Eo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function qw(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Eo(r.removedNodes,i),o=o&&!Eo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const bl=new Map;let Jf=0;function C1(){const n=window.devicePixelRatio;n!==Jf&&(Jf=n,bl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function jw(n,e){bl.size||window.addEventListener("resize",C1),bl.set(n,e)}function Vw(n){bl.delete(n),bl.size||window.removeEventListener("resize",C1)}function Hw(n,e,t){const i=n.canvas,s=i&&Wa(i);if(!s)return;const l=Xg((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),jw(n,l),o}function yr(n,e,t){t&&t.disconnect(),e==="resize"&&Vw(n)}function zw(n,e,t){const i=n.canvas,s=Xg(l=>{n.ctx!==null&&t(Fw(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return Lw(i,e,s),s}class Bw extends T1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(Pw(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];ut(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:Rw,detach:qw,resize:Hw}[t]||zw;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:yr,detach:yr,resize:yr}[t]||Nw)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return dk(e,t,i,s)}isAttached(e){const t=Wa(e);return!!(t&&t.isConnected)}}function Uw(n){return!d1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Aw:Bw}class Ww{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(St(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ut(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=Qe(i.options&&i.options.plugins,{}),l=Yw(i);return s===!1&&!t?[]:Jw(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 Yw(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let l=0;l<i.length;l++)t.push(Xn.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 Kw(n,e){return!e&&n===!1?null:n===!0?{}:n}function Jw(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=Kw(i[a],s);u!==null&&l.push({plugin:r,options:Zw(n.config,{plugin:r,local:t[a]},u,o)})}return l}function Zw(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 ia(n,e){const t=xe.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Gw(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function Xw(n,e){return n===e?"_index_":"_value_"}function Qw(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function sa(n,e){return n==="x"||n==="y"?n:e.axis||Qw(e.position)||n.charAt(0).toLowerCase()}function xw(n,e){const t=ts[n.type]||{scales:{}},i=e.scales||{},s=ia(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!Ze(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=sa(r,a),f=Xw(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=nl(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||ia(a,e),c=(ts[a]||{}).scales||{};Object.keys(c).forEach(d=>{const p=Gw(d,u),h=r[p+"AxisID"]||l[p]||p;o[h]=o[h]||Object.create(null),nl(o[h],[{axis:p},i[h],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];nl(a,[xe.scales[a.type],xe.scale])}),o}function M1(n){const e=n.options||(n.options={});e.plugins=Qe(e.plugins,{}),e.scales=xw(n,e)}function O1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function e3(n){return n=n||{},n.data=O1(n.data),M1(n),n}const Zf=new Map,D1=new Set;function to(n,e){let t=Zf.get(n);return t||(t=e(),Zf.set(n,t),D1.add(t)),t}const Js=(n,e,t)=>{const i=Mi(e,t);i!==void 0&&n.add(i)};class t3{constructor(e){this._config=e3(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=O1(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(),M1(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(c=>Js(a,e,c))),f.forEach(c=>Js(a,s,c)),f.forEach(c=>Js(a,ts[l]||{},c)),f.forEach(c=>Js(a,xe,c)),f.forEach(c=>Js(a,ea,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),D1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,ts[t]||{},xe.datasets[t]||{},{type:t},xe,ea]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Gf(this._resolverCache,e,s);let a=o;if(i3(o,t)){l.$shared=!1,i=Oi(i)?i():i;const u=this.createResolver(e,i,r);a=Os(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Gf(this._resolverCache,e,i);return Ze(t)?Os(l,t,void 0,s):l}}function Gf(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:za(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const n3=n=>Ze(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Oi(n[t]),!1);function i3(n,e){const{isScriptable:t,isIndexable:i}=o1(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Oi(r)||n3(r))||o&&gt(r))return!0}return!1}var s3="3.9.1";const l3=["top","bottom","left","right","chartArea"];function Xf(n,e){return n==="top"||n==="bottom"||l3.indexOf(n)===-1&&e==="x"}function Qf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function xf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),St(t&&t.onComplete,[n],e)}function o3(n){const e=n.chart,t=e.options.animation;St(t&&t.onProgress,[n],e)}function E1(n){return d1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ao={},A1=n=>{const e=E1(n);return Object.values(Ao).filter(t=>t.canvas===e).pop()};function r3(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 a3(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Io{constructor(e,t){const i=this.config=new t3(t),s=E1(e),l=A1(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||Uw(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=Yy(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ww,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=a2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Ao[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",xf),li.listen(this,"progress",o3),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return ut(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():Tf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kf(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(e,t){li.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,Tf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),St(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ct(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=sa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),ct(l,o=>{const r=o.options,a=r.id,u=sa(a,r),f=Qe(r.type,o.dtype);(r.position===void 0||Xf(r.position,u)!==Xf(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=Xn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ct(s,(o,r)=>{o||delete i[r]}),ct(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(Qf("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||ia(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=Xn.getController(r),{datasetElementType:u,dataElementType:f}=xe.datasets[r];Object.assign(a.prototype,{dataElementType:Xn.getElement(f),datasetElementType:u&&Xn.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ct(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u<f;u++){const{controller:c}=this.getDatasetMeta(u),d=!s&&l.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||ct(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Qf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ct(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);(!af(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;r3(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(!af(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=[],ct(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,Oi(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&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),xf({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&ja(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&&Va(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return gl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Sw.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=Ai(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);Nn(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(),li.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(),kf(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Ao[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(l,o)=>{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};ct(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(){ct(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ct(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:l,index:o})=>{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!wo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=Qy(e),u=a3(e,this._lastEvent,i,a);i&&(this._lastEvent=null,St(l.onHover,[e,r,this],this),a&&St(l.onClick,[e,r,this],this));const f=!wo(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const ec=()=>ct(Io.instances,n=>n._plugins.invalidate()),gi=!0;Object.defineProperties(Io,{defaults:{enumerable:gi,value:xe},instances:{enumerable:gi,value:Ao},overrides:{enumerable:gi,value:ts},registry:{enumerable:gi,value:Xn},version:{enumerable:gi,value:s3},getChart:{enumerable:gi,value:A1},register:{enumerable:gi,value:(...n)=>{Xn.add(...n),ec()}},unregister:{enumerable:gi,value:(...n)=>{Xn.remove(...n),ec()}}});function I1(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+Tt,i-Tt),n.closePath(),n.clip()}function u3(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function f3(n,e,t,i){const s=u3(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 Zt(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Zt(s.innerStart,0,o),innerEnd:Zt(s.innerEnd,0,o)}}function hs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function la(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let p=0;const h=s-a;if(i){const W=f>0?f-i:0,J=c>0?c-i:0,x=(W+J)/2,ne=x!==0?h*x/(x+i):h;p=(h-ne)/2}const g=Math.max(.001,h*c-t/Dt)/c,_=(h-g)/2,y=a+_+p,k=s-_-p,{outerStart:T,outerEnd:$,innerStart:M,innerEnd:C}=f3(e,d,c,k-y),O=c-T,E=c-$,P=y+T/O,L=k-$/E,F=d+M,N=d+C,R=y+M/F,z=k-C/N;if(n.beginPath(),l){if(n.arc(o,r,c,P,L),$>0){const x=hs(E,L,o,r);n.arc(x.x,x.y,$,L,k+Tt)}const W=hs(N,k,o,r);if(n.lineTo(W.x,W.y),C>0){const x=hs(N,z,o,r);n.arc(x.x,x.y,C,k+Tt,z+Math.PI)}if(n.arc(o,r,d,k-C/d,y+M/d,!0),M>0){const x=hs(F,R,o,r);n.arc(x.x,x.y,M,R+Math.PI,y-Tt)}const J=hs(O,y,o,r);if(n.lineTo(J.x,J.y),T>0){const x=hs(O,P,o,r);n.arc(x.x,x.y,T,y-Tt,P)}}else{n.moveTo(o,r);const W=Math.cos(P)*c+o,J=Math.sin(P)*c+r;n.lineTo(W,J);const x=Math.cos(L)*c+o,ne=Math.sin(L)*c+r;n.lineTo(x,ne)}n.closePath()}function c3(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){la(n,e,t,i,o+mt,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%mt,r%mt===0&&(a+=mt))}return la(n,e,t,i,a,s),n.fill(),a}function d3(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&&I1(n,e,l+mt),n.beginPath(),n.arc(i,s,u,l+mt,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+mt),f=0;f<r;++f)n.stroke()}function p3(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&&d3(n,e,u),u&&I1(n,e,s),la(n,e,t,i,s,l),n.stroke())}class Xa extends pi{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}=Kg(s,{x:e,y:t}),{startAngle:r,endAngle:a,innerRadius:u,outerRadius:f,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,h=Qe(c,a-r)>=mt||hl(l,r,a),g=_l(o,u+d,f+d);return h&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>mt?Math.floor(i/mt):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>=Dt&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=c3(e,this,r,l,o);p3(e,this,r,l,a,o),e.restore()}}Xa.id="arc";Xa.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Xa.defaultRoutes={backgroundColor:"backgroundColor"};function P1(n,e,t=e){n.lineCap=Qe(t.borderCapStyle,e.borderCapStyle),n.setLineDash(Qe(t.borderDash,e.borderDash)),n.lineDashOffset=Qe(t.borderDashOffset,e.borderDashOffset),n.lineJoin=Qe(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=Qe(t.borderWidth,e.borderWidth),n.strokeStyle=Qe(t.borderColor,e.borderColor)}function m3(n,e,t){n.lineTo(t.x,t.y)}function h3(n){return n.stepped?F2:n.tension||n.cubicInterpolationMode==="monotone"?R2:m3}function L1(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 _3(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=L1(s,t,i),f=h3(l);let{move:c=!0,reverse:d}=i||{},p,h,g;for(p=0;p<=u;++p)h=s[(r+(d?u-p:p))%o],!h.skip&&(c?(n.moveTo(h.x,h.y),c=!1):f(n,g,h,d,l.stepped),g=h);return a&&(h=s[(r+(d?u:0))%o],f(n,g,h,d,l.stepped)),!!a}function g3(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=L1(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,p,h,g,_,y;const k=$=>(o+(u?r-$:$))%l,T=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,y))};for(a&&(p=s[k(0)],n.moveTo(p.x,p.y)),d=0;d<=r;++d){if(p=s[k(d)],p.skip)continue;const $=p.x,M=p.y,C=$|0;C===h?(M<g?g=M:M>_&&(_=M),f=(c*f+$)/++c):(T(),n.lineTo($,M),h=C,c=0,g=_=M),y=M}T()}function oa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?g3:_3}function b3(n){return n.stepped?mk:n.tension||n.cubicInterpolationMode==="monotone"?hk:Ki}function v3(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),P1(n,e.options),n.stroke(s)}function y3(n,e,t,i){const{segments:s,options:l}=e,o=oa(e);for(const r of s)P1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const k3=typeof Path2D=="function";function w3(n,e,t,i){k3&&!e.options.segment?v3(n,e,t,i):y3(n,e,t,i)}class Ii extends pi{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;ok(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Tk(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=h1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=b3(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],p=l[c],h=l[d];if(p===h){r.push(p);continue}const g=Math.abs((s-p[t])/(h[t]-p[t])),_=a(p,h,g,i.stepped);_[t]=e[t],r.push(_)}return r.length===1?r[0]:r}pathSegment(e,t,i){return oa(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=oa(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(),w3(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ii.id="line";Ii.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};Ii.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};Ii.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function tc(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Zo extends pi{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 tc(this,e,"x",t)}inYRange(e,t){return tc(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||!gl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,ta(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Zo.id="point";Zo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Zo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function N1(n,e){const{x:t,y:i,base:s,width:l,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,s),a=Math.max(t,s),u=i-c,f=i+c):(c=l/2,r=t-c,a=t+c,u=Math.min(i,s),f=Math.max(i,s)),{left:r,top:u,right:a,bottom:f}}function ki(n,e,t,i){return n?0:Zt(e,t,i)}function S3(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=l1(i);return{t:ki(s.top,l.top,0,t),r:ki(s.right,l.right,0,e),b:ki(s.bottom,l.bottom,0,t),l:ki(s.left,l.left,0,e)}}function T3(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=ks(s),o=Math.min(e,t),r=n.borderSkipped,a=i||Ze(s);return{topLeft:ki(!a||r.top||r.left,l.topLeft,0,o),topRight:ki(!a||r.top||r.right,l.topRight,0,o),bottomLeft:ki(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:ki(!a||r.bottom||r.right,l.bottomRight,0,o)}}function $3(n){const e=N1(n),t=e.right-e.left,i=e.bottom-e.top,s=S3(n,t/2,i/2),l=T3(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 kr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&N1(n,i);return r&&(s||_l(e,r.left,r.right))&&(l||_l(t,r.top,r.bottom))}function C3(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function M3(n,e){n.rect(e.x,e.y,e.w,e.h)}function wr(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 Qa extends pi{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}=$3(this),r=C3(o.radius)?Oo:M3;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,wr(o,t,l)),e.clip(),r(e,wr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,wr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return kr(this,e,t,i)}inXRange(e,t){return kr(this,e,null,t)}inYRange(e,t){return kr(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}}Qa.id="bar";Qa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Qa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function O3(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=xa(a,u,s);const f=ra(t,s[a],s[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:s[a],end:s[u]});continue}const c=h1(e,f);for(const d of c){const p=ra(t,l[d.start],l[d.end],d.loop),h=m1(r,s,p);for(const g of h)o.push({source:g,target:d,start:{[t]:nc(f,p,"start",Math.max)},end:{[t]:nc(f,p,"end",Math.min)}})}}return o}function ra(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=wn(s),l=wn(l)),{property:n,start:s,end:l}}function D3(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=xa(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 xa(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function nc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function F1(n,e){let t=[],i=!1;return gt(n)?(i=!0,t=n):t=D3(n,e),t.length?new Ii({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function ic(n){return n&&n.fill!==!1}function E3(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(!Lt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function A3(n,e,t){const i=N3(n);if(Ze(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Lt(s)&&Math.floor(s)===s?I3(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function I3(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function P3(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:Ze(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function L3(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:Ze(n)?i=n.value:i=e.getBaseValue(),i}function N3(n){const e=n.options,t=e.fill;let i=Qe(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function F3(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=R3(e,t);r.push(F1({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++)q3(s,o[f],r)}return new Ii({points:s,options:{}})}function R3(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 q3(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=j3(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function j3(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const s=i[t],l=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<l.length;u++){const f=l[u],c=o[f.start][t],d=o[f.end][t];if(_l(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class R1{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:mt},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 V3(n){const{chart:e,fill:t,line:i}=n;if(Lt(t))return H3(e,t);if(t==="stack")return F3(n);if(t==="shape")return!0;const s=z3(n);return s instanceof R1?s:F1(s,i)}function H3(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function z3(n){return(n.scale||{}).getPointPositionForValue?U3(n):B3(n)}function B3(n){const{scale:e={},fill:t}=n,i=P3(t,e);if(Lt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function U3(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=L3(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new R1({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 Sr(n,e,t){const i=V3(e),{line:s,scale:l,axis:o}=e,r=s.options,a=r.fill,u=r.backgroundColor,{above:f=u,below:c=u}=a||{};i&&s.points.length&&(ja(n,t),W3(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Va(n))}function W3(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&&(sc(n,i,o.top),lc(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),sc(n,i,o.bottom)),lc(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function sc(n,e,t){const{segments:i,points:s}=e;let l=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=s[a],c=s[xa(a,u,s)];l?(n.moveTo(f.x,f.y),l=!1):(n.lineTo(f.x,t),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(c.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function lc(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=O3(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,p=i!==!0;n.save(),n.fillStyle=d,Y3(n,o,p&&ra(s,f,c)),n.beginPath();const h=!!t.pathSegment(n,a);let g;if(p){h?n.closePath():oc(n,i,c,s);const _=!!i.pathSegment(n,u,{move:h,reverse:!0});g=h&&_,g||oc(n,i,f,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Y3(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 oc(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var K3={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 Ii&&(a={visible:n.isDatasetVisible(o),index:o,fill:A3(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=E3(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&&Sr(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;ic(l)&&Sr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ic(i)||t.drawTime!=="beforeDatasetDraw"||Sr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ol={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e<t;++e){const o=n[e].element;if(o&&o.hasValue()){const r=o.tooltipPosition();i+=r.x,s+=r.y,++l}}return{x:i/l,y:s/l}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,s=Number.POSITIVE_INFINITY,l,o,r;for(l=0,o=n.length;l<o;++l){const a=n[l].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=Qr(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 Zn(n,e){return e&&(gt(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function oi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function J3(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 rc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Sn(e.bodyFont),u=Sn(e.titleFont),f=Sn(e.footerFont),c=l.length,d=s.length,p=i.length,h=Fn(e.padding);let g=h.height,_=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=p*$+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const T=function($){_=Math.max(_,t.measureText($).width+k)};return t.save(),t.font=u.string,ct(n.title,T),t.font=a.string,ct(n.beforeBody.concat(n.afterBody),T),k=e.displayColors?o+2+e.boxPadding:0,ct(i,$=>{ct($.before,T),ct($.lines,T),ct($.after,T)}),k=0,t.font=f.string,ct(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function Z3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function G3(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 X3(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"),G3(u,n,e,t)&&(u="center"),u}function ac(n,e,t){const i=t.yAlign||e.yAlign||Z3(n,t);return{xAlign:t.xAlign||e.xAlign||X3(n,e,t,i),yAlign:i}}function Q3(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function x3(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function uc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:p}=ks(o);let h=Q3(e,r);const g=x3(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,p)+s),{x:Zt(h,0,i.width-e.width),y:Zt(g,0,i.height-e.height)}}function no(n,e,t){const i=Fn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function fc(n){return Zn([],oi(n))}function eS(n,e,t){return Ai(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function cc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class aa extends pi{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 _1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=eS(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=Zn(r,oi(s)),r=Zn(r,oi(l)),r=Zn(r,oi(o)),r}getBeforeBody(e,t){return fc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ct(e,l=>{const o={before:[],lines:[],after:[]},r=cc(i,l);Zn(o.before,oi(r.beforeLabel.call(this,l))),Zn(o.lines,r.label.call(this,l)),Zn(o.after,oi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return fc(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=Zn(r,oi(s)),r=Zn(r,oi(l)),r=Zn(r,oi(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(J3(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),ct(r,f=>{const c=cc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ol[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=rc(this,i),u=Object.assign({},r,a),f=ac(this.chart,i,u),c=uc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ks(r),{x:d,y:p}=e,{width:h,height:g}=t;let _,y,k,T,$,M;return l==="center"?($=p+g/2,s==="left"?(_=d,y=_-o,T=$+o,M=$-o):(_=d+h,y=_+o,T=$-o,M=$+o),k=_):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+h-Math.max(u,c)-o:y=this.caretX,l==="top"?(T=p,$=T-o,_=y-o,k=y+o):(T=p+g,$=T+o,_=y+o,k=y-o),M=T),{x1:_,x2:y,x3:k,y1:T,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=mr(i.rtl,this.x,this.width);for(e.x=no(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Sn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<l;++a)t.fillText(s[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===l&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,s,l){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u,boxPadding:f}=l,c=Sn(l.bodyFont),d=no(this,"left",l),p=s.x(d),h=a<c.lineHeight?(c.lineHeight-a)/2:0,g=t.y+h;if(l.usePointStyle){const _={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(p,u)+u/2,k=g+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,ta(e,_,y,k),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,ta(e,_,y,k)}else{e.lineWidth=Ze(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 _=s.leftForLtr(p,u-f),y=s.leftForLtr(s.xPlus(p,1),u-f-2),k=ks(o.borderRadius);Object.values(k).some(T=>T!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Oo(e,{x:_,y:g,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Oo(e,{x:y,y:g+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(_,g,u,a),e.strokeRect(_,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Sn(i.bodyFont);let d=c.lineHeight,p=0;const h=mr(i.rtl,this.x,this.width),g=function(E){t.fillText(E,h.x(e.x+p),e.y+d/2),e.y+=d+l},_=h.textAlign(o);let y,k,T,$,M,C,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=no(this,_,i),t.fillStyle=i.bodyColor,ct(this.beforeBody,g),p=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,C=s.length;$<C;++$){for(y=s[$],k=this.labelTextColors[$],t.fillStyle=k,ct(y.before,g),T=y.lines,r&&T.length&&(this._drawColorBox(t,e,$,h,i),d=Math.max(c.lineHeight,a)),M=0,O=T.length;M<O;++M)g(T[M]),d=c.lineHeight;ct(y.after,g)}p=0,d=c.lineHeight,ct(this.afterBody,g),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=mr(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=Sn(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<l;++r)t.fillText(s[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,s){const{xAlign:l,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:p,bottomRight:h}=ks(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-h),t.quadraticCurveTo(r+u,a+f,r+u-h,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+p,a+f),t.quadraticCurveTo(r,a+f,r,a+f-p),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),s.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ol[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=rc(this,e),a=Object.assign({},o,this._size),u=ac(t,e,a),f=uc(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=Fn(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),vk(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),yk(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!wo(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!wo(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ol[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}aa.positioners=ol;var tS={id:"tooltip",_element:aa,positioners:ol,afterInit(n,e,t){t&&(n.tooltip=new aa({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:si,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:si,beforeBody:si,beforeLabel:si,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 ut(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:si,afterBody:si,beforeFooter:si,footer:si,afterFooter:si}},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 nS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function iS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return nS(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const sS=(n,e)=>n===null?null:Zt(Math.round(n),0,e);class ua extends ss{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(ut(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:iS(i,e,Qe(t,e),this._addedLabels),sS(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}}ua.id="category";ua.defaults={ticks:{callback:ua.prototype.getLabelForValue}};function lS(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,p=l||1,h=f-1,{min:g,max:_}=e,y=!ut(o),k=!ut(r),T=!ut(u),$=(_-g)/(c+1);let M=ff((_-g)/h/p)*p,C,O,E,P;if(M<1e-14&&!y&&!k)return[{value:g},{value:_}];P=Math.ceil(_/M)-Math.floor(g/M),P>h&&(M=ff(P*M/h/p)*p),ut(a)||(C=Math.pow(10,a),M=Math.ceil(M*C)/C),s==="ticks"?(O=Math.floor(g/M)*M,E=Math.ceil(_/M)*M):(O=g,E=_),y&&k&&l&&n2((r-o)/l,M/1e3)?(P=Math.round(Math.min((r-o)/M,f)),M=(r-o)/P,O=o,E=r):T?(O=y?o:O,E=k?r:E,P=u-1,M=(E-O)/P):(P=(E-O)/M,il(P,Math.round(P),M/1e3)?P=Math.round(P):P=Math.ceil(P));const L=Math.max(cf(M),cf(O));C=Math.pow(10,ut(a)?L:a),O=Math.round(O*C)/C,E=Math.round(E*C)/C;let F=0;for(y&&(d&&O!==o?(t.push({value:o}),O<o&&F++,il(Math.round((O+F*M)*C)/C,o,dc(o,$,n))&&F++):O<o&&F++);F<P;++F)t.push({value:Math.round((O+F*M)*C)/C});return k&&d&&E!==r?t.length&&il(t[t.length-1].value,r,dc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!k||E===r)&&t.push({value:E}),t}function dc(n,e,{horizontal:t,minRotation:i}){const s=Bn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Po extends ss{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 ut(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=Qn(s),u=Qn(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=lS(s,l);return e.bounds==="ticks"&&Yg(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 Al(e,this.chart.options.locale,this.options.ticks.format)}}class eu extends Po{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Lt(e)?e:0,this.max=Lt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Bn(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}}eu.id="linear";eu.defaults={ticks:{callback:Jo.formatters.numeric}};function pc(n){return n/Math.pow(10,Math.floor(Pn(n)))===1}function oS(n,e){const t=Math.floor(Pn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Dn(n.min,Math.pow(10,Math.floor(Pn(e.min)))),o=Math.floor(Pn(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:pc(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=Dn(n.max,l);return s.push({value:u,major:pc(l)}),s}class q1 extends ss{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Po.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Lt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Lt(e)?Math.max(0,e):null,this.max=Lt(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(Pn(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=oS(t,this);return e.bounds==="ticks"&&Yg(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":Al(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Pn(e),this._valueRange=Pn(this.max)-Pn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Pn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}q1.id="logarithmic";q1.defaults={ticks:{callback:Jo.formatters.logarithmic,major:{enabled:!0}}};function fa(n){const e=n.ticks;if(e.display&&n.display){const t=Fn(e.backdropPadding);return Qe(e.font&&e.font.size,xe.font.size)+t.height}return 0}function rS(n,e,t){return t=gt(t)?t:[t],{w:L2(n,e.string,t),h:t.length*e.lineHeight}}function mc(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 aS(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?Dt/l:0;for(let a=0;a<l;a++){const u=o.setContext(n.getPointLabelContext(a));s[a]=u.padding;const f=n.getPointPosition(a,n.drawingArea+s[a],r),c=Sn(u.font),d=rS(n.ctx,c,n._pointLabels[a]);i[a]=d;const p=wn(n.getIndexAngle(a)+r),h=Math.round(La(p)),g=mc(h,f.x,d.w,0,180),_=mc(h,f.y,d.h,90,270);uS(t,e,p,g,_)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=fS(n,i,s)}function uS(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 fS(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=fa(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Dt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(La(wn(f.angle+Tt))),d=e[u],p=pS(f.y,d.h,c),h=cS(c),g=dS(f.x,d.w,h);i.push({x:f.x,y:p,textAlign:h,left:g,top:p,right:g+d.w,bottom:p+d.h})}return i}function cS(n){return n===0||n===180?"center":n<180?"left":"right"}function dS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function pS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function mS(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=Sn(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:p}=n._pointLabelItems[s],{backdropColor:h}=l;if(!ut(h)){const g=ks(l.borderRadius),_=Fn(l.backdropPadding);t.fillStyle=h;const y=f-_.left,k=c-_.top,T=d-f+_.width,$=p-c+_.height;Object.values(g).some(M=>M!==0)?(t.beginPath(),Oo(t,{x:y,y:k,w:T,h:$,radius:g}),t.fill()):t.fillRect(y,k,T,$)}Mo(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function j1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,mt);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 hS(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(),j1(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function _S(n,e,t){return Ai(n,{label:t,index:e,type:"pointLabel"})}class Go extends Po{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Fn(fa(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=Lt(e)&&!isNaN(e)?e:0,this.max=Lt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fa(this.options))}generateTickLabels(e){Po.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=St(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?aS(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=mt/(this._pointLabels.length||1),i=this.options.startAngle||0;return wn(e*t+Bn(i))}getDistanceFromCenterForValue(e){if(ut(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(ut(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 _S(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-Tt+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(),j1(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&&mS(this,l),s.display&&this.ticks.forEach((u,f)=>{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));hS(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Sn(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Fn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Mo(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Go.id="radialLinear";Go.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Jo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Go.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Go.descriptors={angleLines:{_fallback:"grid"}};const Xo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},dn=Object.keys(Xo);function gS(n,e){return n-e}function hc(n,e){if(ut(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)),Lt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ms(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function _c(n,e,t,i){const s=dn.length;for(let l=dn.indexOf(n);l<s-1;++l){const o=Xo[dn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return dn[l]}return dn[s-1]}function bS(n,e,t,i,s){for(let l=dn.length-1;l>=dn.indexOf(t);l--){const o=dn[l];if(Xo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return dn[t?dn.indexOf(t):0]}function vS(n){for(let e=dn.indexOf(n)+1,t=dn.length;e<t;++e)if(Xo[dn[e]].common)return dn[e]}function gc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Na(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function yS(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 bc(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:yS(n,i,s,t)}class Ll extends ss{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 k1._date(e.adapters.date);s.init(t),nl(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:hc(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=Lt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Lt(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=o2(s,l,o);return this._unit=t.unit||(i.autoSkip?_c(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):bS(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:vS(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),bc(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=Zt(t,0,o),i=Zt(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||_c(l.minUnit,t,i,this._getLabelCapacity(t)),r=Qe(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ms(a)||a===!0,f={};let c=t,d,p;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,p=0;d<i;d=+e.add(d,r,o),p++)gc(f,d,h);return(d===i||s.bounds==="ticks"||p===1)&&gc(f,d,h),Object.keys(f).sort((g,_)=>g-_).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,p=this._adapter.format(e,s||(d?f:u)),h=l.ticks.callback;return h?St(h,[p,t,i],this):p}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=Bn(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,bc(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(hc(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Zg(e.sort(gS))}}Ll.id="time";Ll.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}=Zi(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}=Zi(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 V1 extends Ll{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)}}V1.id="timeseries";V1.defaults=Ll.defaults;/*!
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const kS={datetime:Ve.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ve.TIME_WITH_SECONDS,minute:Ve.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};k1._date.override({_id:"luxon",_create:function(n){return Ve.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return kS},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=Ve.fromFormat(n,e,t):n=Ve.fromISO(n,t):n instanceof Date?n=Ve.fromJSDate(n,t):i==="object"&&!(n instanceof Ve)&&(n=Ve.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 vc(n){let e,t,i;return{c(){e=v("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=qe(e,qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function wS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=D(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function SS(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function TS(n){let e,t,i,s,l,o=n[2]&&vc();function r(f,c){return f[2]?SS:wS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Nr(i,"height","250px"),Nr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=vc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){I(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function $S(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let h of p)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),me.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Qt(()=>(Io.register(Ii,Zo,Ko,eu,Ll,K3,tS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){se[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class CS extends ve{constructor(e){super(),be(this,e,$S,TS,_e,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var yc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ca={},MS={get exports(){return ca},set exports(n){ca=n}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function k(T){return T instanceof a?new a(T.type,k(T.content),T.alias):Array.isArray(T)?T.map(k):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(T,$){$=$||{};var M,C;switch(r.util.type(T)){case"Object":if(C=r.util.objId(T),$[C])return $[C];M={},$[C]=M;for(var O in T)T.hasOwnProperty(O)&&(M[O]=k(T[O],$));return M;case"Array":return C=r.util.objId(T),$[C]?$[C]:(M=[],$[C]=M,T.forEach(function(E,P){M[P]=k(E,$)}),M);default:return T}},getLanguage:function(k){for(;k;){var T=s.exec(k.className);if(T)return T[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,T){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==k)return T[$]}return null}},isActive:function(k,T,$){for(var M="no-"+T;k;){var C=k.classList;if(C.contains(T))return!0;if(C.contains(M))return!1;k=k.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,T){var $=r.util.clone(r.languages[k]);for(var M in T)$[M]=T[M];return $},insertBefore:function(k,T,$,M){M=M||r.languages;var C=M[k],O={};for(var E in C)if(C.hasOwnProperty(E)){if(E==T)for(var P in $)$.hasOwnProperty(P)&&(O[P]=$[P]);$.hasOwnProperty(E)||(O[E]=C[E])}var L=M[k];return M[k]=O,r.languages.DFS(r.languages,function(F,N){N===L&&F!=k&&(this[F]=O)}),O},DFS:function k(T,$,M,C){C=C||{};var O=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){$.call(T,E,T[E],M||E);var P=T[E],L=r.util.type(P);L==="Object"&&!C[O(P)]?(C[O(P)]=!0,k(P,$,null,C)):L==="Array"&&!C[O(P)]&&(C[O(P)]=!0,k(P,$,E,C))}}},plugins:{},highlightAll:function(k,T){r.highlightAllUnder(document,k,T)},highlightAllUnder:function(k,T,$){var M={callback:$,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,O;O=M.elements[C++];)r.highlightElement(O,T===!0,M.callback)},highlightElement:function(k,T,$){var M=r.util.getLanguage(k),C=r.languages[M];r.util.setLanguage(k,M);var O=k.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=k.textContent,P={element:k,language:M,grammar:C,code:E};function L(N){P.highlightedCode=N,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),$&&$.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),$&&$.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){L(r.util.encode(P.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){L(N.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(r.highlight(P.code,P.grammar,P.language))},highlight:function(k,T,$){var M={code:k,grammar:T,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,T){var $=T.rest;if($){for(var M in $)T[M]=$[M];delete T.rest}var C=new c;return d(C,C.head,k),f(k,C,T,C.head,0),h(C)},hooks:{all:{},add:function(k,T){var $=r.hooks.all;$[k]=$[k]||[],$[k].push(T)},run:function(k,T){var $=r.hooks.all[k];if(!(!$||!$.length))for(var M=0,C;C=$[M++];)C(T)}},Token:a};i.Prism=r;function a(k,T,$,M){this.type=k,this.content=T,this.alias=$,this.length=(M||"").length|0}a.stringify=function k(T,$){if(typeof T=="string")return T;if(Array.isArray(T)){var M="";return T.forEach(function(L){M+=k(L,$)}),M}var C={type:T.type,content:k(T.content,$),tag:"span",classes:["token",T.type],attributes:{},language:$},O=T.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(C.classes,O):C.classes.push(O)),r.hooks.run("wrap",C);var E="";for(var P in C.attributes)E+=" "+P+'="'+(C.attributes[P]||"").replace(/"/g,"&quot;")+'"';return"<"+C.tag+' class="'+C.classes.join(" ")+'"'+E+">"+C.content+"</"+C.tag+">"};function u(k,T,$,M){k.lastIndex=T;var C=k.exec($);if(C&&M&&C[1]){var O=C[1].length;C.index+=O,C[0]=C[0].slice(O)}return C}function f(k,T,$,M,C,O){for(var E in $)if(!(!$.hasOwnProperty(E)||!$[E])){var P=$[E];P=Array.isArray(P)?P:[P];for(var L=0;L<P.length;++L){if(O&&O.cause==E+","+L)return;var F=P[L],N=F.inside,R=!!F.lookbehind,z=!!F.greedy,W=F.alias;if(z&&!F.pattern.global){var J=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,J+"g")}for(var x=F.pattern||F,ne=M.next,G=C;ne!==T.tail&&!(O&&G>=O.reach);G+=ne.value.length,ne=ne.next){var fe=ne.value;if(T.length>k.length)return;if(!(fe instanceof a)){var Z=1,ce;if(z){if(ce=u(x,G,k,R),!ce||ce.index>=k.length)break;var je=ce.index,he=ce.index+ce[0].length,Ce=G;for(Ce+=ne.value.length;je>=Ce;)ne=ne.next,Ce+=ne.value.length;if(Ce-=ne.value.length,G=Ce,ne.value instanceof a)continue;for(var Re=ne;Re!==T.tail&&(Ce<he||typeof Re.value=="string");Re=Re.next)Z++,Ce+=Re.value.length;Z--,fe=k.slice(G,Ce),ce.index-=G}else if(ce=u(x,0,fe,R),!ce)continue;var je=ce.index,ye=ce[0],$e=fe.slice(0,je),Ye=fe.slice(je+ye.length),dt=G+fe.length;O&&dt>O.reach&&(O.reach=dt);var Ke=ne.prev;$e&&(Ke=d(T,Ke,$e),G+=$e.length),p(T,Ke,Z);var Be=new a(E,N?r.tokenize(ye,N):ye,W,ye);if(ne=d(T,Ke,Be),Ye&&d(T,ne,Ye),Z>1){var ee={cause:E+","+L,reach:dt};f(k,T,$,ne.prev,G,ee),O&&ee.reach>O.reach&&(O.reach=ee.reach)}}}}}}function c(){var k={value:null,prev:null,next:null},T={value:null,prev:k,next:null};k.next=T,this.head=k,this.tail=T,this.length=0}function d(k,T,$){var M=T.next,C={value:$,prev:T,next:M};return T.next=C,M.prev=C,k.length++,C}function p(k,T,$){for(var M=T.next,C=0;C<$&&M!==k.tail;C++)M=M.next;T.next=M,M.prev=T,k.length-=C}function h(k){for(var T=[],$=k.head.next;$!==k.tail;)T.push($.value),$=$.next;return T}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(k){var T=JSON.parse(k.data),$=T.language,M=T.code,C=T.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),C&&i.close()},!1)),r;var g=r.util.currentScript();g&&(r.filename=g.src,g.hasAttribute("data-manual")&&(r.manual=!0));function _(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",_):window.requestAnimationFrame?window.requestAnimationFrame(_):window.setTimeout(_,16)}return r}(e);n.exports&&(n.exports=t),typeof yc<"u"&&(yc.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(g,_){return"✖ Error "+g+" while fetching file: "+_},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(g,_,y){var k=new XMLHttpRequest;k.open("GET",g,!0),k.onreadystatechange=function(){k.readyState==4&&(k.status<400&&k.responseText?_(k.responseText):k.status>=400?y(s(k.status,k.statusText)):y(l))},k.send(null)}function p(g){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(_){var y=Number(_[1]),k=_[2],T=_[3];return k?T?[y,Number(T)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),t.hooks.add("before-sanity-check",function(g){var _=g.element;if(_.matches(c)){g.code="",_.setAttribute(r,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=i;var k=_.getAttribute("data-src"),T=g.language;if(T==="none"){var $=(/\.(\w+)$/.exec(k)||[,"none"])[1];T=o[$]||$}t.util.setLanguage(y,T),t.util.setLanguage(_,T);var M=t.plugins.autoloader;M&&M.loadLanguages(T),d(k,function(C){_.setAttribute(r,u);var O=p(_.getAttribute("data-range"));if(O){var E=C.split(/\r\n?|\n/g),P=O[0],L=O[1]==null?E.length:O[1];P<0&&(P+=E.length),P=Math.max(0,Math.min(P-1,E.length)),L<0&&(L+=E.length),L=Math.max(0,Math.min(L,E.length)),C=E.slice(P,L).join(`
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(P+1))}y.textContent=C,t.highlightElement(y)},function(C){_.setAttribute(r,f),y.textContent=C})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),k=0,T;T=y[k++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(MS);const Zs=ca;var kc={},OS={get exports(){return kc},set exports(n){kc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var p=s(f[d]);c+=p,c>r&&(f[d]=`
`+f[d],c=p)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,p="",h="",g=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?g=!0:y.nodeName==="#text"&&(g?h+=y.nodeValue:p+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=p+o.code+h,o.code=r.normalize(o.code,o.settings);else{var k=p+o.element.innerHTML+h;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(OS);(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 DS(n){let e,t,i;return{c(){e=v("div"),t=v("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),b(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:X,o:X,d(s){s&&w(e)}}}function ES(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class H1 extends ve{constructor(e){super(),be(this,e,ES,DS,_e,{class:0,content:2,language:3})}}const AS=n=>({}),wc=n=>({}),IS=n=>({}),Sc=n=>({});function Tc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T=n[4]&&!n[2]&&$c(n);const $=n[19].header,M=Et($,n,n[18],Sc);let C=n[4]&&n[2]&&Cc(n);const O=n[19].default,E=Et(O,n,n[18],null),P=n[19].footer,L=Et(P,n,n[18],wc);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),T&&T.c(),r=D(),M&&M.c(),a=D(),C&&C.c(),u=D(),f=v("div"),E&&E.c(),c=D(),d=v("div"),L&&L.c(),m(t,"class","overlay"),m(o,"class","overlay-panel-section panel-header"),m(f,"class","overlay-panel-section panel-content"),m(d,"class","overlay-panel-section panel-footer"),m(l,"class",p="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),m(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(F,N){S(F,e,N),b(e,t),b(e,s),b(e,l),b(l,o),T&&T.m(o,null),b(o,r),M&&M.m(o,null),b(o,a),C&&C.m(o,null),b(l,u),b(l,f),E&&E.m(f,null),n[21](f),b(l,c),b(l,d),L&&L.m(d,null),_=!0,y||(k=[K(t,"click",ft(n[20])),K(f,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?T.p(n,N):(T=$c(n),T.c(),T.m(o,r)):T&&(T.d(1),T=null),M&&M.p&&(!_||N[0]&262144)&&It(M,$,n,n[18],_?At($,n[18],N,IS):Pt(n[18]),Sc),n[4]&&n[2]?C?C.p(n,N):(C=Cc(n),C.c(),C.m(o,null)):C&&(C.d(1),C=null),E&&E.p&&(!_||N[0]&262144)&&It(E,O,n,n[18],_?At(O,n[18],N,null):Pt(n[18]),null),L&&L.p&&(!_||N[0]&262144)&&It(L,P,n,n[18],_?At(P,n[18],N,AS):Pt(n[18]),wc),(!_||N[0]&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&m(l,"class",p),(!_||N[0]&262)&&Q(l,"popup",n[2]),(!_||N[0]&4)&&Q(e,"padded",n[2]),(!_||N[0]&1)&&Q(e,"active",n[0])},i(F){_||(F&&et(()=>{_&&(i||(i=qe(t,vo,{duration:_s,opacity:0},!0)),i.run(1))}),A(M,F),A(E,F),A(L,F),et(()=>{_&&(g&&g.end(1),h=kb(l,ei,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),h.start())}),_=!0)},o(F){F&&(i||(i=qe(t,vo,{duration:_s,opacity:0},!1)),i.run(0)),I(M,F),I(E,F),I(L,F),h&&h.invalidate(),g=wb(l,ei,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),_=!1},d(F){F&&w(e),F&&i&&i.end(),T&&T.d(),M&&M.d(F),C&&C.d(),E&&E.d(F),n[21](null),L&&L.d(F),F&&g&&g.end(),y=!1,Ae(k)}}}function $c(n){let e,t,i;return{c(){e=v("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=K(e,"click",ft(n[5])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Cc(n){let e,t,i;return{c(){e=v("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=K(e,"click",ft(n[5])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function PS(n){let e,t,i,s,l=n[0]&&Tc(n);return{c(){e=v("div"),l&&l.c(),m(e,"class","overlay-panel-wrapper")},m(o,r){S(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Tc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&w(e),l&&l.d(),n[23](null),i=!1,Ae(s)}}}let Ui,Tr=[];function z1(){return Ui=Ui||document.querySelector(".overlays"),Ui||(Ui=document.createElement("div"),Ui.classList.add("overlays"),document.body.appendChild(Ui)),Ui}let _s=150;function Mc(){return 1e3+z1().querySelectorAll(".overlay-panel-container.active").length}function LS(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const p=vt(),h="op_"+H.randomString(10);let g,_,y,k,T="",$=o;function M(){typeof c=="function"&&c()===!1||t(0,o=!0)}function C(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function E(G){t(17,$=G),G?(y=document.activeElement,g==null||g.focus(),p("show")):(clearTimeout(k),y==null||y.focus(),p("hide")),await rn(),P()}function P(){g&&(o?t(6,g.style.zIndex=Mc(),g):t(6,g.style="",g))}function L(){H.pushUnique(Tr,h),document.body.classList.add("overlay-active")}function F(){H.removeByValue(Tr,h),Tr.length||document.body.classList.remove("overlay-active")}function N(G){o&&f&&G.code=="Escape"&&!H.isInput(G.target)&&g&&g.style.zIndex==Mc()&&(G.preventDefault(),C())}function R(G){o&&z(_)}function z(G,fe){fe&&t(8,T=""),G&&(k||(k=setTimeout(()=>{if(clearTimeout(k),k=null,!G)return;if(G.scrollHeight-G.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}G.scrollTop==0?t(8,T+=" scroll-top-reached"):G.scrollTop+G.offsetHeight==G.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100)))}Qt(()=>(z1().appendChild(g),()=>{var G;clearTimeout(k),F(),(G=g==null?void 0:g.classList)==null||G.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const W=()=>a?C():!0;function J(G){se[G?"unshift":"push"](()=>{_=G,t(7,_)})}const x=G=>z(G.target);function ne(G){se[G?"unshift":"push"](()=>{g=G,t(6,g)})}return n.$$set=G=>{"class"in G&&t(1,l=G.class),"active"in G&&t(0,o=G.active),"popup"in G&&t(2,r=G.popup),"overlayClose"in G&&t(3,a=G.overlayClose),"btnClose"in G&&t(4,u=G.btnClose),"escClose"in G&&t(12,f=G.escClose),"beforeOpen"in G&&t(13,c=G.beforeOpen),"beforeHide"in G&&t(14,d=G.beforeHide),"$$scope"in G&&t(18,s=G.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&E(o),n.$$.dirty[0]&128&&z(_,!0),n.$$.dirty[0]&64&&g&&P(),n.$$.dirty[0]&1&&(o?L():F())},[o,l,r,a,u,C,g,_,T,N,R,z,f,c,d,M,O,$,s,i,W,J,x,ne]}class bn extends ve{constructor(e){super(),be(this,e,LS,PS,_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 NS(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function FS(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=B(t),m(e,"href",s=n[2].referer),m(e,"target","_blank"),m(e,"rel","noopener noreferrer")},m(l,o){S(l,e,o),b(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 RS(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function qS(n){let e,t;return e=new H1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.content=JSON.stringify(i[2].meta,null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function jS(n){var Ee;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,p,h,g=n[2].status+"",_,y,k,T,$,M,C=((Ee=n[2].method)==null?void 0:Ee.toUpperCase())+"",O,E,P,L,F,N,R=n[2].auth+"",z,W,J,x,ne,G,fe=n[2].url+"",Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be=n[2].remoteIp+"",ee,Fe,tt,Wt,Pe,ie,Se=n[2].userIp+"",st,nt,kt,xt,mi,pt,Kn=n[2].userAgent+"",ls,Nl,hi,os,Fl,Fi,rs,un,Ge,as,ii,us,Ri,qi,Yt,en;function Rl(Ie,Me){return Ie[2].referer?FS:NS}let U=Rl(n),Y=U(n);const te=[qS,RS],oe=[];function Te(Ie,Me){return Me&4&&(rs=null),rs==null&&(rs=!H.isEmpty(Ie[2].meta)),rs?0:1}return un=Te(n,-1),Ge=oe[un]=te[un](n),Yt=new di({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=D(),o=v("td"),a=B(r),u=D(),f=v("tr"),c=v("td"),c.textContent="Status",d=D(),p=v("td"),h=v("span"),_=B(g),y=D(),k=v("tr"),T=v("td"),T.textContent="Method",$=D(),M=v("td"),O=B(C),E=D(),P=v("tr"),L=v("td"),L.textContent="Auth",F=D(),N=v("td"),z=B(R),W=D(),J=v("tr"),x=v("td"),x.textContent="URL",ne=D(),G=v("td"),Z=B(fe),ce=D(),he=v("tr"),Ce=v("td"),Ce.textContent="Referer",Re=D(),je=v("td"),Y.c(),ye=D(),$e=v("tr"),Ye=v("td"),Ye.textContent="Remote IP",dt=D(),Ke=v("td"),ee=B(Be),Fe=D(),tt=v("tr"),Wt=v("td"),Wt.textContent="User IP",Pe=D(),ie=v("td"),st=B(Se),nt=D(),kt=v("tr"),xt=v("td"),xt.textContent="UserAgent",mi=D(),pt=v("td"),ls=B(Kn),Nl=D(),hi=v("tr"),os=v("td"),os.textContent="Meta",Fl=D(),Fi=v("td"),Ge.c(),as=D(),ii=v("tr"),us=v("td"),us.textContent="Created",Ri=D(),qi=v("td"),V(Yt.$$.fragment),m(s,"class","min-width txt-hint txt-bold"),m(c,"class","min-width txt-hint txt-bold"),m(h,"class","label"),Q(h,"label-danger",n[2].status>=400),m(T,"class","min-width txt-hint txt-bold"),m(L,"class","min-width txt-hint txt-bold"),m(x,"class","min-width txt-hint txt-bold"),m(Ce,"class","min-width txt-hint txt-bold"),m(Ye,"class","min-width txt-hint txt-bold"),m(Wt,"class","min-width txt-hint txt-bold"),m(xt,"class","min-width txt-hint txt-bold"),m(os,"class","min-width txt-hint txt-bold"),m(us,"class","min-width txt-hint txt-bold"),m(e,"class","table-border")},m(Ie,Me){S(Ie,e,Me),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,p),b(p,h),b(h,_),b(t,y),b(t,k),b(k,T),b(k,$),b(k,M),b(M,O),b(t,E),b(t,P),b(P,L),b(P,F),b(P,N),b(N,z),b(t,W),b(t,J),b(J,x),b(J,ne),b(J,G),b(G,Z),b(t,ce),b(t,he),b(he,Ce),b(he,Re),b(he,je),Y.m(je,null),b(t,ye),b(t,$e),b($e,Ye),b($e,dt),b($e,Ke),b(Ke,ee),b(t,Fe),b(t,tt),b(tt,Wt),b(tt,Pe),b(tt,ie),b(ie,st),b(t,nt),b(t,kt),b(kt,xt),b(kt,mi),b(kt,pt),b(pt,ls),b(t,Nl),b(t,hi),b(hi,os),b(hi,Fl),b(hi,Fi),oe[un].m(Fi,null),b(t,as),b(t,ii),b(ii,us),b(ii,Ri),b(ii,qi),q(Yt,qi,null),en=!0},p(Ie,Me){var He;(!en||Me&4)&&r!==(r=Ie[2].id+"")&&le(a,r),(!en||Me&4)&&g!==(g=Ie[2].status+"")&&le(_,g),(!en||Me&4)&&Q(h,"label-danger",Ie[2].status>=400),(!en||Me&4)&&C!==(C=((He=Ie[2].method)==null?void 0:He.toUpperCase())+"")&&le(O,C),(!en||Me&4)&&R!==(R=Ie[2].auth+"")&&le(z,R),(!en||Me&4)&&fe!==(fe=Ie[2].url+"")&&le(Z,fe),U===(U=Rl(Ie))&&Y?Y.p(Ie,Me):(Y.d(1),Y=U(Ie),Y&&(Y.c(),Y.m(je,null))),(!en||Me&4)&&Be!==(Be=Ie[2].remoteIp+"")&&le(ee,Be),(!en||Me&4)&&Se!==(Se=Ie[2].userIp+"")&&le(st,Se),(!en||Me&4)&&Kn!==(Kn=Ie[2].userAgent+"")&&le(ls,Kn);let Ue=un;un=Te(Ie,Me),un===Ue?oe[un].p(Ie,Me):(re(),I(oe[Ue],1,1,()=>{oe[Ue]=null}),ae(),Ge=oe[un],Ge?Ge.p(Ie,Me):(Ge=oe[un]=te[un](Ie),Ge.c()),A(Ge,1),Ge.m(Fi,null));const Ne={};Me&4&&(Ne.date=Ie[2].created),Yt.$set(Ne)},i(Ie){en||(A(Ge),A(Yt.$$.fragment,Ie),en=!0)},o(Ie){I(Ge),I(Yt.$$.fragment,Ie),en=!1},d(Ie){Ie&&w(e),Y.d(),oe[un].d(),j(Yt)}}}function VS(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function HS(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[4]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function zS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[HS],header:[VS],default:[jS]},$$scope:{ctx:n}};return e=new bn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[5](null),j(e,s)}}}function BS(n,e,t){let i,s=new Vr;function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){se[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){de.call(this,n,c)}function f(c){de.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class US extends ve{constructor(e){super(),be(this,e,BS,zS,_e,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function WS(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("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[0],S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&m(e,"id",t),f&1&&(e.checked=u[0]),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 Oc(n){let e,t,i;function s(o){n[10](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new CS({props:l}),se.push(()=>ge(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Dc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new Wy({props:l}),se.push(()=>ge(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&16&&(a.presets=o[4]),!t&&r&4&&(t=!0,a.filter=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function YS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k=n[3],T,$=n[3],M,C;r=new Aa({}),r.$on("refresh",n[7]),d=new pe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[WS,({uniqueId:P})=>({14:P}),({uniqueId:P})=>P?16384:0]},$$scope:{ctx:n}}}),h=new Wo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),h.$on("submit",n[9]);let O=Oc(n),E=Dc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=B(n[5]),o=D(),V(r.$$.fragment),a=D(),u=v("div"),f=D(),c=v("div"),V(d.$$.fragment),p=D(),V(h.$$.fragment),g=D(),_=v("div"),y=D(),O.c(),T=D(),E.c(),M=we(),m(s,"class","breadcrumb-item"),m(i,"class","breadcrumbs"),m(u,"class","flex-fill"),m(c,"class","inline-flex"),m(t,"class","page-header"),m(_,"class","clearfix m-b-base"),m(e,"class","page-header-wrapper m-b-0")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),q(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),q(d,c,null),b(e,p),q(h,e,null),b(e,g),b(e,_),b(e,y),O.m(e,null),S(P,T,L),E.m(P,L),S(P,M,L),C=!0},p(P,L){(!C||L&32)&&le(l,P[5]);const F={};L&49153&&(F.$$scope={dirty:L,ctx:P}),d.$set(F);const N={};L&4&&(N.value=P[2]),h.$set(N),L&8&&_e(k,k=P[3])?(re(),I(O,1,1,X),ae(),O=Oc(P),O.c(),A(O,1),O.m(e,null)):O.p(P,L),L&8&&_e($,$=P[3])?(re(),I(E,1,1,X),ae(),E=Dc(P),E.c(),A(E,1),E.m(M.parentNode,M)):E.p(P,L)},i(P){C||(A(r.$$.fragment,P),A(d.$$.fragment,P),A(h.$$.fragment,P),A(O),A(E),C=!0)},o(P){I(r.$$.fragment,P),I(d.$$.fragment,P),I(h.$$.fragment,P),I(O),I(E),C=!1},d(P){P&&w(e),j(r),j(d),j(h),O.d(P),P&&w(T),P&&w(M),E.d(P)}}}function KS(n){let e,t,i,s;e=new Cn({props:{$$slots:{default:[YS]},$$scope:{ctx:n}}});let l={};return i=new US({props:l}),n[13](i),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(o,r){q(e,o,r),S(o,t,r),q(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),s=!1},d(o){j(e,o),o&&w(t),n[13](null),j(i,o)}}}const Ec="includeAdminLogs";function JS(n,e,t){var y;let i,s;We(n,Ot,k=>t(5,s=k)),Gt(Ot,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(Ec))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=k=>t(2,o=k.detail);function p(k){o=k,t(2,o)}function h(k){o=k,t(2,o)}const g=k=>l==null?void 0:l.show(k==null?void 0:k.detail);function _(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(Ec,r<<0)},[r,l,o,a,i,s,u,f,c,d,p,h,g,_]}class ZS extends ve{constructor(e){super(),be(this,e,JS,KS,_e,{})}}const Pi=Rn([]),Di=Rn({}),Lo=Rn(!1);function GS(n){Pi.update(e=>{const t=H.findByKey(e,"id",n);return t?Di.set(t):e.length&&Di.set(e[0]),e})}function XS(n){Pi.update(e=>(H.removeByKey(e,"id",n.id),Di.update(t=>t.id===n.id?e[0]:t),e))}async function B1(n=null){Lo.set(!0);try{let e=await me.collections.getFullList(200,{sort:"+name"});e=H.sortCollections(e),Pi.set(e);const t=n&&H.findByKey(e,"id",n);t?Di.set(t):e.length&&Di.set(e[0])}catch(e){me.errorResponseHandler(e)}Lo.set(!1)}const tu=Rn({});function pn(n,e,t){tu.set({text:n,yesCallback:e,noCallback:t})}function U1(){tu.set({})}function Ac(n){let e,t,i;const s=n[17].default,l=Et(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),m(e,"class",n[1]),Q(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)&&It(l,s,o,o[16],i?At(s,o[16],r,null):Pt(o[16]),null),(!i||r&2)&&m(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&et(()=>{i&&(t||(t=qe(e,ei,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=qe(e,ei,{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 QS(n){let e,t,i,s,l=n[0]&&Ac(n);return{c(){e=v("div"),l&&l.c(),m(e,"class","toggler-container")},m(o,r){S(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=Ac(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){I(l),t=!1},d(o){o&&w(e),l&&l.d(),n[19](null),i=!1,Ae(s)}}}function xS(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,p,h,g=!1;const _=vt();function y(){t(0,o=!1),g=!1,clearTimeout(h)}function k(){t(0,o=!0),clearTimeout(h),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function T(){o?y():k()}function $(W){return!c||W.classList.contains(u)||(p==null?void 0:p.contains(W))&&!c.contains(W)||c.contains(W)&&W.closest&&W.closest("."+u)}function M(W){(!o||$(W.target))&&(W.preventDefault(),W.stopPropagation(),T())}function C(W){(W.code==="Enter"||W.code==="Space")&&(!o||$(W.target))&&(W.preventDefault(),W.stopPropagation(),T())}function O(W){o&&r&&W.code==="Escape"&&(W.preventDefault(),y())}function E(W){o&&!(c!=null&&c.contains(W.target))?g=!0:g&&(g=!1)}function P(W){o&&!(c!=null&&c.contains(W.target))&&!(p!=null&&p.contains(W.target))&&g&&y()}function L(W){E(W),P(W)}function F(W){N(),t(15,p=W||(c==null?void 0:c.parentNode)),p&&(c==null||c.addEventListener("click",M),p.addEventListener("click",M),p.addEventListener("keydown",C))}function N(){clearTimeout(h),p&&(c==null||c.removeEventListener("click",M),p.removeEventListener("click",M),p.removeEventListener("keydown",C))}Qt(()=>(F(),()=>N()));function R(W){se[W?"unshift":"push"](()=>{d=W,t(3,d)})}function z(W){se[W?"unshift":"push"](()=>{c=W,t(2,c)})}return n.$$set=W=>{"trigger"in W&&t(8,l=W.trigger),"active"in W&&t(0,o=W.active),"escClose"in W&&t(9,r=W.escClose),"autoScroll"in W&&t(10,a=W.autoScroll),"closableClass"in W&&t(11,u=W.closableClass),"class"in W&&t(1,f=W.class),"$$scope"in W&&t(16,s=W.$$scope)},n.$$.update=()=>{var W,J;n.$$.dirty&260&&c&&F(l),n.$$.dirty&32769&&(o?((W=p==null?void 0:p.classList)==null||W.add("active"),_("show")):((J=p==null?void 0:p.classList)==null||J.remove("active"),_("hide")))},[o,f,c,d,O,E,P,L,l,r,a,u,y,k,T,p,s,i,R,z]}class qn extends ve{constructor(e){super(),be(this,e,xS,QS,_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 Ic(n,e,t){const i=n.slice();return i[27]=e[t],i}function eT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=D(),l=v("label"),o=B("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,c){S(f,e,c),S(f,s,c),S(f,l,c),b(l,o),a||(u=K(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&m(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[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 tT(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=$t(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){var c;const f={};if(u[0]&1073741824&&(f.id=a[30]),u[0]&1&&(f.placeholder=`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`),!t&&u[0]&4&&(t=!0,f.value=a[2],ke(()=>t=!1)),u[0]&128&&o!==(o=a[7])){if(e){re();const d=e;I(d.$$.fragment,1,0,()=>{j(d,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function nT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function iT(n){let e,t,i,s;const l=[nT,tT],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):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function Pc(n){let e,t,i,s=n[10],l=[];for(let o=0;o<s.length;o+=1)l[o]=Lc(Ic(n,s,o));return{c(){e=v("div"),t=v("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),b(e,t),b(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=Ic(o,s,a);l[a]?l[a].p(u,r):(l[a]=Lc(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),at(l,o)}}}function Lc(n){let e,t=n[27]+"",i,s,l,o;function r(){return n[21](n[27])}return{c(){e=v("button"),i=B(t),s=D(),m(e,"type","button"),m(e,"class","label link-primary"),Q(e,"label-info",n[9].includes(n[27]))},m(a,u){S(a,e,u),b(e,i),b(e,s),l||(o=K(e,"click",r),l=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&le(i,t),u[0]&1536&&Q(e,"label-info",n[9].includes(n[27]))},d(a){a&&w(e),l=!1,o()}}}function sT(n){let e,t,i,s,l,o;e=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[eT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[iT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Pc(n);return{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),r&&r.c(),l=we()},m(a,u){q(e,a,u),S(a,t,u),q(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 c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Pc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),r&&r.d(a),a&&w(l)}}}function lT(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=B(t),s=B(" index")},m(l,o){S(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&w(e)}}}function Nc(n){let e,t,i;return{c(){e=v("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=[De(ze.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:X,d(s){s&&w(e),t=!1,Ae(i)}}}function oT(n){let e,t,i,s,l,o,r=n[5]!=""&&Nc(n);return{c(){r&&r.c(),e=D(),t=v("button"),t.innerHTML='<span class="txt">Cancel</span>',i=D(),s=v("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"),Q(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=[K(t,"click",n[17]),K(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Nc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(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,Ae(o)}}}function rT(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[oT],header:[lT],default:[sT]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Le(s,i[l]);return e=new bn({props:s}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&16384?bt(i,[i[0],Vt(l[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[22](null),j(e,l)}}}function aT(n,e,t){let i,s,l;const o=["collection","show","hide"];let r=Je(e,o);const a=vt();let{collection:u}=e,f,c="",d="",p="",h,g=!1;function _(W,J){return t(6,p=H.isEmpty(J)?"":J),t(5,c=W||k()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function k(){const W=H.parseIndex("");return W.tableName=(u==null?void 0:u.name)||"",H.buildIndex(W)}function T(){a("remove",c),y()}function $(){l.length&&(a("submit",{old:c,new:d}),y())}function M(W){const J=H.clone(s),x=J.columns.find(ne=>ne.column==W);x?H.removeByValue(J.columns,x):H.pushUnique(J.columns,{column:W}),t(2,d=H.buildIndex(J))}Qt(async()=>{t(8,g=!0);try{t(7,h=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default)}catch(W){console.warn(W)}t(8,g=!1)});const C=()=>T(),O=()=>y(),E=()=>$(),P=W=>{t(3,s.unique=W.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=H.buildIndex(s))};function L(W){d=W,t(2,d)}const F=W=>M(W);function N(W){se[W?"unshift":"push"](()=>{f=W,t(4,f)})}function R(W){de.call(this,n,W)}function z(W){de.call(this,n,W)}return n.$$set=W=>{e=Le(Le({},e),jt(W)),t(14,r=Je(e,o)),"collection"in W&&t(0,u=W.collection)},n.$$.update=()=>{var W,J;n.$$.dirty[0]&1&&t(10,i=((W=u==null?void 0:u.schema)==null?void 0:W.map(x=>x.name))||[]),n.$$.dirty[0]&4&&t(3,s=H.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((J=s.columns)==null?void 0:J.map(x=>x.column))||[])},[u,y,d,s,f,c,p,h,g,l,i,T,$,M,r,_,C,O,E,P,L,F,N,R,z]}class uT extends ve{constructor(e){super(),be(this,e,aT,rT,_e,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Fc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=H.parseIndex(i[10]);return i[11]=s,i}function Rc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(jc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Rc();function c(){return n[4](n[10],n[13])}return{c(){var p,h;e=v("button"),f&&f.c(),t=D(),i=v("span"),l=B(s),m(i,"class","txt"),m(e,"type","button"),m(e,"class",o="label link-primary "+((h=(p=n[2].indexes)==null?void 0:p[n[13]])!=null&&h.message?"label-danger":"label-info")+" svelte-167lbwu")},m(p,h){var g,_;S(p,e,h),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[De(r=ze.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(p,h){var g,_,y,k,T;n=p,n[11].unique?f||(f=Rc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(jc).join(", "))+"")&&le(l,s),h&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"label-info")+" svelte-167lbwu")&&m(e,"class",o),r&&Bt(r.update)&&h&4&&r.update.call(null,((T=(k=n[2].indexes)==null?void 0:k[n[13]])==null?void 0:T.message)||"")},d(p){p&&w(e),f&&f.d(),a=!1,Ae(u)}}}function fT(n){var $,M,C;let e,t,i=(((M=($=n[0])==null?void 0:$.indexes)==null?void 0:M.length)||0)+"",s,l,o,r,a,u,f,c,d,p,h,g,_=((C=n[0])==null?void 0:C.indexes)||[],y=[];for(let O=0;O<_.length;O+=1)y[O]=qc(Fc(n,_,O));function k(O){n[7](O)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new uT({props:T}),n[6](c),se.push(()=>ge(c,"collection",k)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=B("Unique constraints and indexes ("),s=B(i),l=B(")"),o=D(),r=v("div");for(let O=0;O<y.length;O+=1)y[O].c();a=D(),u=v("button"),u.innerHTML=`<span class="txt">+</span>
<span class="txt">New index</span>`,f=D(),V(c.$$.fragment),m(e,"class","section-title"),m(u,"type","button"),m(u,"class","label label-primary link-fade svelte-167lbwu"),m(r,"class","indexes-list svelte-167lbwu")},m(O,E){S(O,e,E),b(e,t),b(e,s),b(e,l),S(O,o,E),S(O,r,E);for(let P=0;P<y.length;P+=1)y[P]&&y[P].m(r,null);b(r,a),b(r,u),S(O,f,E),q(c,O,E),p=!0,h||(g=K(u,"click",n[5]),h=!0)},p(O,[E]){var L,F,N;if((!p||E&1)&&i!==(i=(((F=(L=O[0])==null?void 0:L.indexes)==null?void 0:F.length)||0)+"")&&le(s,i),E&7){_=((N=O[0])==null?void 0:N.indexes)||[];let R;for(R=0;R<_.length;R+=1){const z=Fc(O,_,R);y[R]?y[R].p(z,E):(y[R]=qc(z),y[R].c(),y[R].m(r,a))}for(;R<y.length;R+=1)y[R].d(1);y.length=_.length}const P={};!d&&E&1&&(d=!0,P.collection=O[0],ke(()=>d=!1)),c.$set(P)},i(O){p||(A(c.$$.fragment,O),p=!0)},o(O){I(c.$$.fragment,O),p=!1},d(O){O&&w(e),O&&w(o),O&&w(r),at(y,O),O&&w(f),n[6](null),j(c,O),h=!1,g()}}}const jc=n=>n.column;function cT(n,e,t){let i;We(n,ti,p=>t(2,i=p));let{collection:s}=e,l;function o(p,h){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==p){t(0,s.indexes[g]=h,s),ci("indexes."+g);return}s.indexes.push(h),t(0,s)}const r=(p,h)=>l==null?void 0:l.show(p,h),a=()=>l==null?void 0:l.show();function u(p){se[p?"unshift":"push"](()=>{l=p,t(1,l)})}function f(p){s=p,t(0,s)}const c=p=>{for(let h=0;h<s.indexes.length;h++)if(s.indexes[h]==p.detail){s.indexes.splice(h,1),ci("indexes."+h);break}t(0,s)},d=p=>{o(p.detail.old,p.detail.new)};return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},[s,l,i,o,r,a,u,f,c,d]}class dT extends ve{constructor(e){super(),be(this,e,cT,fT,_e,{collection:0})}}function Vc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),o=B(l),r=D(),m(t,"class","icon "+n[6].icon+" svelte-1p626x7"),m(s,"class","txt"),m(e,"tabindex","0"),m(e,"class","dropdown-item closable svelte-1p626x7")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[K(e,"click",$n(f)),K(e,"keydown",$n(c))],a=!0)},p(d,p){n=d},d(d){d&&w(e),a=!1,Ae(u)}}}function pT(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Hc(Vc(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=Vc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hc(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){at(i,s),s&&w(e)}}}function mT(n){let e,t,i,s,l,o,r,a,u,f;return o=new qn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[pT]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("i"),i=D(),s=v("div"),s.textContent="New field",l=D(),V(o.$$.fragment),m(t,"class","ri-add-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",r=$i(n[0])+" svelte-1p626x7")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(e,l),q(o,e,null),a=!0,u||(f=K(e,"click",n[1]),u=!0)},p(c,[d]){const p={};d&512&&(p.$$scope={dirty:d,ctx:c}),o.$set(p),(!a||d&1&&r!==(r=$i(c[0])+" svelte-1p626x7"))&&m(e,"class",r)},i(c){a||(A(o.$$.fragment,c),a=!0)},o(c){I(o.$$.fragment,c),a=!1},d(c){c&&w(e),j(o),u=!1,f()}}}function hT(n,e,t){let{class:i=""}=e;const s=vt(),l=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.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 _T extends ve{constructor(e){super(),be(this,e,hT,mT,_e,{class:0})}}const gT=n=>({interactive:n&32,hasErrors:n&16}),zc=n=>({interactive:n[5],hasErrors:n[4]}),bT=n=>({interactive:n&32,hasErrors:n&16}),Bc=n=>({interactive:n[5],hasErrors:n[4]});function Uc(n){let e;return{c(){e=v("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 vT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("div"),t=v("i"),s=D(),l=v("input"),m(t,"class",i=H.getFieldTypeIcon(n[0].type)),m(e,"class","form-field-addon prefix no-pointer-events"),Q(e,"txt-disabled",!n[5]),m(l,"type","text"),l.required=!0,l.disabled=o=!n[5],l.readOnly=r=n[0].id&&n[0].system,m(l,"spellcheck","false"),l.autofocus=a=!n[0].id,m(l,"placeholder","Field name"),l.value=u=n[0].name},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),n[0].id||l.focus(),f||(c=K(l,"input",n[13]),f=!0)},p(d,p){p&1&&i!==(i=H.getFieldTypeIcon(d[0].type))&&m(t,"class",i),p&32&&Q(e,"txt-disabled",!d[5]),p&32&&o!==(o=!d[5])&&(l.disabled=o),p&1&&r!==(r=d[0].id&&d[0].system)&&(l.readOnly=r),p&1&&a!==(a=!d[0].id)&&(l.autofocus=a),p&1&&u!==(u=d[0].name)&&l.value!==u&&(l.value=u)},d(d){d&&w(e),d&&w(s),d&&w(l),f=!1,c()}}}function yT(n){let e,t,i;return{c(){e=v("button"),t=v("i"),m(t,"class","ri-settings-3-line"),m(e,"type","button"),m(e,"aria-label","Field options"),m(e,"class",i="btn btn-sm btn-circle btn-transparent options-trigger "+(n[4]?"btn-danger":"btn-hint"))},m(s,l){S(s,e,l),b(e,t),n[14](e)},p(s,l){l&16&&i!==(i="btn btn-sm btn-circle btn-transparent options-trigger "+(s[4]?"btn-danger":"btn-hint"))&&m(e,"class",i)},d(s){s&&w(e),n[14](null)}}}function kT(n){let e,t,i;return{c(){e=v("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=[De(ze.call(null,e,"Restore")),K(e,"click",n[8])],t=!0)},p:X,d(s){s&&w(e),t=!1,Ae(i)}}}function Wc(n){let e,t;return e=new qn({props:{class:"dropdown dropdown-block schema-field-dropdown",trigger:n[2],$$slots:{default:[TT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.trigger=i[2]),s&1048625&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function wT(n){let e,t,i,s,l,o=Kc(n[0])+"",r,a,u,f,c,d,p;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),r=B(o),a=D(),u=v("i"),m(e,"type","checkbox"),m(e,"id",t=n[21]),m(l,"class","txt"),m(u,"class","ri-information-line link-hint"),m(s,"for",c=n[21])},m(h,g){S(h,e,g),e.checked=n[0].required,S(h,i,g),S(h,s,g),b(s,l),b(l,r),b(s,a),b(s,u),d||(p=[K(e,"change",n[15]),De(f=ze.call(null,u,{text:`Requires the field value NOT to be ${H.zeroDefaultStr(n[0])}.`,position:"right"}))],d=!0)},p(h,g){g&2097152&&t!==(t=h[21])&&m(e,"id",t),g&1&&(e.checked=h[0].required),g&1&&o!==(o=Kc(h[0])+"")&&le(r,o),f&&Bt(f.update)&&g&1&&f.update.call(null,{text:`Requires the field value NOT to be ${H.zeroDefaultStr(h[0])}.`,position:"right"}),g&2097152&&c!==(c=h[21])&&m(s,"for",c)},d(h){h&&w(e),h&&w(i),h&&w(s),d=!1,Ae(p)}}}function Yc(n){let e,t,i,s,l,o,r,a,u;return a=new qn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[ST]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=D(),s=v("div"),l=v("button"),o=v("i"),r=D(),V(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,c){S(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),q(a,l,null),u=!0},p(f,c){const d={};c&1048576&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){I(a.$$.fragment,f),u=!1},d(f){f&&w(e),j(a)}}}function ST(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[7]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function TT(n){let e,t,i,s,l,o,r;const a=n[11].options,u=Et(a,n,n[20],zc);l=new pe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[wT,({uniqueId:c})=>({21:c}),({uniqueId:c})=>c?2097152:0]},$$scope:{ctx:n}}});let f=!n[0].toDelete&&Yc(n);return{c(){e=v("div"),t=v("div"),u&&u.c(),i=D(),s=v("div"),V(l.$$.fragment),o=D(),f&&f.c(),m(t,"class","col-sm-12 hidden-empty"),m(s,"class","col-sm-4 flex"),m(e,"class","grid grid-sm")},m(c,d){S(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),b(e,s),q(l,s,null),b(e,o),f&&f.m(e,null),r=!0},p(c,d){u&&u.p&&(!r||d&1048624)&&It(u,a,c,c[20],r?At(a,c[20],d,gT):Pt(c[20]),zc);const p={};d&3145729&&(p.$$scope={dirty:d,ctx:c}),l.$set(p),c[0].toDelete?f&&(re(),I(f,1,1,()=>{f=null}),ae()):f?(f.p(c,d),d&1&&A(f,1)):(f=Yc(c),f.c(),A(f,1),f.m(e,null))},i(c){r||(A(u,c),A(l.$$.fragment,c),A(f),r=!0)},o(c){I(u,c),I(l.$$.fragment,c),I(f),r=!1},d(c){c&&w(e),u&&u.d(c),j(l),f&&f.d()}}}function $T(n){let e,t,i,s,l,o,r,a,u,f,c=n[5]&&Uc();s=new pe({props:{class:"form-field required m-0 "+(n[5]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[vT]},$$scope:{ctx:n}}});const d=n[11].default,p=Et(d,n,n[20],Bc);function h(k,T){if(k[0].toDelete)return kT;if(k[5])return yT}let g=h(n),_=g&&g(n),y=n[5]&&Wc(n);return{c(){e=v("div"),t=v("div"),c&&c.c(),i=D(),V(s.$$.fragment),l=D(),p&&p.c(),o=D(),_&&_.c(),r=D(),y&&y.c(),m(t,"class","schema-field-header"),m(e,"draggable",!0),m(e,"class","schema-field"),Q(e,"drag-over",n[3])},m(k,T){S(k,e,T),b(e,t),c&&c.m(t,null),b(t,i),q(s,t,null),b(t,l),p&&p.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),a=!0,u||(f=[K(e,"dragstart",n[16]),K(e,"dragenter",n[17]),K(e,"drop",ft(n[18])),K(e,"dragleave",n[19]),K(e,"dragover",ft(n[12]))],u=!0)},p(k,[T]){k[5]?c||(c=Uc(),c.c(),c.m(t,i)):c&&(c.d(1),c=null);const $={};T&32&&($.class="form-field required m-0 "+(k[5]?"":"disabled")),T&2&&($.name="schema."+k[1]+".name"),T&1048609&&($.$$scope={dirty:T,ctx:k}),s.$set($),p&&p.p&&(!a||T&1048624)&&It(p,d,k,k[20],a?At(d,k[20],T,bT):Pt(k[20]),Bc),g===(g=h(k))&&_?_.p(k,T):(_&&_.d(1),_=g&&g(k),_&&(_.c(),_.m(t,null))),k[5]?y?(y.p(k,T),T&32&&A(y,1)):(y=Wc(k),y.c(),A(y,1),y.m(e,null)):y&&(re(),I(y,1,1,()=>{y=null}),ae()),(!a||T&8)&&Q(e,"drag-over",k[3])},i(k){a||(A(s.$$.fragment,k),A(p,k),A(y),a=!0)},o(k){I(s.$$.fragment,k),I(p,k),I(y),a=!1},d(k){k&&w(e),c&&c.d(),j(s),p&&p.d(k),_&&_.d(),y&&y.d(),u=!1,Ae(f)}}}function Kc(n){switch(n==null?void 0:n.type){case"bool":return"Nonfalsey";case"number":return"Nonzero";default:return"Nonempty"}}function CT(n,e,t){let i,s,l;We(n,ti,E=>t(10,l=E));let{$$slots:o={},$$scope:r}=e;const a=vt();let{key:u=""}=e,{field:f=new gn}=e,c,d=!1;function p(){f.id?t(0,f.toDelete=!0,f):a("remove")}function h(){t(0,f.toDelete=!1,f),_n({})}function g(E){return H.slugify(E)}function _(E){de.call(this,n,E)}const y=E=>{const P=f.name;t(0,f.name=g(E.target.value),f),E.target.value=f.name,a("rename",{oldName:P,newName:f.name})};function k(E){se[E?"unshift":"push"](()=>{c=E,t(2,c)})}function T(){f.required=this.checked,t(0,f)}const $=E=>{if(!E.target.classList.contains("drag-handle-wrapper")){E.preventDefault();return}const P=document.createElement("div");E.dataTransfer.setDragImage(P,0,0),i&&a("dragstart",E)},M=E=>{i&&(t(3,d=!0),a("dragenter",E))},C=E=>{i&&(t(3,d=!1),a("drop",E))},O=E=>{i&&(t(3,d=!1),a("dragleave",E))};return n.$$set=E=>{"key"in E&&t(1,u=E.key),"field"in E&&t(0,f=E.field),"$$scope"in E&&t(20,r=E.$$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(5,i=!f.toDelete&&!(f.id&&f.system)),n.$$.dirty&1026&&t(4,s=!H.isEmpty(H.getNestedVal(l,`schema.${u}`)))},[f,u,c,d,s,i,a,p,h,g,l,o,_,y,k,T,$,M,C,O,r]}class ni extends ve{constructor(e){super(),be(this,e,CT,$T,_e,{key:1,field:0})}}function MT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min length"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=K(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&&ht(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function OT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max length"),s=D(),l=v("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,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].options.max),a||(u=K(l,"input",n[4]),a=!0)},p(f,c){c&8192&&i!==(i=f[13])&&m(e,"for",i),c&8192&&o!==(o=f[13])&&m(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&m(l,"min",r),c&1&&ht(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function DT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Regex pattern"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.pattern),r||(a=K(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&&ue(l,u[0].options.pattern)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function ET(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[MT,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[OT,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[DT,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(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(c,d){S(c,e,d),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),q(u,a,null),f=!0},p(c,d){const p={};d&2&&(p.name="schema."+c[1]+".options.min"),d&24577&&(p.$$scope={dirty:d,ctx:c}),i.$set(p);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&24577&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const g={};d&2&&(g.name="schema."+c[1]+".options.pattern"),d&24577&&(g.$$scope={dirty:d,ctx:c}),u.$set(g)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(o.$$.fragment,c),I(u.$$.fragment,c),f=!1},d(c){c&&w(e),j(i),j(o),j(u)}}}function AT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[ET]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&16387&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function IT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=ht(this.value),t(0,l)}function a(){l.options.max=ht(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(y){l=y,t(0,l)}function c(y){de.call(this,n,y)}function d(y){de.call(this,n,y)}function p(y){de.call(this,n,y)}function h(y){de.call(this,n,y)}function g(y){de.call(this,n,y)}function _(y){de.call(this,n,y)}return n.$$set=y=>{e=Le(Le({},e),jt(y)),t(2,s=Je(e,i)),"field"in y&&t(0,l=y.field),"key"in y&&t(1,o=y.key)},[l,o,s,r,a,u,f,c,d,p,h,g,_]}class PT extends ve{constructor(e){super(),be(this,e,IT,AT,_e,{field:0,key:1})}}function LT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min"),s=D(),l=v("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12])},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.min),r||(a=K(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&&ht(l.value)!==u[0].options.min&&ue(l,u[0].options.min)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function NT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max"),s=D(),l=v("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,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].options.max),a||(u=K(l,"input",n[4]),a=!0)},p(f,c){c&4096&&i!==(i=f[12])&&m(e,"for",i),c&4096&&o!==(o=f[12])&&m(l,"id",o),c&1&&r!==(r=f[0].options.min)&&m(l,"min",r),c&1&&ht(l.value)!==f[0].options.max&&ue(l,f[0].options.max)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function FT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[LT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[NT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(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),b(e,t),q(i,t,null),b(e,s),b(e,l),q(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 c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&12289&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function RT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[FT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function qT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=ht(this.value),t(0,l)}function a(){l.options.max=ht(this.value),t(0,l)}function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(2,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,p,h,g]}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=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function HT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class zT extends ve{constructor(e){super(),be(this,e,HT,VT,_e,{field:0,key:1})}}function BT(n){let e,t,i,s,l=[{type:t=n[3].type||"text"},{value:n[2]},n[3]],o={};for(let r=0;r<l.length;r+=1)o=Le(o,l[r]);return{c(){e=v("input"),xn(e,o)},m(r,a){S(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(s=K(e,"input",n[4]),i=!0)},p(r,[a]){xn(e,o=bt(l,[a&8&&t!==(t=r[3].type||"text")&&{type:t},a&4&&e.value!==r[2]&&{value:r[2]},a&8&&r[3]])),"value"in o&&(e.value=o.value)},i:X,o:X,d(r){r&&w(e),i=!1,s()}}}function UT(n,e,t){let i;const s=["value","separator"];let l=Je(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=H.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=Le(Le({},e),jt(u)),t(3,l=Je(e,s)),"value"in u&&t(0,o=u.value),"separator"in u&&t(1,r=u.separator)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=(o||[]).join(", "))},[o,r,i,l,a]}class Fs extends ve{constructor(e){super(),be(this,e,UT,BT,_e,{value:0,separator:1})}}function WT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[3](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("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(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`List of domains that are NOT allowed.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function YT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[4](_)}let g={id:n[12]+".options.onlyDomains",disabled:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("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(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]+".options.onlyDomains"))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]+".options.onlyDomains"),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function KT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[WT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[YT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(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),b(e,t),q(i,t,null),b(e,s),b(e,l),q(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 c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function JT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[KT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function ZT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(_){n.$$.not_equal(l.options.exceptDomains,_)&&(l.options.exceptDomains=_,t(0,l))}function a(_){n.$$.not_equal(l.options.onlyDomains,_)&&(l.options.onlyDomains=_,t(0,l))}function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(2,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,p,h,g]}class W1 extends ve{constructor(e){super(),be(this,e,ZT,JT,_e,{field:0,key:1})}}function GT(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=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new W1({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function XT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class QT extends ve{constructor(e){super(),be(this,e,XT,GT,_e,{field:0,key:1})}}function xT(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=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function e$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class t$ extends ve{constructor(e){super(),be(this,e,e$,xT,_e,{field:0,key:1})}}var $r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ws={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},vl={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},fn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},En=function(n){return n===!0?1:0};function Jc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Cr=function(n){return n instanceof Array?n:[n]};function tn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ot(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function so(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Y1(n,e){if(e(n))return n;if(n.parentNode)return Y1(n.parentNode,e)}function lo(n,e){var t=ot("div","numInputWrapper"),i=ot("input","numInput "+n),s=ot("span","arrowUp"),l=ot("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Mr=function(){},No=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},n$={D:Mr,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*En(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:Mr,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:Mr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Ji={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},rl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[rl.w(n,e,t)]},F:function(n,e,t){return No(rl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return fn(rl.h(n,e,t))},H:function(n){return fn(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[En(n.getHours()>11)]},M:function(n,e){return No(n.getMonth(),!0,e)},S:function(n){return fn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return fn(n.getFullYear(),4)},d:function(n){return fn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return fn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return fn(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)}},K1=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?vl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,p){return rl[c]&&p[d-1]!=="\\"?rl[c](r,f,t):c!=="\\"?c:""}).join("")}},da=function(n){var e=n.config,t=e===void 0?ws:e,i=n.l10n,s=i===void 0?vl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||ws).dateFormat,p=String(l).trim();if(p==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(p)||/GMT$/.test(p))f=new Date(l);else{for(var h=void 0,g=[],_=0,y=0,k="";_<d.length;_++){var T=d[_],$=T==="\\",M=d[_-1]==="\\"||$;if(Ji[T]&&!M){k+=Ji[T];var C=new RegExp(k).exec(l);C&&(h=!0)&&g[T!=="Y"?"push":"unshift"]({fn:n$[T],val:C[++y]})}else $||(k+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(O){var E=O.fn,P=O.val;return f=E(f,P,u)||f}),f=h?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function kn(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 i$=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Or=function(n,e,t){return n*3600+e*60+t},s$=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},l$={DAY:864e5};function Dr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var Kt=globalThis&&globalThis.__assign||function(){return Kt=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},Kt.apply(this,arguments)},Zc=globalThis&&globalThis.__spreadArrays||function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),s=0,e=0;e<t;e++)for(var l=arguments[e],o=0,r=l.length;o<r;o++,s++)i[s]=l[o];return i},o$=300;function r$(n,e){var t={config:Kt(Kt({},ws),Rt.defaultConfig),l10n:vl};t.parseDate=da({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=g,t._setHoursFromDate=d,t._positionCalendar=Se,t.changeMonth=Z,t.changeYear=ye,t.clear=ce,t.close=he,t.onMouseOver=Be,t._createElement=ot,t.createDay=C,t.destroy=Ce,t.isEnabled=$e,t.jumpToDate=k,t.updateValue=Yt,t.open=Fe,t.redraw=kt,t.set=Kn,t.setDate=Nl,t.toggle=un;function i(){t.utils={getDaysInMonth:function(U,Y){return U===void 0&&(U=t.currentMonth),Y===void 0&&(Y=t.currentYear),U===1&&(Y%4===0&&Y%100!==0||Y%400===0)?29:t.l10n.daysInMonth[U]}}}function s(){t.element=t.input=n,t.isOpen=!1,Wt(),ie(),Fl(),os(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Yt(!1)),r();var U=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&U&&Se(),Ge("onReady")}function l(){var U;return((U=t.calendarContainer)===null||U===void 0?void 0:U.getRootNode()).activeElement||document.activeElement}function o(U){return U.bind(t)}function r(){var U=t.config;U.weekNumbers===!1&&U.showMonths===1||U.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 Y=(t.days.offsetWidth+1)*U.showMonths;t.daysContainer.style.width=Y+"px",t.calendarContainer.style.width=Y+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(U){if(t.selectedDates.length===0){var Y=t.config.minDate===void 0||kn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),te=Dr(t.config);Y.setHours(te.hours,te.minutes,te.seconds,Y.getMilliseconds()),t.selectedDates=[Y],t.latestSelectedDateObj=Y}U!==void 0&&U.type!=="blur"&&Rl(U);var oe=t._input.value;c(),Yt(),t._input.value!==oe&&t._debouncedChange()}function u(U,Y){return U%12+12*En(Y===t.l10n.amPM[1])}function f(U){switch(U%24){case 0:case 12:return 12;default:return U%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var U=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,Y=(parseInt(t.minuteElement.value,10)||0)%60,te=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(U=u(U,t.amPM.textContent));var oe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&kn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&kn(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 Ee=Or(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ie=Or(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Me=Or(U,Y,te);if(Me>Ie&&Me<Ee){var Ue=s$(Ee);U=Ue[0],Y=Ue[1],te=Ue[2]}}else{if(Te){var Ne=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;U=Math.min(U,Ne.getHours()),U===Ne.getHours()&&(Y=Math.min(Y,Ne.getMinutes())),Y===Ne.getMinutes()&&(te=Math.min(te,Ne.getSeconds()))}if(oe){var He=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;U=Math.max(U,He.getHours()),U===He.getHours()&&Y<He.getMinutes()&&(Y=He.getMinutes()),Y===He.getMinutes()&&(te=Math.max(te,He.getSeconds()))}}p(U,Y,te)}}function d(U){var Y=U||t.latestSelectedDateObj;Y&&Y instanceof Date&&p(Y.getHours(),Y.getMinutes(),Y.getSeconds())}function p(U,Y,te){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(U%24,Y,te||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=fn(t.config.time_24hr?U:(12+U)%12+12*En(U%12===0)),t.minuteElement.value=fn(Y),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[En(U>=12)]),t.secondElement!==void 0&&(t.secondElement.value=fn(te)))}function h(U){var Y=yn(U),te=parseInt(Y.value)+(U.delta||0);(te/1e3>1||U.key==="Enter"&&!/[^\d]/.test(te.toString()))&&ye(te)}function g(U,Y,te,oe){if(Y instanceof Array)return Y.forEach(function(Te){return g(U,Te,te,oe)});if(U instanceof Array)return U.forEach(function(Te){return g(Te,Y,te,oe)});U.addEventListener(Y,te,oe),t._handlers.push({remove:function(){return U.removeEventListener(Y,te,oe)}})}function _(){Ge("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(te){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+te+"]"),function(oe){return g(oe,"click",t[te])})}),t.isMobile){rs();return}var U=Jc(ee,50);if(t._debouncedChange=Jc(_,o$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(te){t.config.mode==="range"&&Be(yn(te))}),g(t._input,"keydown",Ke),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Ke),!t.config.inline&&!t.config.static&&g(window,"resize",U),window.ontouchstart!==void 0?g(window.document,"touchstart",je):g(window.document,"mousedown",je),g(window.document,"focus",je,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",en),g(t.monthNav,["keyup","increment"],h),g(t.daysContainer,"click",mi)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var Y=function(te){return yn(te).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",T),g([t.hourElement,t.minuteElement],["focus","click"],Y),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(te){a(te)})}t.config.allowInput&&g(t._input,"blur",dt)}function k(U,Y){var te=U!==void 0?t.parseDate(U):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate<t.now?t.config.maxDate:t.now),oe=t.currentYear,Te=t.currentMonth;try{te!==void 0&&(t.currentYear=te.getFullYear(),t.currentMonth=te.getMonth())}catch(Ee){Ee.message="Invalid date supplied: "+te,t.config.errorHandler(Ee)}Y&&t.currentYear!==oe&&(Ge("onYearChange"),R()),Y&&(t.currentYear!==oe||t.currentMonth!==Te)&&Ge("onMonthChange"),t.redraw()}function T(U){var Y=yn(U);~Y.className.indexOf("arrow")&&$(U,Y.classList.contains("arrowUp")?1:-1)}function $(U,Y,te){var oe=U&&yn(U),Te=te||oe&&oe.parentNode&&oe.parentNode.firstChild,Ee=as("increment");Ee.delta=Y,Te&&Te.dispatchEvent(Ee)}function M(){var U=window.document.createDocumentFragment();if(t.calendarContainer=ot("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(U.appendChild(J()),t.innerContainer=ot("div","flatpickr-innerContainer"),t.config.weekNumbers){var Y=fe(),te=Y.weekWrapper,oe=Y.weekNumbers;t.innerContainer.appendChild(te),t.weekNumbers=oe,t.weekWrapper=te}t.rContainer=ot("div","flatpickr-rContainer"),t.rContainer.appendChild(ne()),t.daysContainer||(t.daysContainer=ot("div","flatpickr-days"),t.daysContainer.tabIndex=-1),N(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),U.appendChild(t.innerContainer)}t.config.enableTime&&U.appendChild(x()),tn(t.calendarContainer,"rangeMode",t.config.mode==="range"),tn(t.calendarContainer,"animate",t.config.animate===!0),tn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(U);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ee=ot("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ee,t.element),Ee.appendChild(t.element),t.altInput&&Ee.appendChild(t.altInput),Ee.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function C(U,Y,te,oe){var Te=$e(Y,!0),Ee=ot("span",U,Y.getDate().toString());return Ee.dateObj=Y,Ee.$i=oe,Ee.setAttribute("aria-label",t.formatDate(Y,t.config.ariaDateFormat)),U.indexOf("hidden")===-1&&kn(Y,t.now)===0&&(t.todayDateElem=Ee,Ee.classList.add("today"),Ee.setAttribute("aria-current","date")),Te?(Ee.tabIndex=-1,ii(Y)&&(Ee.classList.add("selected"),t.selectedDateElem=Ee,t.config.mode==="range"&&(tn(Ee,"startRange",t.selectedDates[0]&&kn(Y,t.selectedDates[0],!0)===0),tn(Ee,"endRange",t.selectedDates[1]&&kn(Y,t.selectedDates[1],!0)===0),U==="nextMonthDay"&&Ee.classList.add("inRange")))):Ee.classList.add("flatpickr-disabled"),t.config.mode==="range"&&us(Y)&&!ii(Y)&&Ee.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&U!=="prevMonthDay"&&oe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(Y)+"</span>"),Ge("onDayCreate",Ee),Ee}function O(U){U.focus(),t.config.mode==="range"&&Be(U)}function E(U){for(var Y=U>0?0:t.config.showMonths-1,te=U>0?t.config.showMonths:-1,oe=Y;oe!=te;oe+=U)for(var Te=t.daysContainer.children[oe],Ee=U>0?0:Te.children.length-1,Ie=U>0?Te.children.length:-1,Me=Ee;Me!=Ie;Me+=U){var Ue=Te.children[Me];if(Ue.className.indexOf("hidden")===-1&&$e(Ue.dateObj))return Ue}}function P(U,Y){for(var te=U.className.indexOf("Month")===-1?U.dateObj.getMonth():t.currentMonth,oe=Y>0?t.config.showMonths:-1,Te=Y>0?1:-1,Ee=te-t.currentMonth;Ee!=oe;Ee+=Te)for(var Ie=t.daysContainer.children[Ee],Me=te-t.currentMonth===Ee?U.$i+Y:Y<0?Ie.children.length-1:0,Ue=Ie.children.length,Ne=Me;Ne>=0&&Ne<Ue&&Ne!=(Y>0?Ue:-1);Ne+=Te){var He=Ie.children[Ne];if(He.className.indexOf("hidden")===-1&&$e(He.dateObj)&&Math.abs(U.$i-Ne)>=Math.abs(Y))return O(He)}t.changeMonth(Te),L(E(Te),0)}function L(U,Y){var te=l(),oe=Ye(te||document.body),Te=U!==void 0?U:oe?te:t.selectedDateElem!==void 0&&Ye(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Ye(t.todayDateElem)?t.todayDateElem:E(Y>0?1:-1);Te===void 0?t._input.focus():oe?P(Te,Y):O(Te)}function F(U,Y){for(var te=(new Date(U,Y,1).getDay()-t.l10n.firstDayOfWeek+7)%7,oe=t.utils.getDaysInMonth((Y-1+12)%12,U),Te=t.utils.getDaysInMonth(Y,U),Ee=window.document.createDocumentFragment(),Ie=t.config.showMonths>1,Me=Ie?"prevMonthDay hidden":"prevMonthDay",Ue=Ie?"nextMonthDay hidden":"nextMonthDay",Ne=oe+1-te,He=0;Ne<=oe;Ne++,He++)Ee.appendChild(C("flatpickr-day "+Me,new Date(U,Y-1,Ne),Ne,He));for(Ne=1;Ne<=Te;Ne++,He++)Ee.appendChild(C("flatpickr-day",new Date(U,Y,Ne),Ne,He));for(var _t=Te+1;_t<=42-te&&(t.config.showMonths===1||He%7!==0);_t++,He++)Ee.appendChild(C("flatpickr-day "+Ue,new Date(U,Y+1,_t%Te),_t,He));var Jn=ot("div","dayContainer");return Jn.appendChild(Ee),Jn}function N(){if(t.daysContainer!==void 0){so(t.daysContainer),t.weekNumbers&&so(t.weekNumbers);for(var U=document.createDocumentFragment(),Y=0;Y<t.config.showMonths;Y++){var te=new Date(t.currentYear,t.currentMonth,1);te.setMonth(t.currentMonth+Y),U.appendChild(F(te.getFullYear(),te.getMonth()))}t.daysContainer.appendChild(U),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Be()}}function R(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var U=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 Y=0;Y<12;Y++)if(U(Y)){var te=ot("option","flatpickr-monthDropdown-month");te.value=new Date(t.currentYear,Y).getMonth().toString(),te.textContent=No(Y,t.config.shorthandCurrentMonth,t.l10n),te.tabIndex=-1,t.currentMonth===Y&&(te.selected=!0),t.monthsDropdownContainer.appendChild(te)}}}function z(){var U=ot("div","flatpickr-month"),Y=window.document.createDocumentFragment(),te;t.config.showMonths>1||t.config.monthSelectorType==="static"?te=ot("span","cur-month"):(t.monthsDropdownContainer=ot("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Ie){var Me=yn(Ie),Ue=parseInt(Me.value,10);t.changeMonth(Ue-t.currentMonth),Ge("onMonthChange")}),R(),te=t.monthsDropdownContainer);var oe=lo("cur-year",{tabindex:"-1"}),Te=oe.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ee=ot("div","flatpickr-current-month");return Ee.appendChild(te),Ee.appendChild(oe),Y.appendChild(Ee),U.appendChild(Y),{container:U,yearElement:Te,monthElement:te}}function W(){so(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var U=t.config.showMonths;U--;){var Y=z();t.yearElements.push(Y.yearElement),t.monthElements.push(Y.monthElement),t.monthNav.appendChild(Y.container)}t.monthNav.appendChild(t.nextMonthNav)}function J(){return t.monthNav=ot("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ot("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ot("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,W(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(U){t.__hidePrevMonthArrow!==U&&(tn(t.prevMonthNav,"flatpickr-disabled",U),t.__hidePrevMonthArrow=U)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(U){t.__hideNextMonthArrow!==U&&(tn(t.nextMonthNav,"flatpickr-disabled",U),t.__hideNextMonthArrow=U)}}),t.currentYearElement=t.yearElements[0],Ri(),t.monthNav}function x(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var U=Dr(t.config);t.timeContainer=ot("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var Y=ot("span","flatpickr-time-separator",":"),te=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=te.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=fn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?U.hours:f(U.hours)),t.minuteElement.value=fn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():U.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(te),t.timeContainer.appendChild(Y),t.timeContainer.appendChild(oe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=lo("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=fn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():U.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ot("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ot("span","flatpickr-am-pm",t.l10n.amPM[En((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ne(){t.weekdayContainer?so(t.weekdayContainer):t.weekdayContainer=ot("div","flatpickr-weekdays");for(var U=t.config.showMonths;U--;){var Y=ot("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(Y)}return G(),t.weekdayContainer}function G(){if(t.weekdayContainer){var U=t.l10n.firstDayOfWeek,Y=Zc(t.l10n.weekdays.shorthand);U>0&&U<Y.length&&(Y=Zc(Y.splice(U,Y.length),Y.splice(0,U)));for(var te=t.config.showMonths;te--;)t.weekdayContainer.children[te].innerHTML=`
<span class='flatpickr-weekday'>
`+Y.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var U=ot("div","flatpickr-weekwrapper");U.appendChild(ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Y=ot("div","flatpickr-weeks");return U.appendChild(Y),{weekWrapper:U,weekNumbers:Y}}function Z(U,Y){Y===void 0&&(Y=!0);var te=Y?U:U-t.currentMonth;te<0&&t._hidePrevMonthArrow===!0||te>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=te,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ge("onYearChange"),R()),N(),Ge("onMonthChange"),Ri())}function ce(U,Y){if(U===void 0&&(U=!0),Y===void 0&&(Y=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Y===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var te=Dr(t.config),oe=te.hours,Te=te.minutes,Ee=te.seconds;p(oe,Te,Ee)}t.redraw(),U&&Ge("onChange")}function he(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ge("onClose")}function Ce(){t.config!==void 0&&Ge("onDestroy");for(var U=t._handlers.length;U--;)t._handlers[U].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 Y=t.calendarContainer.parentNode;if(Y.lastChild&&Y.removeChild(Y.lastChild),Y.parentNode){for(;Y.firstChild;)Y.parentNode.insertBefore(Y.firstChild,Y);Y.parentNode.removeChild(Y)}}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(te){try{delete t[te]}catch{}})}function Re(U){return t.calendarContainer.contains(U)}function je(U){if(t.isOpen&&!t.config.inline){var Y=yn(U),te=Re(Y),oe=Y===t.input||Y===t.altInput||t.element.contains(Y)||U.path&&U.path.indexOf&&(~U.path.indexOf(t.input)||~U.path.indexOf(t.altInput)),Te=!oe&&!te&&!Re(U.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ie){return Ie.contains(Y)});Te&&Ee&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ye(U){if(!(!U||t.config.minDate&&U<t.config.minDate.getFullYear()||t.config.maxDate&&U>t.config.maxDate.getFullYear())){var Y=U,te=t.currentYear!==Y;t.currentYear=Y||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)),te&&(t.redraw(),Ge("onYearChange"),R())}}function $e(U,Y){var te;Y===void 0&&(Y=!0);var oe=t.parseDate(U,void 0,Y);if(t.config.minDate&&oe&&kn(oe,t.config.minDate,Y!==void 0?Y:!t.minDateHasTime)<0||t.config.maxDate&&oe&&kn(oe,t.config.maxDate,Y!==void 0?Y:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(oe===void 0)return!1;for(var Te=!!t.config.enable,Ee=(te=t.config.enable)!==null&&te!==void 0?te:t.config.disable,Ie=0,Me=void 0;Ie<Ee.length;Ie++){if(Me=Ee[Ie],typeof Me=="function"&&Me(oe))return Te;if(Me instanceof Date&&oe!==void 0&&Me.getTime()===oe.getTime())return Te;if(typeof Me=="string"){var Ue=t.parseDate(Me,void 0,!0);return Ue&&Ue.getTime()===oe.getTime()?Te:!Te}else if(typeof Me=="object"&&oe!==void 0&&Me.from&&Me.to&&oe.getTime()>=Me.from.getTime()&&oe.getTime()<=Me.to.getTime())return Te}return!Te}function Ye(U){return t.daysContainer!==void 0?U.className.indexOf("hidden")===-1&&U.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(U):!1}function dt(U){var Y=U.target===t._input,te=t._input.value.trimEnd()!==qi();Y&&te&&!(U.relatedTarget&&Re(U.relatedTarget))&&t.setDate(t._input.value,!0,U.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ke(U){var Y=yn(U),te=t.config.wrap?n.contains(Y):Y===t._input,oe=t.config.allowInput,Te=t.isOpen&&(!oe||!te),Ee=t.config.inline&&te&&!oe;if(U.keyCode===13&&te){if(oe)return t.setDate(t._input.value,!0,Y===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),Y.blur();t.open()}else if(Re(Y)||Te||Ee){var Ie=!!t.timeContainer&&t.timeContainer.contains(Y);switch(U.keyCode){case 13:Ie?(U.preventDefault(),a(),xt()):mi(U);break;case 27:U.preventDefault(),xt();break;case 8:case 46:te&&!t.config.allowInput&&(U.preventDefault(),t.clear());break;case 37:case 39:if(!Ie&&!te){U.preventDefault();var Me=l();if(t.daysContainer!==void 0&&(oe===!1||Me&&Ye(Me))){var Ue=U.keyCode===39?1:-1;U.ctrlKey?(U.stopPropagation(),Z(Ue),L(E(1),0)):L(void 0,Ue)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:U.preventDefault();var Ne=U.keyCode===40?1:-1;t.daysContainer&&Y.$i!==void 0||Y===t.input||Y===t.altInput?U.ctrlKey?(U.stopPropagation(),ye(t.currentYear-Ne),L(E(1),0)):Ie||L(void 0,Ne*7):Y===t.currentYearElement?ye(t.currentYear-Ne):t.config.enableTime&&(!Ie&&t.hourElement&&t.hourElement.focus(),a(U),t._debouncedChange());break;case 9:if(Ie){var He=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(vn){return vn}),_t=He.indexOf(Y);if(_t!==-1){var Jn=He[_t+(U.shiftKey?-1:1)];U.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(Y)&&U.shiftKey&&(U.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&Y===t.amPM)switch(U.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Yt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Yt();break}(te||Re(Y))&&Ge("onKeyDown",U)}function Be(U,Y){if(Y===void 0&&(Y="flatpickr-day"),!(t.selectedDates.length!==1||U&&(!U.classList.contains(Y)||U.classList.contains("flatpickr-disabled")))){for(var te=U?U.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),oe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(te,t.selectedDates[0].getTime()),Ee=Math.max(te,t.selectedDates[0].getTime()),Ie=!1,Me=0,Ue=0,Ne=Te;Ne<Ee;Ne+=l$.DAY)$e(new Date(Ne),!0)||(Ie=Ie||Ne>Te&&Ne<Ee,Ne<oe&&(!Me||Ne>Me)?Me=Ne:Ne>oe&&(!Ue||Ne<Ue)&&(Ue=Ne));var He=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+Y));He.forEach(function(_t){var Jn=_t.dateObj,vn=Jn.getTime(),Rs=Me>0&&vn<Me||Ue>0&&vn>Ue;if(Rs){_t.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(fs){_t.classList.remove(fs)});return}else if(Ie&&!Rs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(fs){_t.classList.remove(fs)}),U!==void 0&&(U.classList.add(te<=t.selectedDates[0].getTime()?"startRange":"endRange"),oe<te&&vn===oe?_t.classList.add("startRange"):oe>te&&vn===oe&&_t.classList.add("endRange"),vn>=Me&&(Ue===0||vn<=Ue)&&i$(vn,oe,te)&&_t.classList.add("inRange"))})}}function ee(){t.isOpen&&!t.config.static&&!t.config.inline&&Se()}function Fe(U,Y){if(Y===void 0&&(Y=t._positionElement),t.isMobile===!0){if(U){U.preventDefault();var te=yn(U);te&&te.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Ge("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"),Ge("onOpen"),Se(Y)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(U===void 0||!t.timeContainer.contains(U.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function tt(U){return function(Y){var te=t.config["_"+U+"Date"]=t.parseDate(Y,t.config.dateFormat),oe=t.config["_"+(U==="min"?"max":"min")+"Date"];te!==void 0&&(t[U==="min"?"minDateHasTime":"maxDateHasTime"]=te.getHours()>0||te.getMinutes()>0||te.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return $e(Te)}),!t.selectedDates.length&&U==="min"&&d(te),Yt()),t.daysContainer&&(kt(),te!==void 0?t.currentYearElement[U]=te.getFullYear().toString():t.currentYearElement.removeAttribute(U),t.currentYearElement.disabled=!!oe&&te!==void 0&&oe.getFullYear()===te.getFullYear())}}function Wt(){var U=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],Y=Kt(Kt({},JSON.parse(JSON.stringify(n.dataset||{}))),e),te={};t.config.parseDate=Y.parseDate,t.config.formatDate=Y.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(He){t.config._enable=hi(He)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(He){t.config._disable=hi(He)}});var oe=Y.mode==="time";if(!Y.dateFormat&&(Y.enableTime||oe)){var Te=Rt.defaultConfig.dateFormat||ws.dateFormat;te.dateFormat=Y.noCalendar||oe?"H:i"+(Y.enableSeconds?":S":""):Te+" H:i"+(Y.enableSeconds?":S":"")}if(Y.altInput&&(Y.enableTime||oe)&&!Y.altFormat){var Ee=Rt.defaultConfig.altFormat||ws.altFormat;te.altFormat=Y.noCalendar||oe?"h:i"+(Y.enableSeconds?":S K":" K"):Ee+(" h:i"+(Y.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:tt("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:tt("max")});var Ie=function(He){return function(_t){t.config[He==="min"?"_minTime":"_maxTime"]=t.parseDate(_t,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ie("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ie("max")}),Y.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,te,Y);for(var Me=0;Me<U.length;Me++)t.config[U[Me]]=t.config[U[Me]]===!0||t.config[U[Me]]==="true";$r.filter(function(He){return t.config[He]!==void 0}).forEach(function(He){t.config[He]=Cr(t.config[He]||[]).map(o)}),t.isMobile=!t.config.disableMobile&&!t.config.inline&&t.config.mode==="single"&&!t.config.disable.length&&!t.config.enable&&!t.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Me=0;Me<t.config.plugins.length;Me++){var Ue=t.config.plugins[Me](t)||{};for(var Ne in Ue)$r.indexOf(Ne)>-1?t.config[Ne]=Cr(Ue[Ne]).map(o).concat(t.config[Ne]):typeof Y[Ne]>"u"&&(t.config[Ne]=Ue[Ne])}Y.altInputClass||(t.config.altInputClass=Pe().className+" "+t.config.altInputClass),Ge("onParseConfig")}function Pe(){return t.config.wrap?n.querySelector("[data-input]"):n}function ie(){typeof t.config.locale!="object"&&typeof Rt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Kt(Kt({},Rt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Rt.l10ns[t.config.locale]:void 0),Ji.D="("+t.l10n.weekdays.shorthand.join("|")+")",Ji.l="("+t.l10n.weekdays.longhand.join("|")+")",Ji.M="("+t.l10n.months.shorthand.join("|")+")",Ji.F="("+t.l10n.months.longhand.join("|")+")",Ji.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var U=Kt(Kt({},e),JSON.parse(JSON.stringify(n.dataset||{})));U.time_24hr===void 0&&Rt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=K1(t),t.parseDate=da({config:t.config,l10n:t.l10n})}function Se(U){if(typeof t.config.position=="function")return void t.config.position(t,U);if(t.calendarContainer!==void 0){Ge("onPreCalendarPosition");var Y=U||t._positionElement,te=Array.prototype.reduce.call(t.calendarContainer.children,function(lb,ob){return lb+ob.offsetHeight},0),oe=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ee=Te[0],Ie=Te.length>1?Te[1]:null,Me=Y.getBoundingClientRect(),Ue=window.innerHeight-Me.bottom,Ne=Ee==="above"||Ee!=="below"&&Ue<te&&Me.top>te,He=window.pageYOffset+Me.top+(Ne?-te-2:Y.offsetHeight+2);if(tn(t.calendarContainer,"arrowTop",!Ne),tn(t.calendarContainer,"arrowBottom",Ne),!t.config.inline){var _t=window.pageXOffset+Me.left,Jn=!1,vn=!1;Ie==="center"?(_t-=(oe-Me.width)/2,Jn=!0):Ie==="right"&&(_t-=oe-Me.width,vn=!0),tn(t.calendarContainer,"arrowLeft",!Jn&&!vn),tn(t.calendarContainer,"arrowCenter",Jn),tn(t.calendarContainer,"arrowRight",vn);var Rs=window.document.body.offsetWidth-(window.pageXOffset+Me.right),fs=_t+oe>window.document.body.offsetWidth,Q1=Rs+oe>window.document.body.offsetWidth;if(tn(t.calendarContainer,"rightMost",fs),!t.config.static)if(t.calendarContainer.style.top=He+"px",!fs)t.calendarContainer.style.left=_t+"px",t.calendarContainer.style.right="auto";else if(!Q1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Rs+"px";else{var er=st();if(er===void 0)return;var x1=window.document.body.offsetWidth,eb=Math.max(0,x1/2-oe/2),tb=".flatpickr-calendar.centerMost:before",nb=".flatpickr-calendar.centerMost:after",ib=er.cssRules.length,sb="{left:"+Me.left+"px;right:auto;}";tn(t.calendarContainer,"rightMost",!1),tn(t.calendarContainer,"centerMost",!0),er.insertRule(tb+","+nb+sb,ib),t.calendarContainer.style.left=eb+"px",t.calendarContainer.style.right="auto"}}}}function st(){for(var U=null,Y=0;Y<document.styleSheets.length;Y++){var te=document.styleSheets[Y];if(te.cssRules){try{te.cssRules}catch{continue}U=te;break}}return U??nt()}function nt(){var U=document.createElement("style");return document.head.appendChild(U),U.sheet}function kt(){t.config.noCalendar||t.isMobile||(R(),Ri(),N())}function xt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function mi(U){U.preventDefault(),U.stopPropagation();var Y=function(He){return He.classList&&He.classList.contains("flatpickr-day")&&!He.classList.contains("flatpickr-disabled")&&!He.classList.contains("notAllowed")},te=Y1(yn(U),Y);if(te!==void 0){var oe=te,Te=t.latestSelectedDateObj=new Date(oe.dateObj.getTime()),Ee=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=oe,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Ie=ii(Te);Ie?t.selectedDates.splice(parseInt(Ie),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),kn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(He,_t){return He.getTime()-_t.getTime()}));if(c(),Ee){var Me=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),Me&&(Ge("onYearChange"),R()),Ge("onMonthChange")}if(Ri(),N(),Yt(),!Ee&&t.config.mode!=="range"&&t.config.showMonths===1?O(oe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ue=t.config.mode==="single"&&!t.config.enableTime,Ne=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ue||Ne)&&xt()}_()}}var pt={locale:[ie,G],showMonths:[W,r,ne],minDate:[k],maxDate:[k],positionElement:[Fi],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Kn(U,Y){if(U!==null&&typeof U=="object"){Object.assign(t.config,U);for(var te in U)pt[te]!==void 0&&pt[te].forEach(function(oe){return oe()})}else t.config[U]=Y,pt[U]!==void 0?pt[U].forEach(function(oe){return oe()}):$r.indexOf(U)>-1&&(t.config[U]=Cr(Y));t.redraw(),Yt(!0)}function ls(U,Y){var te=[];if(U instanceof Array)te=U.map(function(oe){return t.parseDate(oe,Y)});else if(U instanceof Date||typeof U=="number")te=[t.parseDate(U,Y)];else if(typeof U=="string")switch(t.config.mode){case"single":case"time":te=[t.parseDate(U,Y)];break;case"multiple":te=U.split(t.config.conjunction).map(function(oe){return t.parseDate(oe,Y)});break;case"range":te=U.split(t.l10n.rangeSeparator).map(function(oe){return t.parseDate(oe,Y)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(U)));t.selectedDates=t.config.allowInvalidPreload?te:te.filter(function(oe){return oe instanceof Date&&$e(oe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(oe,Te){return oe.getTime()-Te.getTime()})}function Nl(U,Y,te){if(Y===void 0&&(Y=!1),te===void 0&&(te=t.config.dateFormat),U!==0&&!U||U instanceof Array&&U.length===0)return t.clear(Y);ls(U,te),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),k(void 0,Y),d(),t.selectedDates.length===0&&t.clear(!1),Yt(Y),Y&&Ge("onChange")}function hi(U){return U.slice().map(function(Y){return typeof Y=="string"||typeof Y=="number"||Y instanceof Date?t.parseDate(Y,void 0,!0):Y&&typeof Y=="object"&&Y.from&&Y.to?{from:t.parseDate(Y.from,void 0),to:t.parseDate(Y.to,void 0)}:Y}).filter(function(Y){return Y})}function os(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var U=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);U&&ls(U,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 Fl(){if(t.input=Pe(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ot(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Fi()}function Fi(){t._positionElement=t.config.positionElement||t._input}function rs(){var U=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ot("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=U,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=U==="datetime-local"?"Y-m-d\\TH:i:S":U==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(Y){t.setDate(yn(Y).value,!1,t.mobileFormatStr),Ge("onChange"),Ge("onClose")})}function un(U){if(t.isOpen===!0)return t.close();t.open(U)}function Ge(U,Y){if(t.config!==void 0){var te=t.config[U];if(te!==void 0&&te.length>0)for(var oe=0;te[oe]&&oe<te.length;oe++)te[oe](t.selectedDates,t.input.value,t,Y);U==="onChange"&&(t.input.dispatchEvent(as("change")),t.input.dispatchEvent(as("input")))}}function as(U){var Y=document.createEvent("Event");return Y.initEvent(U,!0,!0),Y}function ii(U){for(var Y=0;Y<t.selectedDates.length;Y++){var te=t.selectedDates[Y];if(te instanceof Date&&kn(te,U)===0)return""+Y}return!1}function us(U){return t.config.mode!=="range"||t.selectedDates.length<2?!1:kn(U,t.selectedDates[0])>=0&&kn(U,t.selectedDates[1])<=0}function Ri(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(U,Y){var te=new Date(t.currentYear,t.currentMonth,1);te.setMonth(t.currentMonth+Y),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[Y].textContent=No(te.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=te.getMonth().toString(),U.value=te.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 qi(U){var Y=U||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(te){return t.formatDate(te,Y)}).filter(function(te,oe,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(te)===oe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Yt(U){U===void 0&&(U=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=qi(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=qi(t.config.altFormat)),U!==!1&&Ge("onValueUpdate")}function en(U){var Y=yn(U),te=t.prevMonthNav.contains(Y),oe=t.nextMonthNav.contains(Y);te||oe?Z(te?-1:1):t.yearElements.indexOf(Y)>=0?Y.select():Y.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):Y.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rl(U){U.preventDefault();var Y=U.type==="keydown",te=yn(U),oe=te;t.amPM!==void 0&&te===t.amPM&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(oe.getAttribute("min")),Ee=parseFloat(oe.getAttribute("max")),Ie=parseFloat(oe.getAttribute("step")),Me=parseInt(oe.value,10),Ue=U.delta||(Y?U.which===38?1:-1:0),Ne=Me+Ie*Ue;if(typeof oe.value<"u"&&oe.value.length===2){var He=oe===t.hourElement,_t=oe===t.minuteElement;Ne<Te?(Ne=Ee+Ne+En(!He)+(En(He)&&En(!t.amPM)),_t&&$(void 0,-1,t.hourElement)):Ne>Ee&&(Ne=oe===t.hourElement?Ne-Ee-En(!t.amPM):Te,_t&&$(void 0,1,t.hourElement)),t.amPM&&He&&(Ie===1?Ne+Me===23:Math.abs(Ne-Me)>Ie)&&(t.amPM.textContent=t.l10n.amPM[En(t.amPM.textContent===t.l10n.amPM[0])]),oe.value=fn(Ne)}}return s(),t}function Ss(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=r$(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Ss(this,n)},HTMLElement.prototype.flatpickr=function(n){return Ss([this],n)});var Rt=function(n,e){return typeof n=="string"?Ss(window.document.querySelectorAll(n),e):n instanceof Node?Ss([n],e):Ss(n,e)};Rt.defaultConfig={};Rt.l10ns={en:Kt({},vl),default:Kt({},vl)};Rt.localize=function(n){Rt.l10ns.default=Kt(Kt({},Rt.l10ns.default),n)};Rt.setDefaults=function(n){Rt.defaultConfig=Kt(Kt({},Rt.defaultConfig),n)};Rt.parseDate=da({});Rt.formatDate=K1({});Rt.compareDates=kn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Ss(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Rt);function a$(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=Le(i,t[s]);return{c(){e=v("input"),xn(e,i)},m(s,l){S(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){xn(e,i=bt(t,[l&2&&s[1]]))},d(s){s&&w(e),n[11](null)}}}function u$(n){let e;const t=n[10].default,i=Et(t,n,n[9],null),s=i||a$(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)&&It(i,t,l,l[9],e?At(t,l[9],o,null):Pt(l[9]),null):s&&s.p&&(!e||o&3)&&s.p(l,e?o:-1)},i(l){e||(A(s,l),e=!0)},o(l){I(s,l),e=!1},d(l){s&&s.d(l)}}}function f$(n){return n.charAt(2).toLowerCase()+n.substring(3)}function Gc(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function Xc(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function c$(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Je(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,p=!1,{input:h=void 0,flatpickr:g=void 0}=e;Qt(()=>{const $=f??h,M=y(d);return M.onReady.push((C,O,E)=>{a===void 0&&k(C,O,E),rn().then(()=>{t(8,p=!0)})}),t(3,g=Rt($,Object.assign(M,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=vt();function y($={}){$=Object.assign({},$);for(const M of r){const C=(O,E,P)=>{_(f$(M),[O,E,P])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(C)):$[M]=[C]}return $.onChange&&!$.onChange.includes(k)&&$.onChange.push(k),$}function k($,M,C){const O=Gc(C,$);!Xc(a,O)&&(a||O)&&t(2,a=O),t(4,u=M)}function T($){se[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Le(Le({},e),jt($)),t(1,s=Je(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,g=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&p&&(Xc(a,Gc(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&p)for(const[$,M]of Object.entries(y(d)))g.set($,M)},[h,s,a,g,u,f,c,d,p,o,l,T]}class nu extends ve{constructor(e){super(),be(this,e,c$,u$,_e,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function d$(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[12],options:H.defaultFlatpickrOptions(),value:n[0].options.min};return n[0].options.min!==void 0&&(u.formattedValue=n[0].options.min),l=new nu({props:u}),se.push(()=>ge(l,"formattedValue",a)),{c(){e=v("label"),t=B("Min date (UTC)"),s=D(),V(l.$$.fragment),m(e,"for",i=n[12])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4096&&i!==(i=f[12]))&&m(e,"for",i);const d={};c&4096&&(d.id=f[12]),c&1&&(d.value=f[0].options.min),!o&&c&1&&(o=!0,d.formattedValue=f[0].options.min,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function p$(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[12],options:H.defaultFlatpickrOptions(),value:n[0].options.max};return n[0].options.max!==void 0&&(u.formattedValue=n[0].options.max),l=new nu({props:u}),se.push(()=>ge(l,"formattedValue",a)),{c(){e=v("label"),t=B("Max date (UTC)"),s=D(),V(l.$$.fragment),m(e,"for",i=n[12])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4096&&i!==(i=f[12]))&&m(e,"for",i);const d={};c&4096&&(d.id=f[12]),c&1&&(d.value=f[0].options.max),!o&&c&1&&(o=!0,d.formattedValue=f[0].options.max,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function m$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[d$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[p$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(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),b(e,t),q(i,t,null),b(e,s),b(e,l),q(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 c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&12289&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function h$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[m$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function _$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(_){n.$$.not_equal(l.options.min,_)&&(l.options.min=_,t(0,l))}function a(_){n.$$.not_equal(l.options.max,_)&&(l.options.max=_,t(0,l))}function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(2,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,p,h,g]}class g$ extends ve{constructor(e){super(),be(this,e,_$,h$,_e,{field:0,key:1})}}const b$=n=>({}),Qc=n=>({});function xc(n,e,t){const i=n.slice();return i[46]=e[t],i}const v$=n=>({}),ed=n=>({});function td(n,e,t){const i=n.slice();return i[46]=e[t],i[50]=t,i}function nd(n){let e,t,i;return{c(){e=v("div"),t=B(n[2]),i=D(),m(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5])},m(s,l){S(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&32&&Q(e,"link-hint",!s[5])},d(s){s&&w(e)}}}function y$(n){let e,t=n[46]+"",i;return{c(){e=v("span"),i=B(t),m(e,"class","txt")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[46]+"")&&le(i,t)},i:X,o:X,d(s){s&&w(e)}}}function k$(n){let e,t,i;const s=[{item:n[46]},n[9]];var l=n[8];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Le(a,s[u]);return{props:a}}return l&&(e=$t(l,o())),{c(){e&&V(e.$$.fragment),t=we()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&513?bt(s,[a[0]&1&&{item:r[46]},a[0]&512&&Vt(r[9])]):{};if(a[0]&256&&l!==(l=r[8])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{j(f,1)}),ae()}l?(e=$t(l,o()),V(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function id(n){let e,t,i;function s(){return n[34](n[46])}return{c(){e=v("span"),e.innerHTML='<i class="ri-close-line"></i>',m(e,"class","clear")},m(l,o){S(l,e,o),t||(i=[De(ze.call(null,e,"Clear")),K(e,"click",$n(ft(s)))],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Ae(i)}}}function sd(n){let e,t,i,s,l,o;const r=[k$,y$],a=[];function u(c,d){return c[8]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&id(n);return{c(){e=v("div"),i.c(),s=D(),f&&f.c(),l=D(),m(e,"class","option")},m(c,d){S(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let p=t;t=u(c),t===p?a[t].p(c,d):(re(),I(a[p],1,1,()=>{a[p]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[6]?f?f.p(c,d):(f=id(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&w(e),a[t].d(),f&&f.d()}}}function ld(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[18],$$slots:{default:[T$]},$$scope:{ctx:n}};return e=new qn({props:i}),n[39](e),e.$on("show",n[24]),e.$on("hide",n[40]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&262144&&(o.trigger=s[18]),l[0]&1612938|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[39](null),j(e,s)}}}function od(n){let e,t,i,s,l,o,r,a,u=n[15].length&&rd(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='<i class="ri-search-line"></i>',s=D(),l=v("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,c){S(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),ue(l,n[15]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=K(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&m(l,"placeholder",f[3]),c[0]&32768&&l.value!==f[15]&&ue(l,f[15]),f[15].length?u?u.p(f,c):(u=rd(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 rd(n){let e,t,i,s;return{c(){e=v("div"),t=v("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),b(e,t),i||(s=K(t,"click",$n(ft(n[21]))),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function ad(n){let e,t=n[1]&&ud(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=ud(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function ud(n){let e,t;return{c(){e=v("div"),t=B(n[1]),m(e,"class","txt-missing")},m(i,s){S(i,e,s),b(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&w(e)}}}function w$(n){let e=n[46]+"",t;return{c(){t=B(e)},m(i,s){S(i,t,s)},p(i,s){s[0]&1048576&&e!==(e=i[46]+"")&&le(t,e)},i:X,o:X,d(i){i&&w(t)}}}function S$(n){let e,t,i;const s=[{item:n[46]},n[11]];var l=n[10];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=Le(a,s[u]);return{props:a}}return l&&(e=$t(l,o())),{c(){e&&V(e.$$.fragment),t=we()},m(r,a){e&&q(e,r,a),S(r,t,a),i=!0},p(r,a){const u=a[0]&1050624?bt(s,[a[0]&1048576&&{item:r[46]},a[0]&2048&&Vt(r[11])]):{};if(a[0]&1024&&l!==(l=r[10])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{j(f,1)}),ae()}l?(e=$t(l,o()),V(e.$$.fragment),A(e.$$.fragment,1),q(e,t.parentNode,t)):e=null}else l&&e.$set(u)},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&w(t),e&&j(e,r)}}}function fd(n){let e,t,i,s,l,o,r;const a=[S$,w$],u=[];function f(p,h){return p[10]?0:1}t=f(n),i=u[t]=a[t](n);function c(...p){return n[37](n[46],...p)}function d(...p){return n[38](n[46],...p)}return{c(){e=v("div"),i.c(),s=D(),m(e,"tabindex","0"),m(e,"class","dropdown-item option"),Q(e,"closable",n[7]),Q(e,"selected",n[19](n[46]))},m(p,h){S(p,e,h),u[t].m(e,null),b(e,s),l=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(p,h){n=p;let g=t;t=f(n),t===g?u[t].p(n,h):(re(),I(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||h[0]&128)&&Q(e,"closable",n[7]),(!l||h[0]&1572864)&&Q(e,"selected",n[19](n[46]))},i(p){l||(A(i),l=!0)},o(p){I(i),l=!1},d(p){p&&w(e),u[t].d(),o=!1,Ae(r)}}}function T$(n){let e,t,i,s,l,o=n[12]&&od(n);const r=n[33].beforeOptions,a=Et(r,n,n[42],ed);let u=n[20],f=[];for(let g=0;g<u.length;g+=1)f[g]=fd(xc(n,u,g));const c=g=>I(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=ad(n));const p=n[33].afterOptions,h=Et(p,n,n[42],Qc);return{c(){o&&o.c(),e=D(),a&&a.c(),t=D(),i=v("div");for(let g=0;g<f.length;g+=1)f[g].c();d&&d.c(),s=D(),h&&h.c(),m(i,"class","options-list")},m(g,_){o&&o.m(g,_),S(g,e,_),a&&a.m(g,_),S(g,t,_),S(g,i,_);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(i,null);d&&d.m(i,null),S(g,s,_),h&&h.m(g,_),l=!0},p(g,_){if(g[12]?o?o.p(g,_):(o=od(g),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||_[1]&2048)&&It(a,r,g,g[42],l?At(r,g[42],_,v$):Pt(g[42]),ed),_[0]&14158978){u=g[20];let y;for(y=0;y<u.length;y+=1){const k=xc(g,u,y);f[y]?(f[y].p(k,_),A(f[y],1)):(f[y]=fd(k),f[y].c(),A(f[y],1),f[y].m(i,null))}for(re(),y=u.length;y<f.length;y+=1)c(y);ae(),!u.length&&d?d.p(g,_):u.length?d&&(d.d(1),d=null):(d=ad(g),d.c(),d.m(i,null))}h&&h.p&&(!l||_[1]&2048)&&It(h,p,g,g[42],l?At(p,g[42],_,b$):Pt(g[42]),Qc)},i(g){if(!l){A(a,g);for(let _=0;_<u.length;_+=1)A(f[_]);A(h,g),l=!0}},o(g){I(a,g),f=f.filter(Boolean);for(let _=0;_<f.length;_+=1)I(f[_]);I(h,g),l=!1},d(g){o&&o.d(g),g&&w(e),a&&a.d(g),g&&w(t),g&&w(i),at(f,g),d&&d.d(),g&&w(s),h&&h.d(g)}}}function $$(n){let e,t,i,s,l,o,r=H.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=sd(td(n,r,d));const u=d=>I(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=nd(n));let c=!n[5]&&ld(n);return{c(){e=v("div"),t=v("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=D(),c&&c.c(),m(t,"tabindex",i=n[5]?"-1":"0"),m(t,"class","selected-container"),Q(t,"disabled",n[5]),m(e,"class",l="select "+n[13]),Q(e,"multiple",n[4]),Q(e,"disabled",n[5])},m(d,p){S(d,e,p),b(e,t);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(t,null);f&&f.m(t,null),n[35](t),b(e,s),c&&c.m(e,null),n[41](e),o=!0},p(d,p){if(p[0]&17269){r=H.toArray(d[0]);let h;for(h=0;h<r.length;h+=1){const g=td(d,r,h);a[h]?(a[h].p(g,p),A(a[h],1)):(a[h]=sd(g),a[h].c(),A(a[h],1),a[h].m(t,null))}for(re(),h=r.length;h<a.length;h+=1)u(h);ae(),!r.length&&f?f.p(d,p):r.length?f&&(f.d(1),f=null):(f=nd(d),f.c(),f.m(t,null))}(!o||p[0]&32&&i!==(i=d[5]?"-1":"0"))&&m(t,"tabindex",i),(!o||p[0]&32)&&Q(t,"disabled",d[5]),d[5]?c&&(re(),I(c,1,1,()=>{c=null}),ae()):c?(c.p(d,p),p[0]&32&&A(c,1)):(c=ld(d),c.c(),A(c,1),c.m(e,null)),(!o||p[0]&8192&&l!==(l="select "+d[13]))&&m(e,"class",l),(!o||p[0]&8208)&&Q(e,"multiple",d[4]),(!o||p[0]&8224)&&Q(e,"disabled",d[5])},i(d){if(!o){for(let p=0;p<r.length;p+=1)A(a[p]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let p=0;p<a.length;p+=1)I(a[p]);I(c),o=!1},d(d){d&&w(e),at(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}function C$(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 M$(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:p=!1}=e,{selected:h=d?[]:void 0}=e,{toggle:g=d}=e,{closable:_=!0}=e,{labelComponent:y=void 0}=e,{labelComponentProps:k={}}=e,{optionComponent:T=void 0}=e,{optionComponentProps:$={}}=e,{searchable:M=!1}=e,{searchFunc:C=void 0}=e,{class:O=""}=e,E,P="",L,F;function N(ee){if(H.isEmpty(h))return;let Fe=H.toArray(h);H.inArray(Fe,ee)&&(H.removeByValue(Fe,ee),t(0,h=Fe)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function R(ee){if(d){let Fe=H.toArray(h);H.inArray(Fe,ee)||t(0,h=[...Fe,ee])}else t(0,h=ee);L==null||L.dispatchEvent(new CustomEvent("change",{detail:h,bubbles:!0}))}function z(ee){return s(ee)?N(ee):R(ee)}function W(){t(0,h=d?[]:void 0)}function J(){E!=null&&E.show&&(E==null||E.show())}function x(){E!=null&&E.hide&&(E==null||E.hide())}function ne(){if(H.isEmpty(h)||H.isEmpty(c))return;let ee=H.toArray(h),Fe=[];for(const tt of ee)H.inArray(c,tt)||Fe.push(tt);if(Fe.length){for(const tt of Fe)H.removeByValue(ee,tt);t(0,h=d?ee:ee[0])}}function G(){t(15,P="")}function fe(ee,Fe){ee=ee||[];const tt=C||C$;return ee.filter(Wt=>tt(Wt,Fe))||[]}function Z(ee,Fe){ee.preventDefault(),g&&d?z(Fe):R(Fe)}function ce(ee,Fe){(ee.code==="Enter"||ee.code==="Space")&&Z(ee,Fe)}function he(){G(),setTimeout(()=>{const ee=L==null?void 0:L.querySelector(".dropdown-item.option.selected");ee&&(ee.focus(),ee.scrollIntoView({block:"nearest"}))},0)}function Ce(ee){ee.stopPropagation(),!p&&(E==null||E.toggle())}Qt(()=>{const ee=document.querySelectorAll(`label[for="${r}"]`);for(const Fe of ee)Fe.addEventListener("click",Ce);return()=>{for(const Fe of ee)Fe.removeEventListener("click",Ce)}});const Re=ee=>N(ee);function je(ee){se[ee?"unshift":"push"](()=>{F=ee,t(18,F)})}function ye(){P=this.value,t(15,P)}const $e=(ee,Fe)=>Z(Fe,ee),Ye=(ee,Fe)=>ce(Fe,ee);function dt(ee){se[ee?"unshift":"push"](()=>{E=ee,t(16,E)})}function Ke(ee){de.call(this,n,ee)}function Be(ee){se[ee?"unshift":"push"](()=>{L=ee,t(17,L)})}return n.$$set=ee=>{"id"in ee&&t(25,r=ee.id),"noOptionsText"in ee&&t(1,a=ee.noOptionsText),"selectPlaceholder"in ee&&t(2,u=ee.selectPlaceholder),"searchPlaceholder"in ee&&t(3,f=ee.searchPlaceholder),"items"in ee&&t(26,c=ee.items),"multiple"in ee&&t(4,d=ee.multiple),"disabled"in ee&&t(5,p=ee.disabled),"selected"in ee&&t(0,h=ee.selected),"toggle"in ee&&t(6,g=ee.toggle),"closable"in ee&&t(7,_=ee.closable),"labelComponent"in ee&&t(8,y=ee.labelComponent),"labelComponentProps"in ee&&t(9,k=ee.labelComponentProps),"optionComponent"in ee&&t(10,T=ee.optionComponent),"optionComponentProps"in ee&&t(11,$=ee.optionComponentProps),"searchable"in ee&&t(12,M=ee.searchable),"searchFunc"in ee&&t(27,C=ee.searchFunc),"class"in ee&&t(13,O=ee.class),"$$scope"in ee&&t(42,o=ee.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&67108864&&c&&(ne(),G()),n.$$.dirty[0]&67141632&&t(20,i=fe(c,P)),n.$$.dirty[0]&1&&t(19,s=function(ee){const Fe=H.toArray(h);return H.inArray(Fe,ee)})},[h,a,u,f,d,p,g,_,y,k,T,$,M,O,N,P,E,L,F,s,i,G,Z,ce,he,r,c,C,R,z,W,J,x,l,Re,je,ye,$e,Ye,dt,Ke,Be,o]}class iu extends ve{constructor(e){super(),be(this,e,M$,$$,_e,{id:25,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:26,multiple:4,disabled:5,selected:0,toggle:6,closable:7,labelComponent:8,labelComponentProps:9,optionComponent:10,optionComponentProps:11,searchable:12,searchFunc:27,class:13,deselectItem:14,selectItem:28,toggleItem:29,reset:30,showDropdown:31,hideDropdown:32},null,[-1,-1])}get deselectItem(){return this.$$.ctx[14]}get selectItem(){return this.$$.ctx[28]}get toggleItem(){return this.$$.ctx[29]}get reset(){return this.$$.ctx[30]}get showDropdown(){return this.$$.ctx[31]}get hideDropdown(){return this.$$.ctx[32]}}function cd(n){let e,t;return{c(){e=v("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 O$(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&&cd(n);return{c(){l&&l.c(),e=D(),t=v("span"),s=B(i),m(t,"class","txt")},m(o,r){l&&l.m(o,r),S(o,e,r),S(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=cd(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:X,o:X,d(o){l&&l.d(o),o&&w(e),o&&w(t)}}}function D$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class dd extends ve{constructor(e){super(),be(this,e,D$,O$,_e,{item:0})}}const E$=n=>({}),pd=n=>({});function A$(n){let e;const t=n[8].afterOptions,i=Et(t,n,n[12],pd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&It(i,t,s,s[12],e?At(t,s[12],l,E$):Pt(s[12]),pd)},i(s){e||(A(i,s),e=!0)},o(s){I(i,s),e=!1},d(s){i&&i.d(s)}}}function I$(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:[A$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new iu({props:o}),se.push(()=>ge(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?bt(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Vt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function P$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Je(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=dd}=e,{optionComponent:c=dd}=e,{selectionKey:d="value"}=e,{keyOfSelected:p=a?[]:void 0}=e;function h(T){T=H.toArray(T,!0);let $=[];for(let M of T){const C=H.findByKey(r,d,M);C&&$.push(C)}T.length&&!$.length||t(0,u=a?$:$[0])}async function g(T){let $=H.toArray(T,!0).map(M=>M[d]);r.length&&t(6,p=a?$:$[0])}function _(T){u=T,t(0,u)}function y(T){de.call(this,n,T)}function k(T){de.call(this,n,T)}return n.$$set=T=>{e=Le(Le({},e),jt(T)),t(5,s=Je(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,p=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(p),n.$$.dirty&1&&g(u)},[u,r,a,f,c,s,p,d,l,_,y,k,o]}class Li extends ve{constructor(e){super(),be(this,e,P$,I$,_e,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function L$(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,disabled:!n[18]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Fs({props:a}),se.push(()=>ge(t,"value",r)),{c(){e=v("div"),V(t.$$.fragment)},m(u,f){S(u,e,f),q(t,e,null),s=!0,l||(o=De(ze.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&131072&&(c.id=u[17]),f&262144&&(c.disabled=!u[18]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ke(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){I(t.$$.fragment,u),s=!1},d(u){u&&w(e),j(t),l=!1,o()}}}function N$(n){let e,t,i;function s(o){n[8](o)}let l={id:n[17],items:n[3],disabled:!n[18]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&131072&&(a.id=o[17]),r&262144&&(a.disabled=!o[18]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function F$(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[18]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[L$,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[18]?"":"disabled"),inlineError:!0,$$slots:{default:[N$,({uniqueId:l})=>({17:l}),({uniqueId:l})=>l?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o&262144&&(r.class="form-field required "+(l[18]?"":"disabled")),o&2&&(r.name="schema."+l[1]+".options.values"),o&917505&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o&262144&&(a.class="form-field form-field-single-multiple-select "+(l[18]?"":"disabled")),o&917508&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function md(n){let e,t;return e=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[R$,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(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||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function R$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=K(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&&ht(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function q$(n){let e,t,i=!n[2]&&md(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&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=md(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function j$(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[q$],default:[F$,({interactive:r})=>({18:r}),({interactive:r})=>r?262144:0]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&18?bt(s,[a&2&&{key:r[1]},a&16&&Vt(r[4])]):{};a&786439&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function V$(n,e,t){var M;const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((M=l.options)==null?void 0:M.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=ht(this.value),t(0,l),t(5,u),t(2,a)}function d(C){n.$$.not_equal(l.options.values,C)&&(l.options.values=C,t(0,l),t(5,u),t(2,a))}function p(C){a=C,t(2,a)}function h(C){l=C,t(0,l),t(5,u),t(2,a)}function g(C){de.call(this,n,C)}function _(C){de.call(this,n,C)}function y(C){de.call(this,n,C)}function k(C){de.call(this,n,C)}function T(C){de.call(this,n,C)}function $(C){de.call(this,n,C)}return n.$$set=C=>{e=Le(Le({},e),jt(C)),t(4,s=Je(e,i)),"field"in C&&t(0,l=C.field),"key"in C&&t(1,o=C.key)},n.$$.update=()=>{var C,O;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((O=(C=l.options)==null?void 0:C.values)==null?void 0:O.length)||2,l)),n.$$.dirty&1&&H.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,p,h,g,_,y,k,T,$]}class H$ extends ve{constructor(e){super(),be(this,e,V$,j$,_e,{field:0,key:1})}}function z$(n){let e;return{c(){e=v("i"),m(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function B$(n){let e;return{c(){e=v("i"),m(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function hd(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O='"{"a":1,"b":2}"',E,P,L,F,N,R,z,W,J,x,ne,G,fe;return{c(){e=v("div"),t=v("div"),i=v("div"),s=B("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=B(` and
`),r=v("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=B(` field
is a
`),c=v("strong"),c.textContent="plain string",d=B(`:
`),p=v("ul"),h=v("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=D(),_=v("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=D(),k=v("li"),k.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=D(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),C=v("li"),E=B(O),P=B(" is converted to the json "),L=v("code"),L.textContent='{"a":1,"b":2}',F=D(),N=v("li"),N.textContent="numeric strings are converted to json number",R=D(),z=v("li"),z.textContent="double quoted strings are left as they are (aka. without normalizations)",W=D(),J=v("li"),J.textContent="any other string (empty string too) is double quoted",x=B(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),ne=v("code"),ne.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(Z,ce){S(Z,e,ce),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(p,h),b(p,g),b(p,_),b(p,y),b(p,k),b(p,T),b(p,$),b(p,M),b(p,C),b(C,E),b(C,P),b(C,L),b(p,F),b(p,N),b(p,R),b(p,z),b(p,W),b(p,J),b(i,x),b(i,ne),fe=!0},i(Z){fe||(Z&&et(()=>{fe&&(G||(G=qe(e,Mt,{duration:150},!0)),G.run(1))}),fe=!0)},o(Z){Z&&(G||(G=qe(e,Mt,{duration:150},!1)),G.run(0)),fe=!1},d(Z){Z&&w(e),Z&&G&&G.end()}}}function U$(n){let e,t,i,s,l,o,r;function a(d,p){return d[2]?B$:z$}let u=a(n),f=u(n),c=n[2]&&hd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),c&&c.c(),l=we(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,p){S(d,e,p),b(e,t),b(e,i),f.m(e,null),S(d,s,p),c&&c.m(d,p),S(d,l,p),o||(r=K(e,"click",n[4]),o=!0)},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?p&4&&A(c,1):(c=hd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function W$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[U$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(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(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?bt(s,[a&2&&{key:r[1]},a&8&&Vt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function Y$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(3,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,r,s,a,u,f,c,d,p,h,g]}class K$ extends ve{constructor(e){super(),be(this,e,Y$,W$,_e,{field:0,key:1})}}function J$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=B(t),s=D(),l=v("small"),r=B(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){S(a,e,u),b(e,i),S(a,s,u),S(a,l,u),b(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:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function Z$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class _d extends ve{constructor(e){super(),be(this,e,Z$,J$,_e,{item:0})}}const G$=[{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 X$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[25],items:n[4],disabled:!n[26]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&33554432&&(a.id=o[25]),r&67108864&&(a.disabled=!o[26]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Q$(n){let e,t;return e=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[26]?"":"disabled"),inlineError:!0,$$slots:{default:[X$,({uniqueId:i})=>({25:i}),({uniqueId:i})=>i?33554432:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&67108864&&(l.class="form-field form-field-single-multiple-select "+(i[26]?"":"disabled")),s&234881028&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function x$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',s=D(),l=v("button"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=D(),r=v("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,c){S(f,e,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),S(f,o,c),S(f,r,c),a||(u=[K(e,"click",n[8]),K(i,"click",n[9]),K(l,"click",n[10]),K(r,"click",n[11])],a=!0)},p:X,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,Ae(u)}}}function eC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T;function $(C){n[7](C)}let M={id:n[25],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:_d,optionComponent:_d};return n[0].options.mimeTypes!==void 0&&(M.keyOfSelected=n[0].options.mimeTypes),r=new Li({props:M}),se.push(()=>ge(r,"keyOfSelected",$)),_=new qn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[x$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",p=D(),h=v("i"),g=D(),V(_.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[25]),m(d,"class","txt link-primary"),m(h,"class","ri-arrow-drop-down-fill"),m(c,"type","button"),m(c,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(C,O){S(C,e,O),b(e,t),b(e,i),b(e,s),S(C,o,O),q(r,C,O),S(C,u,O),S(C,f,O),b(f,c),b(c,d),b(c,p),b(c,h),b(c,g),q(_,c,null),y=!0,k||(T=De(ze.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),k=!0)},p(C,O){(!y||O&33554432&&l!==(l=C[25]))&&m(e,"for",l);const E={};O&33554432&&(E.id=C[25]),O&8&&(E.items=C[3]),!a&&O&1&&(a=!0,E.keyOfSelected=C[0].options.mimeTypes,ke(()=>a=!1)),r.$set(E);const P={};O&134217729&&(P.$$scope={dirty:O,ctx:C}),_.$set(P)},i(C){y||(A(r.$$.fragment,C),A(_.$$.fragment,C),y=!0)},o(C){I(r.$$.fragment,C),I(_.$$.fragment,C),y=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(_),k=!1,T()}}}function tC(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,m(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function nC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;function C(E){n[12](E)}let O={id:n[25],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Fs({props:O}),se.push(()=>ge(r,"value",C)),k=new qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[tC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),p=v("button"),h=v("span"),h.textContent="Supported formats",g=D(),_=v("i"),y=D(),V(k.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[25]),m(c,"class","txt"),m(h,"class","txt link-primary"),m(_,"class","ri-arrow-drop-down-fill"),m(p,"type","button"),m(p,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(e,i),b(e,s),S(E,o,P),q(r,E,P),S(E,u,P),S(E,f,P),b(f,c),b(f,d),b(f,p),b(p,h),b(p,g),b(p,_),b(p,y),q(k,p,null),T=!0,$||(M=De(ze.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(E,P){(!T||P&33554432&&l!==(l=E[25]))&&m(e,"for",l);const L={};P&33554432&&(L.id=E[25]),!a&&P&1&&(a=!0,L.value=E[0].options.thumbs,ke(()=>a=!1)),r.$set(L);const F={};P&134217728&&(F.$$scope={dirty:P,ctx:E}),k.$set(F)},i(E){T||(A(r.$$.fragment,E),A(k.$$.fragment,E),T=!0)},o(E){I(r.$$.fragment,E),I(k.$$.fragment,E),T=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(k),$=!1,M()}}}function iC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Max file size"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Must be in bytes.",m(e,"for",i=n[25]),m(l,"type","number"),m(l,"id",o=n[25]),m(l,"step","1"),m(l,"min","0"),m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[0].options.maxSize),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[13]),u=!0)},p(c,d){d&33554432&&i!==(i=c[25])&&m(e,"for",i),d&33554432&&o!==(o=c[25])&&m(l,"id",o),d&1&&ht(l.value)!==c[0].options.maxSize&&ue(l,c[0].options.maxSize)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function gd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[sC,({uniqueId:s})=>({25:s}),({uniqueId:s})=>s?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","col-sm-3")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&167772161&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function sC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"id",o=n[25]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[eC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[nC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[iC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}});let h=!n[2]&&gd(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),a=D(),u=v("div"),V(f.$$.fragment),d=D(),h&&h.c(),m(t,"class","col-sm-12"),m(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),m(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),m(e,"class","grid grid-sm")},m(g,_){S(g,e,_),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,a),b(e,u),q(f,u,null),b(e,d),h&&h.m(e,null),p=!0},p(g,_){const y={};_&2&&(y.name="schema."+g[1]+".options.mimeTypes"),_&167772169&&(y.$$scope={dirty:_,ctx:g}),i.$set(y);const k={};_&2&&(k.name="schema."+g[1]+".options.thumbs"),_&167772161&&(k.$$scope={dirty:_,ctx:g}),o.$set(k),(!p||_&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&m(l,"class",r);const T={};_&2&&(T.name="schema."+g[1]+".options.maxSize"),_&167772161&&(T.$$scope={dirty:_,ctx:g}),f.$set(T),(!p||_&4&&c!==(c=g[2]?"col-sm-4":"col-sm-3"))&&m(u,"class",c),g[2]?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(g,_),_&4&&A(h,1)):(h=gd(g),h.c(),A(h,1),h.m(e,null))},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(f.$$.fragment,g),A(h),p=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(f.$$.fragment,g),I(h),p=!1},d(g){g&&w(e),j(i),j(o),j(f),h&&h.d()}}}function oC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[16](r)}let o={$$slots:{options:[lC],default:[Q$,({interactive:r})=>({26:r}),({interactive:r})=>r?67108864:0]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[17]),e.$on("remove",n[18]),e.$on("drop",n[19]),e.$on("dragstart",n[20]),e.$on("dragenter",n[21]),e.$on("dragleave",n[22]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&34?bt(s,[a&2&&{key:r[1]},a&32&&Vt(r[5])]):{};a&201326607&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function rC(n,e,t){var R;const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=G$.slice(),u=((R=l.options)==null?void 0:R.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(H.isEmpty(l.options.mimeTypes))return;const z=[];for(const W of l.options.mimeTypes)a.find(J=>J.mimeType===W)||z.push({mimeType:W});z.length&&t(3,a=a.concat(z))}function p(z){n.$$.not_equal(l.options.mimeTypes,z)&&(l.options.mimeTypes=z,t(0,l),t(6,f),t(2,u))}const h=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},g=()=>{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)},_=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},y=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function k(z){n.$$.not_equal(l.options.thumbs,z)&&(l.options.thumbs=z,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=ht(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=ht(this.value),t(0,l),t(6,f),t(2,u)}function M(z){u=z,t(2,u)}function C(z){l=z,t(0,l),t(6,f),t(2,u)}function O(z){de.call(this,n,z)}function E(z){de.call(this,n,z)}function P(z){de.call(this,n,z)}function L(z){de.call(this,n,z)}function F(z){de.call(this,n,z)}function N(z){de.call(this,n,z)}return n.$$set=z=>{e=Le(Le({},e),jt(z)),t(5,s=Je(e,i)),"field"in z&&t(0,l=z.field),"key"in z&&t(1,o=z.key)},n.$$.update=()=>{var z,W;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((W=(z=l.options)==null?void 0:z.values)==null?void 0:W.length)||99,l)),n.$$.dirty&1&&(H.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,p,h,g,_,y,k,T,$,M,C,O,E,P,L,F,N]}class aC extends ve{constructor(e){super(),be(this,e,rC,oC,_e,{field:0,key:1})}}function uC(n){let e,t,i,s,l;return{c(){e=v("hr"),t=D(),i=v("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=K(i,"click",n[15]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function fC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33],$$slots:{afterOptions:[uC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[1]&4&&(a.disabled=!o[33]),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function cC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function dC(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[fC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[cC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function bd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[pC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),i=D(),s=v("div"),V(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(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]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=K(l,"input",n[11]),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]&1&&ht(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"step","1"),m(l,"placeholder","No max limit"),m(l,"min",r=n[0].options.minSelect||2)},m(f,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].options.maxSelect),a||(u=K(l,"input",n[12]),a=!0)},p(f,c){c[1]&2&&i!==(i=f[32])&&m(e,"for",i),c[1]&2&&o!==(o=f[32])&&m(l,"id",o),c[0]&1&&r!==(r=f[0].options.minSelect||2)&&m(l,"min",r),c[0]&1&&ht(l.value)!==f[0].options.maxSelect&&ue(l,f[0].options.maxSelect)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function hC(n){let e,t,i,s,l,o,r,a,u,f,c;function d(h){n[13](h)}let p={multiple:!0,searchable:!0,id:n[32],selectPlaceholder:"Auto",items:n[5]};return n[0].options.displayFields!==void 0&&(p.selected=n[0].options.displayFields),r=new iu({props:p}),se.push(()=>ge(r,"selected",d)),{c(){e=v("label"),t=v("span"),t.textContent="Display fields",i=D(),s=v("i"),o=D(),V(r.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[32])},m(h,g){S(h,e,g),b(e,t),b(e,i),b(e,s),S(h,o,g),q(r,h,g),u=!0,f||(c=De(ze.call(null,s,{text:"Optionally select the field(s) that will be used in the listings UI. Leave empty for auto.",position:"top"})),f=!0)},p(h,g){(!u||g[1]&2&&l!==(l=h[32]))&&m(e,"for",l);const _={};g[1]&2&&(_.id=h[32]),g[0]&32&&(_.items=h[5]),!a&&g[0]&1&&(a=!0,_.selected=h[0].options.displayFields,ke(()=>a=!1)),r.$set(_)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){I(r.$$.fragment,h),u=!1},d(h){h&&w(e),h&&w(o),j(r,h),f=!1,c()}}}function _C(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[32],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(u.keyOfSelected=n[0].options.cascadeDelete),l=new Li({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("Delete main record on relation delete"),s=D(),V(l.$$.fragment),m(e,"for",i=n[32])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&2&&i!==(i=f[32]))&&m(e,"for",i);const d={};c[1]&2&&(d.id=f[32]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].options.cascadeDelete,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function gC(n){let e,t,i,s,l,o,r,a,u=!n[2]&&bd(n);return s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[hC,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[_C,({uniqueId:f})=>({32:f}),({uniqueId:f})=>[0,f?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),u&&u.c(),t=D(),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(f,c){S(f,e,c),u&&u.m(e,null),b(e,t),b(e,i),q(s,i,null),b(e,l),b(e,o),q(r,o,null),a=!0},p(f,c){f[2]?u&&(re(),I(u,1,1,()=>{u=null}),ae()):u?(u.p(f,c),c[0]&4&&A(u,1)):(u=bd(f),u.c(),A(u,1),u.m(e,t));const d={};c[0]&2&&(d.name="schema."+f[1]+".options.displayFields"),c[0]&33|c[1]&10&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&2&&(p.name="schema."+f[1]+".options.cascadeDelete"),c[0]&1|c[1]&10&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){a||(A(u),A(s.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){I(u),I(s.$$.fragment,f),I(r.$$.fragment,f),a=!1},d(f){f&&w(e),u&&u.d(),j(s),j(r)}}}function bC(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[18](f)}let a={$$slots:{options:[gC],default:[dC,({interactive:f})=>({33:f}),({interactive:f})=>[0,f?4:0]]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=Le(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new ni({props:a}),se.push(()=>ge(e,"field",r)),e.$on("rename",n[19]),e.$on("remove",n[20]),e.$on("drop",n[21]),e.$on("dragstart",n[22]),e.$on("dragenter",n[23]),e.$on("dragleave",n[24]);let u={};return s=new su({props:u}),n[25](s),s.$on("save",n[26]),{c(){V(e.$$.fragment),i=D(),V(s.$$.fragment)},m(f,c){q(e,f,c),S(f,i,c),q(s,f,c),l=!0},p(f,c){const d=c[0]&258?bt(o,[c[0]&2&&{key:f[1]},c[0]&256&&Vt(f[8])]):{};c[0]&63|c[1]&12&&(d.$$scope={dirty:c,ctx:f}),!t&&c[0]&1&&(t=!0,d.field=f[0],ke(()=>t=!1)),e.$set(d);const p={};s.$set(p)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),I(s.$$.fragment,f),l=!1},d(f){j(e,f),f&&w(i),n[25](null),j(s,f)}}}function vC(n,e,t){var fe;let i;const s=["field","key"];let l=Je(e,s),o;We(n,Pi,Z=>t(3,o=Z));let{field:r}=e,{key:a=""}=e;const u=[{label:"Single",value:!0},{label:"Multiple",value:!1}],f=[{label:"False",value:!1},{label:"True",value:!0}],c=["id","created","updated"],d=["username","email","emailVisibility","verified"];let p=null,h=[],g=null,_=((fe=r.options)==null?void 0:fe.maxSelect)==1,y=_;function k(){t(0,r.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},r),t(2,_=!0),t(10,y=_)}function T(){var Z,ce;if(t(5,h=c.slice(0)),!!i){i.isAuth&&t(5,h=h.concat(d));for(const he of i.schema)h.push(he.name);if(((ce=(Z=r.options)==null?void 0:Z.displayFields)==null?void 0:ce.length)>0)for(let he=r.options.displayFields.length-1;he>=0;he--)h.includes(r.options.displayFields[he])||r.options.displayFields.splice(he,1)}}function $(){r.options.minSelect=ht(this.value),t(0,r),t(10,y),t(2,_)}function M(){r.options.maxSelect=ht(this.value),t(0,r),t(10,y),t(2,_)}function C(Z){n.$$.not_equal(r.options.displayFields,Z)&&(r.options.displayFields=Z,t(0,r),t(10,y),t(2,_))}function O(Z){n.$$.not_equal(r.options.cascadeDelete,Z)&&(r.options.cascadeDelete=Z,t(0,r),t(10,y),t(2,_))}const E=()=>p==null?void 0:p.show();function P(Z){n.$$.not_equal(r.options.collectionId,Z)&&(r.options.collectionId=Z,t(0,r),t(10,y),t(2,_))}function L(Z){_=Z,t(2,_)}function F(Z){r=Z,t(0,r),t(10,y),t(2,_)}function N(Z){de.call(this,n,Z)}function R(Z){de.call(this,n,Z)}function z(Z){de.call(this,n,Z)}function W(Z){de.call(this,n,Z)}function J(Z){de.call(this,n,Z)}function x(Z){de.call(this,n,Z)}function ne(Z){se[Z?"unshift":"push"](()=>{p=Z,t(4,p)})}const G=Z=>{var ce,he;(he=(ce=Z==null?void 0:Z.detail)==null?void 0:ce.collection)!=null&&he.id&&t(0,r.options.collectionId=Z.detail.collection.id,r)};return n.$$set=Z=>{e=Le(Le({},e),jt(Z)),t(8,l=Je(e,s)),"field"in Z&&t(0,r=Z.field),"key"in Z&&t(1,a=Z.key)},n.$$.update=()=>{n.$$.dirty[0]&1028&&y!=_&&(t(10,y=_),_?(t(0,r.options.minSelect=null,r),t(0,r.options.maxSelect=1,r)):t(0,r.options.maxSelect=null,r)),n.$$.dirty[0]&1&&H.isEmpty(r.options)&&k(),n.$$.dirty[0]&9&&(i=o.find(Z=>Z.id==r.options.collectionId)||null),n.$$.dirty[0]&513&&g!=r.options.collectionId&&(t(9,g=r.options.collectionId),T())},[r,a,_,o,p,h,u,f,l,g,y,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne,G]}class yC extends ve{constructor(e){super(),be(this,e,vC,bC,_e,{field:0,key:1},null,[-1,-1])}}function vd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function yd(n){let e,t,i,s,l,o,r,a;return{c(){e=B(`,
`),t=v("code"),t.textContent="username",i=B(` ,
`),s=v("code"),s.textContent="email",l=B(` ,
`),o=v("code"),o.textContent="emailVisibility",r=B(` ,
`),a=v("code"),a.textContent="verified",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 kd(n,e){let t,i,s,l,o;function r(p){e[7](p,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...p){return e[10](e[19],...p)}function f(...p){return e[11](e[19],...p)}var c=e[1][e[17].type];function d(p){let h={key:p[4](p[17])};return p[17]!==void 0&&(h.field=p[17]),{props:h}}return c&&(i=$t(c,d(e)),se.push(()=>ge(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&&V(i.$$.fragment),l=we(),this.first=t},m(p,h){S(p,t,h),i&&q(i,p,h),S(p,l,h),o=!0},p(p,h){e=p;const g={};if(h&1&&(g.key=e[4](e[17])),!s&&h&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),h&1&&c!==(c=e[1][e[17].type])){if(i){re();const _=i;I(_.$$.fragment,1,0,()=>{j(_,1)}),ae()}c?(i=$t(c,d(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),V(i.$$.fragment),A(i.$$.fragment,1),q(i,l.parentNode,l)):i=null}else c&&i.$set(g)},i(p){o||(i&&A(i.$$.fragment,p),o=!0)},o(p){i&&I(i.$$.fragment,p),o=!1},d(p){p&&w(t),p&&w(l),i&&j(i,p)}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=[],h=new Map,g,_,y,k,T,$,M,C,O=n[0].isAuth&&yd(),E=n[0].schema;const P=N=>N[17];for(let N=0;N<E.length;N+=1){let R=vd(n,E,N),z=P(R);h.set(z,p[N]=kd(z,R))}_=new _T({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function L(N){n[13](N)}let F={};return n[0]!==void 0&&(F.collection=n[0]),$=new dT({props:F}),se.push(()=>ge($,"collection",L)),{c(){e=v("div"),t=v("p"),i=B(`System fields:
`),s=v("code"),s.textContent="id",l=B(` ,
`),o=v("code"),o.textContent="created",r=B(` ,
`),a=v("code"),a.textContent="updated",u=D(),O&&O.c(),f=B(`
.`),c=D(),d=v("div");for(let N=0;N<p.length;N+=1)p[N].c();g=D(),V(_.$$.fragment),y=D(),k=v("div"),T=D(),V($.$$.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(d,"class","accordions schema-fields"),m(k,"class","clearfix m-b-base")},m(N,R){S(N,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),O&&O.m(t,null),b(t,f),S(N,c,R),S(N,d,R);for(let z=0;z<p.length;z+=1)p[z]&&p[z].m(d,null);S(N,g,R),q(_,N,R),S(N,y,R),S(N,k,R),S(N,T,R),q($,N,R),C=!0},p(N,[R]){N[0].isAuth?O||(O=yd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&119&&(E=N[0].schema,re(),p=Ct(p,R,P,1,N,E,h,d,an,kd,null,vd),ae());const z={};!M&&R&1&&(M=!0,z.collection=N[0],ke(()=>M=!1)),$.$set(z)},i(N){if(!C){for(let R=0;R<E.length;R+=1)A(p[R]);A(_.$$.fragment,N),A($.$$.fragment,N),C=!0}},o(N){for(let R=0;R<p.length;R+=1)I(p[R]);I(_.$$.fragment,N),I($.$$.fragment,N),C=!1},d(N){N&&w(e),O&&O.d(),N&&w(c),N&&w(d);for(let R=0;R<p.length;R+=1)p[R].d();N&&w(g),j(_,N),N&&w(y),N&&w(k),N&&w(T),j($,N)}}}function wC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function SC(n,e,t){let i,{collection:s=new hn}=e;const l={text:PT,number:jT,bool:zT,email:W1,url:QT,editor:t$,date:g$,select:H$,json:K$,file:aC,relation:yC};function o($){s.schema[$]&&(s.schema.splice($,1),t(0,s))}function r($="text"){const M=new gn({name:a(),type:$});M.onMountExpand=!0,s.schema.push(M),t(0,s)}function a($="field"){let M="";for(;u($+M);)++M;return $+M}function u($){return!!s.schema.find(M=>M.name===$)}function f($){return i.findIndex(M=>M===$)}function c($,M){var C;!((C=s==null?void 0:s.schema)!=null&&C.length)||$===M||!M||t(0,s.indexes=s.indexes.map(O=>H.replaceIndexColumn(O,$,M)),s)}function d($,M){if(!$)return;$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain")),O=s.schema;C<M?(O.splice(M+1,0,O[C]),O.splice(C,1)):(O.splice(M,0,O[C]),O.splice(C+1,1)),t(0,s.schema=O,s),_n({})}function p($,M,C,O){C[O]=$,t(0,s)}const h=$=>o($),g=$=>c($.detail.oldName,$.detail.newName),_=($,M)=>wC(M.detail,$),y=($,M)=>d(M.detail,$),k=$=>r($.detail);function T($){s=$,t(0,s)}return n.$$set=$=>{"collection"in $&&t(0,s=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new hn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter($=>!$.toDelete)||[])},[s,l,o,r,f,c,d,p,h,g,_,y,k,T]}class TC extends ve{constructor(e){super(),be(this,e,SC,kC,_e,{collection:0})}}const $C=n=>({isAdminOnly:n&256}),wd=n=>({isAdminOnly:n[8]});function CC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[EC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MC(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function OC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function DC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function EC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,p,h,g;function _(E,P){return E[8]?DC:OC}let y=_(n),k=y(n);function T(E){n[13](E)}var $=n[6];function M(E){let P={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(P.value=E[0]),{props:P}}$&&(c=$t($,M(n)),n[12](c),se.push(()=>ge(c,"value",T)));const C=n[11].default,O=Et(C,n,n[14],wd);return{c(){e=v("label"),t=v("span"),i=B(n[2]),s=D(),l=v("span"),r=B(o),a=D(),k.c(),f=D(),c&&V(c.$$.fragment),p=D(),h=v("div"),O&&O.c(),m(t,"class","txt"),Q(t,"txt-hint",n[8]),m(l,"class","label label-sm svelte-5uq9tk"),m(e,"for",u=n[17]),m(e,"class","svelte-5uq9tk"),m(h,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(t,i),b(e,s),b(e,l),b(l,r),b(e,a),k.m(e,null),S(E,f,P),c&&q(c,E,P),S(E,p,P),S(E,h,P),O&&O.m(h,null),g=!0},p(E,P){(!g||P&4)&&le(i,E[2]),(!g||P&256)&&Q(t,"txt-hint",E[8]),(!g||P&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),y===(y=_(E))&&k?k.p(E,P):(k.d(1),k=y(E),k&&(k.c(),k.m(e,null))),(!g||P&131072&&u!==(u=E[17]))&&m(e,"for",u);const L={};if(P&131072&&(L.id=E[17]),P&2&&(L.baseCollection=E[1]),P&256&&(L.disabled=E[8]),P&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&P&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),P&64&&$!==($=E[6])){if(c){re();const F=c;I(F.$$.fragment,1,0,()=>{j(F,1)}),ae()}$?(c=$t($,M(E)),E[12](c),se.push(()=>ge(c,"value",T)),V(c.$$.fragment),A(c.$$.fragment,1),q(c,p.parentNode,p)):c=null}else $&&c.$set(L);O&&O.p&&(!g||P&16640)&&It(O,C,E,E[14],g?At(C,E[14],P,$C):Pt(E[14]),wd)},i(E){g||(c&&A(c.$$.fragment,E),A(O,E),g=!0)},o(E){c&&I(c.$$.fragment,E),I(O,E),g=!1},d(E){E&&w(e),k.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(p),E&&w(h),O&&O.d(E)}}}function AC(n){let e,t,i,s;const l=[MC,CC],o=[];function r(a,u){return a[7]?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):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Sd;function IC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,p=Sd,h=!1;g();async function g(){p||h||(t(7,h=!0),t(6,p=(await rt(()=>import("./FilterAutocompleteInput-2b0e39bf.js"),["./FilterAutocompleteInput-2b0e39bf.js","./index-20adcf24.js"],import.meta.url)).default),Sd=p,t(7,h=!1))}async function _(){t(0,r=d||""),await rn(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k($){se[$?"unshift":"push"](()=>{c=$,t(5,c)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"$$scope"in $&&t(14,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,p,h,i,_,y,s,k,T,l]}class Ts extends ve{constructor(e){super(),be(this,e,IC,AC,_e,{collection:1,rule:0,label:2,formKey:3,required:4})}}function Td(n,e,t){const i=n.slice();return i[10]=e[t],i}function $d(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=n[2],L=[];for(let F=0;F<P.length;F+=1)L[F]=Cd(Td(n,P,F));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div");for(let F=0;F<L.length;F+=1)L[F].c();r=D(),a=v("hr"),u=D(),f=v("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=D(),d=v("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,p=D(),h=v("hr"),g=D(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=D(),k=v("div"),k.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=D(),$=v("hr"),M=D(),C=v("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,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(d,"class","inline-flex flex-gap-5"),m(h,"class","m-t-10 m-b-5"),m(_,"class","m-b-0"),m(k,"class","inline-flex flex-gap-5"),m($,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(F,N){S(F,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R<L.length;R+=1)L[R]&&L[R].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(i,h),b(i,g),b(i,_),b(i,y),b(i,k),b(i,T),b(i,$),b(i,M),b(i,C),E=!0},p(F,N){if(N&4){P=F[2];let R;for(R=0;R<P.length;R+=1){const z=Td(F,P,R);L[R]?L[R].p(z,N):(L[R]=Cd(z),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=P.length}},i(F){E||(F&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(F){F&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(F){F&&w(e),at(L,F),F&&O&&O.end()}}}function Cd(n){let e,t=n[10]+"",i;return{c(){e=v("code"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Md(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ts({props:c}),se.push(()=>ge(e,"rule",f));function d(_){n[7](_)}let p={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(p.rule=n[0].updateRule),s=new Ts({props:p}),se.push(()=>ge(s,"rule",d));function h(_){n[8](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ts({props:g}),se.push(()=>ge(r,"rule",h)),{c(){V(e.$$.fragment),i=D(),V(s.$$.fragment),o=D(),V(r.$$.fragment)},m(_,y){q(e,_,y),S(_,i,y),q(s,_,y),S(_,o,y),q(r,_,y),u=!0},p(_,y){const k={};y&1&&(k.collection=_[0]),!t&&y&1&&(t=!0,k.rule=_[0].createRule,ke(()=>t=!1)),e.$set(k);const T={};y&1&&(T.collection=_[0]),!l&&y&1&&(l=!0,T.rule=_[0].updateRule,ke(()=>l=!1)),s.$set(T);const $={};y&1&&($.collection=_[0]),!a&&y&1&&(a=!0,$.rule=_[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(s.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){j(e,_),_&&w(i),j(s,_),_&&w(o),j(r,_)}}}function Od(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[PC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>ge(e,"rule",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PC(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function LC(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=n[1]&&$d(n);function C(z){n[4](z)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Ts({props:O}),se.push(()=>ge(f,"rule",C));function E(z){n[5](z)}let P={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(P.rule=n[0].viewRule),p=new Ts({props:P}),se.push(()=>ge(p,"rule",E));let L=!((N=n[0])!=null&&N.isView)&&Md(n),F=((R=n[0])==null?void 0:R.isAuth)&&Od(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=v("button"),r=B(o),a=D(),M&&M.c(),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),L&&L.c(),_=D(),F&&F.c(),y=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"),Q(e,"fade",!n[1])},m(z,W){S(z,e,W),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),M&&M.m(e,null),S(z,u,W),q(f,z,W),S(z,d,W),q(p,z,W),S(z,g,W),L&&L.m(z,W),S(z,_,W),F&&F.m(z,W),S(z,y,W),k=!0,T||($=K(l,"click",n[3]),T=!0)},p(z,[W]){var ne,G;(!k||W&2)&&o!==(o=z[1]?"Hide available fields":"Show available fields")&&le(r,o),z[1]?M?(M.p(z,W),W&2&&A(M,1)):(M=$d(z),M.c(),A(M,1),M.m(e,null)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),(!k||W&2)&&Q(e,"fade",!z[1]);const J={};W&1&&(J.collection=z[0]),!c&&W&1&&(c=!0,J.rule=z[0].listRule,ke(()=>c=!1)),f.$set(J);const x={};W&1&&(x.collection=z[0]),!h&&W&1&&(h=!0,x.rule=z[0].viewRule,ke(()=>h=!1)),p.$set(x),(ne=z[0])!=null&&ne.isView?L&&(re(),I(L,1,1,()=>{L=null}),ae()):L?(L.p(z,W),W&1&&A(L,1)):(L=Md(z),L.c(),A(L,1),L.m(_.parentNode,_)),(G=z[0])!=null&&G.isAuth?F?(F.p(z,W),W&1&&A(F,1)):(F=Od(z),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(re(),I(F,1,1,()=>{F=null}),ae())},i(z){k||(A(M),A(f.$$.fragment,z),A(p.$$.fragment,z),A(L),A(F),k=!0)},o(z){I(M),I(f.$$.fragment,z),I(p.$$.fragment,z),I(L),I(F),k=!1},d(z){z&&w(e),M&&M.d(),z&&w(u),j(f,z),z&&w(d),j(p,z),z&&w(g),L&&L.d(z),z&&w(_),F&&F.d(z),z&&w(y),T=!1,$()}}}function NC(n,e,t){let i,{collection:s=new hn}=e,l=!1;const o=()=>t(1,l=!l);function r(p){n.$$.not_equal(s.listRule,p)&&(s.listRule=p,t(0,s))}function a(p){n.$$.not_equal(s.viewRule,p)&&(s.viewRule=p,t(0,s))}function u(p){n.$$.not_equal(s.createRule,p)&&(s.createRule=p,t(0,s))}function f(p){n.$$.not_equal(s.updateRule,p)&&(s.updateRule=p,t(0,s))}function c(p){n.$$.not_equal(s.deleteRule,p)&&(s.deleteRule=p,t(0,s))}function d(p){n.$$.not_equal(s.options.manageRule,p)&&(s.options.manageRule=p,t(0,s))}return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class FC extends ve{constructor(e){super(),be(this,e,NC,LC,_e,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[9]=e[t],i}function RC(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=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function qC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Ed(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Ad(Dd(n,i,l));return{c(){e=v("div"),t=v("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),b(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=Dd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Ad(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),at(s,l)}}}function Ad(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function jC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[qC,RC],p=[];function h(_,y){return _[2]?0:1}l=h(n),o=p[l]=d[l](n);let g=n[3].length&&Ed(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li>
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=D(),g&&g.c(),f=we(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),p[l].m(_,y),S(_,r,y),S(_,a,y),S(_,u,y),g&&g.m(_,y),S(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&m(e,"for",i);let k=l;l=h(_),l===k?p[l].p(_,y):(re(),I(p[k],1,1,()=>{p[k]=null}),ae(),o=p[l],o?o.p(_,y):(o=p[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=Ed(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&w(e),_&&w(s),p[l].d(_),_&&w(r),_&&w(a),_&&w(u),g&&g.d(_),_&&w(f)}}}function VC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[jC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function HC(n,e,t){let i;We(n,ti,c=>t(4,i=c));let{collection:s=new hn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const p=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(p,"id"),H.removeByValue(p,"created"),H.removeByValue(p,"updated");for(let g in d)for(let _ in d[g]){const y=d[g][_].message,k=p[g]||g;r.push(H.sentenize(k+": "+y))}}Qt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&ci("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class zC extends ve{constructor(e){super(),be(this,e,HC,VC,_e,{collection:0})}}const BC=n=>({active:n&1}),Id=n=>({active:n[0]});function Pd(n){let e,t,i;const s=n[15].default,l=Et(s,n,n[14],null);return{c(){e=v("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)&&It(l,s,o,o[14],i?At(s,o[14],r,null):Pt(o[14]),null)},i(o){i||(A(l,o),o&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function UC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Et(a,n,n[14],Id);let f=n[0]&&Pd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=D(),f&&f.c(),m(t,"type","button"),m(t,"class","accordion-header"),m(t,"draggable",n[2]),Q(t,"interactive",n[3]),m(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){S(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",ft(n[17])),K(t,"drop",ft(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",ft(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&It(u,a,c,c[14],l?At(a,c[14],d,BC):Pt(c[14]),Id),(!l||d&4)&&m(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Pd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&m(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ae(r)}}}function WC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=vt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,p=!1;function h(){return!!f}function g(){k(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():g()}function k(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of L)F.click()}}Qt(()=>()=>clearTimeout(r));function T(L){de.call(this,n,L)}const $=()=>c&&y(),M=L=>{u&&(t(7,p=!1),k(),l("drop",L))},C=L=>u&&l("dragstart",L),O=L=>{u&&(t(7,p=!0),l("dragenter",L))},E=L=>{u&&(t(7,p=!1),l("dragleave",L))};function P(L){se[L?"unshift":"push"](()=>{o=L,t(6,o)})}return n.$$set=L=>{"class"in L&&t(1,a=L.class),"draggable"in L&&t(2,u=L.draggable),"active"in L&&t(0,f=L.active),"interactive"in L&&t(3,c=L.interactive),"single"in L&&t(9,d=L.single),"$$scope"in L&&t(14,s=L.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,k,o,p,l,d,h,g,_,r,s,i,T,$,M,C,O,E,P]}class al extends ve{constructor(e){super(),be(this,e,WC,UC,_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 YC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("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),b(s,l),r||(a=K(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 KC(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[YC,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JC(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ZC(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Ld(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function GC(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowUsernameAuth?ZC:JC}let u=a(n),f=u(n),c=n[3]&&Ld();return{c(){e=v("div"),e.innerHTML=`<i class="ri-user-star-line"></i>
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?p&8&&A(c,1):(c=Ld(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function XC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("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),b(s,l),r||(a=K(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 Nd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[QC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[xC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(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),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&et(()=>{a&&(r||(r=qe(e,Mt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=qe(e,Mt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[7](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("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(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function xC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[8](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("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(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function e4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[XC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Nd(n);return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Nd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function t4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function n4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Fd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function i4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowEmailAuth?n4:t4}let u=a(n),f=u(n),c=n[2]&&Fd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?p&4&&A(c,1):(c=Fd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function s4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("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),b(s,l),r||(a=K(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 Rd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',m(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function l4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[s4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Rd();return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Rd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function o4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function r4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function a4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowOAuth2Auth?r4:o4}let u=a(n),f=u(n),c=n[1]&&qd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?p&2&&A(c,1):(c=qd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function u4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Minimum password length"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=K(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&&ht(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function f4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("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(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),De(ze.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&m(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return s=new al({props:{single:!0,$$slots:{header:[GC],default:[KC]},$$scope:{ctx:n}}}),o=new al({props:{single:!0,$$slots:{header:[i4],default:[e4]},$$scope:{ctx:n}}}),a=new al({props:{single:!0,$$slots:{header:[a4],default:[l4]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[u4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[f4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",p=D(),V(h.$$.fragment),g=D(),V(_.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(d,"class","section-title")},m(k,T){S(k,e,T),S(k,t,T),S(k,i,T),q(s,i,null),b(i,l),q(o,i,null),b(i,r),q(a,i,null),S(k,u,T),S(k,f,T),S(k,c,T),S(k,d,T),S(k,p,T),q(h,k,T),S(k,g,T),q(_,k,T),y=!0},p(k,[T]){const $={};T&8201&&($.$$scope={dirty:T,ctx:k}),s.$set($);const M={};T&8197&&(M.$$scope={dirty:T,ctx:k}),o.$set(M);const C={};T&8195&&(C.$$scope={dirty:T,ctx:k}),a.$set(C);const O={};T&12289&&(O.$$scope={dirty:T,ctx:k}),h.$set(O);const E={};T&12289&&(E.$$scope={dirty:T,ctx:k}),_.$set(E)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(h.$$.fragment,k),A(_.$$.fragment,k),y=!0)},o(k){I(s.$$.fragment,k),I(o.$$.fragment,k),I(a.$$.fragment,k),I(h.$$.fragment,k),I(_.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),j(s),j(o),j(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(p),j(h,k),k&&w(g),j(_,k)}}}function d4(n,e,t){let i,s,l,o;We(n,ti,g=>t(4,o=g));let{collection:r=new hn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function p(){r.options.minPasswordLength=ht(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,_,y,k;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,p,h]}class p4 extends ve{constructor(e){super(),be(this,e,d4,c4,_e,{collection:0})}}function jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[17]=e[t],i}function zd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){var r;let e,t,i,s,l=n[3]&&Ud(n),o=!((r=n[2])!=null&&r.isView)&&Wd(n);return{c(){e=v("h6"),e.textContent="Changes:",t=D(),i=v("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),b(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Ud(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=Wd(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 Ud(n){var p,h;let e,t,i,s,l=((p=n[1])==null?void 0:p.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed collection
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),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(g,_){S(g,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(g,_){var y,k;_&2&&l!==(l=((y=g[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((k=g[2])==null?void 0:k.name)+"")&&le(d,c)},d(g){g&&w(e)}}}function Wd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=Yd(Hd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=Kd(Vd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=Jd(jd(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,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);S(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);S(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);S(f,i,c)},p(f,c){if(c&32){s=f[5];let d;for(d=0;d<s.length;d+=1){const p=Hd(f,s,d);l[d]?l[d].p(p,c):(l[d]=Yd(p),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&128){o=f[7];let d;for(d=0;d<o.length;d+=1){const p=Vd(f,o,d);r[d]?r[d].p(p,c):(r[d]=Kd(p),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&64){a=f[6];let d;for(d=0;d<a.length;d+=1){const p=jd(f,a,d);u[d]?u[d].p(p,c):(u[d]=Jd(p),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){at(l,f),f&&w(e),at(r,f),f&&w(t),at(u,f),f&&w(i)}}}function Yd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=v("li"),t=B(`Multiple to single value conversion of field
`),i=v("strong"),l=B(s),o=D(),r=v("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),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function Kd(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,c=n[17].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed field
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),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(p,h){S(p,e,h),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(p,h){h&128&&l!==(l=p[17].originalName+"")&&le(o,l),h&128&&c!==(c=p[17].name+"")&&le(d,c)},d(p){p&&w(e)}}}function Jd(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=v("li"),t=B("Removed field "),i=v("span"),l=B(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function m4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&zd(),f=n[8]&&Bd(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[6].length?u||(u=zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[8]?f?f.p(c,d):(f=Bd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function h4(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function _4(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("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=[K(e,"click",n[11]),K(i,"click",n[12])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function g4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[_4],header:[h4],default:[m4]},$$scope:{ctx:n}};return e=new bn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[13](null),j(e,s)}}}function b4(n,e,t){let i,s,l,o,r;const a=vt();let u,f,c;async function d($,M){t(1,f=$),t(2,c=M),await rn(),i||s.length||l.length||o.length?u==null||u.show():h()}function p(){u==null||u.hide()}function h(){p(),a("confirm")}const g=()=>p(),_=()=>h();function y($){se[$?"unshift":"push"](()=>{u=$,t(4,u)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{var $,M,C;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(c==null?void 0:c.name)),n.$$.dirty&4&&t(7,s=(($=c==null?void 0:c.schema)==null?void 0:$.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((M=c==null?void 0:c.schema)==null?void 0:M.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((C=c==null?void 0:c.schema)==null?void 0:C.filter(O=>{var P,L,F;const E=(P=f==null?void 0:f.schema)==null?void 0:P.find(N=>N.id==O.id);return E?((L=E.options)==null?void 0:L.maxSelect)!=1&&((F=O.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(c!=null&&c.isView)||i)},[p,f,c,i,u,o,l,s,r,h,d,g,_,y,k,T]}class v4 extends ve{constructor(e){super(),be(this,e,b4,g4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function Zd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function y4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new TC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function k4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new zC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Gd(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 FC({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Xd(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 p4({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Es)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function w4(n){let e,t,i,s,l,o,r;const a=[k4,y4],u=[];function f(p,h){return p[2].isView?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===yl&&Gd(n),d=n[2].isAuth&&Xd(n);return{c(){e=v("div"),t=v("div"),s.c(),l=D(),c&&c.c(),o=D(),d&&d.c(),m(t,"class","tab-item"),Q(t,"active",n[3]===wi),m(e,"class","tabs-content svelte-12y0yzb")},m(p,h){S(p,e,h),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(p,h){let g=i;i=f(p),i===g?u[i].p(p,h):(re(),I(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(p,h):(s=u[i]=a[i](p),s.c()),A(s,1),s.m(t,null)),(!r||h[0]&8)&&Q(t,"active",p[3]===wi),p[3]===yl?c?(c.p(p,h),h[0]&8&&A(c,1)):(c=Gd(p),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),p[2].isAuth?d?(d.p(p,h),h[0]&4&&A(d,1)):(d=Xd(p),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(p){r||(A(s),A(c),A(d),r=!0)},o(p){I(s),I(c),I(d),r=!1},d(p){p&&w(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Qd(n){let e,t,i,s,l,o,r;return o=new qn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[S4]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=D(),i=v("button"),s=v("i"),l=D(),V(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),b(i,s),b(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[1]&1048576&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function S4(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,t=D(),i=v("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=[K(e,"click",n[24]),K(i,"click",$n(ft(n[25])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function xd(n){let e,t,i,s;return i=new qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[T4]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),V(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function ep(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[27](n[47])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=B(o),a=B(" collection"),u=D(),m(t,"class",i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(p,h){S(p,e,h),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=K(e,"click",d),f=!0)},p(p,h){n=p,h[0]&64&&i!==(i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(p){p&&w(e),f=!1,c()}}}function T4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=ep(Zd(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=Zd(s,t,o);i[o]?i[o].p(r,l):(i[o]=ep(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){at(i,s),s&&w(e)}}}function tp(n){let e;return{c(){e=v("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y=(n[6][n[2].type]||"N/A")+"",k,T,$,M,C,O,E,P,L,F=n[2].isNew&&xd(n),N=n[2].system&&tp();return{c(){e=v("label"),t=B("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),p=v("span"),h=D(),g=v("span"),_=B("Type: "),k=B(y),T=D(),F&&F.c(),C=D(),N&&N.c(),O=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(g,"class","txt"),m(d,"type","button"),m(d,"class",$="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,m(c,"class","form-field-addon")},m(R,z){S(R,e,z),b(e,t),S(R,s,z),S(R,l,z),S(R,f,z),S(R,c,z),b(c,d),b(d,p),b(d,h),b(d,g),b(g,_),b(g,k),b(d,T),F&&F.m(d,null),S(R,C,z),N&&N.m(R,z),S(R,O,z),E=!0,n[2].isNew&&l.focus(),P||(L=K(l,"input",n[26]),P=!0)},p(R,z){(!E||z[1]&32768&&i!==(i=R[46]))&&m(e,"for",i),(!E||z[1]&32768&&o!==(o=R[46]))&&m(l,"id",o),(!E||z[0]&8192)&&(l.disabled=R[13]),(!E||z[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||z[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!E||z[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||z[0]&68)&&y!==(y=(R[6][R[2].type]||"N/A")+"")&&le(k,y),R[2].isNew?F?(F.p(R,z),z[0]&4&&A(F,1)):(F=xd(R),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||z[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&m(d,"class",$),(!E||z[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=tp(),N.c(),N.m(O.parentNode,O)):N&&(N.d(1),N=null)},i(R){E||(A(F),E=!0)},o(R){I(F),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w(C),N&&N.d(R),R&&w(O),P=!1,L()}}}function np(n){let e,t,i,s,l,o;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=De(t=ze.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&et(()=>{s&&(i||(i=qe(e,qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,qt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&w(e),r&&i&&i.end(),l=!1,o()}}}function ip(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function sp(n){var a,u,f;let e,t,i,s=!H.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&&lp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=D(),r&&r.c(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(c,d){S(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=K(e,"click",n[31]),l=!0)},p(c,d){var p,h,g;d[0]&32&&(s=!H.isEmpty((p=c[5])==null?void 0:p.options)&&!((g=(h=c[5])==null?void 0:h.options)!=null&&g.manageRule)),s?r?d[0]&32&&A(r,1):(r=lp(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&Q(e,"active",c[3]===Es)},d(c){c&&w(e),r&&r.d(),l=!1,o()}}}function lp(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function C4(n){var W,J,x,ne,G,fe,Z,ce;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,h=(W=n[2])!=null&&W.isView?"Query":"Fields",g,_,y=!H.isEmpty(n[11]),k,T,$,M,C=!H.isEmpty((J=n[5])==null?void 0:J.listRule)||!H.isEmpty((x=n[5])==null?void 0:x.viewRule)||!H.isEmpty((ne=n[5])==null?void 0:ne.createRule)||!H.isEmpty((G=n[5])==null?void 0:G.updateRule)||!H.isEmpty((fe=n[5])==null?void 0:fe.deleteRule)||!H.isEmpty((ce=(Z=n[5])==null?void 0:Z.options)==null?void 0:ce.manageRule),O,E,P,L,F=!n[2].isNew&&!n[2].system&&Qd(n);r=new pe({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[$4,({uniqueId:he})=>({46:he}),({uniqueId:he})=>[0,he?32768:0]]},$$scope:{ctx:n}}});let N=y&&np(n),R=C&&ip(),z=n[2].isAuth&&sp(n);return{c(){e=v("h4"),i=B(t),s=D(),F&&F.c(),l=D(),o=v("form"),V(r.$$.fragment),a=D(),u=v("input"),f=D(),c=v("div"),d=v("button"),p=v("span"),g=B(h),_=D(),N&&N.c(),k=D(),T=v("button"),$=v("span"),$.textContent="API Rules",M=D(),R&&R.c(),O=D(),z&&z.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(p,"class","txt"),m(d,"type","button"),m(d,"class","tab-item"),Q(d,"active",n[3]===wi),m($,"class","txt"),m(T,"type","button"),m(T,"class","tab-item"),Q(T,"active",n[3]===yl),m(c,"class","tabs-header stretched")},m(he,Ce){S(he,e,Ce),b(e,i),S(he,s,Ce),F&&F.m(he,Ce),S(he,l,Ce),S(he,o,Ce),q(r,o,null),b(o,a),b(o,u),S(he,f,Ce),S(he,c,Ce),b(c,d),b(d,p),b(p,g),b(d,_),N&&N.m(d,null),b(c,k),b(c,T),b(T,$),b(T,M),R&&R.m(T,null),b(c,O),z&&z.m(c,null),E=!0,P||(L=[K(o,"submit",ft(n[28])),K(d,"click",n[29]),K(T,"click",n[30])],P=!0)},p(he,Ce){var je,ye,$e,Ye,dt,Ke,Be,ee;(!E||Ce[0]&4)&&t!==(t=he[2].isNew?"New collection":"Edit collection")&&le(i,t),!he[2].isNew&&!he[2].system?F?(F.p(he,Ce),Ce[0]&4&&A(F,1)):(F=Qd(he),F.c(),A(F,1),F.m(l.parentNode,l)):F&&(re(),I(F,1,1,()=>{F=null}),ae());const Re={};Ce[0]&8192&&(Re.class="form-field collection-field-name required m-b-0 "+(he[13]?"disabled":"")),Ce[0]&8260|Ce[1]&1081344&&(Re.$$scope={dirty:Ce,ctx:he}),r.$set(Re),(!E||Ce[0]&4)&&h!==(h=(je=he[2])!=null&&je.isView?"Query":"Fields")&&le(g,h),Ce[0]&2048&&(y=!H.isEmpty(he[11])),y?N?(N.p(he,Ce),Ce[0]&2048&&A(N,1)):(N=np(he),N.c(),A(N,1),N.m(d,null)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),(!E||Ce[0]&8)&&Q(d,"active",he[3]===wi),Ce[0]&32&&(C=!H.isEmpty((ye=he[5])==null?void 0:ye.listRule)||!H.isEmpty(($e=he[5])==null?void 0:$e.viewRule)||!H.isEmpty((Ye=he[5])==null?void 0:Ye.createRule)||!H.isEmpty((dt=he[5])==null?void 0:dt.updateRule)||!H.isEmpty((Ke=he[5])==null?void 0:Ke.deleteRule)||!H.isEmpty((ee=(Be=he[5])==null?void 0:Be.options)==null?void 0:ee.manageRule)),C?R?Ce[0]&32&&A(R,1):(R=ip(),R.c(),A(R,1),R.m(T,null)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),(!E||Ce[0]&8)&&Q(T,"active",he[3]===yl),he[2].isAuth?z?z.p(he,Ce):(z=sp(he),z.c(),z.m(c,null)):z&&(z.d(1),z=null)},i(he){E||(A(F),A(r.$$.fragment,he),A(N),A(R),E=!0)},o(he){I(F),I(r.$$.fragment,he),I(N),I(R),E=!1},d(he){he&&w(e),he&&w(s),F&&F.d(he),he&&w(l),he&&w(o),j(r),he&&w(f),he&&w(c),N&&N.d(),R&&R.d(),z&&z.d(),P=!1,Ae(L)}}}function M4(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=B(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],Q(s,"btn-loading",n[9])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(l,r),u||(f=[K(e,"click",n[22]),K(s,"click",n[23])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function O4(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,beforeHide:n[36],$$slots:{footer:[M4],header:[C4],default:[w4]},$$scope:{ctx:n}};e=new bn({props:l}),n[37](e),e.$on("hide",n[38]),e.$on("show",n[39]);let o={};return i=new v4({props:o}),n[40](i),i.$on("confirm",n[41]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&1040&&(u.beforeHide=r[36]),a[0]&14956|a[1]&1048576&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){n[37](null),j(e,r),r&&w(t),n[40](null),j(i,r)}}}const wi="schema",yl="api_rules",Es="options",D4="base",op="auth",rp="view";function Er(n){return JSON.stringify(n)}function E4(n,e,t){let i,s,l,o;We(n,ti,ee=>t(5,o=ee));const r={};r[D4]="Base",r[rp]="View",r[op]="Auth";const a=vt();let u,f,c=null,d=new hn,p=!1,h=!1,g=wi,_=Er(d),y="";function k(ee){t(3,g=ee)}function T(ee){return M(ee),t(10,h=!0),k(wi),u==null?void 0:u.show()}function $(){return u==null?void 0:u.hide()}async function M(ee){_n({}),typeof ee<"u"?(t(20,c=ee),t(2,d=ee.clone())):(t(20,c=null),t(2,d=new hn)),t(2,d.schema=d.schema||[],d),t(2,d.originalName=d.name||"",d),await rn(),t(21,_=Er(d))}function C(){d.isNew?O():f==null||f.show(c,d)}function O(){if(p)return;t(9,p=!0);const ee=E();let Fe;d.isNew?Fe=me.collections.create(ee):Fe=me.collections.update(d.id,ee),Fe.then(tt=>{Oa(),B1(tt.id),t(10,h=!1),$(),Ut(d.isNew?"Successfully created collection.":"Successfully updated collection."),a("save",{isNew:d.isNew,collection:tt})}).catch(tt=>{me.errorResponseHandler(tt)}).finally(()=>{t(9,p=!1)})}function E(){const ee=d.export();ee.schema=ee.schema.slice(0);for(let Fe=ee.schema.length-1;Fe>=0;Fe--)ee.schema[Fe].toDelete&&ee.schema.splice(Fe,1);return ee}function P(){c!=null&&c.id&&pn(`Do you really want to delete collection "${c==null?void 0:c.name}" and all its records?`,()=>me.collections.delete(c==null?void 0:c.id).then(()=>{$(),Ut(`Successfully deleted collection "${c==null?void 0:c.name}".`),a("delete",c),XS(c)}).catch(ee=>{me.errorResponseHandler(ee)}))}function L(ee){t(2,d.type=ee,d),ci("schema")}function F(){s?pn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ee=c==null?void 0:c.clone();if(ee){if(ee.id="",ee.created="",ee.updated="",ee.name+="_duplicate",!H.isEmpty(ee.schema))for(const Fe of ee.schema)Fe.id="";if(!H.isEmpty(ee.indexes))for(let Fe=0;Fe<ee.indexes.length;Fe++){const tt=H.parseIndex(ee.indexes[Fe]);tt.tableName=ee.name,ee.indexes[Fe]=H.buildIndex(tt)}}T(ee),await rn(),t(21,_="")}const R=()=>$(),z=()=>C(),W=()=>F(),J=()=>P(),x=ee=>{t(2,d.name=H.slugify(ee.target.value),d),ee.target.value=d.name},ne=ee=>L(ee),G=()=>{l&&C()},fe=()=>k(wi),Z=()=>k(yl),ce=()=>k(Es);function he(ee){d=ee,t(2,d),t(20,c)}function Ce(ee){d=ee,t(2,d),t(20,c)}function Re(ee){d=ee,t(2,d),t(20,c)}function je(ee){d=ee,t(2,d),t(20,c)}const ye=()=>s&&h?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,h=!1),$()}),!1):!0;function $e(ee){se[ee?"unshift":"push"](()=>{u=ee,t(7,u)})}function Ye(ee){de.call(this,n,ee)}function dt(ee){de.call(this,n,ee)}function Ke(ee){se[ee?"unshift":"push"](()=>{f=ee,t(8,f)})}const Be=()=>O();return n.$$.update=()=>{var ee;n.$$.dirty[0]&32&&(o.schema||(ee=o.options)!=null&&ee.query?t(11,y=H.getNestedVal(o,"schema.message")||"Has errors"):t(11,y="")),n.$$.dirty[0]&4&&d.type===rp&&(t(2,d.createRule=null,d),t(2,d.updateRule=null,d),t(2,d.deleteRule=null,d)),n.$$.dirty[0]&1048580&&d!=null&&d.name&&(c==null?void 0:c.name)!=(d==null?void 0:d.name)&&t(2,d.indexes=d.indexes.map(Fe=>H.replaceIndexTableName(Fe,d.name)),d),n.$$.dirty[0]&4&&t(13,i=!d.isNew&&d.system),n.$$.dirty[0]&2097156&&t(4,s=_!=Er(d)),n.$$.dirty[0]&20&&t(12,l=d.isNew||s),n.$$.dirty[0]&12&&g===Es&&d.type!==op&&k(wi)},[k,$,d,g,s,o,r,u,f,p,h,y,l,i,C,O,P,L,F,T,c,_,R,z,W,J,x,ne,G,fe,Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be]}class su extends ve{constructor(e){super(),be(this,e,E4,O4,_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 ap(n,e,t){const i=n.slice();return i[15]=e[t],i}function up(n){let e,t=n[1].length&&fp();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=fp(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function fp(n){let e;return{c(){e=v("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,c,d;return{key:n,first:null,c(){var p;t=v("a"),i=v("i"),l=D(),o=v("span"),a=B(r),u=D(),m(i,"class",s=H.getCollectionTypeIcon(e[15].type)),m(o,"class","txt"),m(t,"href",f="/collections?collectionId="+e[15].id),m(t,"class","sidebar-list-item"),Q(t,"active",((p=e[5])==null?void 0:p.id)===e[15].id),this.first=t},m(p,h){S(p,t,h),b(t,i),b(t,l),b(t,o),b(o,a),b(t,u),c||(d=De(nn.call(null,t)),c=!0)},p(p,h){var g;e=p,h&8&&s!==(s=H.getCollectionTypeIcon(e[15].type))&&m(i,"class",s),h&8&&r!==(r=e[15].name+"")&&le(a,r),h&8&&f!==(f="/collections?collectionId="+e[15].id)&&m(t,"href",f),h&40&&Q(t,"active",((g=e[5])==null?void 0:g.id)===e[15].id)},d(p){p&&w(t),c=!1,d()}}}function dp(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){S(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function A4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,h,g,_,y,k,T,$=n[3];const M=P=>P[15].id;for(let P=0;P<$.length;P+=1){let L=ap(n,$,P),F=M(L);p.set(F,d[P]=cp(F,L))}let C=null;$.length||(C=up(n));let O=!n[7]&&dp(n),E={};return _=new su({props:E}),n[13](_),_.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let P=0;P<d.length;P+=1)d[P].c();C&&C.c(),h=D(),O&&O.c(),g=D(),V(_.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(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"),Q(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ue(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let F=0;F<d.length;F+=1)d[F]&&d[F].m(c,null);C&&C.m(c,null),b(e,h),O&&O.m(e,null),S(P,g,L),q(_,P,L),y=!0,k||(T=[K(l,"click",n[10]),K(r,"input",n[11])],k=!0)},p(P,[L]){(!y||L&16)&&Q(l,"hidden",!P[4]),L&1&&r.value!==P[0]&&ue(r,P[0]),(!y||L&16)&&Q(i,"active",P[4]),L&42&&($=P[3],d=Ct(d,L,M,1,P,$,p,c,ns,cp,null,ap),!$.length&&C?C.p(P,L):$.length?C&&(C.d(1),C=null):(C=up(P),C.c(),C.m(c,null))),(!y||L&64)&&Q(c,"fade",P[6]),(!y||L&8)&&Q(c,"sidebar-content-compact",P[3].length>20),P[7]?O&&(O.d(1),O=null):O?O.p(P,L):(O=dp(P),O.c(),O.m(e,null));const F={};_.$set(F)},i(P){y||(A(_.$$.fragment,P),y=!0)},o(P){I(_.$$.fragment,P),y=!1},d(P){P&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),O&&O.d(),P&&w(g),n[13](null),j(_,P),k=!1,Ae(T)}}}function I4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function P4(n,e,t){let i,s,l,o,r,a,u;We(n,Di,k=>t(5,o=k)),We(n,Pi,k=>t(9,r=k)),We(n,Lo,k=>t(6,a=k)),We(n,Cs,k=>t(7,u=k));let f,c="";function d(k){Gt(Di,o=k,o)}const p=()=>t(0,c="");function h(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function _(k){se[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var T;(T=k.detail)!=null&&T.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&I4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,p,h,g,_,y]}class L4 extends ve{constructor(e){super(),be(this,e,P4,A4,_e,{})}}function pp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function mp(n){n[18]=n[19].default}function hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function _p(n){let e;return{c(){e=v("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function gp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&_p();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=we(),c&&c.c(),s=D(),l=v("button"),r=B(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(p,h){S(p,t,h),c&&c.m(p,h),S(p,s,h),S(p,l,h),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(p,h){e=p,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=_p(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(p){p&&w(t),c&&c.d(p),p&&w(s),p&&w(l),u=!1,f()}}}function bp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:R4,then:F4,catch:N4,value:19,blocks:[,,,]};return uu(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)&&uu(t,s)||Sb(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];I(r)}i=!1},d(l){l&&w(e),s.block.d(l),s.token=null,s=null}}}function N4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function F4(n){mp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=D()},m(s,l){q(e,s,l),S(s,t,l),i=!0},p(s,l){mp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){I(e.$$.fragment,s),i=!1},d(s){j(e,s),s&&w(t)}}}function R4(n){return{c:X,m:X,p:X,i:X,o:X,d:X}}function vp(n,e){let t,i,s,l=e[5]===e[14]&&bp(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&&A(l,1)):(l=bp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){I(l),s=!1},d(o){o&&w(t),l&&l.d(o),o&&w(i)}}}function q4(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=Object.entries(n[3]);const d=g=>g[14];for(let g=0;g<c.length;g+=1){let _=hp(n,c,g),y=d(_);l.set(y,s[g]=gp(y,_))}let p=Object.entries(n[3]);const h=g=>g[14];for(let g=0;g<p.length;g+=1){let _=pp(n,p,g),y=h(_);u.set(y,a[g]=vp(y,_))}return{c(){var g;e=v("div"),t=v("aside"),i=v("nav");for(let _=0;_<s.length;_+=1)s[_].c();o=D(),r=v("div");for(let _=0;_<a.length;_+=1)a[_].c();m(i,"class","sidebar-content"),m(t,"class","docs-sidebar"),Q(t,"compact",(g=n[2])==null?void 0:g.isAuth),m(r,"class","docs-content"),m(e,"class","docs-content-wrapper")},m(g,_){S(g,e,_),b(e,t),b(t,i);for(let y=0;y<s.length;y+=1)s[y]&&s[y].m(i,null);b(e,o),b(e,r);for(let y=0;y<a.length;y+=1)a[y]&&a[y].m(r,null);f=!0},p(g,_){var y;_&106&&(c=Object.entries(g[3]),s=Ct(s,_,d,1,g,c,l,i,ns,gp,null,hp)),(!f||_&4)&&Q(t,"compact",(y=g[2])==null?void 0:y.isAuth),_&44&&(p=Object.entries(g[3]),re(),a=Ct(a,_,h,1,g,p,u,r,an,vp,null,pp),ae())},i(g){if(!f){for(let _=0;_<p.length;_+=1)A(a[_]);f=!0}},o(g){for(let _=0;_<a.length;_+=1)I(a[_]);f=!1},d(g){g&&w(e);for(let _=0;_<s.length;_+=1)s[_].d();for(let _=0;_<a.length;_+=1)a[_].d()}}}function j4(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[8]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function V4(n){let e,t,i={class:"docs-panel",$$slots:{footer:[j4],default:[q4]},$$scope:{ctx:n}};return e=new bn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[10](null),j(e,s)}}}function H4(n,e,t){const i={list:{label:"List/Search",component:rt(()=>import("./ListApiDocs-5a6d75a8.js"),["./ListApiDocs-5a6d75a8.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:rt(()=>import("./ViewApiDocs-785f1771.js"),["./ViewApiDocs-785f1771.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},create:{label:"Create",component:rt(()=>import("./CreateApiDocs-94f1d992.js"),["./CreateApiDocs-94f1d992.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},update:{label:"Update",component:rt(()=>import("./UpdateApiDocs-69e4ff47.js"),["./UpdateApiDocs-69e4ff47.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},delete:{label:"Delete",component:rt(()=>import("./DeleteApiDocs-88c15d5f.js"),["./DeleteApiDocs-88c15d5f.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:rt(()=>import("./RealtimeApiDocs-9dcdfcc2.js"),["./RealtimeApiDocs-9dcdfcc2.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:rt(()=>import("./AuthWithPasswordDocs-fbccbd38.js"),["./AuthWithPasswordDocs-fbccbd38.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:rt(()=>import("./AuthWithOAuth2Docs-2c09670a.js"),["./AuthWithOAuth2Docs-2c09670a.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},refresh:{label:"Auth refresh",component:rt(()=>import("./AuthRefreshDocs-3ca95ce9.js"),["./AuthRefreshDocs-3ca95ce9.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-verification":{label:"Request verification",component:rt(()=>import("./RequestVerificationDocs-fd08e595.js"),["./RequestVerificationDocs-fd08e595.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:rt(()=>import("./ConfirmVerificationDocs-dc975776.js"),["./ConfirmVerificationDocs-dc975776.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:rt(()=>import("./RequestPasswordResetDocs-6b846035.js"),["./RequestPasswordResetDocs-6b846035.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:rt(()=>import("./ConfirmPasswordResetDocs-9f1b3d43.js"),["./ConfirmPasswordResetDocs-9f1b3d43.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:rt(()=>import("./RequestEmailChangeDocs-58048419.js"),["./RequestEmailChangeDocs-58048419.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:rt(()=>import("./ConfirmEmailChangeDocs-b78acf4b.js"),["./ConfirmEmailChangeDocs-b78acf4b.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:rt(()=>import("./AuthMethodsDocs-5d86a994.js"),["./AuthMethodsDocs-5d86a994.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:rt(()=>import("./ListExternalAuthsDocs-bfe9b829.js"),["./ListExternalAuthsDocs-bfe9b829.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:rt(()=>import("./UnlinkExternalAuthDocs-5ef72405.js"),["./UnlinkExternalAuthDocs-5ef72405.js","./SdkTabs-720afe62.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o=new hn,r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),p=y=>c(y);function h(y){se[y?"unshift":"push"](()=>{l=y,t(4,l)})}function g(y){de.call(this,n,y)}function _(y){de.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.isAuth?(t(3,a=Object.assign({},i,s)),!(o!=null&&o.options.allowUsernameAuth)&&!(o!=null&&o.options.allowEmailAuth)&&delete a["auth-with-password"],o!=null&&o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.isView?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,p,h,g,_]}class z4 extends ve{constructor(e){super(),be(this,e,H4,V4,_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 B4(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Username",o=D(),r=v("input"),m(t,"class",H.getFieldTypeIcon("user")),m(s,"class","txt"),m(e,"for",l=n[12]),m(r,"type","text"),m(r,"requried",a=!n[0].isNew),m(r,"placeholder",u=n[0].isNew?"Leave empty to auto generate...":n[3]),m(r,"id",f=n[12])},m(p,h){S(p,e,h),b(e,t),b(e,i),b(e,s),S(p,o,h),S(p,r,h),ue(r,n[0].username),c||(d=K(r,"input",n[4]),c=!0)},p(p,h){h&4096&&l!==(l=p[12])&&m(e,"for",l),h&1&&a!==(a=!p[0].isNew)&&m(r,"requried",a),h&1&&u!==(u=p[0].isNew?"Leave empty to auto generate...":p[3])&&m(r,"placeholder",u),h&4096&&f!==(f=p[12])&&m(r,"id",f),h&1&&r.value!==p[0].username&&ue(r,p[0].username)},d(p){p&&w(e),p&&w(o),p&&w(r),c=!1,d()}}}function U4(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,p,h,g,_,y,k,T,$;return{c(){var M;e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("div"),a=v("button"),u=v("span"),f=B("Public: "),d=B(c),h=D(),g=v("input"),m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[12]),m(u,"class","txt"),m(a,"type","button"),m(a,"class",p="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),m(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),m(g,"type","email"),g.autofocus=_=n[0].isNew,m(g,"autocomplete","off"),m(g,"id",y=n[12]),g.required=k=(M=n[1].options)==null?void 0:M.requireEmail,m(g,"class","svelte-1751a4d")},m(M,C){S(M,e,C),b(e,t),b(e,i),b(e,s),S(M,o,C),S(M,r,C),b(r,a),b(a,u),b(u,f),b(u,d),S(M,h,C),S(M,g,C),ue(g,n[0].email),n[0].isNew&&g.focus(),T||($=[De(ze.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",n[5]),K(g,"input",n[6])],T=!0)},p(M,C){var O;C&4096&&l!==(l=M[12])&&m(e,"for",l),C&1&&c!==(c=M[0].emailVisibility?"On":"Off")&&le(d,c),C&1&&p!==(p="btn btn-sm btn-transparent "+(M[0].emailVisibility?"btn-success":"btn-hint"))&&m(a,"class",p),C&1&&_!==(_=M[0].isNew)&&(g.autofocus=_),C&4096&&y!==(y=M[12])&&m(g,"id",y),C&2&&k!==(k=(O=M[1].options)==null?void 0:O.requireEmail)&&(g.required=k),C&1&&g.value!==M[0].email&&ue(g,M[0].email)},d(M){M&&w(e),M&&w(o),M&&w(r),M&&w(h),M&&w(g),T=!1,Ae($)}}}function yp(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[W4,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&12292&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function W4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Change password"),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[2],S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[7]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&4&&(e.checked=u[2]),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 kp(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Y4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[K4,({uniqueId:f})=>({12:f}),({uniqueId:f})=>f?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),Q(t,"p-t-xs",n[2]),m(e,"class","block")},m(f,c){S(f,e,c),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),u=!0},p(f,c){const d={};c&12289&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c&12289&&(p.$$scope={dirty:c,ctx:f}),r.$set(p),(!u||c&4)&&Q(t,"p-t-xs",f[2])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=qe(e,Mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=qe(e,Mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function Y4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[12]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[0].password),u||(f=K(r,"input",n[8]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&m(e,"for",l),d&4096&&a!==(a=c[12])&&m(r,"id",a),d&1&&r.value!==c[0].password&&ue(r,c[0].password)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function K4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[12]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[12]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[0].passwordConfirm),u||(f=K(r,"input",n[9]),u=!0)},p(c,d){d&4096&&l!==(l=c[12])&&m(e,"for",l),d&4096&&a!==(a=c[12])&&m(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ue(r,c[0].passwordConfirm)},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function J4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Verified"),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].verified,S(u,i,f),S(u,s,f),b(s,l),r||(a=[K(e,"change",n[10]),K(e,"change",ft(n[11]))],r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].verified),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ae(a)}}}function Z4(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,p;i=new pe({props:{class:"form-field "+(n[0].isNew?"":"required"),name:"username",$$slots:{default:[B4,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[U4,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}});let h=!n[0].isNew&&yp(n),g=(n[0].isNew||n[2])&&kp(n);return d=new pe({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[J4,({uniqueId:y})=>({12:y}),({uniqueId:y})=>y?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),h&&h.c(),u=D(),g&&g.c(),f=D(),c=v("div"),V(d.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(a,"class","col-lg-12"),m(c,"class","col-lg-12"),m(e,"class","grid m-b-base")},m(y,k){S(y,e,k),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),h&&h.m(a,null),b(a,u),g&&g.m(a,null),b(e,f),b(e,c),q(d,c,null),p=!0},p(y,[k]){var C;const T={};k&1&&(T.class="form-field "+(y[0].isNew?"":"required")),k&12289&&(T.$$scope={dirty:k,ctx:y}),i.$set(T);const $={};k&2&&($.class="form-field "+((C=y[1].options)!=null&&C.requireEmail?"required":"")),k&12291&&($.$$scope={dirty:k,ctx:y}),o.$set($),y[0].isNew?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(y,k),k&1&&A(h,1)):(h=yp(y),h.c(),A(h,1),h.m(a,u)),y[0].isNew||y[2]?g?(g.p(y,k),k&5&&A(g,1)):(g=kp(y),g.c(),A(g,1),g.m(a,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae());const M={};k&12289&&(M.$$scope={dirty:k,ctx:y}),d.$set(M)},i(y){p||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(g),A(d.$$.fragment,y),p=!0)},o(y){I(i.$$.fragment,y),I(o.$$.fragment,y),I(h),I(g),I(d.$$.fragment,y),p=!1},d(y){y&&w(e),j(i),j(o),h&&h.d(),g&&g.d(),j(d)}}}function G4(n,e,t){let{collection:i=new hn}=e,{record:s=new Ci}=e,l=s.username||null,o=!1;function r(){s.username=this.value,t(0,s),t(2,o)}const a=()=>t(0,s.emailVisibility=!s.emailVisibility,s);function u(){s.email=this.value,t(0,s),t(2,o)}function f(){o=this.checked,t(2,o)}function c(){s.password=this.value,t(0,s),t(2,o)}function d(){s.passwordConfirm=this.value,t(0,s),t(2,o)}function p(){s.verified=this.checked,t(0,s),t(2,o)}const h=g=>{s.isNew||pn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,s.verified=!g.target.checked,s)})};return n.$$set=g=>{"collection"in g&&t(1,i=g.collection),"record"in g&&t(0,s=g.record)},n.$$.update=()=>{n.$$.dirty&1&&!s.username&&s.username!==null&&t(0,s.username=null,s),n.$$.dirty&4&&(o||(t(0,s.password=null,s),t(0,s.passwordConfirm=null,s),ci("password"),ci("passwordConfirm")))},[s,i,o,l,r,a,u,f,c,d,p,h]}class X4 extends ve{constructor(e){super(),be(this,e,G4,Z4,_e,{collection:1,record:0})}}function Q4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=Le(l,s[o]);return{c(){e=v("textarea"),xn(e,l),Q(e,"svelte-1x1pbts",!0)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[5](e),ue(e,n[0]),t||(i=[K(e,"input",n[6]),K(e,"keydown",n[2])],t=!0)},p(o,[r]){xn(e,l=bt(s,[r&8&&o[3]])),r&1&&ue(e,o[0]),Q(e,"svelte-1x1pbts",!0)},i:X,o:X,d(o){o&&w(e),n[5](null),t=!1,Ae(i)}}}function x4(n,e,t){const i=["value","maxHeight"];let s=Je(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(p){if((p==null?void 0:p.code)==="Enter"&&!(p!=null&&p.shiftKey)&&!(p!=null&&p.isComposing)){p.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Qt(()=>(u(),()=>clearTimeout(a)));function c(p){se[p?"unshift":"push"](()=>{r=p,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=Le(Le({},e),jt(p)),t(3,s=Je(e,i)),"value"in p&&t(0,l=p.value),"maxHeight"in p&&t(4,o=p.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class e5 extends ve{constructor(e){super(),be(this,e,x4,Q4,_e,{value:0,maxHeight:4})}}function t5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function p(g){n[2](g)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new e5({props:h}),se.push(()=>ge(f,"value",p)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),V(f.$$.fragment),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3])},m(g,_){S(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),S(g,u,_),q(f,g,_),d=!0},p(g,_){(!d||_&2&&i!==(i=H.getFieldTypeIcon(g[1].type)))&&m(t,"class",i),(!d||_&2)&&o!==(o=g[1].name+"")&&le(r,o),(!d||_&8&&a!==(a=g[3]))&&m(e,"for",a);const y={};_&8&&(y.id=g[3]),_&2&&(y.required=g[1].required),!c&&_&1&&(c=!0,y.value=g[0],ke(()=>c=!1)),f.$set(y)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){I(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function n5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[t5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function i5(n,e,t){let{field:i=new gn}=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 s5 extends ve{constructor(e){super(),be(this,e,i5,n5,_e,{field:1,value:0})}}function l5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h,g,_;return{c(){var y,k;e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("input"),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","number"),m(f,"id",c=n[3]),f.required=d=n[1].required,m(f,"min",p=(y=n[1].options)==null?void 0:y.min),m(f,"max",h=(k=n[1].options)==null?void 0:k.max),m(f,"step","any")},m(y,k){S(y,e,k),b(e,t),b(e,s),b(e,l),b(l,r),S(y,u,k),S(y,f,k),ue(f,n[0]),g||(_=K(f,"input",n[2]),g=!0)},p(y,k){var T,$;k&2&&i!==(i=H.getFieldTypeIcon(y[1].type))&&m(t,"class",i),k&2&&o!==(o=y[1].name+"")&&le(r,o),k&8&&a!==(a=y[3])&&m(e,"for",a),k&8&&c!==(c=y[3])&&m(f,"id",c),k&2&&d!==(d=y[1].required)&&(f.required=d),k&2&&p!==(p=(T=y[1].options)==null?void 0:T.min)&&m(f,"min",p),k&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&m(f,"max",h),k&1&&ht(f.value)!==y[0]&&ue(f,y[0])},d(y){y&&w(e),y&&w(u),y&&w(f),g=!1,_()}}}function o5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[l5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function r5(n,e,t){let{field:i=new gn}=e,{value:s=void 0}=e;function l(){s=ht(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class a5 extends ve{constructor(e){super(),be(this,e,r5,o5,_e,{field:1,value:0})}}function u5(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=D(),s=v("label"),o=B(l),m(e,"type","checkbox"),m(e,"id",t=n[3]),m(s,"for",r=n[3])},m(f,c){S(f,e,c),e.checked=n[0],S(f,i,c),S(f,s,c),b(s,o),a||(u=K(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&m(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&m(s,"for",r)},d(f){f&&w(e),f&&w(i),f&&w(s),a=!1,u()}}}function f5(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[u5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function c5(n,e,t){let{field:i=new gn}=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 d5 extends ve{constructor(e){super(),be(this,e,c5,f5,_e,{field:1,value:0})}}function p5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("input"),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","email"),m(f,"id",c=n[3]),f.required=d=n[1].required},m(g,_){S(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),S(g,u,_),S(g,f,_),ue(f,n[0]),p||(h=K(f,"input",n[2]),p=!0)},p(g,_){_&2&&i!==(i=H.getFieldTypeIcon(g[1].type))&&m(t,"class",i),_&2&&o!==(o=g[1].name+"")&&le(r,o),_&8&&a!==(a=g[3])&&m(e,"for",a),_&8&&c!==(c=g[3])&&m(f,"id",c),_&2&&d!==(d=g[1].required)&&(f.required=d),_&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),p=!1,h()}}}function m5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[p5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function h5(n,e,t){let{field:i=new gn}=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 _5 extends ve{constructor(e){super(),be(this,e,h5,m5,_e,{field:1,value:0})}}function g5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("input"),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3]),m(f,"type","url"),m(f,"id",c=n[3]),f.required=d=n[1].required},m(g,_){S(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),S(g,u,_),S(g,f,_),ue(f,n[0]),p||(h=K(f,"input",n[2]),p=!0)},p(g,_){_&2&&i!==(i=H.getFieldTypeIcon(g[1].type))&&m(t,"class",i),_&2&&o!==(o=g[1].name+"")&&le(r,o),_&8&&a!==(a=g[3])&&m(e,"for",a),_&8&&c!==(c=g[3])&&m(f,"id",c),_&2&&d!==(d=g[1].required)&&(f.required=d),_&1&&f.value!==g[0]&&ue(f,g[0])},d(g){g&&w(e),g&&w(u),g&&w(f),p=!1,h()}}}function b5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[g5,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function v5(n,e,t){let{field:i=new gn}=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 y5 extends ve{constructor(e){super(),be(this,e,v5,b5,_e,{field:1,value:0})}}function wp(n){let e,t,i,s;return{c(){e=v("div"),t=v("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),b(e,t),i||(s=[De(ze.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:X,d(l){l&&w(e),i=!1,Ae(s)}}}function k5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h,g,_=n[0]&&!n[1].required&&wp(n);function y($){n[6]($)}function k($){n[7]($)}let T={id:n[8],options:H.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new nu({props:T}),se.push(()=>ge(d,"value",y)),se.push(()=>ge(d,"formattedValue",k)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),a=B(" (UTC)"),f=D(),_&&_.c(),c=D(),V(d.$$.fragment),m(t,"class",i=$i(H.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),m(l,"class","txt"),m(e,"for",u=n[8])},m($,M){S($,e,M),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),S($,f,M),_&&_.m($,M),S($,c,M),q(d,$,M),g=!0},p($,M){(!g||M&2&&i!==(i=$i(H.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&m(t,"class",i),(!g||M&2)&&o!==(o=$[1].name+"")&&le(r,o),(!g||M&256&&u!==(u=$[8]))&&m(e,"for",u),$[0]&&!$[1].required?_?_.p($,M):(_=wp($),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const C={};M&256&&(C.id=$[8]),!p&&M&4&&(p=!0,C.value=$[2],ke(()=>p=!1)),!h&&M&1&&(h=!0,C.formattedValue=$[0],ke(()=>h=!1)),d.$set(C)},i($){g||(A(d.$$.fragment,$),g=!0)},o($){I(d.$$.fragment,$),g=!1},d($){$&&w(e),$&&w(f),_&&_.d($),$&&w(c),j(d,$)}}}function w5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[k5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function S5(n,e,t){let{field:i=new gn}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class T5 extends ve{constructor(e){super(),be(this,e,S5,w5,_e,{field:1,value:0})}}function Sp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=B("Select up to "),s=B(i),l=B(" items."),m(e,"class","help-block")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&w(e)}}}function $5(n){var k,T,$,M,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h;function g(O){n[3](O)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((k=n[0])==null?void 0:k.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((M=n[1].options)==null?void 0:M.values)>5};n[0]!==void 0&&(_.selected=n[0]),f=new iu({props:_}),se.push(()=>ge(f,"selected",g));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&Sp(n);return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),V(f.$$.fragment),d=D(),y&&y.c(),p=we(),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[4])},m(O,E){S(O,e,E),b(e,t),b(e,s),b(e,l),b(l,r),S(O,u,E),q(f,O,E),S(O,d,E),y&&y.m(O,E),S(O,p,E),h=!0},p(O,E){var L,F,N,R,z;(!h||E&2&&i!==(i=H.getFieldTypeIcon(O[1].type)))&&m(t,"class",i),(!h||E&2)&&o!==(o=O[1].name+"")&&le(r,o),(!h||E&16&&a!==(a=O[4]))&&m(e,"for",a);const P={};E&16&&(P.id=O[4]),E&6&&(P.toggle=!O[1].required||O[2]),E&4&&(P.multiple=O[2]),E&7&&(P.closable=!O[2]||((L=O[0])==null?void 0:L.length)>=((F=O[1].options)==null?void 0:F.maxSelect)),E&2&&(P.items=(N=O[1].options)==null?void 0:N.values),E&2&&(P.searchable=((R=O[1].options)==null?void 0:R.values)>5),!c&&E&1&&(c=!0,P.selected=O[0],ke(()=>c=!1)),f.$set(P),((z=O[1].options)==null?void 0:z.maxSelect)>1?y?y.p(O,E):(y=Sp(O),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i(O){h||(A(f.$$.fragment,O),h=!0)},o(O){I(f.$$.fragment,O),h=!1},d(O){O&&w(e),O&&w(u),j(f,O),O&&w(d),y&&y.d(O),O&&w(p)}}}function C5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function M5(n,e,t){let i,{field:s=new gn}=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 O5 extends ve{constructor(e){super(),be(this,e,M5,C5,_e,{field:1,value:0})}}function D5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,h;return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("textarea"),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[4]),m(f,"id",c=n[4]),m(f,"class","txt-mono"),f.required=d=n[1].required,f.value=n[2]},m(g,_){S(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),S(g,u,_),S(g,f,_),p||(h=K(f,"input",n[3]),p=!0)},p(g,_){_&2&&i!==(i=H.getFieldTypeIcon(g[1].type))&&m(t,"class",i),_&2&&o!==(o=g[1].name+"")&&le(r,o),_&16&&a!==(a=g[4])&&m(e,"for",a),_&16&&c!==(c=g[4])&&m(f,"id",c),_&2&&d!==(d=g[1].required)&&(f.required=d),_&4&&(f.value=g[2])},d(g){g&&w(e),g&&w(u),g&&w(f),p=!1,h()}}}function E5(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[D5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function A5(n,e,t){let{field:i=new gn}=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 I5 extends ve{constructor(e){super(),be(this,e,A5,E5,_e,{field:1,value:0})}}function P5(n){let e,t;return{c(){e=v("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 L5(n){let e,t,i;return{c(){e=v("img"),Un(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&&!Un(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 N5(n){let e;function t(l,o){return l[2]?L5:P5}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:X,o:X,d(l){s.d(l),l&&w(e)}}}function F5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),H.hasImageExtension(s==null?void 0:s.name)&&H.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{console.warn("Unable to generate thumb: ",r)})}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class R5 extends ve{constructor(e){super(),be(this,e,F5,N5,_e,{file:0,size:1})}}function Tp(n){let e;function t(l,o){return l[4]==="image"?j5:q5}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 q5(n){let e,t;return{c(){e=v("object"),t=B("Cannot preview the file."),m(e,"title",n[2]),m(e,"data",n[1])},m(i,s){S(i,e,s),b(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 j5(n){let e,t,i;return{c(){e=v("img"),Un(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&&!Un(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 V5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Tp(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=Tp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){i&&i.d(l),l&&w(t)}}}function H5(n){let e,t,i;return{c(){e=v("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=K(e,"click",ft(n[0])),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function z5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=B(n[2]),i=D(),s=v("i"),l=D(),o=v("div"),r=D(),a=v("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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,l,d),S(c,o,d),S(c,r,d),S(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&m(e,"href",c[1]),d&4&&m(e,"title",c[2])},d(c){c&&w(e),c&&w(l),c&&w(o),c&&w(r),c&&w(a),u=!1,f()}}}function B5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[z5],header:[H5],default:[V5]},$$scope:{ctx:n}};return e=new bn({props:i}),n[6](e),e.$on("show",n[7]),e.$on("hide",n[8]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&542&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function U5(n,e,t){let i,s,l,o="";function r(d){d!==""&&(t(1,o=d),l==null||l.show())}function a(){return l==null?void 0:l.hide()}function u(d){se[d?"unshift":"push"](()=>{l=d,t(3,l)})}function f(d){de.call(this,n,d)}function c(d){de.call(this,n,d)}return n.$$.update=()=>{n.$$.dirty&2&&t(2,i=o.substring(o.lastIndexOf("/")+1)),n.$$.dirty&4&&t(4,s=H.getFileType(i))},[a,o,i,l,s,r,u,f,c]}class W5 extends ve{constructor(e){super(),be(this,e,U5,B5,_e,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function Y5(n){let e;return{c(){e=v("i"),m(e,"class","ri-file-3-line")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function K5(n){let e;return{c(){e=v("i"),m(e,"class","ri-video-line")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function J5(n){let e,t,i,s,l;return{c(){e=v("img"),Un(e.src,t=n[4])||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=K(e,"error",n[7]),s=!0)},p(o,r){r&16&&!Un(e.src,t=o[4])&&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 Z5(n){let e,t,i,s,l,o,r,a;function u(p,h){return p[2]==="image"?J5:p[2]==="video"||p[2]==="audio"?K5:Y5}let f=u(n),c=f(n),d={};return l=new W5({props:d}),n[10](l),{c(){e=v("a"),c.c(),s=D(),V(l.$$.fragment),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[5]?"Preview":"Download")+" "+n[0])},m(p,h){S(p,e,h),c.m(e,null),S(p,s,h),q(l,p,h),o=!0,r||(a=K(e,"click",$n(n[9])),r=!0)},p(p,[h]){f===(f=u(p))&&c?c.p(p,h):(c.d(1),c=f(p),c&&(c.c(),c.m(e,null))),(!o||h&2&&t!==(t="thumb "+(p[1]?`thumb-${p[1]}`:"")))&&m(e,"class",t),(!o||h&33&&i!==(i=(p[5]?"Preview":"Download")+" "+p[0]))&&m(e,"title",i);const g={};l.$set(g)},i(p){o||(A(l.$$.fragment,p),o=!0)},o(p){I(l.$$.fragment,p),o=!1},d(p){p&&w(e),c.d(),p&&w(s),n[10](null),j(l,p),r=!1,a()}}}function G5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f=me.getFileUrl(l,o);function c(){t(4,u="")}const d=h=>{s&&(h.preventDefault(),a==null||a.show(f))};function p(h){se[h?"unshift":"push"](()=>{a=h,t(3,a)})}return n.$$set=h=>{"record"in h&&t(8,l=h.record),"filename"in h&&t(0,o=h.filename),"size"in h&&t(1,r=h.size)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getFileType(o)),n.$$.dirty&5&&t(5,s=["image","audio","video"].includes(i)||o.endsWith(".pdf"))},t(4,u=f?f+"?thumb=100x100":""),[o,r,i,a,u,s,f,c,l,d,p]}class lu extends ve{constructor(e){super(),be(this,e,G5,Z5,_e,{record:8,filename:0,size:1})}}function $p(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function Cp(n,e,t){const i=n.slice();i[25]=e[t],i[24]=t;const s=i[1].includes(i[24]);return i[26]=s,i}function X5(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=v("button"),e.innerHTML='<i class="ri-close-line"></i>',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=[De(ze.call(null,e,"Remove file")),K(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,Ae(i)}}}function Q5(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=v("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=K(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&w(e),t=!1,i()}}}function Mp(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,p,h,g;s=new lu({props:{record:e[2],filename:e[25]}});function _(T,$){return $&18&&(h=null),h==null&&(h=!!T[1].includes(T[24])),h?Q5:X5}let y=_(e,-1),k=y(e);return{key:n,first:null,c(){t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),r=v("a"),u=B(a),d=D(),p=v("div"),k.c(),Q(i,"fade",e[1].includes(e[24])),m(r,"href",f=me.getFileUrl(e[2],e[25])),m(r,"class",c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")),m(r,"title","Download"),m(r,"target","_blank"),m(r,"rel","noopener noreferrer"),m(o,"class","content"),m(p,"class","actions"),m(t,"class","list-item"),this.first=t},m(T,$){S(T,t,$),b(t,i),q(s,i,null),b(t,l),b(t,o),b(o,r),b(r,u),b(t,d),b(t,p),k.m(p,null),g=!0},p(T,$){e=T;const M={};$&4&&(M.record=e[2]),$&16&&(M.filename=e[25]),s.$set(M),(!g||$&18)&&Q(i,"fade",e[1].includes(e[24])),(!g||$&16)&&a!==(a=e[25]+"")&&le(u,a),(!g||$&20&&f!==(f=me.getFileUrl(e[2],e[25])))&&m(r,"href",f),(!g||$&18&&c!==(c="txt-ellipsis "+(e[26]?"txt-strikethrough txt-hint":"link-primary")))&&m(r,"class",c),y===(y=_(e,$))&&k?k.p(e,$):(k.d(1),k=y(e),k&&(k.c(),k.m(p,null)))},i(T){g||(A(s.$$.fragment,T),g=!0)},o(T){I(s.$$.fragment,T),g=!1},d(T){T&&w(t),j(s),k.d()}}}function Op(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,p,h,g,_;i=new R5({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=v("div"),t=v("figure"),V(i.$$.fragment),s=D(),l=v("div"),o=v("small"),o.textContent="New",r=D(),a=v("span"),f=B(u),d=D(),p=v("button"),p.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",c=n[22].name),m(p,"type","button"),m(p,"class","btn btn-transparent btn-sm btn-circle btn-remove"),m(e,"class","list-item")},m(k,T){S(k,e,T),b(e,t),q(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,p),h=!0,g||(_=[De(ze.call(null,p,"Remove file")),K(p,"click",y)],g=!0)},p(k,T){n=k;const $={};T&1&&($.file=n[22]),i.$set($),(!h||T&1)&&u!==(u=n[22].name+"")&&le(f,u),(!h||T&1&&c!==(c=n[22].name))&&m(l,"title",c)},i(k){h||(A(i.$$.fragment,k),h=!0)},o(k){I(i.$$.fragment,k),h=!1},d(k){k&&w(e),j(i),g=!1,Ae(_)}}}function x5(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,h,g,_,y,k,T,$,M,C,O,E,P=n[4];const L=z=>z[25]+z[2].id;for(let z=0;z<P.length;z+=1){let W=Cp(n,P,z),J=L(W);d.set(J,c[z]=Mp(J,W))}let F=n[0],N=[];for(let z=0;z<F.length;z+=1)N[z]=Op($p(n,F,z));const R=z=>I(N[z],1,1,()=>{N[z]=null});return{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div");for(let z=0;z<c.length;z+=1)c[z].c();p=D();for(let z=0;z<N.length;z+=1)N[z].c();h=D(),g=v("div"),_=v("input"),y=D(),k=v("button"),T=v("i"),$=D(),M=v("span"),M.textContent="Upload new file",m(t,"class",i=H.getFieldTypeIcon(n[3].type)),m(l,"class","txt"),m(e,"for",a=n[21]),m(_,"type","file"),m(_,"class","hidden"),_.multiple=n[5],m(T,"class","ri-upload-cloud-line"),m(M,"class","txt"),m(k,"type","button"),m(k,"class","btn btn-transparent btn-sm btn-block"),k.disabled=n[8],m(g,"class","list-item list-item-btn"),m(f,"class","list")},m(z,W){S(z,e,W),b(e,t),b(e,s),b(e,l),b(l,r),S(z,u,W),S(z,f,W);for(let J=0;J<c.length;J+=1)c[J]&&c[J].m(f,null);b(f,p);for(let J=0;J<N.length;J+=1)N[J]&&N[J].m(f,null);b(f,h),b(f,g),b(g,_),n[16](_),b(g,y),b(g,k),b(k,T),b(k,$),b(k,M),n[19](f),C=!0,O||(E=[K(_,"change",n[17]),K(k,"click",n[18])],O=!0)},p(z,W){if((!C||W&8&&i!==(i=H.getFieldTypeIcon(z[3].type)))&&m(t,"class",i),(!C||W&8)&&o!==(o=z[3].name+"")&&le(r,o),(!C||W&2097152&&a!==(a=z[21]))&&m(e,"for",a),W&1558&&(P=z[4],re(),c=Ct(c,W,L,1,z,P,d,f,an,Mp,p,Cp),ae()),W&2049){F=z[0];let J;for(J=0;J<F.length;J+=1){const x=$p(z,F,J);N[J]?(N[J].p(x,W),A(N[J],1)):(N[J]=Op(x),N[J].c(),A(N[J],1),N[J].m(f,h))}for(re(),J=F.length;J<N.length;J+=1)R(J);ae()}(!C||W&32)&&(_.multiple=z[5]),(!C||W&256)&&(k.disabled=z[8])},i(z){if(!C){for(let W=0;W<P.length;W+=1)A(c[W]);for(let W=0;W<F.length;W+=1)A(N[W]);C=!0}},o(z){for(let W=0;W<c.length;W+=1)I(c[W]);N=N.filter(Boolean);for(let W=0;W<N.length;W+=1)I(N[W]);C=!1},d(z){z&&w(e),z&&w(u),z&&w(f);for(let W=0;W<c.length;W+=1)c[W].d();at(N,z),n[16](null),n[19](null),O=!1,Ae(E)}}}function eM(n){let e,t;return e=new pe({props:{class:"form-field form-field-list form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[x5,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-list form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&270533119&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function tM(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new gn}=e,c,d;function p(E){H.removeByValue(u,E),t(1,u)}function h(E){H.pushUnique(u,E),t(1,u)}function g(E){H.isEmpty(a[E])||a.splice(E,1),t(0,a)}function _(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>p(E),k=E=>h(E),T=E=>g(E);function $(E){se[E?"unshift":"push"](()=>{c=E,t(6,c)})}const M=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},C=()=>c==null?void 0:c.click();function O(E){se[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,P;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=H.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=H.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&H.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=H.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((P=f.options)==null?void 0:P.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&_()},[a,u,o,f,s,i,c,d,l,p,h,g,r,y,k,T,$,M,C,O]}class nM extends ve{constructor(e){super(),be(this,e,tM,eM,_e,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function Dp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function iM(n,e){e=Dp(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=Dp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}const sM=n=>({dragging:n&2,dragover:n&4}),Ep=n=>({dragging:n[1],dragover:n[2]});function lM(n){let e,t,i,s;const l=n[8].default,o=Et(l,n,n[7],Ep);return{c(){e=v("div"),o&&o.c(),m(e,"draggable",!0),m(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[1]),Q(e,"dragover",n[2])},m(r,a){S(r,e,a),o&&o.m(e,null),t=!0,i||(s=[K(e,"dragover",ft(n[9])),K(e,"dragleave",ft(n[10])),K(e,"dragend",n[11]),K(e,"dragstart",n[12]),K(e,"drop",n[13])],i=!0)},p(r,[a]){o&&o.p&&(!t||a&134)&&It(o,l,r,r[7],t?At(l,r[7],a,sM):Pt(r[7]),Ep),(!t||a&2)&&Q(e,"dragging",r[1]),(!t||a&4)&&Q(e,"dragover",r[2])},i(r){t||(A(o,r),t=!0)},o(r){I(o,r),t=!1},d(r){r&&w(e),o&&o.d(r),i=!1,Ae(s)}}}function oM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=vt();let{index:o}=e,{list:r=[]}=e,{disabled:a=!1}=e,u=!1,f=!1;function c(k,T){!k&&!a||(t(1,u=!0),k.dataTransfer.effectAllowed="move",k.dataTransfer.dropEffect="move",k.dataTransfer.setData("text/plain",T))}function d(k,T){if(!k&&!a)return;t(2,f=!1),t(1,u=!1),k.dataTransfer.dropEffect="move";const $=parseInt(k.dataTransfer.getData("text/plain"));$<T?(r.splice(T+1,0,r[$]),r.splice($,1)):(r.splice(T,0,r[$]),r.splice($+1,1)),t(5,r),l("sort",r)}const p=()=>{t(2,f=!0)},h=()=>{t(2,f=!1)},g=()=>{t(2,f=!1),t(1,u=!1)},_=k=>c(k,o),y=k=>d(k,o);return n.$$set=k=>{"index"in k&&t(0,o=k.index),"list"in k&&t(5,r=k.list),"disabled"in k&&t(6,a=k.disabled),"$$scope"in k&&t(7,s=k.$$scope)},[o,u,f,c,d,r,a,s,i,p,h,g,_,y]}class rM extends ve{constructor(e){super(),be(this,e,oM,lM,_e,{index:0,list:5,disabled:6})}}function Ap(n,e,t){const i=n.slice();i[6]=e[t];const s=H.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Ip(n,e,t){const i=n.slice();return i[10]=e[t],i}function Pp(n){let e,t;return e=new lu({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function Lp(n){let e=!H.isEmpty(n[10]),t,i,s=e&&Pp(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=!H.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Pp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){I(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function Np(n){let e,t,i=n[7],s=[];for(let o=0;o<i.length;o+=1)s[o]=Lp(Ip(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=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=Ip(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Lp(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function aM(n){let e,t,i,s,l,o,r=H.truncate(H.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=n[1],p=[];for(let g=0;g<d.length;g+=1)p[g]=Np(Ap(n,d,g));const h=g=>I(p[g],1,1,()=>{p[g]=null});return{c(){e=v("div"),t=v("i"),s=D();for(let g=0;g<p.length;g+=1)p[g].c();l=D(),o=v("span"),a=B(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(g,_){S(g,e,_),b(e,t),b(e,s);for(let y=0;y<p.length;y+=1)p[y]&&p[y].m(e,null);b(e,l),b(e,o),b(o,a),u=!0,f||(c=De(i=ze.call(null,t,{text:H.truncate(JSON.stringify(H.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),f=!0)},p(g,[_]){if(i&&Bt(i.update)&&_&1&&i.update.call(null,{text:H.truncate(JSON.stringify(H.truncateObject(g[0]),null,2),800,!0),class:"code",position:"left"}),_&3){d=g[1];let y;for(y=0;y<d.length;y+=1){const k=Ap(g,d,y);p[y]?(p[y].p(k,_),A(p[y],1)):(p[y]=Np(k),p[y].c(),A(p[y],1),p[y].m(e,l))}for(re(),y=d.length;y<p.length;y+=1)h(y);ae()}(!u||_&5)&&r!==(r=H.truncate(H.displayValue(g[0],g[2]),70)+"")&&le(a,r)},i(g){if(!u){for(let _=0;_<d.length;_+=1)A(p[_]);u=!0}},o(g){p=p.filter(Boolean);for(let _=0;_<p.length;_+=1)I(p[_]);u=!1},d(g){g&&w(e),at(p,g),f=!1,c()}}}function uM(n,e,t){let i,s,l,o;We(n,Pi,u=>t(5,o=u));let{record:r}=e,{displayFields:a=[]}=e;return n.$$set=u=>{"record"in u&&t(0,r=u.record),"displayFields"in u&&t(3,a=u.displayFields)},n.$$.update=()=>{n.$$.dirty&33&&t(4,i=o==null?void 0:o.find(u=>u.id==(r==null?void 0:r.collectionId))),n.$$.dirty&24&&t(1,s=(a==null?void 0:a.filter(u=>{var f;return!!((f=i==null?void 0:i.schema)!=null&&f.find(c=>c.name==u&&c.type=="file"))}))||[]),n.$$.dirty&10&&t(2,l=(s.length?a==null?void 0:a.filter(u=>!s.includes(u)):a)||[])},[r,s,l,a,i,o]}class Qo extends ve{constructor(e){super(),be(this,e,uM,aM,_e,{record:0,displayFields:3})}}function Fp(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function Rp(n,e,t){const i=n.slice();i[49]=e[t];const s=i[8](i[49]);return i[6]=s,i}function qp(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[31]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function jp(n){let e,t;function i(o,r){return o[12]?cM:fM}let s=i(n),l=s(n);return{c(){e=v("div"),l.c(),t=D(),m(e,"class","list-item")},m(o,r){S(o,e,r),l.m(e,null),b(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 fM(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&Vp(n);return{c(){e=v("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=Vp(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 cM(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader loader-sm active"></span>',m(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Vp(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[35]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function dM(n){let e;return{c(){e=v("i"),m(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pM(n){let e;return{c(){e=v("i"),m(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Hp(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("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),b(e,t),i||(s=[De(ze.call(null,t,"Edit")),K(t,"keydown",$n(n[27])),K(t,"click",$n(l))],i=!0)},p(o,r){n=o},d(o){o&&w(e),i=!1,Ae(s)}}}function zp(n,e){var y;let t,i,s,l,o,r,a,u,f;function c(k,T){return k[6]?pM:dM}let d=c(e),p=d(e);l=new Qo({props:{record:e[49],displayFields:e[13]}});let h=!((y=e[10])!=null&&y.isView)&&Hp(e);function g(){return e[33](e[49])}function _(...k){return e[34](e[49],...k)}return{key:n,first:null,c(){t=v("div"),p.c(),i=D(),s=v("div"),V(l.$$.fragment),o=D(),h&&h.c(),r=D(),m(s,"class","content"),m(t,"tabindex","0"),m(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[5]>1&&!e[9]),this.first=t},m(k,T){S(k,t,T),p.m(t,null),b(t,i),b(t,s),q(l,s,null),b(t,o),h&&h.m(t,null),b(t,r),a=!0,u||(f=[K(t,"click",g),K(t,"keydown",_)],u=!0)},p(k,T){var M;e=k,d!==(d=c(e))&&(p.d(1),p=d(e),p&&(p.c(),p.m(t,i)));const $={};T[0]&8&&($.record=e[49]),T[0]&8192&&($.displayFields=e[13]),l.$set($),(M=e[10])!=null&&M.isView?h&&(h.d(1),h=null):h?h.p(e,T):(h=Hp(e),h.c(),h.m(t,r)),(!a||T[0]&264)&&Q(t,"selected",e[6]),(!a||T[0]&808)&&Q(t,"disabled",!e[6]&&e[5]>1&&!e[9])},i(k){a||(A(l.$$.fragment,k),a=!0)},o(k){I(l.$$.fragment,k),a=!1},d(k){k&&w(t),p.d(),j(l),h&&h.d(),u=!1,Ae(f)}}}function Bp(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=B("("),i=B(t),s=B(" of MAX "),l=B(n[5]),o=B(")")},m(r,a){S(r,e,a),S(r,i,a),S(r,s,a),S(r,l,a),S(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&32&&le(l,r[5])},d(r){r&&w(e),r&&w(i),r&&w(s),r&&w(l),r&&w(o)}}}function mM(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function hM(n){let e,t,i=n[6],s=[];for(let o=0;o<i.length;o+=1)s[o]=Up(Fp(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o<s.length;o+=1)s[o].c();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=Fp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Up(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){o&&w(e),at(s,o)}}}function _M(n){let e,t,i,s,l,o,r,a;t=new Qo({props:{record:n[49],displayFields:n[13]}});function u(){return n[37](n[49])}return{c(){e=v("span"),V(t.$$.fragment),i=D(),s=v("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"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){S(f,e,c),q(t,e,null),b(e,i),b(e,s),S(f,l,c),o=!0,r||(a=K(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),c[0]&8192&&(d.displayFields=n[13]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){I(t.$$.fragment,f),o=!1},d(f){f&&w(e),j(t),f&&w(l),r=!1,a()}}}function Up(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[_M,({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 rM({props:l}),se.push(()=>ge(e,"list",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&8256|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function gM(n){var F;let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,p,h,g,_,y,k;t=new Wo({props:{value:n[2],autocompleteCollection:n[10]}}),t.$on("submit",n[30]);let T=!((F=n[10])!=null&&F.isView)&&qp(n),$=n[3];const M=N=>N[49].id;for(let N=0;N<$.length;N+=1){let R=Rp(n,$,N),z=M(R);r.set(z,o[N]=zp(z,R))}let C=null;$.length||(C=jp(n));let O=n[5]>1&&Bp(n);const E=[hM,mM],P=[];function L(N,R){return N[6].length?0:1}return p=L(n),h=P[p]=E[p](n),{c(){e=v("div"),V(t.$$.fragment),i=D(),T&&T.c(),s=D(),l=v("div");for(let N=0;N<o.length;N+=1)o[N].c();C&&C.c(),u=D(),f=v("h5"),c=B(`Selected
`),O&&O.c(),d=D(),h.c(),g=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(N,R){S(N,e,R),q(t,e,null),b(e,i),T&&T.m(e,null),S(N,s,R),S(N,l,R);for(let z=0;z<o.length;z+=1)o[z]&&o[z].m(l,null);C&&C.m(l,null),S(N,u,R),S(N,f,R),b(f,c),O&&O.m(f,null),S(N,d,R),P[p].m(N,R),S(N,g,R),_=!0,y||(k=De(a=iM.call(null,l,n[36])),y=!0)},p(N,R){var J;const z={};R[0]&4&&(z.value=N[2]),R[0]&1024&&(z.autocompleteCollection=N[10]),t.$set(z),(J=N[10])!=null&&J.isView?T&&(T.d(1),T=null):T?T.p(N,R):(T=qp(N),T.c(),T.m(e,null)),R[0]&145324&&($=N[3],re(),o=Ct(o,R,M,1,N,$,r,l,an,zp,null,Rp),ae(),!$.length&&C?C.p(N,R):$.length?C&&(C.d(1),C=null):(C=jp(N),C.c(),C.m(l,null))),a&&Bt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?O?O.p(N,R):(O=Bp(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let W=p;p=L(N),p===W?P[p].p(N,R):(re(),I(P[W],1,1,()=>{P[W]=null}),ae(),h=P[p],h?h.p(N,R):(h=P[p]=E[p](N),h.c()),A(h,1),h.m(g.parentNode,g))},i(N){if(!_){A(t.$$.fragment,N);for(let R=0;R<$.length;R+=1)A(o[R]);A(h),_=!0}},o(N){I(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)I(o[R]);I(h),_=!1},d(N){N&&w(e),j(t),T&&T.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();C&&C.d(),N&&w(u),N&&w(f),O&&O.d(),N&&w(d),P[p].d(N),N&&w(g),y=!1,k()}}}function bM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=B("Select "),i=v("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(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 vM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save 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=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function yM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[vM],header:[bM],default:[gM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Le(o,l[a]);e=new bn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new G1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?bt(l,[l[0],l[1],Vt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Ar=100;function kM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Je(e,c),p;We(n,Pi,Pe=>t(26,p=Pe));const h=vt(),g="picker_"+H.randomString(5);let{value:_}=e,{field:y}=e,k,T,$="",M=[],C=[],O=1,E=0,P=!1,L=!1;function F(){return t(2,$=""),t(3,M=[]),t(6,C=[]),R(),z(!0),k==null?void 0:k.show()}function N(){return k==null?void 0:k.hide()}async function R(){const Pe=H.toArray(_);if(!s||!Pe.length)return;t(24,L=!0);let ie=[];const Se=Pe.slice(),st=[];for(;Se.length>0;){const nt=[];for(const kt of Se.splice(0,Ar))nt.push(`id="${kt}"`);st.push(me.collection(s).getFullList(Ar,{filter:nt.join("||"),$autoCancel:!1}))}try{await Promise.all(st).then(nt=>{ie=ie.concat(...nt)}),t(6,C=[]);for(const nt of Pe){const kt=H.findByKey(ie,"id",nt);kt&&C.push(kt)}$.trim()||t(3,M=H.filterDuplicatesByKey(C.concat(M)))}catch(nt){me.errorResponseHandler(nt)}t(24,L=!1)}async function z(Pe=!1){if(s){t(4,P=!0),Pe&&($.trim()?t(3,M=[]):t(3,M=H.toArray(C).slice()));try{const ie=Pe?1:O+1,Se=await me.collection(s).getList(ie,Ar,{filter:$,sort:o!=null&&o.isView?"":"-created",$cancelKey:g+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(Se.items))),O=Se.page,t(23,E=Se.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,P=!1)}}function W(Pe){i==1?t(6,C=[Pe]):u&&(H.pushOrReplaceByKey(C,Pe),t(6,C))}function J(Pe){H.removeByKey(C,"id",Pe.id),t(6,C)}function x(Pe){f(Pe)?J(Pe):W(Pe)}function ne(){var Pe;i!=1?t(20,_=C.map(ie=>ie.id)):t(20,_=((Pe=C==null?void 0:C[0])==null?void 0:Pe.id)||""),h("save",C),N()}function G(Pe){de.call(this,n,Pe)}const fe=()=>N(),Z=()=>ne(),ce=Pe=>t(2,$=Pe.detail),he=()=>T==null?void 0:T.show(),Ce=Pe=>T==null?void 0:T.show(Pe),Re=Pe=>x(Pe),je=(Pe,ie)=>{(ie.code==="Enter"||ie.code==="Space")&&(ie.preventDefault(),ie.stopPropagation(),x(Pe))},ye=()=>t(2,$=""),$e=()=>{a&&!P&&z()},Ye=Pe=>J(Pe);function dt(Pe){C=Pe,t(6,C)}function Ke(Pe){se[Pe?"unshift":"push"](()=>{k=Pe,t(1,k)})}function Be(Pe){de.call(this,n,Pe)}function ee(Pe){de.call(this,n,Pe)}function Fe(Pe){se[Pe?"unshift":"push"](()=>{T=Pe,t(7,T)})}const tt=Pe=>{H.removeByKey(M,"id",Pe.detail.id),M.unshift(Pe.detail),t(3,M),W(Pe.detail)},Wt=Pe=>{H.removeByKey(M,"id",Pe.detail.id),t(3,M),J(Pe.detail)};return n.$$set=Pe=>{e=Le(Le({},e),jt(Pe)),t(19,d=Je(e,c)),"value"in Pe&&t(20,_=Pe.value),"field"in Pe&&t(21,y=Pe.field)},n.$$.update=()=>{var Pe,ie,Se;n.$$.dirty[0]&2097152&&t(5,i=((Pe=y==null?void 0:y.options)==null?void 0:Pe.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ie=y==null?void 0:y.options)==null?void 0:ie.collectionId),n.$$.dirty[0]&2097152&&t(13,l=(Se=y==null?void 0:y.options)==null?void 0:Se.displayFields),n.$$.dirty[0]&100663296&&t(10,o=p.find(st=>st.id==s)||null),n.$$.dirty[0]&16777222&&typeof $<"u"&&!L&&k!=null&&k.isActive()&&z(!0),n.$$.dirty[0]&16777232&&t(12,r=P||L),n.$$.dirty[0]&8388616&&t(11,a=E>M.length),n.$$.dirty[0]&96&&t(9,u=i===null||i>C.length),n.$$.dirty[0]&64&&t(8,f=function(st){return H.findByKey(C,"id",st.id)})},[N,k,$,M,P,i,C,T,f,u,o,a,r,l,z,W,J,x,ne,d,_,y,F,E,L,s,p,G,fe,Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be,ee,Fe,tt,Wt]}class wM extends ve{constructor(e){super(),be(this,e,kM,yM,_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 Wp(n,e,t){const i=n.slice();return i[15]=e[t],i}function Yp(n,e,t){const i=n.slice();return i[18]=e[t],i}function Kp(n){let e,t=n[5]&&Jp(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=Jp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&w(e)}}}function Jp(n){let e,t=H.toArray(n[0]).slice(0,10),i=[];for(let s=0;s<t.length;s+=1)i[s]=Zp(Yp(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=H.toArray(s[0]).slice(0,10);let o;for(o=0;o<t.length;o+=1){const r=Yp(s,t,o);i[o]?i[o].p(r,l):(i[o]=Zp(),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){at(i,s),s&&w(e)}}}function Zp(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="skeleton-loader"></div>
`,m(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Gp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),o=v("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")},m(p,h){S(p,e,h),b(e,t),q(i,t,null),b(e,s),b(e,l),b(l,o),b(e,r),a=!0,u||(f=[De(ze.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(p,h){var _;n=p;const g={};h&16&&(g.record=n[15]),h&4&&(g.displayFields=(_=n[2].options)==null?void 0:_.displayFields),i.$set(g)},i(p){a||(A(i.$$.fragment,p),a=!0)},o(p){I(i.$$.fragment,p),a=!1},d(p){p&&w(e),j(i),u=!1,Ae(f)}}}function SM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k=n[4],T=[];for(let C=0;C<k.length;C+=1)T[C]=Gp(Wp(n,k,C));const $=C=>I(T[C],1,1,()=>{T[C]=null});let M=null;return k.length||(M=Kp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div"),c=v("div");for(let C=0;C<T.length;C+=1)T[C].c();M&&M.c(),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=$i(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[14]),m(c,"class","relations-list svelte-1ynw0pc"),m(h,"type","button"),m(h,"class","btn btn-transparent btn-sm btn-block"),m(p,"class","list-item list-item-btn"),m(f,"class","list")},m(C,O){S(C,e,O),b(e,t),b(e,s),b(e,l),b(l,r),S(C,u,O),S(C,f,O),b(f,c);for(let E=0;E<T.length;E+=1)T[E]&&T[E].m(c,null);M&&M.m(c,null),b(f,d),b(f,p),b(p,h),g=!0,_||(y=K(h,"click",n[9]),_=!0)},p(C,O){if((!g||O&4&&i!==(i=$i(H.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!g||O&4)&&o!==(o=C[2].name+"")&&le(r,o),(!g||O&16384&&a!==(a=C[14]))&&m(e,"for",a),O&181){k=C[4];let E;for(E=0;E<k.length;E+=1){const P=Wp(C,k,E);T[E]?(T[E].p(P,O),A(T[E],1)):(T[E]=Gp(P),T[E].c(),A(T[E],1),T[E].m(c,null))}for(re(),E=k.length;E<T.length;E+=1)$(E);ae(),!k.length&&M?M.p(C,O):k.length?M&&(M.d(1),M=null):(M=Kp(C),M.c(),M.m(c,null))}},i(C){if(!g){for(let O=0;O<k.length;O+=1)A(T[O]);g=!0}},o(C){T=T.filter(Boolean);for(let O=0;O<T.length;O+=1)I(T[O]);g=!1},d(C){C&&w(e),C&&w(u),C&&w(f),at(T,C),M&&M.d(),_=!1,y()}}}function TM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[SM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new wM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Xp=100;function $M(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new gn}=e,r,a=[],u=!1;f();async function f(){var $,M;const y=H.toArray(s);if(!(($=o==null?void 0:o.options)!=null&&$.collectionId)||!y.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const k=y.slice(),T=[];for(;k.length>0;){const C=[];for(const O of k.splice(0,Xp))C.push(`id="${O}"`);T.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Xp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(T).then(O=>{C=C.concat(...O)});for(const O of y){const E=H.findByKey(C,"id",O);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(y){var k;H.removeByKey(a,"id",y.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((k=a[0])==null?void 0:k.id)||"")}const d=y=>c(y),p=()=>l==null?void 0:l.show();function h(y){se[y?"unshift":"push"](()=>{r=y,t(3,r)})}function g(y){se[y?"unshift":"push"](()=>{l=y,t(1,l)})}const _=y=>{var k;t(4,a=y.detail||[]),t(0,s=i?a.map(T=>T.id):((k=a[0])==null?void 0:k.id)||"")};return n.$$set=y=>{"value"in y&&t(0,s=y.value),"picker"in y&&t(1,l=y.picker),"field"in y&&t(2,o=y.field)},n.$$.update=()=>{var y;n.$$.dirty&4&&t(6,i=((y=o.options)==null?void 0:y.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,p,h,g,_]}class CM extends ve{constructor(e){super(),be(this,e,$M,TM,_e,{value:0,picker:1,field:2})}}const MM=["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"],OM=(n,e)=>{MM.forEach(t=>{n.on(t,i=>{e(t.toLowerCase(),{eventName:t,event:i,editor:n})})})};function DM(n){let e;return{c(){e=v("textarea"),m(e,"id",n[0]),Nr(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 EM(n){let e;return{c(){e=v("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 AM(n){let e;function t(l,o){return l[1]?EM:DM}let i=t(n),s=i(n);return{c(){e=v("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:X,o:X,d(l){l&&w(e),s.d(),n[19](null)}}}const J1=n=>n+"_"+Math.floor(Math.random()*1e9)+String(Date.now()),IM=()=>{let n={listeners:[],scriptId:J1("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 PM=IM();function LM(n,e,t){var i;let{id:s=J1("tinymce-svelte")}=e,{inline:l=void 0}=e,{disabled:o=!1}=e,{apiKey:r="no-api-key"}=e,{channel:a="6"}=e,{scriptSrc:u=void 0}=e,{conf:f={}}=e,{modelEvents:c="change input undo redo"}=e,{value:d=""}=e,{text:p=""}=e,{cssClass:h="tinymce-wrapper"}=e,g,_,y,k="",T=o;const $=vt(),M=()=>{const F=(()=>typeof window<"u"?window:global)();return F&&F.tinymce?F.tinymce:null},C=()=>{const L=Object.assign(Object.assign({},f),{target:_,inline:l!==void 0?l:f.inline!==void 0?f.inline:!1,readonly:o,setup:F=>{t(14,y=F),F.on("init",()=>{F.setContent(d),F.on(c,()=>{t(15,k=F.getContent()),k!==d&&(t(5,d=k),t(6,p=F.getContent({format:"text"})))})}),OM(F,$),typeof f.setup=="function"&&f.setup(F)}});t(4,_.style.visibility="",_),M().init(L)};Qt(()=>{if(M()!==null)C();else{const L=u||`https://cdn.tiny.cloud/1/${r}/tinymce/${a}/tinymce.min.js`;PM.load(g.ownerDocument,L,()=>{C()})}}),I_(()=>{var L;y&&((L=M())===null||L===void 0||L.remove(y))});function O(L){se[L?"unshift":"push"](()=>{_=L,t(4,_)})}function E(L){se[L?"unshift":"push"](()=>{_=L,t(4,_)})}function P(L){se[L?"unshift":"push"](()=>{g=L,t(3,g)})}return n.$$set=L=>{"id"in L&&t(0,s=L.id),"inline"in L&&t(1,l=L.inline),"disabled"in L&&t(7,o=L.disabled),"apiKey"in L&&t(8,r=L.apiKey),"channel"in L&&t(9,a=L.channel),"scriptSrc"in L&&t(10,u=L.scriptSrc),"conf"in L&&t(11,f=L.conf),"modelEvents"in L&&t(12,c=L.modelEvents),"value"in L&&t(5,d=L.value),"text"in L&&t(6,p=L.text),"cssClass"in L&&t(2,h=L.cssClass)},n.$$.update=()=>{n.$$.dirty&123040&&(y&&k!==d&&(y.setContent(d),t(6,p=y.getContent({format:"text"}))),y&&o!==T&&(t(16,T=o),typeof(t(13,i=y.mode)===null||i===void 0?void 0:i.set)=="function"?y.mode.set(o?"readonly":"design"):y.setMode(o?"readonly":"design")))},[s,l,h,g,_,d,p,o,r,a,u,f,c,i,y,k,T,O,E,P]}class Z1 extends ve{constructor(e){super(),be(this,e,LM,AM,_e,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function NM(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function p(g){n[2](g)}let h={id:n[3],scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()};return n[0]!==void 0&&(h.value=n[0]),f=new Z1({props:h}),se.push(()=>ge(f,"value",p)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),V(f.$$.fragment),m(t,"class",i=H.getFieldTypeIcon(n[1].type)),m(l,"class","txt"),m(e,"for",a=n[3])},m(g,_){S(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),S(g,u,_),q(f,g,_),d=!0},p(g,_){(!d||_&2&&i!==(i=H.getFieldTypeIcon(g[1].type)))&&m(t,"class",i),(!d||_&2)&&o!==(o=g[1].name+"")&&le(r,o),(!d||_&8&&a!==(a=g[3]))&&m(e,"for",a);const y={};_&8&&(y.id=g[3]),!c&&_&1&&(c=!0,y.value=g[0],ke(()=>c=!1)),f.$set(y)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){I(f.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(u),j(f,g)}}}function FM(n){let e,t;return e=new pe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[NM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function RM(n,e,t){let{field:i=new gn}=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 qM extends ve{constructor(e){super(),be(this,e,RM,FM,_e,{field:1,value:0})}}function jM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Auth URL"),s=D(),l=v("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].authUrl),r||(a=K(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&&ue(l,u[0].authUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function VM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Token URL"),s=D(),l=v("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].tokenUrl),r||(a=K(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&&ue(l,u[0].tokenUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function HM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("User API URL"),s=D(),l=v("input"),m(e,"for",i=n[5]),m(l,"type","url"),m(l,"id",o=n[5])},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].userApiUrl),r||(a=K(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&&ue(l,u[0].userApiUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function zM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new pe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[jM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[VM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[HM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Selfhosted endpoints (optional)",t=D(),i=v("div"),s=v("div"),V(l.$$.fragment),o=D(),r=v("div"),V(a.$$.fragment),u=D(),f=v("div"),V(c.$$.fragment),m(e,"class","section-title"),m(s,"class","col-lg-4"),m(r,"class","col-lg-4"),m(f,"class","col-lg-4"),m(i,"class","grid")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),b(i,s),q(l,s,null),b(i,o),b(i,r),q(a,r,null),b(i,u),b(i,f),q(c,f,null),d=!0},p(p,[h]){const g={};h&2&&(g.name=p[1]+".authUrl"),h&97&&(g.$$scope={dirty:h,ctx:p}),l.$set(g);const _={};h&2&&(_.name=p[1]+".tokenUrl"),h&97&&(_.$$scope={dirty:h,ctx:p}),a.$set(_);const y={};h&2&&(y.name=p[1]+".userApiUrl"),h&97&&(y.$$scope={dirty:h,ctx:p}),c.$set(y)},i(p){d||(A(l.$$.fragment,p),A(a.$$.fragment,p),A(c.$$.fragment,p),d=!0)},o(p){I(l.$$.fragment,p),I(a.$$.fragment,p),I(c.$$.fragment,p),d=!1},d(p){p&&w(e),p&&w(t),p&&w(i),j(l),j(a),j(c)}}}function BM(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 Qp extends ve{constructor(e){super(),be(this,e,BM,zM,_e,{key:1,config:0})}}function UM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Auth URL"),s=D(),l=v("input"),a=D(),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].authUrl),S(d,a,p),S(d,u,p),f||(c=K(l,"input",n[2]),f=!0)},p(d,p){p&16&&i!==(i=d[4])&&m(e,"for",i),p&16&&o!==(o=d[4])&&m(l,"id",o),p&1&&r!==(r=d[0].enabled)&&(l.required=r),p&1&&l.value!==d[0].authUrl&&ue(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function WM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Token URL"),s=D(),l=v("input"),a=D(),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].tokenUrl),S(d,a,p),S(d,u,p),f||(c=K(l,"input",n[3]),f=!0)},p(d,p){p&16&&i!==(i=d[4])&&m(e,"for",i),p&16&&o!==(o=d[4])&&m(l,"id",o),p&1&&r!==(r=d[0].enabled)&&(l.required=r),p&1&&l.value!==d[0].tokenUrl&&ue(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function YM(n){let e,t,i,s,l,o,r,a,u;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[UM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[WM,({uniqueId:f})=>({4:f}),({uniqueId:f})=>f?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=D(),i=v("div"),s=v("div"),V(l.$$.fragment),o=D(),r=v("div"),V(a.$$.fragment),m(e,"class","section-title"),m(s,"class","col-lg-12"),m(r,"class","col-lg-12"),m(i,"class","grid")},m(f,c){S(f,e,c),S(f,t,c),S(f,i,c),b(i,s),q(l,s,null),b(i,o),b(i,r),q(a,r,null),u=!0},p(f,[c]){const d={};c&1&&(d.class="form-field "+(f[0].enabled?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&49&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const p={};c&1&&(p.class="form-field "+(f[0].enabled?"required":"")),c&2&&(p.name=f[1]+".tokenUrl"),c&49&&(p.$$scope={dirty:c,ctx:f}),a.$set(p)},i(f){u||(A(l.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(l.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&w(e),f&&w(t),f&&w(i),j(l),j(a)}}}function KM(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 JM extends ve{constructor(e){super(),be(this,e,KM,YM,_e,{key:1,config:0})}}function ZM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Auth URL"),s=D(),l=v("input"),a=D(),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].authUrl),S(d,a,p),S(d,u,p),f||(c=K(l,"input",n[2]),f=!0)},p(d,p){p&32&&i!==(i=d[5])&&m(e,"for",i),p&32&&o!==(o=d[5])&&m(l,"id",o),p&1&&r!==(r=d[0].enabled)&&(l.required=r),p&1&&l.value!==d[0].authUrl&&ue(l,d[0].authUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function GM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Token URL"),s=D(),l=v("input"),a=D(),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].tokenUrl),S(d,a,p),S(d,u,p),f||(c=K(l,"input",n[3]),f=!0)},p(d,p){p&32&&i!==(i=d[5])&&m(e,"for",i),p&32&&o!==(o=d[5])&&m(l,"id",o),p&1&&r!==(r=d[0].enabled)&&(l.required=r),p&1&&l.value!==d[0].tokenUrl&&ue(l,d[0].tokenUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function XM(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("User API URL"),s=D(),l=v("input"),a=D(),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0].userApiUrl),S(d,a,p),S(d,u,p),f||(c=K(l,"input",n[4]),f=!0)},p(d,p){p&32&&i!==(i=d[5])&&m(e,"for",i),p&32&&o!==(o=d[5])&&m(l,"id",o),p&1&&r!==(r=d[0].enabled)&&(l.required=r),p&1&&l.value!==d[0].userApiUrl&&ue(l,d[0].userApiUrl)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(a),d&&w(u),f=!1,c()}}}function QM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return l=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[ZM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[GM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),c=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[XM,({uniqueId:p})=>({5:p}),({uniqueId:p})=>p?32:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Endpoints",t=D(),i=v("div"),s=v("div"),V(l.$$.fragment),o=D(),r=v("div"),V(a.$$.fragment),u=D(),f=v("div"),V(c.$$.fragment),m(e,"class","section-title"),m(s,"class","col-lg-12"),m(r,"class","col-lg-12"),m(f,"class","col-lg-12"),m(i,"class","grid")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),b(i,s),q(l,s,null),b(i,o),b(i,r),q(a,r,null),b(i,u),b(i,f),q(c,f,null),d=!0},p(p,[h]){const g={};h&1&&(g.class="form-field "+(p[0].enabled?"required":"")),h&2&&(g.name=p[1]+".authUrl"),h&97&&(g.$$scope={dirty:h,ctx:p}),l.$set(g);const _={};h&1&&(_.class="form-field "+(p[0].enabled?"required":"")),h&2&&(_.name=p[1]+".tokenUrl"),h&97&&(_.$$scope={dirty:h,ctx:p}),a.$set(_);const y={};h&1&&(y.class="form-field "+(p[0].enabled?"required":"")),h&2&&(y.name=p[1]+".userApiUrl"),h&97&&(y.$$scope={dirty:h,ctx:p}),c.$set(y)},i(p){d||(A(l.$$.fragment,p),A(a.$$.fragment,p),A(c.$$.fragment,p),d=!0)},o(p){I(l.$$.fragment,p),I(a.$$.fragment,p),I(c.$$.fragment,p),d=!1},d(p){p&&w(e),p&&w(t),p&&w(i),j(l),j(a),j(c)}}}function xM(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 Ir extends ve{constructor(e){super(),be(this,e,xM,QM,_e,{key:1,config:0})}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Client ID"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=K(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]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function tO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Team ID"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[3]),r||(a=K(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]&&ue(l,u[3])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function nO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Key ID"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[4]),r||(a=K(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]&&ue(l,u[4])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=D(),s=v("i"),o=D(),r=v("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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[6]),u||(f=[De(ze.call(null,s,{text:`Max ${po} seconds (~${po/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&m(e,"for",l),d&8388608&&a!==(a=c[23])&&m(r,"id",a),d&64&&r.value!==c[6]&&ue(r,c[6])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,Ae(f)}}}function sO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Private key"),s=D(),l=v("textarea"),r=D(),a=v("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(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[5]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&m(e,"for",i),d&8388608&&o!==(o=c[23])&&m(l,"id",o),d&32&&ue(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function lO(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[eO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[tO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[nO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[iO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[sO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),a=D(),u=v("div"),V(f.$$.fragment),c=D(),d=v("div"),V(p.$$.fragment),h=D(),V(g.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(u,"class","col-lg-6"),m(d,"class","col-lg-6"),m(t,"class","grid"),m(e,"id",n[9]),m(e,"autocomplete","off")},m(T,$){S(T,e,$),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),b(t,a),b(t,u),q(f,u,null),b(t,c),b(t,d),q(p,d,null),b(t,h),q(g,t,null),_=!0,y||(k=K(e,"submit",ft(n[17])),y=!0)},p(T,$){const M={};$&25165828&&(M.$$scope={dirty:$,ctx:T}),s.$set(M);const C={};$&25165832&&(C.$$scope={dirty:$,ctx:T}),r.$set(C);const O={};$&25165840&&(O.$$scope={dirty:$,ctx:T}),f.$set(O);const E={};$&25165888&&(E.$$scope={dirty:$,ctx:T}),p.$set(E);const P={};$&25165856&&(P.$$scope={dirty:$,ctx:T}),g.$set(P)},i(T){_||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(p.$$.fragment,T),A(g.$$.fragment,T),_=!0)},o(T){I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(p.$$.fragment,T),I(g.$$.fragment,T),_=!1},d(T){T&&w(e),j(s),j(r),j(f),j(p),j(g),y=!1,k()}}}function oO(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("i"),o=D(),r=v("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],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function aO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[rO],header:[oO],default:[lO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function uO(n,e,t){let i;const s=vt(),l="apple_secret_"+H.randomString(5);let o,r,a,u,f,c,d=!1;function p(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),_n({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),Ut("Successfully generated client secret."),s("submit",L),o==null||o.hide()}catch(L){me.errorResponseHandler(L)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function k(){u=this.value,t(4,u)}function T(){c=this.value,t(6,c)}function $(){f=this.value,t(5,f)}const M=()=>g(),C=()=>!d;function O(L){se[L?"unshift":"push"](()=>{o=L,t(1,o)})}function E(L){de.call(this,n,L)}function P(L){de.call(this,n,L)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,l,g,p,_,y,k,T,$,M,C,O,E,P]}class fO extends ve{constructor(e){super(),be(this,e,uO,aO,_e,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new fO({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=D(),s=v("span"),s.textContent="Generate secret",o=D(),V(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(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),S(d,o,p),q(r,d,p),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[p]){(!a||p&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&m(e,"class",l);const h={};r.$set(h)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){I(r.$$.fragment,d),a=!1},d(d){d&&w(e),d&&w(o),n[4](null),j(r,d),u=!1,f()}}}function dO(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){se[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class pO extends ve{constructor(e){super(),be(this,e,dO,cO,_e,{key:1,config:0})}}const As={appleAuth:{title:"Apple",icon:"ri-apple-fill",optionsComponent:pO},googleAuth:{title:"Google",icon:"ri-google-fill"},microsoftAuth:{title:"Microsoft",icon:"ri-microsoft-fill",optionsComponent:JM},facebookAuth:{title:"Facebook",icon:"ri-facebook-fill"},twitterAuth:{title:"Twitter",icon:"ri-twitter-fill"},githubAuth:{title:"GitHub",icon:"ri-github-fill"},gitlabAuth:{title:"GitLab",icon:"ri-gitlab-fill",optionsComponent:Qp},giteeAuth:{title:"Gitee",icon:"ri-git-repository-fill"},giteaAuth:{title:"Gitea",icon:"ri-cup-fill",optionsComponent:Qp},discordAuth:{title:"Discord",icon:"ri-discord-fill"},kakaoAuth:{title:"Kakao",icon:"ri-kakao-talk-fill"},spotifyAuth:{title:"Spotify",icon:"ri-spotify-fill"},twitchAuth:{title:"Twitch",icon:"ri-twitch-fill"},stravaAuth:{title:"Strava",icon:"ri-riding-fill"},livechatAuth:{title:"LiveChat",icon:"ri-chat-1-fill"},oidcAuth:{title:"OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",optionsComponent:Ir},oidc2Auth:{title:"(2) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ir},oidc3Auth:{title:"(3) OpenID Connect - Authentik, Keycloak, Okta, etc.",icon:"ri-lock-fill",hidden:!0,optionsComponent:Ir}};function xp(n,e,t){const i=n.slice();return i[9]=e[t],i}function mO(n){let e;return{c(){e=v("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:X,d(t){t&&w(e)}}}function hO(n){let e,t=n[1],i=[];for(let s=0;s<t.length;s+=1)i[s]=em(xp(n,t,s));return{c(){e=v("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=xp(s,t,o);i[o]?i[o].p(r,l):(i[o]=em(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),at(i,s)}}}function _O(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function em(n){let e,t,i,s,l,o=n[3](n[9].provider)+"",r,a,u,f,c=n[9].providerId+"",d,p,h,g,_,y;function k(){return n[6](n[9])}return{c(){e=v("div"),t=v("i"),s=D(),l=v("span"),r=B(o),a=D(),u=v("div"),f=B("ID: "),d=B(c),p=D(),h=v("button"),h.innerHTML='<i class="ri-close-line"></i>',g=D(),m(t,"class",i=n[4](n[9].provider)),m(l,"class","txt"),m(u,"class","txt-hint"),m(h,"type","button"),m(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),m(e,"class","list-item")},m(T,$){S(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),b(u,f),b(u,d),b(e,p),b(e,h),b(e,g),_||(y=K(h,"click",k),_=!0)},p(T,$){n=T,$&2&&i!==(i=n[4](n[9].provider))&&m(t,"class",i),$&2&&o!==(o=n[3](n[9].provider)+"")&&le(r,o),$&2&&c!==(c=n[9].providerId+"")&&le(d,c)},d(T){T&&w(e),_=!1,y()}}}function gO(n){let e;function t(l,o){var r;return l[2]?_O:(r=l[0])!=null&&r.id&&l[1].length?hO:mO}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:X,o:X,d(l){s.d(l),l&&w(e)}}}function bO(n,e,t){const i=vt();let{record:s}=e,l=[],o=!1;function r(d){var p;return((p=As[d+"Auth"])==null?void 0:p.title)||H.sentenize(d,!1)}function a(d){var p;return((p=As[d+"Auth"])==null?void 0:p.icon)||`ri-${d}-line`}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await me.collection(s.collectionId).listExternalAuths(s.id))}catch(d){me.errorResponseHandler(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||pn(`Do you really want to unlink the ${r(d)} provider?`,()=>me.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{Ut(`Successfully unlinked the ${r(d)} provider.`),i("unlink",d),u()}).catch(p=>{me.errorResponseHandler(p)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class vO extends ve{constructor(e){super(),be(this,e,bO,gO,_e,{record:0})}}function tm(n,e,t){const i=n.slice();return i[51]=e[t],i[52]=e,i[53]=t,i}function nm(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[yO,({uniqueId:i})=>({54:i}),({uniqueId:i})=>[0,i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&25165824&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function yO(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="id",l=D(),o=v("span"),a=D(),u=v("div"),f=v("i"),d=D(),p=v("input"),m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(o,"class","flex-fill"),m(e,"for",r=n[54]),m(f,"class","ri-calendar-event-line txt-disabled"),m(u,"class","form-field-addon"),m(p,"type","text"),m(p,"id",h=n[54]),p.value=g=n[2].id,p.readOnly=!0},m(k,T){S(k,e,T),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),S(k,a,T),S(k,u,T),b(u,f),S(k,d,T),S(k,p,T),_||(y=De(c=ze.call(null,f,{text:`Created: ${n[2].created}
Updated: ${n[2].updated}`,position:"left"})),_=!0)},p(k,T){T[1]&8388608&&r!==(r=k[54])&&m(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
Updated: ${k[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=k[54])&&m(p,"id",h),T[0]&4&&g!==(g=k[2].id)&&p.value!==g&&(p.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(p),_=!1,y()}}}function im(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new X4({props:r}),se.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&sm();return{c(){V(e.$$.fragment),i=D(),a&&a.c(),s=we()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,g;const p={};d[0]&1&&(p.collection=c[0]),!t&&d[0]&4&&(t=!0,p.record=c[2],ke(()=>t=!1)),e.$set(p),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=sm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function sm(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kO(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new CM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wO(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new nM({props:u}),se.push(()=>ge(e,"value",o)),se.push(()=>ge(e,"uploadedFiles",r)),se.push(()=>ge(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function SO(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new I5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TO(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new O5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $O(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new T5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CO(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new qM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MO(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new y5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function OO(n){let e,t,i;function s(o){n[33](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new _5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function DO(n){let e,t,i;function s(o){n[32](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new d5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function EO(n){let e,t,i;function s(o){n[31](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new a5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function AO(n){let e,t,i;function s(o){n[30](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new s5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function lm(n,e){let t,i,s,l,o;const r=[AO,EO,DO,OO,MO,CO,$O,TO,SO,wO,kO],a=[];function u(f,c){return f[51].type==="text"?0:f[51].type==="number"?1:f[51].type==="bool"?2:f[51].type==="email"?3:f[51].type==="url"?4:f[51].type==="editor"?5:f[51].type==="date"?6:f[51].type==="select"?7:f[51].type==="json"?8:f[51].type==="file"?9:f[51].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=we(),s&&s.c(),l=we(),this.first=t},m(f,c){S(f,t,c),~i&&a[i].m(f,c),S(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){I(s),o=!1},d(f){f&&w(t),~i&&a[i].d(f),f&&w(l)}}}function om(n){let e,t,i;return t=new vO({props:{record:n[2]}}),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item"),Q(e,"active",n[10]===kl)},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&4&&(o.record=s[2]),t.$set(o),(!i||l[0]&1024)&&Q(e,"active",s[10]===kl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function IO(n){var _,y;let e,t,i,s,l=[],o=new Map,r,a,u,f,c=!n[2].isNew&&nm(n),d=((_=n[0])==null?void 0:_.isAuth)&&im(n),p=((y=n[0])==null?void 0:y.schema)||[];const h=k=>k[51].name;for(let k=0;k<p.length;k+=1){let T=tm(n,p,k),$=h(T);o.set($,l[k]=lm($,T))}let g=n[0].isAuth&&!n[2].isNew&&om(n);return{c(){e=v("div"),t=v("form"),c&&c.c(),i=D(),d&&d.c(),s=D();for(let k=0;k<l.length;k+=1)l[k].c();r=D(),g&&g.c(),m(t,"id",n[13]),m(t,"class","tab-item"),Q(t,"active",n[10]===xi),m(e,"class","tabs-content")},m(k,T){S(k,e,T),b(e,t),c&&c.m(t,null),b(t,i),d&&d.m(t,null),b(t,s);for(let $=0;$<l.length;$+=1)l[$]&&l[$].m(t,null);b(e,r),g&&g.m(e,null),a=!0,u||(f=K(t,"submit",ft(n[14])),u=!0)},p(k,T){var $,M;k[2].isNew?c&&(re(),I(c,1,1,()=>{c=null}),ae()):c?(c.p(k,T),T[0]&4&&A(c,1)):(c=nm(k),c.c(),A(c,1),c.m(t,i)),($=k[0])!=null&&$.isAuth?d?(d.p(k,T),T[0]&1&&A(d,1)):(d=im(k),d.c(),A(d,1),d.m(t,s)):d&&(re(),I(d,1,1,()=>{d=null}),ae()),T[0]&29&&(p=((M=k[0])==null?void 0:M.schema)||[],re(),l=Ct(l,T,h,1,k,p,o,t,an,lm,null,tm),ae()),(!a||T[0]&1024)&&Q(t,"active",k[10]===xi),k[0].isAuth&&!k[2].isNew?g?(g.p(k,T),T[0]&5&&A(g,1)):(g=om(k),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(k){if(!a){A(c),A(d);for(let T=0;T<p.length;T+=1)A(l[T]);A(g),a=!0}},o(k){I(c),I(d);for(let T=0;T<l.length;T+=1)I(l[T]);I(g),a=!1},d(k){k&&w(e),c&&c.d(),d&&d.d();for(let T=0;T<l.length;T+=1)l[T].d();g&&g.d(),u=!1,f()}}}function rm(n){let e,t,i,s,l,o,r;return o=new qn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[PO]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=D(),i=v("button"),s=v("i"),l=D(),V(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),b(i,s),b(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[0]&129|u[1]&16777216&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&w(e),a&&w(t),a&&w(i),j(o)}}}function am(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function um(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function PO(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&am(n),u=n[0].isAuth&&n[7].email&&um(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=v("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,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[K(i,"click",n[25]),K(l,"click",$n(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=am(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=um(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,Ae(r)}}}function fm(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),Q(t,"active",n[10]===xi),m(s,"type","button"),m(s,"class","tab-item"),Q(s,"active",n[10]===kl),m(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[27]),K(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===xi),a[0]&1024&&Q(s,"active",r[10]===kl)},d(r){r&&w(e),l=!1,Ae(o)}}}function LO(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,p=!n[2].isNew&&rm(n),h=n[0].isAuth&&!n[2].isNew&&fm(n);return{c(){e=v("h4"),i=B(t),s=D(),l=v("strong"),r=B(o),a=B(" record"),u=D(),p&&p.c(),f=D(),h&&h.c(),c=we()},m(_,y){S(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),S(_,u,y),p&&p.m(_,y),S(_,f,y),h&&h.m(_,y),S(_,c,y),d=!0},p(_,y){var k;(!d||y[0]&4)&&t!==(t=_[2].isNew?"New":"Edit")&&le(i,t),(!d||y[0]&1)&&o!==(o=((k=_[0])==null?void 0:k.name)+"")&&le(r,o),_[2].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(_,y),y[0]&4&&A(p,1)):(p=rm(_),p.c(),A(p,1),p.m(f.parentNode,f)),_[0].isAuth&&!_[2].isNew?h?h.p(_,y):(h=fm(_),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(_){d||(A(p),d=!0)},o(_){I(p),d=!1},d(_){_&&w(e),_&&w(u),p&&p.d(_),_&&w(f),h&&h.d(_),_&&w(c)}}}function NO(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=B(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[8],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[13]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function FO(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[NO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const xi="form",kl="providers";function cm(n){return JSON.stringify(n)}function RO(n,e,t){let i,s,l,o;const r=vt(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ci,p=!1,h=!1,g={},_={},y="",k=xi;function T(ie){return M(ie),t(9,h=!0),t(10,k=xi),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(ie){_n({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ci),t(3,g={}),t(4,_={}),await rn(),t(20,y=cm(d))}function C(){if(p||!o||!(u!=null&&u.id))return;t(8,p=!0);const ie=E();let Se;d.isNew?Se=me.collection(u.id).create(ie):Se=me.collection(u.id).update(d.id,ie),Se.then(st=>{Ut(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),r("save",st)}).catch(st=>{me.errorResponseHandler(st)}).finally(()=>{t(8,p=!1)})}function O(){c!=null&&c.id&&pn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{$(),Ut("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},Se=new FormData,st={};for(const nt of(u==null?void 0:u.schema)||[])st[nt.name]=!0;u!=null&&u.isAuth&&(st.username=!0,st.email=!0,st.emailVisibility=!0,st.password=!0,st.passwordConfirm=!0,st.verified=!0);for(const nt in ie)st[nt]&&(typeof ie[nt]>"u"&&(ie[nt]=null),H.addValueToFormData(Se,nt,ie[nt]));for(const nt in g){const kt=H.toArray(g[nt]);for(const xt of kt)Se.append(nt,xt)}for(const nt in _){const kt=H.toArray(_[nt]);for(const xt of kt)Se.append(nt+"."+xt,"")}return Se}function P(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{Ut(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{Ut(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function F(){l?pn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const Se=(u==null?void 0:u.schema)||[];for(const st of Se)st.type==="file"&&delete ie[st.name]}T(ie),await rn(),t(20,y="")}const R=()=>$(),z=()=>P(),W=()=>L(),J=()=>F(),x=()=>O(),ne=()=>t(10,k=xi),G=()=>t(10,k=kl);function fe(ie){d=ie,t(2,d)}function Z(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function he(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Re(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function je(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function $e(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function dt(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ke(ie,Se){n.$$.not_equal(g[Se.name],ie)&&(g[Se.name]=ie,t(3,g))}function Be(ie,Se){n.$$.not_equal(_[Se.name],ie)&&(_[Se.name]=ie,t(4,_))}function ee(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}const Fe=()=>l&&h?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),$()}),!1):(_n({}),!0);function tt(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Wt(ie){de.call(this,n,ie)}function Pe(ie){de.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((ie=u==null?void 0:u.schema)!=null&&ie.find(Se=>Se.type==="editor"))),n.$$.dirty[0]&24&&t(21,s=H.hasNonEmptyProps(g)||H.hasNonEmptyProps(_)),n.$$.dirty[0]&3145732&&t(5,l=s||y!=cm(d)),n.$$.dirty[0]&36&&t(11,o=d.isNew||l)},[u,$,d,g,_,l,f,c,p,h,k,o,i,a,C,O,P,L,F,T,y,s,R,z,W,J,x,ne,G,fe,Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be,ee,Fe,tt,Wt,Pe]}class G1 extends ve{constructor(e){super(),be(this,e,RO,FO,_e,{collection:0,show:19,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[19]}get hide(){return this.$$.ctx[1]}}function qO(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class",t=n[2]?n[1]:n[0])},m(o,r){S(o,e,r),s||(l=[De(i=ze.call(null,e,n[2]?"":"Copy")),K(e,"click",$n(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&m(e,"class",t),i&&Bt(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:X,o:X,d(o){o&&w(e),s=!1,Ae(l)}}}function jO(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&&(H.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Qt(()=>()=>{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 xo extends ve{constructor(e){super(),be(this,e,jO,qO,_e,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function dm(n,e,t){const i=n.slice();return i[16]=e[t],i[8]=t,i}function pm(n,e,t){const i=n.slice();return i[13]=e[t],i}function mm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function hm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function VO(n){const e=n.slice(),t=H.toArray(e[3]);e[9]=t;const i=H.toArray(e[0].expand[e[1].name]);e[10]=i;const s=e[2]?20:200;return e[11]=s,e}function HO(n){const e=n.slice(),t=JSON.stringify(e[3])||"";return e[5]=t,e}function zO(n){let e,t;return{c(){e=v("div"),t=B(n[3]),m(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){S(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:X,o:X,d(i){i&&w(e)}}}function BO(n){let e,t=H.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=H.truncate(n[3]))},m(l,o){S(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=H.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=H.truncate(l[3]))&&m(e,"title",s)},i:X,o:X,d(l){l&&w(e)}}}function UO(n){let e,t=[],i=new Map,s,l=H.toArray(n[3]);const o=r=>r[8]+r[16];for(let r=0;r<l.length;r+=1){let a=dm(n,l,r),u=o(a);i.set(u,t[r]=_m(u,a))}return{c(){e=v("div");for(let r=0;r<t.length;r+=1)t[r].c();m(e,"class","inline-flex")},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){a&9&&(l=H.toArray(r[3]),re(),t=Ct(t,a,o,1,r,l,i,e,an,_m,null,dm),ae())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)I(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function WO(n){let e,t,i,s,l;const o=[tD,eD],r=[];function a(f,c){return f[10].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[9].length>n[11]&&vm();return{c(){e=v("div"),i.c(),s=D(),u&&u.c(),m(e,"class","inline-flex")},m(f,c){S(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=vm(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){f&&w(e),r[t].d(),u&&u.d()}}}function YO(n){let e,t=[],i=new Map,s=H.toArray(n[3]);const l=o=>o[8]+o[6];for(let o=0;o<s.length;o+=1){let r=hm(n,s,o),a=l(r);i.set(a,t[o]=ym(a,r))}return{c(){e=v("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=H.toArray(o[3]),t=Ct(t,r,l,1,o,s,i,e,ns,ym,null,hm))},i:X,o:X,d(o){o&&w(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function KO(n){let e,t;return e=new di({props:{date:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.date=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function JO(n){let e,t,i,s;const l=[iD,nD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=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):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function ZO(n){let e,t=H.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=B(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),b(e,i),s||(l=[De(ze.call(null,e,"Open in new tab")),K(e,"click",$n(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=H.truncate(o[3])+"")&&le(i,t),r&8&&m(e,"href",o[3])},i:X,o:X,d(o){o&&w(e),s=!1,Ae(l)}}}function GO(n){let e,t;return{c(){e=v("span"),t=B(n[3]),m(e,"class","txt")},m(i,s){S(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:X,o:X,d(i){i&&w(e)}}}function XO(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=B(t),m(e,"class","txt")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:X,o:X,d(s){s&&w(e)}}}function QO(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function xO(n){let e,t,i,s;const l=[lD,sD],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):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}function _m(n,e){let t,i,s;return i=new lu({props:{record:e[0],filename:e[16],size:"sm"}}),{key:n,first:null,c(){t=we(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&8&&(r.filename=e[16]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function eD(n){let e,t=n[9].slice(0,n[11]),i=[];for(let s=0;s<t.length;s+=1)i[s]=gm(pm(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=pm(s,t,o);i[o]?i[o].p(r,l):(i[o]=gm(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:X,o:X,d(s){at(i,s),s&&w(e)}}}function tD(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=mm(n,l,r),u=o(a);t.set(u,e[r]=bm(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]),re(),e=Ct(e,a,o,1,r,l,t,i.parentNode,an,bm,i,mm),ae())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)I(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&w(i)}}}function gm(n){let e,t=n[13]+"",i;return{c(){e=v("span"),i=B(t),m(e,"class","label")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&12&&t!==(t=s[13]+"")&&le(i,t)},d(s){s&&w(e)}}}function bm(n,e){var o;let t,i,s,l;return i=new Qo({props:{record:e[6],displayFields:(o=e[1].options)==null?void 0:o.displayFields}}),{key:n,first:null,c(){t=v("span"),V(i.$$.fragment),s=D(),m(t,"class","label"),this.first=t},m(r,a){S(r,t,a),q(i,t,null),b(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||(A(i.$$.fragment,r),l=!0)},o(r){I(i.$$.fragment,r),l=!1},d(r){r&&w(t),j(i)}}}function vm(n){let e;return{c(){e=B("...")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ym(n,e){let t,i=e[6]+"",s;return{key:n,first:null,c(){t=v("span"),s=B(i),m(t,"class","label"),this.first=t},m(l,o){S(l,t,o),b(t,s)},p(l,o){e=l,o&8&&i!==(i=e[6]+"")&&le(s,i)},d(l){l&&w(t)}}}function nD(n){let e,t;return e=new Z1({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(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function iD(n){let e,t=H.truncate(H.plainText(n[3]),250)+"",i;return{c(){e=v("span"),i=B(t),m(e,"class","txt")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=H.truncate(H.plainText(s[3]),250)+"")&&le(i,t)},i:X,o:X,d(s){s&&w(e)}}}function sD(n){let e,t=H.truncate(n[5],500,!0)+"",i,s,l,o,r=n[5].length>500&&km(n);return{c(){e=v("span"),i=B(t),s=D(),r&&r.c(),l=we(),m(e,"class","txt")},m(a,u){S(a,e,u),b(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=H.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=km(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){o||(A(r),o=!0)},o(a){I(r),o=!1},d(a){a&&w(e),a&&w(s),r&&r.d(a),a&&w(l)}}}function lD(n){let e,t=H.truncate(n[5])+"",i;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis")},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=H.truncate(s[5])+"")&&le(i,t)},i:X,o:X,d(s){s&&w(e)}}}function km(n){let e,t;return e=new xo({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function oD(n){let e,t,i,s,l;const o=[xO,QO,XO,GO,ZO,JO,KO,YO,WO,UO,BO,zO],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!H.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?HO(f):c===8?VO(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=we()},m(f,c){r[t].m(f,c),S(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){I(i),l=!1},d(f){r[t].d(f),f&&w(s)}}}function rD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){de.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 X1 extends ve{constructor(e){super(),be(this,e,rD,oD,_e,{record:0,field:1,short:2})}}function wm(n,e,t){const i=n.slice();return i[10]=e[t],i}function Sm(n){let e,t,i=n[10].name+"",s,l,o,r,a;return r=new X1({props:{field:n[10],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=B(i),l=D(),o=v("td"),V(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),b(e,t),b(t,s),b(e,l),b(e,o),q(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[10].name+"")&&le(s,i);const c={};f&1&&(c.field=u[10]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){I(r.$$.fragment,u),a=!1},d(u){u&&w(e),j(r)}}}function Tm(n){let e,t,i,s,l,o;return l=new di({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=D(),s=v("td"),V(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),b(e,t),b(e,i),b(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function $m(n){let e,t,i,s,l,o;return l=new di({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=D(),s=v("td"),V(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),b(e,t),b(e,i),b(e,s),q(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(l)}}}function aD(n){var C;let e,t,i,s,l,o,r,a,u,f,c=n[3].id+"",d,p,h,g,_;a=new xo({props:{value:n[3].id}});let y=(C=n[0])==null?void 0:C.schema,k=[];for(let O=0;O<y.length;O+=1)k[O]=Sm(wm(n,y,O));const T=O=>I(k[O],1,1,()=>{k[O]=null});let $=n[3].created&&Tm(n),M=n[3].updated&&$m(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=D(),o=v("td"),r=v("div"),V(a.$$.fragment),u=D(),f=v("span"),d=B(c),p=D();for(let O=0;O<k.length;O+=1)k[O].c();h=D(),$&&$.c(),g=D(),M&&M.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(O,E){S(O,e,E),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,r),q(a,r,null),b(r,u),b(r,f),b(f,d),b(t,p);for(let P=0;P<k.length;P+=1)k[P]&&k[P].m(t,null);b(t,h),$&&$.m(t,null),b(t,g),M&&M.m(t,null),_=!0},p(O,E){var L;const P={};if(E&8&&(P.value=O[3].id),a.$set(P),(!_||E&8)&&c!==(c=O[3].id+"")&&le(d,c),E&9){y=(L=O[0])==null?void 0:L.schema;let F;for(F=0;F<y.length;F+=1){const N=wm(O,y,F);k[F]?(k[F].p(N,E),A(k[F],1)):(k[F]=Sm(N),k[F].c(),A(k[F],1),k[F].m(t,h))}for(re(),F=y.length;F<k.length;F+=1)T(F);ae()}O[3].created?$?($.p(O,E),E&8&&A($,1)):($=Tm(O),$.c(),A($,1),$.m(t,g)):$&&(re(),I($,1,1,()=>{$=null}),ae()),O[3].updated?M?(M.p(O,E),E&8&&A(M,1)):(M=$m(O),M.c(),A(M,1),M.m(t,null)):M&&(re(),I(M,1,1,()=>{M=null}),ae())},i(O){if(!_){A(a.$$.fragment,O);for(let E=0;E<y.length;E+=1)A(k[E]);A($),A(M),_=!0}},o(O){I(a.$$.fragment,O),k=k.filter(Boolean);for(let E=0;E<k.length;E+=1)I(k[E]);I($),I(M),_=!1},d(O){O&&w(e),j(a),at(k,O),$&&$.d(),M&&M.d()}}}function uD(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",s,l;return{c(){e=v("h4"),t=v("strong"),s=B(i),l=B(" record preview")},m(r,a){S(r,e,a),b(e,t),b(t,s),b(e,l)},p(r,a){var u;a&1&&i!==(i=((u=r[0])==null?void 0:u.name)+"")&&le(s,i)},d(r){r&&w(e)}}}function fD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Close</span>',m(e,"type","button"),m(e,"class","btn btn-transparent")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[6]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function cD(n){let e,t,i={class:"record-preview-panel "+(n[4]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[fD],header:[uD],default:[aD]},$$scope:{ctx:n}};return e=new bn({props:i}),n[7](e),e.$on("hide",n[8]),e.$on("show",n[9]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="record-preview-panel "+(s[4]?"overlay-panel-xl":"overlay-panel-lg")),l&8201&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[7](null),j(e,s)}}}function dD(n,e,t){let i,{collection:s}=e,l,o=new Ci;function r(p){return t(3,o=p),l==null?void 0:l.show()}function a(){return l==null?void 0:l.hide()}const u=()=>a();function f(p){se[p?"unshift":"push"](()=>{l=p,t(2,l)})}function c(p){de.call(this,n,p)}function d(p){de.call(this,n,p)}return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},n.$$.update=()=>{var p;n.$$.dirty&1&&t(4,i=!!((p=s==null?void 0:s.schema)!=null&&p.find(h=>h.type==="editor")))},[s,a,l,o,i,r,u,f,c,d]}class pD extends ve{constructor(e){super(),be(this,e,dD,cD,_e,{collection:0,show:5,hide:1})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[1]}}function Cm(n,e,t){const i=n.slice();return i[55]=e[t],i}function Mm(n,e,t){const i=n.slice();return i[58]=e[t],i}function Om(n,e,t){const i=n.slice();return i[58]=e[t],i}function Dm(n,e,t){const i=n.slice();return i[51]=e[t],i}function Em(n){let e;function t(l,o){return l[12]?hD:mD}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),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 mD(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=D(),l=v("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),b(e,t),b(e,s),b(e,l),o||(r=K(t,"change",n[28]),o=!0)},p(a,u){u[0]&16&&i!==(i=!a[4].length)&&(t.disabled=i),u[0]&65536&&(t.checked=a[16])},d(a){a&&w(e),o=!1,r()}}}function hD(n){let e;return{c(){e=v("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Am(n){let e,t,i;function s(o){n[29](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[_D]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Jt({props:l}),se.push(()=>ge(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function _D(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Im(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l,o=e&&Pm(n),r=i&&Lm(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&&A(o,1)):(o=Pm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),u[0]&128&&(i=!a[7].includes("@email")),i?r?(r.p(a,u),u[0]&128&&A(r,1)):(r=Lm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(r),l=!0)},o(a){I(o),I(r),l=!1},d(a){o&&o.d(a),a&&w(t),r&&r.d(a),a&&w(s)}}}function Pm(n){let e,t,i;function s(o){n[30](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[gD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Jt({props:l}),se.push(()=>ge(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function gD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="username",m(t,"class",H.getFieldTypeIcon("user")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Lm(n){let e,t,i;function s(o){n[31](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[bD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Jt({props:l}),se.push(()=>ge(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function bD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function vD(n){let e,t,i,s,l,o=n[58].name+"",r;return{c(){e=v("div"),t=v("i"),s=D(),l=v("span"),r=B(o),m(t,"class",i=H.getFieldTypeIcon(n[58].type)),m(l,"class","txt"),m(e,"class","col-header-content")},m(a,u){S(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&262144&&i!==(i=H.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 Nm(n,e){let t,i,s,l;function o(a){e[32](a)}let r={class:"col-type-"+e[58].type+" col-field-"+e[58].name,name:e[58].name,$$slots:{default:[vD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Jt({props:r}),se.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=we(),V(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&262144&&(f.class="col-type-"+e[58].type+" col-field-"+e[58].name),u[0]&262144&&(f.name=e[58].name),u[0]&262144|u[2]&2&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ke(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){I(i.$$.fragment,a),l=!1},d(a){a&&w(t),j(i,a)}}}function Fm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[yD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Jt({props:l}),se.push(()=>ge(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function yD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Rm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[kD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new Jt({props:l}),se.push(()=>ge(e,"sort",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[2]&2&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function kD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="updated",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function qm(n){let e;return{c(){e=v("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:X,d(t){t&&w(e),n[35](null)}}}function jm(n){let e;function t(l,o){return l[12]?SD:wD}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 wD(n){let e,t,i,s,l;function o(u,f){var c,d;if((c=u[1])!=null&&c.length)return $D;if(!((d=u[2])!=null&&d.isView))return TD}let r=o(n),a=r&&r(n);return{c(){e=v("tr"),t=v("td"),i=v("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),b(e,t),b(t,i),b(t,s),a&&a.m(t,null),b(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 SD(n){let e;return{c(){e=v("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:X,d(t){t&&w(e)}}}function TD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $D(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Vm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=D(),r=v("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(d,p){S(d,e,p),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[K(i,"change",c),K(t,"click",$n(n[26]))],u=!0)},p(d,p){n=d,p[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),p[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),p[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(d){d&&w(e),u=!1,Ae(f)}}}function Hm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new xo({props:{value:n[55].id}});let c=n[2].isAuth&&zm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),a=B(r),u=D(),c&&c.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(d,p){S(d,e,p),b(e,t),b(t,i),q(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,p){const h={};p[0]&16&&(h.value=d[55].id),s.$set(h),(!f||p[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,p):(c=zm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function zm(n){let e;function t(l,o){return l[55].verified?MD:CD}let i=t(n),s=i(n);return{c(){s.c(),e=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 CD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function MD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Bm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Um(n),o=i&&Wm(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=Um(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=Wm(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 Um(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?DD:OD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("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 OD(n){let e,t=n[55].username+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){S(l,e,o),b(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 DD(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Wm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?AD:ED}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("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 ED(n){let e,t=n[55].email+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){S(l,e,o),b(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 AD(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Ym(n,e){let t,i,s,l;return i=new X1({props:{short:!0,record:e[55],field:e[58]}}),{key:n,first:null,c(){t=v("td"),V(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),q(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&16&&(a.record=e[55]),r[0]&262144&&(a.field=e[58]),i.$set(a),(!l||r[0]&262144&&s!==(s="col-type-"+e[58].type+" col-field-"+e[58].name))&&m(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){I(i.$$.fragment,o),l=!1},d(o){o&&w(t),j(i)}}}function Km(n){let e,t,i;return t=new di({props:{date:n[55].created}}),{c(){e=v("td"),V(t.$$.fragment),m(e,"class","col-type-date col-field-created")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Jm(n){let e,t,i;return t=new di({props:{date:n[55].updated}}),{c(){e=v("td"),V(t.$$.fragment),m(e,"class","col-type-date col-field-updated")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l[0]&16&&(o.date=s[55].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function Zm(n,e){let t,i,s=!e[7].includes("@id"),l,o,r=[],a=new Map,u,f=e[10]&&!e[7].includes("@created"),c,d=e[9]&&!e[7].includes("@updated"),p,h,g,_,y,k,T=!e[2].isView&&Vm(e),$=s&&Hm(e),M=e[2].isAuth&&Bm(e),C=e[18];const O=N=>N[58].name;for(let N=0;N<C.length;N+=1){let R=Mm(e,C,N),z=O(R);a.set(z,r[N]=Ym(z,R))}let E=f&&Km(e),P=d&&Jm(e);function L(){return e[37](e[55])}function F(...N){return e[38](e[55],...N)}return{key:n,first:null,c(){t=v("tr"),T&&T.c(),i=D(),$&&$.c(),l=D(),M&&M.c(),o=D();for(let N=0;N<r.length;N+=1)r[N].c();u=D(),E&&E.c(),c=D(),P&&P.c(),p=D(),h=v("td"),h.innerHTML='<i class="ri-arrow-right-line"></i>',g=D(),m(h,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(N,R){S(N,t,R),T&&T.m(t,null),b(t,i),$&&$.m(t,null),b(t,l),M&&M.m(t,null),b(t,o);for(let z=0;z<r.length;z+=1)r[z]&&r[z].m(t,null);b(t,u),E&&E.m(t,null),b(t,c),P&&P.m(t,null),b(t,p),b(t,h),b(t,g),_=!0,y||(k=[K(t,"click",L),K(t,"keydown",F)],y=!0)},p(N,R){e=N,e[2].isView?T&&(T.d(1),T=null):T?T.p(e,R):(T=Vm(e),T.c(),T.m(t,i)),R[0]&128&&(s=!e[7].includes("@id")),s?$?($.p(e,R),R[0]&128&&A($,1)):($=Hm(e),$.c(),A($,1),$.m(t,l)):$&&(re(),I($,1,1,()=>{$=null}),ae()),e[2].isAuth?M?M.p(e,R):(M=Bm(e),M.c(),M.m(t,o)):M&&(M.d(1),M=null),R[0]&262160&&(C=e[18],re(),r=Ct(r,R,O,1,e,C,a,t,an,Ym,u,Mm),ae()),R[0]&1152&&(f=e[10]&&!e[7].includes("@created")),f?E?(E.p(e,R),R[0]&1152&&A(E,1)):(E=Km(e),E.c(),A(E,1),E.m(t,c)):E&&(re(),I(E,1,1,()=>{E=null}),ae()),R[0]&640&&(d=e[9]&&!e[7].includes("@updated")),d?P?(P.p(e,R),R[0]&640&&A(P,1)):(P=Jm(e),P.c(),A(P,1),P.m(t,p)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(N){if(!_){A($);for(let R=0;R<C.length;R+=1)A(r[R]);A(E),A(P),_=!0}},o(N){I($);for(let R=0;R<r.length;R+=1)I(r[R]);I(E),I(P),_=!1},d(N){N&&w(t),T&&T.d(),$&&$.d(),M&&M.d();for(let R=0;R<r.length;R+=1)r[R].d();E&&E.d(),P&&P.d(),y=!1,Ae(k)}}}function ID(n){let e,t,i,s,l=!n[7].includes("@id"),o,r,a=[],u=new Map,f,c=n[10]&&!n[7].includes("@created"),d,p=n[9]&&!n[7].includes("@updated"),h,g,_,y,k=[],T=new Map,$,M=!n[2].isView&&Em(n),C=l&&Am(n),O=n[2].isAuth&&Im(n),E=n[18];const P=J=>J[58].name;for(let J=0;J<E.length;J+=1){let x=Om(n,E,J),ne=P(x);u.set(ne,a[J]=Nm(ne,x))}let L=c&&Fm(n),F=p&&Rm(n),N=n[15].length&&qm(n),R=n[4];const z=J=>J[2].isView?J[55]:J[55].id;for(let J=0;J<R.length;J+=1){let x=Cm(n,R,J),ne=z(x);T.set(ne,k[J]=Zm(ne,x))}let W=null;return R.length||(W=jm(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),M&&M.c(),s=D(),C&&C.c(),o=D(),O&&O.c(),r=D();for(let J=0;J<a.length;J+=1)a[J].c();f=D(),L&&L.c(),d=D(),F&&F.c(),h=D(),g=v("th"),N&&N.c(),_=D(),y=v("tbody");for(let J=0;J<k.length;J+=1)k[J].c();W&&W.c(),m(g,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[12])},m(J,x){S(J,e,x),b(e,t),b(t,i),M&&M.m(i,null),b(i,s),C&&C.m(i,null),b(i,o),O&&O.m(i,null),b(i,r);for(let ne=0;ne<a.length;ne+=1)a[ne]&&a[ne].m(i,null);b(i,f),L&&L.m(i,null),b(i,d),F&&F.m(i,null),b(i,h),b(i,g),N&&N.m(g,null),b(e,_),b(e,y);for(let ne=0;ne<k.length;ne+=1)k[ne]&&k[ne].m(y,null);W&&W.m(y,null),$=!0},p(J,x){J[2].isView?M&&(M.d(1),M=null):M?M.p(J,x):(M=Em(J),M.c(),M.m(i,s)),x[0]&128&&(l=!J[7].includes("@id")),l?C?(C.p(J,x),x[0]&128&&A(C,1)):(C=Am(J),C.c(),A(C,1),C.m(i,o)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),J[2].isAuth?O?(O.p(J,x),x[0]&4&&A(O,1)):(O=Im(J),O.c(),A(O,1),O.m(i,r)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),x[0]&262145&&(E=J[18],re(),a=Ct(a,x,P,1,J,E,u,i,an,Nm,f,Om),ae()),x[0]&1152&&(c=J[10]&&!J[7].includes("@created")),c?L?(L.p(J,x),x[0]&1152&&A(L,1)):(L=Fm(J),L.c(),A(L,1),L.m(i,d)):L&&(re(),I(L,1,1,()=>{L=null}),ae()),x[0]&640&&(p=J[9]&&!J[7].includes("@updated")),p?F?(F.p(J,x),x[0]&640&&A(F,1)):(F=Rm(J),F.c(),A(F,1),F.m(i,h)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),J[15].length?N?N.p(J,x):(N=qm(J),N.c(),N.m(g,null)):N&&(N.d(1),N=null),x[0]&4986582&&(R=J[4],re(),k=Ct(k,x,z,1,J,R,T,y,an,Zm,null,Cm),ae(),!R.length&&W?W.p(J,x):R.length?W&&(W.d(1),W=null):(W=jm(J),W.c(),W.m(y,null))),(!$||x[0]&4096)&&Q(e,"table-loading",J[12])},i(J){if(!$){A(C),A(O);for(let x=0;x<E.length;x+=1)A(a[x]);A(L),A(F);for(let x=0;x<R.length;x+=1)A(k[x]);$=!0}},o(J){I(C),I(O);for(let x=0;x<a.length;x+=1)I(a[x]);I(L),I(F);for(let x=0;x<k.length;x+=1)I(k[x]);$=!1},d(J){J&&w(e),M&&M.d(),C&&C.d(),O&&O.d();for(let x=0;x<a.length;x+=1)a[x].d();L&&L.d(),F&&F.d(),N&&N.d();for(let x=0;x<k.length;x+=1)k[x].d();W&&W.d()}}}function Gm(n){let e,t;return e=new qn({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[14],$$slots:{default:[LD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&16384&&(l.trigger=i[14]),s[0]&32896|s[2]&2&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function PD(n){let e,t,i,s,l,o=n[51].name+"",r,a,u,f,c;function d(...p){return n[27](n[51],...p)}return{c(){e=v("input"),s=D(),l=v("label"),r=B(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(p,h){S(p,e,h),S(p,s,h),S(p,l,h),b(l,r),S(p,u,h),f||(c=K(e,"change",d),f=!0)},p(p,h){n=p,h[1]&8388608&&t!==(t=n[54])&&m(e,"id",t),h[0]&32896&&i!==(i=!n[7].includes(n[51].id))&&(e.checked=i),h[0]&32768&&o!==(o=n[51].name+"")&&le(r,o),h[1]&8388608&&a!==(a=n[54])&&m(l,"for",a)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(u),f=!1,c()}}}function Xm(n,e){let t,i,s;return i=new pe({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[PD,({uniqueId:l})=>({54:l}),({uniqueId:l})=>[0,l?8388608:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=we(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&32896|o[1]&8388608|o[2]&2&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function LD(n){let e,t,i=[],s=new Map,l,o,r=n[15];const a=u=>u[51].id+u[51].name;for(let u=0;u<r.length;u+=1){let f=Dm(n,r,u),c=a(f);s.set(c,i[u]=Xm(c,f))}return{c(){e=v("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 c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);S(u,l,f),o=!0},p(u,f){f[0]&32896|f[1]&8388608&&(r=u[15],re(),i=Ct(i,f,a,1,u,r,s,l.parentNode,an,Xm,l,Dm),ae())},i(u){if(!o){for(let f=0;f<r.length;f+=1)A(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)I(i[f]);o=!1},d(u){u&&w(e),u&&w(t);for(let f=0;f<i.length;f+=1)i[f].d(u);u&&w(l)}}}function ND(n){let e,t,i=n[14]&&Gm(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&&A(i,1)):(i=Gm(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function Qm(n){let e,t,i=n[4].length+"",s,l,o;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),o=B(n[5]),m(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){S(r,e,a),b(e,t),b(e,s),b(e,l),b(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 xm(n){let e,t,i,s,l=n[5]-n[4].length+"",o,r,a,u;return{c(){e=v("div"),t=v("button"),i=v("span"),s=B("Load more ("),o=B(l),r=B(")"),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[12]),Q(t,"btn-disabled",n[12]),m(e,"class","block txt-center m-t-xs")},m(f,c){S(f,e,c),b(e,t),b(t,i),b(i,s),b(i,o),b(i,r),a||(u=K(t,"click",n[41]),a=!0)},p(f,c){c[0]&48&&l!==(l=f[5]-f[4].length+"")&&le(o,l),c[0]&4096&&Q(t,"btn-loading",f[12]),c[0]&4096&&Q(t,"btn-disabled",f[12])},d(f){f&&w(e),a=!1,u()}}}function eh(n){let e,t,i,s,l,o,r=n[8]===1?"record":"records",a,u,f,c,d,p,h,g,_,y,k;return{c(){e=v("div"),t=v("div"),i=B("Selected "),s=v("strong"),l=B(n[8]),o=D(),a=B(r),u=D(),f=v("button"),f.innerHTML='<span class="txt">Reset</span>',c=D(),d=v("div"),p=D(),h=v("button"),h.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"),Q(f,"btn-disabled",n[13]),m(d,"class","flex-fill"),m(h,"type","button"),m(h,"class","btn btn-sm btn-transparent btn-danger"),Q(h,"btn-loading",n[13]),Q(h,"btn-disabled",n[13]),m(e,"class","bulkbar")},m(T,$){S(T,e,$),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,p),b(e,h),_=!0,y||(k=[K(f,"click",n[42]),K(h,"click",n[43])],y=!0)},p(T,$){(!_||$[0]&256)&&le(l,T[8]),(!_||$[0]&256)&&r!==(r=T[8]===1?"record":"records")&&le(a,r),(!_||$[0]&8192)&&Q(f,"btn-disabled",T[13]),(!_||$[0]&8192)&&Q(h,"btn-loading",T[13]),(!_||$[0]&8192)&&Q(h,"btn-disabled",T[13])},i(T){_||(T&&et(()=>{_&&(g||(g=qe(e,ei,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(T){T&&(g||(g=qe(e,ei,{duration:150,y:5},!1)),g.run(0)),_=!1},d(T){T&&w(e),T&&g&&g.end(),y=!1,Ae(k)}}}function FD(n){let e,t,i,s,l,o;e=new Ia({props:{class:"table-wrapper",$$slots:{before:[ND],default:[ID]},$$scope:{ctx:n}}});let r=n[4].length&&Qm(n),a=n[4].length&&n[17]&&xm(n),u=n[8]&&eh(n);return{c(){V(e.$$.fragment),t=D(),r&&r.c(),i=D(),a&&a.c(),s=D(),u&&u.c(),l=we()},m(f,c){q(e,f,c),S(f,t,c),r&&r.m(f,c),S(f,i,c),a&&a.m(f,c),S(f,s,c),u&&u.m(f,c),S(f,l,c),o=!0},p(f,c){const d={};c[0]&382679|c[2]&2&&(d.$$scope={dirty:c,ctx:f}),e.$set(d),f[4].length?r?r.p(f,c):(r=Qm(f),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null),f[4].length&&f[17]?a?a.p(f,c):(a=xm(f),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null),f[8]?u?(u.p(f,c),c[0]&256&&A(u,1)):(u=eh(f),u.c(),A(u,1),u.m(l.parentNode,l)):u&&(re(),I(u,1,1,()=>{u=null}),ae())},i(f){o||(A(e.$$.fragment,f),A(u),o=!0)},o(f){I(e.$$.fragment,f),I(u),o=!1},d(f){j(e,f),f&&w(t),r&&r.d(f),f&&w(i),a&&a.d(f),f&&w(s),u&&u.d(f),f&&w(l)}}}const RD=/^([\+\-])?(\w+)$/;function qD(n,e,t){let i,s,l,o,r,a,u,f;const c=vt();let{collection:d}=e,{sort:p=""}=e,{filter:h=""}=e,g=[],_=1,y=0,k={},T=!0,$=!1,M=0,C,O=[],E=[];function P(){d!=null&&d.id&&localStorage.setItem((d==null?void 0:d.id)+"@hiddenCollumns",JSON.stringify(O))}function L(){if(t(7,O=[]),!!(d!=null&&d.id))try{const ie=localStorage.getItem(d.id+"@hiddenCollumns");ie&&t(7,O=JSON.parse(ie)||[])}catch{}}async function F(){const ie=_;for(let Se=1;Se<=ie;Se++)(Se===1||o)&&await N(Se,!1)}async function N(ie=1,Se=!0){var xt,mi;if(!(d!=null&&d.id))return;t(12,T=!0);let st=p;const nt=st.match(RD),kt=nt?s.find(pt=>pt.name===nt[2]):null;if(nt&&((mi=(xt=kt==null?void 0:kt.options)==null?void 0:xt.displayFields)==null?void 0:mi.length)>0){const pt=[];for(const Kn of kt.options.displayFields)pt.push((nt[1]||"")+nt[2]+"."+Kn);st=pt.join(",")}return me.collection(d.id).getList(ie,30,{sort:st,filter:h,expand:s.map(pt=>pt.name).join(","),$cancelKey:"records_list"}).then(async pt=>{if(ie<=1&&R(),t(12,T=!1),t(11,_=pt.page),t(5,y=pt.totalItems),c("load",g.concat(pt.items)),Se){const Kn=++M;for(;pt.items.length&&M==Kn;)t(4,g=g.concat(pt.items.splice(0,15))),await H.yieldToMain()}else t(4,g=g.concat(pt.items))}).catch(pt=>{pt!=null&&pt.isAbort||(t(12,T=!1),console.warn(pt),R(),me.errorResponseHandler(pt,!1))})}function R(){t(4,g=[]),t(11,_=1),t(5,y=0),t(6,k={})}function z(){a?W():J()}function W(){t(6,k={})}function J(){for(const ie of g)t(6,k[ie.id]=ie,k);t(6,k)}function x(ie){k[ie.id]?delete k[ie.id]:t(6,k[ie.id]=ie,k),t(6,k)}function ne(){pn(`Do you really want to delete the selected ${r===1?"record":"records"}?`,G)}async function G(){if($||!r||!(d!=null&&d.id))return;let ie=[];for(const Se of Object.keys(k))ie.push(me.collection(d.id).delete(Se));return t(13,$=!0),Promise.all(ie).then(()=>{Ut(`Successfully deleted the selected ${r===1?"record":"records"}.`),W()}).catch(Se=>{me.errorResponseHandler(Se)}).finally(()=>(t(13,$=!1),F()))}function fe(ie){de.call(this,n,ie)}const Z=(ie,Se)=>{Se.target.checked?H.removeByValue(O,ie.id):H.pushUnique(O,ie.id),t(7,O)},ce=()=>z();function he(ie){p=ie,t(0,p)}function Ce(ie){p=ie,t(0,p)}function Re(ie){p=ie,t(0,p)}function je(ie){p=ie,t(0,p)}function ye(ie){p=ie,t(0,p)}function $e(ie){p=ie,t(0,p)}function Ye(ie){se[ie?"unshift":"push"](()=>{C=ie,t(14,C)})}const dt=ie=>x(ie),Ke=ie=>c("select",ie),Be=(ie,Se)=>{Se.code==="Enter"&&(Se.preventDefault(),c("select",ie))},ee=()=>t(1,h=""),Fe=()=>c("new"),tt=()=>N(_+1),Wt=()=>W(),Pe=()=>ne();return n.$$set=ie=>{"collection"in ie&&t(2,d=ie.collection),"sort"in ie&&t(0,p=ie.sort),"filter"in ie&&t(1,h=ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&4&&d!=null&&d.id&&(L(),R()),n.$$.dirty[0]&4&&t(25,i=(d==null?void 0:d.schema)||[]),n.$$.dirty[0]&33554432&&(s=i.filter(ie=>ie.type==="relation")),n.$$.dirty[0]&33554560&&t(18,l=i.filter(ie=>!O.includes(ie.id))),n.$$.dirty[0]&7&&d!=null&&d.id&&p!==-1&&h!==-1&&N(1),n.$$.dirty[0]&48&&t(17,o=y>g.length),n.$$.dirty[0]&64&&t(8,r=Object.keys(k).length),n.$$.dirty[0]&272&&t(16,a=g.length&&r===g.length),n.$$.dirty[0]&128&&O!==-1&&P(),n.$$.dirty[0]&20&&t(10,u=!(d!=null&&d.isView)||g.length>0&&g[0].created!=""),n.$$.dirty[0]&20&&t(9,f=!(d!=null&&d.isView)||g.length>0&&g[0].updated!=""),n.$$.dirty[0]&33555972&&t(15,E=[].concat(d.isAuth?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],i.map(ie=>({id:ie.id,name:ie.name})),u?{id:"@created",name:"created"}:[],f?{id:"@updated",name:"updated"}:[]))},[p,h,d,N,g,y,k,O,r,f,u,_,T,$,C,E,a,o,l,c,z,W,x,ne,F,i,fe,Z,ce,he,Ce,Re,je,ye,$e,Ye,dt,Ke,Be,ee,Fe,tt,Wt,Pe]}class jD extends ve{constructor(e){super(),be(this,e,qD,FD,_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 VD(n){let e,t,i,s;return e=new L4({}),i=new Cn({props:{$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&1527|o[1]&8&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function HD(n){let e,t;return e=new Cn({props:{center:!0,$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1040|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function zD(n){let e,t;return e=new Cn({props:{center:!0,$$slots:{default:[KD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function th(n){let e,t,i;return{c(){e=v("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=[De(ze.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[15])],t=!0)},p:X,d(s){s&&w(e),t=!1,Ae(i)}}}function nh(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P,L,F=!n[10]&&th(n);c=new Aa({}),c.$on("refresh",n[16]);let N=!n[2].isView&&nh(n);y=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function R(J){n[21](J)}function z(J){n[22](J)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),M=new jD({props:W}),n[20](M),se.push(()=>ge(M,"filter",R)),se.push(()=>ge(M,"sort",z)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=D(),l=v("div"),r=B(o),a=D(),u=v("div"),F&&F.c(),f=D(),V(c.$$.fragment),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),N&&N.c(),_=D(),V(y.$$.fragment),k=D(),T=v("div"),$=D(),V(M.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(h,"type","button"),m(h,"class","btn btn-outline"),m(p,"class","btns-group"),m(e,"class","page-header"),m(T,"class","clearfix m-b-base")},m(J,x){S(J,e,x),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),q(c,u,null),b(e,d),b(e,p),b(p,h),b(p,g),N&&N.m(p,null),S(J,_,x),q(y,J,x),S(J,k,x),S(J,T,x),S(J,$,x),q(M,J,x),E=!0,P||(L=K(h,"click",n[17]),P=!0)},p(J,x){(!E||x[0]&4)&&o!==(o=J[2].name+"")&&le(r,o),J[10]?F&&(F.d(1),F=null):F?F.p(J,x):(F=th(J),F.c(),F.m(u,f)),J[2].isView?N&&(N.d(1),N=null):N?N.p(J,x):(N=nh(J),N.c(),N.m(p,null));const ne={};x[0]&1&&(ne.value=J[0]),x[0]&4&&(ne.autocompleteCollection=J[2]),y.$set(ne);const G={};x[0]&4&&(G.collection=J[2]),!C&&x[0]&1&&(C=!0,G.filter=J[0],ke(()=>C=!1)),!O&&x[0]&2&&(O=!0,G.sort=J[1],ke(()=>O=!1)),M.$set(G)},i(J){E||(A(c.$$.fragment,J),A(y.$$.fragment,J),A(M.$$.fragment,J),E=!0)},o(J){I(c.$$.fragment,J),I(y.$$.fragment,J),I(M.$$.fragment,J),E=!1},d(J){J&&w(e),F&&F.d(),j(c),N&&N.d(),J&&w(_),j(y,J),J&&w(k),J&&w(T),J&&w($),n[20](null),j(M,J),P=!1,L()}}}function UD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("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=K(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function WD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function YD(n){let e,t,i;function s(r,a){return r[10]?WD:UD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function KD(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[zD,HD,VD],p=[];function h(T,$){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=p[e]=d[e](n);let g={};s=new su({props:g}),n[25](s);let _={};o=new z4({props:_}),n[26](o);let y={collection:n[2]};a=new G1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let k={collection:n[2]};return f=new pD({props:k}),n[30](f),{c(){t.c(),i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment)},m(T,$){p[e].m(T,$),S(T,i,$),q(s,T,$),S(T,l,$),q(o,T,$),S(T,r,$),q(a,T,$),S(T,u,$),q(f,T,$),c=!0},p(T,$){let M=e;e=h(T),e===M?p[e].p(T,$):(re(),I(p[M],1,1,()=>{p[M]=null}),ae(),t=p[e],t?t.p(T,$):(t=p[e]=d[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const O={};o.$set(O);const E={};$[0]&4&&(E.collection=T[2]),a.$set(E);const P={};$[0]&4&&(P.collection=T[2]),f.$set(P)},i(T){c||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),c=!0)},o(T){I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),c=!1},d(T){p[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function ZD(n,e,t){let i,s,l,o,r,a,u;We(n,Di,Z=>t(2,s=Z)),We(n,Ot,Z=>t(31,l=Z)),We(n,Lo,Z=>t(3,o=Z)),We(n,ga,Z=>t(13,r=Z)),We(n,Pi,Z=>t(9,a=Z)),We(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,p,h,g,_=f.get("filter")||"",y=f.get("sort")||"",k=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,k=s==null?void 0:s.id),t(0,_=""),t(1,y="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,y="")}B1(k);const $=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>g==null?void 0:g.load(),O=()=>d==null?void 0:d.show(s),E=()=>p==null?void 0:p.show(),P=Z=>t(0,_=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{g=Z,t(8,g)})}function F(Z){_=Z,t(0,_)}function N(Z){y=Z,t(1,y)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):p==null||p.show(Z==null?void 0:Z.detail)},z=()=>p==null?void 0:p.show();function W(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function J(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function x(Z){se[Z?"unshift":"push"](()=>{p=Z,t(6,p)})}const ne=()=>g==null?void 0:g.reloadLoadedPages(),G=()=>g==null?void 0:g.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=k&&GS(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&k!=s.id&&T(),n.$$.dirty[0]&7&&(y||_||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:_,sort:y}).toString();Ei("/collections?"+Z)}n.$$.dirty[0]&4&&Gt(Ot,l=(s==null?void 0:s.name)||"Collections",l)},[_,y,s,o,c,d,p,h,g,a,u,k,i,r,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne,G,fe]}class GD extends ve{constructor(e){super(),be(this,e,ZD,JD,_e,{},null,[-1,-1])}}function XD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),p=v("a"),p.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,_=D(),y=v("div"),y.textContent="Authentication",k=D(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=D(),O=v("a"),O.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(c,"class","sidebar-title"),m(p,"href","/settings/export-collections"),m(p,"class","sidebar-list-item"),m(g,"href","/settings/import-collections"),m(g,"class","sidebar-list-item"),m(y,"class","sidebar-title"),m(T,"href","/settings/auth-providers"),m(T,"class","sidebar-list-item"),m(M,"href","/settings/tokens"),m(M,"class","sidebar-list-item"),m(O,"href","/settings/admins"),m(O,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,p),b(t,h),b(t,g),b(t,_),b(t,y),b(t,k),b(t,T),b(t,$),b(t,M),b(t,C),b(t,O),E||(P=[De(Hn.call(null,l,{path:"/settings"})),De(nn.call(null,l)),De(Hn.call(null,r,{path:"/settings/mail/?.*"})),De(nn.call(null,r)),De(Hn.call(null,u,{path:"/settings/storage/?.*"})),De(nn.call(null,u)),De(Hn.call(null,p,{path:"/settings/export-collections/?.*"})),De(nn.call(null,p)),De(Hn.call(null,g,{path:"/settings/import-collections/?.*"})),De(nn.call(null,g)),De(Hn.call(null,T,{path:"/settings/auth-providers/?.*"})),De(nn.call(null,T)),De(Hn.call(null,M,{path:"/settings/tokens/?.*"})),De(nn.call(null,M)),De(Hn.call(null,O,{path:"/settings/admins/?.*"})),De(nn.call(null,O))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Ae(P)}}}class Ni extends ve{constructor(e){super(),be(this,e,null,XD,_e,{})}}function ih(n,e,t){const i=n.slice();return i[30]=e[t],i}function sh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[QD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="id",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),m(t,"class",H.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(c,"type","text"),m(c,"id",d=n[29]),c.value=p=n[1].id,c.readOnly=!0},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),S(_,r,y),b(r,a),S(_,f,y),S(_,c,y),h||(g=De(u=ze.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(_,y){y[0]&536870912&&l!==(l=_[29])&&m(e,"for",l),u&&Bt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${_[1].created}
Updated: ${_[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=_[29])&&m(c,"id",d),y[0]&2&&p!==(p=_[1].id)&&c.value!==p&&(c.value=p)},d(_){_&&w(e),_&&w(o),_&&w(r),_&&w(f),_&&w(c),h=!1,g()}}}function lh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),Un(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),b(e,t),b(e,s),o||(r=K(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 xD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),m(t,"class",H.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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[3]),u||(f=K(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&8&&r.value!==c[3]&&ue(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function oh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[eE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("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),b(s,l),r||(a=K(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 rh(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[tE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(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,c){S(f,e,c),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&536871424|c[1]&4&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=qe(t,Mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=qe(t,Mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[8]),u||(f=K(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&256&&r.value!==c[8]&&ue(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function nE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&512&&r.value!==c[9]&&ue(r,c[9])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function iE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h=!n[1].isNew&&sh(n),g=[0,1,2,3,4,5,6,7,8,9],_=[];for(let T=0;T<10;T+=1)_[T]=lh(ih(n,g,T));a=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[xD,({uniqueId:T})=>({29:T}),({uniqueId:T})=>[T?536870912:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&oh(n),k=(n[1].isNew||n[4])&&rh(n);return{c(){e=v("form"),h&&h.c(),t=D(),i=v("div"),s=v("p"),s.textContent="Avatar",l=D(),o=v("div");for(let T=0;T<10;T+=1)_[T].c();r=D(),V(a.$$.fragment),u=D(),y&&y.c(),f=D(),k&&k.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(T,$){S(T,e,$),h&&h.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let M=0;M<10;M+=1)_[M]&&_[M].m(o,null);b(e,r),q(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),k&&k.m(e,null),c=!0,d||(p=K(e,"submit",ft(n[12])),d=!0)},p(T,$){if(T[1].isNew?h&&(re(),I(h,1,1,()=>{h=null}),ae()):h?(h.p(T,$),$[0]&2&&A(h,1)):(h=sh(T),h.c(),A(h,1),h.m(e,t)),$[0]&4){g=[0,1,2,3,4,5,6,7,8,9];let C;for(C=0;C<10;C+=1){const O=ih(T,g,C);_[C]?_[C].p(O,$):(_[C]=lh(O),_[C].c(),_[C].m(o,null))}for(;C<10;C+=1)_[C].d(1)}const M={};$[0]&536870920|$[1]&4&&(M.$$scope={dirty:$,ctx:T}),a.$set(M),T[1].isNew?y&&(re(),I(y,1,1,()=>{y=null}),ae()):y?(y.p(T,$),$[0]&2&&A(y,1)):(y=oh(T),y.c(),A(y,1),y.m(e,f)),T[1].isNew||T[4]?k?(k.p(T,$),$[0]&18&&A(k,1)):(k=rh(T),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae())},i(T){c||(A(h),A(a.$$.fragment,T),A(y),A(k),c=!0)},o(T){I(h),I(a.$$.fragment,T),I(y),I(k),c=!1},d(T){T&&w(e),h&&h.d(),at(_,T),j(a),y&&y.d(),k&&k.d(),d=!1,p()}}}function sE(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=B(t)},m(s,l){S(s,e,l),b(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 ah(n){let e,t,i,s,l,o,r,a,u;return o=new qn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[lE]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=D(),s=v("i"),l=D(),V(o.$$.fragment),r=D(),a=v("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,c){S(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),q(o,e,null),S(f,r,c),S(f,a,c),u=!0},p(f,c){const d={};c[1]&4&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){I(o.$$.fragment,f),u=!1},d(f){f&&w(e),j(o),f&&w(r),f&&w(a)}}}function lE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function oE(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&ah(n);return{c(){p&&p.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=B(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],Q(l,"btn-loading",n[6])},m(h,g){p&&p.m(h,g),S(h,e,g),S(h,t,g),b(t,i),S(h,s,g),S(h,l,g),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(h,g),g[0]&2&&A(p,1)):(p=ah(h),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(p),f=!0)},o(h){I(p),f=!1},d(h){p&&p.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function rE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[oE],header:[sE],default:[iE]},$$scope:{ctx:n}};return e=new bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function aE(n,e,t){let i;const s=vt(),l="admin_"+H.randomString(5);let o,r=new es,a=!1,u=!1,f=0,c="",d="",p="",h=!1;function g(J){return y(J),t(7,u=!0),o==null?void 0:o.show()}function _(){return o==null?void 0:o.hide()}function y(J){t(1,r=J!=null&&J.clone?J.clone():new es),k()}function k(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p=""),_n({})}function T(){if(a||!i)return;t(6,a=!0);const J={email:c,avatar:f};(r.isNew||h)&&(J.password=d,J.passwordConfirm=p);let x;r.isNew?x=me.admins.create(J):x=me.admins.update(r.id,J),x.then(async ne=>{var G;t(7,u=!1),_(),Ut(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((G=me.authStore.model)==null?void 0:G.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function $(){r!=null&&r.id&&pn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),_(),Ut("Successfully deleted admin."),s("delete",r)}).catch(J=>{me.errorResponseHandler(J)}))}const M=()=>$(),C=()=>_(),O=J=>t(2,f=J);function E(){c=this.value,t(3,c)}function P(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function F(){p=this.value,t(9,p)}const N=()=>i&&u?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),_()}),!1):!0;function R(J){se[J?"unshift":"push"](()=>{o=J,t(5,o)})}function z(J){de.call(this,n,J)}function W(J){de.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[_,r,f,c,h,o,a,u,d,p,i,l,T,$,g,M,C,O,E,P,L,F,N,R,z,W]}class uE extends ve{constructor(e){super(),be(this,e,aE,rE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function uh(n,e,t){const i=n.slice();return i[24]=e[t],i}function fE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function cE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function dE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function pE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="updated",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function fh(n){let e;function t(l,o){return l[5]?hE:mE}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 mE(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&ch(n);return{c(){e=v("tr"),t=v("td"),i=v("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),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=ch(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function hE(n){let e;return{c(){e=v("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:X,d(t){t&&w(e)}}}function ch(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function dh(n){let e;return{c(){e=v("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 ph(n,e){let t,i,s,l,o,r,a,u,f,c,d,p=e[24].id+"",h,g,_,y,k,T=e[24].email+"",$,M,C,O,E,P,L,F,N,R,z,W,J,x;f=new xo({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&dh();E=new di({props:{date:e[24].created}}),F=new di({props:{date:e[24].updated}});function G(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),u=v("div"),V(f.$$.fragment),c=D(),d=v("span"),h=B(p),g=D(),ne&&ne.c(),_=D(),y=v("td"),k=v("span"),$=B(T),C=D(),O=v("td"),V(E.$$.fragment),P=D(),L=v("td"),V(F.$$.fragment),N=D(),R=v("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',z=D(),Un(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(d,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m(k,"class","txt txt-ellipsis"),m(k,"title",M=e[24].email),m(y,"class","col-type-email col-field-email"),m(O,"class","col-type-date col-field-created"),m(L,"class","col-type-date col-field-updated"),m(R,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Z,ce){S(Z,t,ce),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),q(f,u,null),b(u,c),b(u,d),b(d,h),b(a,g),ne&&ne.m(a,null),b(t,_),b(t,y),b(y,k),b(k,$),b(t,C),b(t,O),q(E,O,null),b(t,P),b(t,L),q(F,L,null),b(t,N),b(t,R),b(t,z),W=!0,J||(x=[K(t,"click",G),K(t,"keydown",fe)],J=!0)},p(Z,ce){e=Z,(!W||ce&16&&!Un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const he={};ce&16&&(he.value=e[24].id),f.$set(he),(!W||ce&16)&&p!==(p=e[24].id+"")&&le(h,p),e[24].id===e[7].id?ne||(ne=dh(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!W||ce&16)&&T!==(T=e[24].email+"")&&le($,T),(!W||ce&16&&M!==(M=e[24].email))&&m(k,"title",M);const Ce={};ce&16&&(Ce.date=e[24].created),E.$set(Ce);const Re={};ce&16&&(Re.date=e[24].updated),F.$set(Re)},i(Z){W||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(F.$$.fragment,Z),W=!0)},o(Z){I(f.$$.fragment,Z),I(E.$$.fragment,Z),I(F.$$.fragment,Z),W=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(F),J=!1,Ae(x)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=[],C=new Map,O;function E(G){n[11](G)}let P={class:"col-type-text",name:"id",$$slots:{default:[fE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new Jt({props:P}),se.push(()=>ge(o,"sort",E));function L(G){n[12](G)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Jt({props:F}),se.push(()=>ge(u,"sort",L));function N(G){n[13](G)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Jt({props:R}),se.push(()=>ge(d,"sort",N));function z(G){n[14](G)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),g=new Jt({props:W}),se.push(()=>ge(g,"sort",z));let J=n[4];const x=G=>G[24].id;for(let G=0;G<J.length;G+=1){let fe=uh(n,J,G),Z=x(fe);C.set(Z,M[G]=ph(Z,fe))}let ne=null;return J.length||(ne=fh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),V(o.$$.fragment),a=D(),V(u.$$.fragment),c=D(),V(d.$$.fragment),h=D(),V(g.$$.fragment),y=D(),k=v("th"),T=D(),$=v("tbody");for(let G=0;G<M.length;G+=1)M[G].c();ne&&ne.c(),m(s,"class","min-width"),m(k,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[5])},m(G,fe){S(G,e,fe),b(e,t),b(t,i),b(i,s),b(i,l),q(o,i,null),b(i,a),q(u,i,null),b(i,c),q(d,i,null),b(i,h),q(g,i,null),b(i,y),b(i,k),b(e,T),b(e,$);for(let Z=0;Z<M.length;Z+=1)M[Z]&&M[Z].m($,null);ne&&ne.m($,null),O=!0},p(G,fe){const Z={};fe&134217728&&(Z.$$scope={dirty:fe,ctx:G}),!r&&fe&4&&(r=!0,Z.sort=G[2],ke(()=>r=!1)),o.$set(Z);const ce={};fe&134217728&&(ce.$$scope={dirty:fe,ctx:G}),!f&&fe&4&&(f=!0,ce.sort=G[2],ke(()=>f=!1)),u.$set(ce);const he={};fe&134217728&&(he.$$scope={dirty:fe,ctx:G}),!p&&fe&4&&(p=!0,he.sort=G[2],ke(()=>p=!1)),d.$set(he);const Ce={};fe&134217728&&(Ce.$$scope={dirty:fe,ctx:G}),!_&&fe&4&&(_=!0,Ce.sort=G[2],ke(()=>_=!1)),g.$set(Ce),fe&186&&(J=G[4],re(),M=Ct(M,fe,x,1,G,J,C,$,an,ph,null,uh),ae(),!J.length&&ne?ne.p(G,fe):J.length?ne&&(ne.d(1),ne=null):(ne=fh(G),ne.c(),ne.m($,null))),(!O||fe&32)&&Q(e,"table-loading",G[5])},i(G){if(!O){A(o.$$.fragment,G),A(u.$$.fragment,G),A(d.$$.fragment,G),A(g.$$.fragment,G);for(let fe=0;fe<J.length;fe+=1)A(M[fe]);O=!0}},o(G){I(o.$$.fragment,G),I(u.$$.fragment,G),I(d.$$.fragment,G),I(g.$$.fragment,G);for(let fe=0;fe<M.length;fe+=1)I(M[fe]);O=!1},d(G){G&&w(e),j(o),j(u),j(d),j(g);for(let fe=0;fe<M.length;fe+=1)M[fe].d();ne&&ne.d()}}}function mh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=v("small"),t=B("Showing "),s=B(i),l=B(" of "),r=B(o),m(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){S(a,e,u),b(e,t),b(e,s),b(e,l),b(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 gE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O;a=new Aa({}),a.$on("refresh",n[8]),h=new Wo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),h.$on("submit",n[10]),k=new Ia({props:{class:"table-wrapper",$$slots:{default:[_E]},$$scope:{ctx:n}}});let E=n[4].length&&mh(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[6]),r=D(),V(a.$$.fragment),u=D(),f=v("div"),c=D(),d=v("button"),d.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,p=D(),V(h.$$.fragment),g=D(),_=v("div"),y=D(),V(k.$$.fragment),T=D(),E&&E.c(),$=we(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(e,"class","page-header"),m(_,"class","clearfix m-b-base")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),q(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),S(P,p,L),q(h,P,L),S(P,g,L),S(P,_,L),S(P,y,L),q(k,P,L),S(P,T,L),E&&E.m(P,L),S(P,$,L),M=!0,C||(O=K(d,"click",n[9]),C=!0)},p(P,L){(!M||L&64)&&le(o,P[6]);const F={};L&2&&(F.value=P[1]),h.$set(F);const N={};L&134217918&&(N.$$scope={dirty:L,ctx:P}),k.$set(N),P[4].length?E?E.p(P,L):(E=mh(P),E.c(),E.m($.parentNode,$)):E&&(E.d(1),E=null)},i(P){M||(A(a.$$.fragment,P),A(h.$$.fragment,P),A(k.$$.fragment,P),M=!0)},o(P){I(a.$$.fragment,P),I(h.$$.fragment,P),I(k.$$.fragment,P),M=!1},d(P){P&&w(e),j(a),P&&w(p),j(h,P),P&&w(g),P&&w(_),P&&w(y),j(k,P),P&&w(T),E&&E.d(P),P&&w($),C=!1,O()}}}function bE(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gE]},$$scope:{ctx:n}}});let r={};return l=new uE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function vE(n,e,t){let i,s,l;We(n,ga,F=>t(21,i=F)),We(n,Ot,F=>t(6,s=F)),We(n,Ea,F=>t(7,l=F)),Gt(Ot,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),p(),me.errorResponseHandler(F,!1))})}function p(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),_=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function k(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),C=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){se[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ei("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,h,g,_,y,k,T,$,M,C,O,E,P,L]}class yE extends ve{constructor(e){super(),be(this,e,vE,bE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function kE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(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]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),b(a,u),f||(c=[K(l,"input",n[5]),De(nn.call(null,u))],f=!0)},p(d,p){p&256&&i!==(i=d[8])&&m(e,"for",i),p&256&&o!==(o=d[8])&&m(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Ae(c)}}}function SE(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[kE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[wE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="<h4>Admin sign in</h4>",i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),a=v("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"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),m(e,"class","block")},m(d,p){S(d,e,p),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",ft(n[3])),f=!0)},p(d,p){const h={};p&769&&(h.$$scope={dirty:p,ctx:d}),s.$set(h);const g={};p&770&&(g.$$scope={dirty:p,ctx:d}),o.$set(g),(!u||p&4)&&Q(a,"btn-disabled",d[2]),(!u||p&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function TE(n){let e,t;return e=new zg({props:{$$slots:{default:[SE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $E(n,e,t){let i;We(n,ga,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Oa(),Ei("/")}).catch(()=>{pl("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 CE extends ve{constructor(e){super(),be(this,e,$E,TE,_e,{})}}function ME(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[DE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[EE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[AE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[IE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&hh(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),c=D(),d=v("div"),p=v("div"),h=D(),C&&C.c(),g=D(),_=v("button"),y=v("span"),y.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(p,"class","flex-fill"),m(y,"class","txt"),m(_,"type","submit"),m(_,"class","btn btn-expanded"),_.disabled=k=!n[3]||n[2],Q(_,"btn-loading",n[2]),m(d,"class","col-lg-12 flex"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),q(a,e,null),b(e,u),q(f,e,null),b(e,c),b(e,d),b(d,p),b(d,h),C&&C.m(d,null),b(d,g),b(d,_),b(_,y),T=!0,$||(M=K(_,"click",n[13]),$=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),f.$set(N),O[3]?C?C.p(O,E):(C=hh(O),C.c(),C.m(d,g)):C&&(C.d(1),C=null),(!T||E&12&&k!==(k=!O[3]||O[2]))&&(_.disabled=k),(!T||E&4)&&Q(_,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(a.$$.fragment,O),I(f.$$.fragment,O),T=!1},d(O){O&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),$=!1,M()}}}function OE(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application name"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=K(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&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application url"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appUrl),r||(a=K(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&&ue(l,u[0].meta.appUrl)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function AE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Logs max days retention"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].logs.maxDays),r||(a=K(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&&ht(l.value)!==u[0].logs.maxDays&&ue(l,u[0].logs.maxDays)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function IE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=D(),r=v("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(c,d){S(c,e,d),e.checked=n[0].meta.hideControls,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),De(ze.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&m(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function hh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),b(e,t),i||(s=K(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function PE(n){let e,t,i,s,l,o,r,a,u;const f=[OE,ME],c=[];function d(p,h){return p[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",ft(n[4])),a=!0)},p(p,h){let g=l;l=d(p),l===g?c[l].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),o=c[l],o?o.p(p,h):(o=c[l]=f[l](p),o.c()),A(o,1),o.m(s,null))},i(p){r||(A(o),r=!0)},o(p){I(o),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),c[l].d(),a=!1,u()}}}function LE(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function NE(n,e,t){let i,s,l,o;We(n,Cs,C=>t(14,s=C)),We(n,ko,C=>t(15,l=C)),We(n,Ot,C=>t(16,o=C)),Gt(Ot,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function p(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(H.filterRedactedProps(a));h(C),Ut("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var O,E;Gt(ko,l=(O=C==null?void 0:C.meta)==null?void 0:O.appName,l),Gt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function k(){a.logs.maxDays=ht(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>g(),M=()=>p();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,p,g,r,c,_,y,k,T,$,M]}class FE extends ve{constructor(e){super(),be(this,e,NE,LE,_e,{})}}function RE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Le(l,s[o]);return{c(){e=v("input"),xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){xn(e,l=bt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function qE(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=Le(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),xn(s,a)},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[De(ze.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){xn(s,a=bt(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,Ae(o)}}}function jE(n){let e;function t(l,o){return l[3]?qE:RE}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:X,o:X,d(l){s.d(l),l&&w(e)}}}function VE(n,e,t){const i=["value","mask"];let s=Je(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await rn(),r==null||r.focus()}const f=()=>u();function c(p){se[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=Le(Le({},e),jt(p)),t(5,s=Je(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends ve{constructor(e){super(),be(this,e,VE,jE,_e,{value:0,mask:1})}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=B("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B("."),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(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),S(_,l,y),ue(l,n[0].subject),S(_,r,y),S(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),h||(g=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&m(e,"for",i),y[1]&1&&o!==(o=_[31])&&m(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ue(l,_[0].subject)},d(_){_&&w(e),_&&w(s),_&&w(l),_&&w(r),_&&w(a),h=!1,Ae(g)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return{c(){e=v("label"),t=B("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B("."),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(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(h,"title","Required parameter"),m(a,"class","help-block")},m(k,T){S(k,e,T),b(e,t),S(k,s,T),S(k,l,T),ue(l,n[0].actionUrl),S(k,r,T),S(k,a,T),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],_=!0)},p(k,T){T[1]&1&&i!==(i=k[31])&&m(e,"for",i),T[1]&1&&o!==(o=k[31])&&m(l,"id",o),T[0]&1&&l.value!==k[0].actionUrl&&ue(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),_=!1,Ae(y)}}}function BE(n){let e,t,i,s;return{c(){e=v("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),ue(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function UE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$;const M=[UE,BE],C=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=C[l]=M[l](n),{c(){e=v("label"),t=B("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),_=v("button"),_.textContent=`{ACTION_URL}
`,y=B("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(_,"type","button"),m(_,"class","label label-sm link-primary txt-mono"),m(_,"title","Required parameter"),m(a,"class","help-block")},m(E,P){S(E,e,P),b(e,t),S(E,s,P),C[l].m(E,P),S(E,r,P),S(E,a,P),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),b(a,_),b(a,y),k=!0,T||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(_,"click",n[25])],T=!0)},p(E,P){(!k||P[1]&1&&i!==(i=E[31]))&&m(e,"for",i);let L=l;l=O(E),l===L?C[l].p(E,P):(re(),I(C[L],1,1,()=>{C[L]=null}),ae(),o=C[l],o?o.p(E,P):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){k||(A(o),k=!0)},o(E){I(o),k=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),T=!1,Ae($)}}}function YE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[HE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[zE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[WE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function _h(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&_h();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=B(n[2]),o=D(),r=v("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(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=_h(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function JE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[KE],default:[YE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Le(s,i[l]);return e=new al({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?bt(i,[Vt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let gh;function ZE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Je(e,s),o;We(n,ti,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=gh,d=!1;function p(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default),gh=c,t(5,d=!1))}function y(G){H.copyToClipboard(G),Vg(`Copied ${G} to clipboard`,2e3)}_();function k(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),E=()=>y("{TOKEN}");function P(G){n.$$.not_equal(u.body,G)&&(u.body=G,t(0,u))}function L(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),z=()=>y("{ACTION_URL}");function W(G){se[G?"unshift":"push"](()=>{f=G,t(3,f)})}function J(G){de.call(this,n,G)}function x(G){de.call(this,n,G)}function ne(G){de.call(this,n,G)}return n.$$set=G=>{e=Le(Le({},e),jt(G)),t(8,l=Je(e,s)),"key"in G&&t(1,r=G.key),"title"in G&&t(2,a=G.title),"config"in G&&t(0,u=G.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ci(r))},[u,r,a,f,c,d,i,y,l,p,h,g,o,k,T,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne]}class Pr extends ve{constructor(e){super(),be(this,e,ZE,JE,_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 bh(n,e,t){const i=n.slice();return i[21]=e[t],i}function vh(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,p;return c=cb(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=D(),o=v("label"),a=B(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"),c.p(i),this.first=t},m(h,g){S(h,t,g),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(p=K(i,"change",e[10]),d=!0)},p(h,g){e=h,g&1048576&&s!==(s=e[20]+e[21].value)&&m(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&1048576&&u!==(u=e[20]+e[21].value)&&m(o,"for",u)},d(h){h&&w(t),c.r(),d=!1,p()}}}function GE(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=bh(n,s,o),a=l(r);t.set(a,e[o]=vh(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=Ct(e,r,l,1,o,s,t,i.parentNode,ns,vh,i,bh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function XE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("To email address"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1]),l.focus(),r||(a=K(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]&&ue(l,u[1])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function QE(n){let e,t,i,s,l,o,r;return t=new pe({props:{class:"form-field required",name:"template",$$slots:{default:[GE,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new pe({props:{class:"form-field required m-0",name:"email",$$slots:{default:[XE,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),V(t.$$.fragment),i=D(),V(s.$$.fragment),m(e,"id",n[6]),m(e,"autocomplete","off")},m(a,u){S(a,e,u),q(t,e,null),b(e,i),q(s,e,null),l=!0,o||(r=K(e,"submit",ft(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){I(t.$$.fragment,a),I(s.$$.fragment,a),l=!1},d(a){a&&w(e),j(t),j(s),o=!1,r()}}}function xE(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function eA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("i"),o=D(),r=v("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],Q(s,"btn-loading",n[4])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function tA(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:[eA],header:[xE],default:[QE]},$$scope:{ctx:n}};return e=new bn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[15](null),j(e,s)}}}const Lr="last_email_test",yh="email_test_request";function nA(n,e,t){let i;const s=vt(),l="email_test_"+H.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(Lr),u=o[0].value,f=!1,c=null;function d(O="",E=""){t(1,a=O||localStorage.getItem(Lr)),t(2,u=E||o[0].value),_n({}),r==null||r.show()}function p(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Lr,a),clearTimeout(c),c=setTimeout(()=>{me.cancelRequest(yh),pl("Test email send timeout.")},3e4);try{await me.settings.testEmail(a,u,{$cancelKey:yh}),Ut("Successfully sent test email."),s("submit"),t(4,f=!1),await rn(),p()}catch(O){t(4,f=!1),me.errorResponseHandler(O)}clearTimeout(c)}}const g=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const k=()=>h(),T=()=>!f;function $(O){se[O?"unshift":"push"](()=>{r=O,t(3,r)})}function M(O){de.call(this,n,O)}function C(O){de.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[p,a,u,r,f,i,l,o,h,d,_,g,y,k,T,$,M,C]}class iA extends ve{constructor(e){super(),be(this,e,nA,tA,_e,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function sA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P,L;i=new pe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[oA,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[rA,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});function F(Z){n[14](Z)}let N={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(N.config=n[0].meta.verificationTemplate),u=new Pr({props:N}),se.push(()=>ge(u,"config",F));function R(Z){n[15](Z)}let z={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(z.config=n[0].meta.resetPasswordTemplate),d=new Pr({props:z}),se.push(()=>ge(d,"config",R));function W(Z){n[16](Z)}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),g=new Pr({props:J}),se.push(()=>ge(g,"config",W)),$=new pe({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[aA,({uniqueId:Z})=>({31:Z}),({uniqueId:Z})=>[0,Z?1:0]]},$$scope:{ctx:n}}});let x=n[0].smtp.enabled&&kh(n);function ne(Z,ce){return Z[4]?_A:hA}let G=ne(n),fe=G(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(u.$$.fragment),c=D(),V(d.$$.fragment),h=D(),V(g.$$.fragment),y=D(),k=v("hr"),T=D(),V($.$$.fragment),M=D(),x&&x.c(),C=D(),O=v("div"),E=v("div"),P=D(),fe.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(E,"class","flex-fill"),m(O,"class","flex")},m(Z,ce){S(Z,e,ce),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),S(Z,r,ce),S(Z,a,ce),q(u,a,null),b(a,c),q(d,a,null),b(a,h),q(g,a,null),S(Z,y,ce),S(Z,k,ce),S(Z,T,ce),q($,Z,ce),S(Z,M,ce),x&&x.m(Z,ce),S(Z,C,ce),S(Z,O,ce),b(O,E),b(O,P),fe.m(O,null),L=!0},p(Z,ce){const he={};ce[0]&1|ce[1]&3&&(he.$$scope={dirty:ce,ctx:Z}),i.$set(he);const Ce={};ce[0]&1|ce[1]&3&&(Ce.$$scope={dirty:ce,ctx:Z}),o.$set(Ce);const Re={};!f&&ce[0]&1&&(f=!0,Re.config=Z[0].meta.verificationTemplate,ke(()=>f=!1)),u.$set(Re);const je={};!p&&ce[0]&1&&(p=!0,je.config=Z[0].meta.resetPasswordTemplate,ke(()=>p=!1)),d.$set(je);const ye={};!_&&ce[0]&1&&(_=!0,ye.config=Z[0].meta.confirmEmailChangeTemplate,ke(()=>_=!1)),g.$set(ye);const $e={};ce[0]&1|ce[1]&3&&($e.$$scope={dirty:ce,ctx:Z}),$.$set($e),Z[0].smtp.enabled?x?(x.p(Z,ce),ce[0]&1&&A(x,1)):(x=kh(Z),x.c(),A(x,1),x.m(C.parentNode,C)):x&&(re(),I(x,1,1,()=>{x=null}),ae()),G===(G=ne(Z))&&fe?fe.p(Z,ce):(fe.d(1),fe=G(Z),fe&&(fe.c(),fe.m(O,null)))},i(Z){L||(A(i.$$.fragment,Z),A(o.$$.fragment,Z),A(u.$$.fragment,Z),A(d.$$.fragment,Z),A(g.$$.fragment,Z),A($.$$.fragment,Z),A(x),L=!0)},o(Z){I(i.$$.fragment,Z),I(o.$$.fragment,Z),I(u.$$.fragment,Z),I(d.$$.fragment,Z),I(g.$$.fragment,Z),I($.$$.fragment,Z),I(x),L=!1},d(Z){Z&&w(e),j(i),j(o),Z&&w(r),Z&&w(a),j(u),j(d),j(g),Z&&w(y),Z&&w(k),Z&&w(T),j($,Z),Z&&w(M),x&&x.d(Z),Z&&w(C),Z&&w(O),fe.d()}}}function lA(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function oA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Sender name"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderName),r||(a=K(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&&ue(l,u[0].meta.senderName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function rA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Sender address"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.senderAddress),r||(a=K(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&&ue(l,u[0].meta.senderAddress)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function aA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=D(),r=v("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(c,d){S(c,e,d),e.checked=n[0].smtp.enabled,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[17]),De(ze.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&1&&t!==(t=c[31])&&m(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&1&&a!==(a=c[31])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function kh(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C;return i=new pe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[uA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[fA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[cA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[dA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[pA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),k=new pe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[mA,({uniqueId:O})=>({31:O}),({uniqueId:O})=>[0,O?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(u.$$.fragment),f=D(),c=v("div"),V(d.$$.fragment),p=D(),h=v("div"),V(g.$$.fragment),_=D(),y=v("div"),V(k.$$.fragment),T=D(),$=v("div"),m(t,"class","col-lg-4"),m(l,"class","col-lg-2"),m(a,"class","col-lg-3"),m(c,"class","col-lg-3"),m(h,"class","col-lg-6"),m(y,"class","col-lg-6"),m($,"class","col-lg-12"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),q(u,a,null),b(e,f),b(e,c),q(d,c,null),b(e,p),b(e,h),q(g,h,null),b(e,_),b(e,y),q(k,y,null),b(e,T),b(e,$),C=!0},p(O,E){const P={};E[0]&1|E[1]&3&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E[0]&1|E[1]&3&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E[0]&1|E[1]&3&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const N={};E[0]&1|E[1]&3&&(N.$$scope={dirty:E,ctx:O}),d.$set(N);const R={};E[0]&1|E[1]&3&&(R.$$scope={dirty:E,ctx:O}),g.$set(R);const z={};E[0]&1|E[1]&3&&(z.$$scope={dirty:E,ctx:O}),k.$set(z)},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(k.$$.fragment,O),O&&et(()=>{C&&(M||(M=qe(e,Mt,{duration:150},!0)),M.run(1))}),C=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(g.$$.fragment,O),I(k.$$.fragment,O),O&&(M||(M=qe(e,Mt,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),O&&M&&M.end()}}}function uA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("SMTP server host"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.host),r||(a=K(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&&ue(l,u[0].smtp.host)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function fA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Port"),s=D(),l=v("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),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.port),r||(a=K(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&&ht(l.value)!==u[0].smtp.port&&ue(l,u[0].smtp.port)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function cA(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 Li({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("TLS encryption"),s=D(),V(l.$$.fragment),m(e,"for",i=n[31])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function dA(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 Li({props:u}),se.push(()=>ge(l,"keyOfSelected",a)),{c(){e=v("label"),t=B("AUTH method"),s=D(),V(l.$$.fragment),m(e,"for",i=n[31])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function pA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Username"),s=D(),l=v("input"),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31])},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].smtp.username),r||(a=K(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&&ue(l,u[0].smtp.username)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mA(n){let e,t,i,s,l,o,r;function a(f){n[23](f)}let u={id:n[31]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new ou({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Password"),s=D(),V(l.$$.fragment),m(e,"for",i=n[31])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&1&&i!==(i=f[31]))&&m(e,"for",i);const d={};c[1]&1&&(d.id=f[31]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function hA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send test email</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function _A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("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],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=[K(e,"click",n[24]),K(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ae(a)}}}function gA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[lA,sA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[5]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),p.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($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[27])),g=!0)},p($,M){(!h||M[0]&32)&&le(o,$[5]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function bA(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gA]},$$scope:{ctx:n}}});let r={};return l=new iA({props:r}),n[28](l),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function vA(n,e,t){let i,s,l;We(n,Ot,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Gt(Ot,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;p();async function p(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};g(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(H.filterRedactedProps(f));g(ne),_n({}),Ut("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function $(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=ht(this.value),t(0,f)}function P(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>_(),z=()=>h(),W=()=>a==null?void 0:a.show(),J=()=>h();function x(ne){se[ne?"unshift":"push"](()=>{a=ne,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&1024&&t(11,i=JSON.stringify(u)),n.$$.dirty[0]&2049&&t(4,s=i!=JSON.stringify(f))},[f,a,c,d,s,l,o,r,h,_,u,i,y,k,T,$,M,C,O,E,P,L,F,N,R,z,W,J,x]}class yA extends ve{constructor(e){super(),be(this,e,vA,bA,_e,{},null,[-1,-1])}}function kA(n){var $,M;let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[SA,({uniqueId:C})=>({25:C}),({uniqueId:C})=>C?33554432:0]},$$scope:{ctx:n}}});let _=(($=n[0].s3)==null?void 0:$.enabled)!=n[1].s3.enabled&&wh(n),y=n[1].s3.enabled&&Sh(n),k=((M=n[1].s3)==null?void 0:M.enabled)&&!n[6]&&!n[3]&&Th(n),T=n[6]&&$h(n);return{c(){V(e.$$.fragment),t=D(),_&&_.c(),i=D(),y&&y.c(),s=D(),l=v("div"),o=v("div"),r=D(),k&&k.c(),a=D(),T&&T.c(),u=D(),f=v("button"),c=v("span"),c.textContent="Save changes",m(o,"class","flex-fill"),m(c,"class","txt"),m(f,"type","submit"),m(f,"class","btn btn-expanded"),f.disabled=d=!n[6]||n[3],Q(f,"btn-loading",n[3]),m(l,"class","flex")},m(C,O){q(e,C,O),S(C,t,O),_&&_.m(C,O),S(C,i,O),y&&y.m(C,O),S(C,s,O),S(C,l,O),b(l,o),b(l,r),k&&k.m(l,null),b(l,a),T&&T.m(l,null),b(l,u),b(l,f),b(f,c),p=!0,h||(g=K(f,"click",n[19]),h=!0)},p(C,O){var P,L;const E={};O&100663298&&(E.$$scope={dirty:O,ctx:C}),e.$set(E),((P=C[0].s3)==null?void 0:P.enabled)!=C[1].s3.enabled?_?(_.p(C,O),O&3&&A(_,1)):(_=wh(C),_.c(),A(_,1),_.m(i.parentNode,i)):_&&(re(),I(_,1,1,()=>{_=null}),ae()),C[1].s3.enabled?y?(y.p(C,O),O&2&&A(y,1)):(y=Sh(C),y.c(),A(y,1),y.m(s.parentNode,s)):y&&(re(),I(y,1,1,()=>{y=null}),ae()),(L=C[1].s3)!=null&&L.enabled&&!C[6]&&!C[3]?k?k.p(C,O):(k=Th(C),k.c(),k.m(l,a)):k&&(k.d(1),k=null),C[6]?T?T.p(C,O):(T=$h(C),T.c(),T.m(l,u)):T&&(T.d(1),T=null),(!p||O&72&&d!==(d=!C[6]||C[3]))&&(f.disabled=d),(!p||O&8)&&Q(f,"btn-loading",C[3])},i(C){p||(A(e.$$.fragment,C),A(_),A(y),p=!0)},o(C){I(e.$$.fragment,C),I(_),I(y),p=!1},d(C){j(e,C),C&&w(t),_&&_.d(C),C&&w(i),y&&y.d(C),C&&w(s),C&&w(l),k&&k.d(),T&&T.d(),h=!1,g()}}}function wA(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function SA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Use S3 storage"),m(e,"type","checkbox"),m(e,"id",t=n[25]),e.required=!0,m(s,"for",o=n[25])},m(u,f){S(u,e,f),e.checked=n[1].s3.enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&33554432&&t!==(t=u[25])&&m(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&33554432&&o!==(o=u[25])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function wh(n){var P;let e,t,i,s,l,o,r,a=(P=n[0].s3)!=null&&P.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",p,h,g,_,y,k,T,$,M,C,O,E;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=D(),l=v("div"),o=B(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=v("strong"),u=B(a),f=B(`
to the
`),c=v("strong"),p=B(d),h=B(`.
`),g=v("br"),_=B(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,k=B(`,
`),T=v("a"),T.textContent=`s5cmd
`,$=B(", etc."),M=D(),C=v("div"),m(i,"class","icon"),m(y,"href","https://github.com/rclone/rclone"),m(y,"target","_blank"),m(y,"rel","noopener noreferrer"),m(y,"class","txt-bold"),m(T,"href","https://github.com/peak/s5cmd"),m(T,"target","_blank"),m(T,"rel","noopener noreferrer"),m(T,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m(C,"class","clearfix m-t-base")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,p),b(l,h),b(l,g),b(l,_),b(l,y),b(l,k),b(l,T),b(l,$),b(e,M),b(e,C),E=!0},p(L,F){var N;(!E||F&1)&&a!==(a=(N=L[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!E||F&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(p,d)},i(L){E||(L&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(L){L&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&w(e),L&&O&&O.end()}}}function Sh(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[TA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[$A,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[CA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[MA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[OA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),k=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[DA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(u.$$.fragment),f=D(),c=v("div"),V(d.$$.fragment),p=D(),h=v("div"),V(g.$$.fragment),_=D(),y=v("div"),V(k.$$.fragment),T=D(),$=v("div"),m(t,"class","col-lg-6"),m(l,"class","col-lg-3"),m(a,"class","col-lg-3"),m(c,"class","col-lg-6"),m(h,"class","col-lg-6"),m(y,"class","col-lg-12"),m($,"class","col-lg-12"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),q(u,a,null),b(e,f),b(e,c),q(d,c,null),b(e,p),b(e,h),q(g,h,null),b(e,_),b(e,y),q(k,y,null),b(e,T),b(e,$),C=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:O}),d.$set(N);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:O}),g.$set(R);const z={};E&100663298&&(z.$$scope={dirty:E,ctx:O}),k.$set(z)},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(k.$$.fragment,O),O&&et(()=>{C&&(M||(M=qe(e,Mt,{duration:150},!0)),M.run(1))}),C=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(g.$$.fragment,O),I(k.$$.fragment,O),O&&(M||(M=qe(e,Mt,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),O&&M&&M.end()}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Endpoint"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Bucket"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&ue(l,u[1].s3.bucket)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Region"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.region),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.region&&ue(l,u[1].s3.region)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Access key"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.accessKey),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&ue(l,u[1].s3.accessKey)},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[16](f)}let u={id:n[25],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new ou({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Secret"),s=D(),V(l.$$.fragment),m(e,"for",i=n[25])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&33554432&&i!==(i=f[25]))&&m(e,"for",i);const d={};c&33554432&&(d.id=f[25]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function DA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=D(),r=v("i"),m(e,"type","checkbox"),m(e,"id",t=n[25]),m(l,"class","txt"),m(r,"class","ri-information-line link-hint"),m(s,"for",a=n[25])},m(c,d){S(c,e,d),e.checked=n[1].s3.forcePathStyle,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[17]),De(ze.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&m(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&33554432&&a!==(a=c[25])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function Th(n){let e;function t(l,o){return l[4]?IA:l[5]?AA: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=v("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:X,d(t){t&&w(e)}}}function AA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=De(t=ze.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function IA(n){let e;return{c(){e=v("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function $h(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",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),b(e,t),i||(s=K(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function PA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[wA,kA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[7]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),p.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($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[20])),g=!0)},p($,M){(!h||M&128)&&le(o,$[7]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function LA(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const oo="s3_test_request";function NA(n,e,t){let i,s,l;We(n,Ot,N=>t(7,l=N)),Gt(Ot,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;p();async function p(){t(2,a=!0);try{const N=await me.settings.getAll()||{};g(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(oo);const N=await me.settings.update(H.filterRedactedProps(r));_n({}),await g(N),Oa(),c?Zv("Successfully saved but failed to establish S3 connection."):Ut("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(oo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:oo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Qt(()=>()=>{clearTimeout(d)});function k(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function $(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>_(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,_,i,k,T,$,M,C,O,E,P,L,F]}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=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[21]),m(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&m(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&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=v("label"),t=B("Client ID"),s=D(),l=v("input"),m(e,"for",i=n[21]),m(l,"type","text"),m(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].clientId),a||(u=K(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&m(e,"for",i),c&2097152&&o!==(o=f[21])&&m(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&ue(l,f[0].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[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Client secret"),s=D(),V(l.$$.fragment),m(e,"for",i=n[21])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&m(e,"for",i);const d={};c&2097152&&(d.id=f[21]),c&1&&(d.required=f[0].enabled),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,ke(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){I(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),j(l,f)}}}function Ch(n){let e,t,i,s;function l(a){n[16](a)}var o=n[4];function r(a){let u={key:a[1]};return a[0]!==void 0&&(u.config=a[0]),{props:u}}return o&&(t=$t(o,r(n)),se.push(()=>ge(t,"config",l))),{c(){e=v("div"),t&&V(t.$$.fragment),m(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&q(t,e,null),s=!0},p(a,u){const f={};if(u&2&&(f.key=a[1]),!i&&u&1&&(i=!0,f.config=a[0],ke(()=>i=!1)),u&16&&o!==(o=a[4])){if(t){re();const c=t;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(t=$t(o,r(a)),se.push(()=>ge(t,"config",l)),V(t.$$.fragment),A(t.$$.fragment,1),q(t,e,null)):t=null}else o&&t.$set(f)},i(a){s||(t&&A(t.$$.fragment,a),s=!0)},o(a){t&&I(t.$$.fragment,a),s=!1},d(a){a&&w(e),t&&j(t)}}}function VA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;t=new pe({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[RA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientId",$$slots:{default:[qA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".clientSecret",$$slots:{default:[jA,({uniqueId:T})=>({21:T}),({uniqueId:T})=>T?2097152:0]},$$scope:{ctx:n}}});let k=n[4]&&Ch(n);return{c(){e=v("div"),V(t.$$.fragment),i=D(),s=v("button"),s.innerHTML='<span class="txt">Clear all fields</span>',l=D(),o=v("div"),r=v("div"),a=D(),u=v("div"),V(f.$$.fragment),c=D(),d=v("div"),V(p.$$.fragment),h=D(),k&&k.c(),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),m(e,"class","flex"),m(r,"class","col-12 spacing"),m(u,"class","col-lg-6"),m(d,"class","col-lg-6"),m(o,"class","grid")},m(T,$){S(T,e,$),q(t,e,null),b(e,i),b(e,s),S(T,l,$),S(T,o,$),b(o,r),b(o,a),b(o,u),q(f,u,null),b(o,c),b(o,d),q(p,d,null),b(o,h),k&&k.m(o,null),g=!0,_||(y=K(s,"click",n[7]),_=!0)},p(T,$){const M={};$&2&&(M.name=T[1]+".enabled"),$&6291457&&(M.$$scope={dirty:$,ctx:T}),t.$set(M);const C={};$&1&&(C.class="form-field "+(T[0].enabled?"required":"")),$&2&&(C.name=T[1]+".clientId"),$&6291457&&(C.$$scope={dirty:$,ctx:T}),f.$set(C);const O={};$&1&&(O.class="form-field "+(T[0].enabled?"required":"")),$&2&&(O.name=T[1]+".clientSecret"),$&6291457&&(O.$$scope={dirty:$,ctx:T}),p.$set(O),T[4]?k?(k.p(T,$),$&16&&A(k,1)):(k=Ch(T),k.c(),A(k,1),k.m(o,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae())},i(T){g||(A(t.$$.fragment,T),A(f.$$.fragment,T),A(p.$$.fragment,T),A(k),g=!0)},o(T){I(t.$$.fragment,T),I(f.$$.fragment,T),I(p.$$.fragment,T),I(k),g=!1},d(T){T&&w(e),j(t),T&&w(l),T&&w(o),j(f),j(p),k&&k.d(),_=!1,y()}}}function Mh(n){let e;return{c(){e=v("i"),m(e,"class",n[3])},m(t,i){S(t,e,i)},p(t,i){i&8&&m(e,"class",t[3])},d(t){t&&w(e)}}}function Oh(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function HA(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label label-hint")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function zA(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function BA(n){let e,t,i,s,l,o,r,a=n[1].substring(0,n[1].length-4)+"",u,f,c,d,p,h,g,_=n[3]&&Mh(n),y=n[6]&&Oh();function k(M,C){return M[0].enabled?zA:HA}let T=k(n),$=T(n);return{c(){e=v("div"),_&&_.c(),t=D(),i=v("span"),s=B(n[2]),l=D(),o=v("em"),r=B("("),u=B(a),f=B(")"),c=D(),d=v("div"),p=D(),y&&y.c(),h=D(),$.c(),g=we(),m(i,"class","txt"),m(o,"class","txt-hint"),m(e,"class","inline-flex"),m(d,"class","flex-fill")},m(M,C){S(M,e,C),_&&_.m(e,null),b(e,t),b(e,i),b(i,s),b(e,l),b(e,o),b(o,r),b(o,u),b(o,f),S(M,c,C),S(M,d,C),S(M,p,C),y&&y.m(M,C),S(M,h,C),$.m(M,C),S(M,g,C)},p(M,C){M[3]?_?_.p(M,C):(_=Mh(M),_.c(),_.m(e,t)):_&&(_.d(1),_=null),C&4&&le(s,M[2]),C&2&&a!==(a=M[1].substring(0,M[1].length-4)+"")&&le(u,a),M[6]?y?C&64&&A(y,1):(y=Oh(),y.c(),A(y,1),y.m(h.parentNode,h)):y&&(re(),I(y,1,1,()=>{y=null}),ae()),T!==(T=k(M))&&($.d(1),$=T(M),$&&($.c(),$.m(g.parentNode,g)))},d(M){M&&w(e),_&&_.d(),M&&w(c),M&&w(d),M&&w(p),y&&y.d(M),M&&w(h),$.d(M),M&&w(g)}}}function UA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[BA],default:[VA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Le(s,i[l]);return e=new al({props:s}),n[17](e),e.$on("expand",n[18]),e.$on("collapse",n[19]),e.$on("toggle",n[20]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&256?bt(i,[Vt(l[8])]):{};o&4194399&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[17](null),j(e,l)}}}function WA(n,e,t){let i;const s=["key","title","icon","config","optionsComponent","expand","collapse","collapseSiblings"];let l=Je(e,s),o;We(n,ti,P=>t(12,o=P));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{optionsComponent:c}=e,d;function p(){d==null||d.expand()}function h(){d==null||d.collapse()}function g(){d==null||d.collapseSiblings()}function _(){for(let P in f)t(0,f[P]="",f);t(0,f.enabled=!1,f)}function y(){f.enabled=this.checked,t(0,f)}function k(){f.clientId=this.value,t(0,f)}function T(P){n.$$.not_equal(f.clientSecret,P)&&(f.clientSecret=P,t(0,f))}function $(P){f=P,t(0,f)}function M(P){se[P?"unshift":"push"](()=>{d=P,t(5,d)})}function C(P){de.call(this,n,P)}function O(P){de.call(this,n,P)}function E(P){de.call(this,n,P)}return n.$$set=P=>{e=Le(Le({},e),jt(P)),t(8,l=Je(e,s)),"key"in P&&t(1,r=P.key),"title"in P&&t(2,a=P.title),"icon"in P&&t(3,u=P.icon),"config"in P&&t(0,f=P.config),"optionsComponent"in P&&t(4,c=P.optionsComponent)},n.$$.update=()=>{n.$$.dirty&4098&&t(6,i=!H.isEmpty(H.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||ci(r))},[f,r,a,u,c,d,i,_,l,p,h,g,o,y,k,T,$,M,C,O,E]}class YA extends ve{constructor(e){super(),be(this,e,WA,UA,_e,{key:1,title:2,icon:3,config:0,optionsComponent:4,expand:9,collapse:10,collapseSiblings:11})}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Dh(n,e,t){const i=n.slice();return i[18]=e[t][0],i[19]=e[t][1],i[20]=e,i[21]=t,i}function KA(n){let e,t,i,s,l,o,r,a,u,f,c,d=Object.entries(As),p=[];for(let y=0;y<d.length;y+=1)p[y]=Ah(Dh(n,d,y));const h=y=>I(p[y],1,1,()=>{p[y]=null});let g=!n[4]&&Ih(n),_=n[5]&&Ph(n);return{c(){e=v("div");for(let y=0;y<p.length;y+=1)p[y].c();t=D(),g&&g.c(),i=D(),s=v("div"),l=v("div"),o=D(),_&&_.c(),r=D(),a=v("button"),u=v("span"),u.textContent="Save changes",m(e,"class","accordions"),m(l,"class","flex-fill"),m(u,"class","txt"),m(a,"type","submit"),m(a,"class","btn btn-expanded"),a.disabled=f=!n[5]||n[3],Q(a,"btn-loading",n[3]),m(s,"class","flex m-t-base")},m(y,k){S(y,e,k);for(let T=0;T<p.length;T+=1)p[T]&&p[T].m(e,null);S(y,t,k),g&&g.m(y,k),S(y,i,k),S(y,s,k),b(s,l),b(s,o),_&&_.m(s,null),b(s,r),b(s,a),b(a,u),c=!0},p(y,k){if(k&19){d=Object.entries(As);let T;for(T=0;T<d.length;T+=1){const $=Dh(y,d,T);p[T]?(p[T].p($,k),A(p[T],1)):(p[T]=Ah($),p[T].c(),A(p[T],1),p[T].m(e,null))}for(re(),T=d.length;T<p.length;T+=1)h(T);ae()}y[4]?g&&(g.d(1),g=null):g?g.p(y,k):(g=Ih(y),g.c(),g.m(i.parentNode,i)),y[5]?_?_.p(y,k):(_=Ph(y),_.c(),_.m(s,r)):_&&(_.d(1),_=null),(!c||k&40&&f!==(f=!y[5]||y[3]))&&(a.disabled=f),(!c||k&8)&&Q(a,"btn-loading",y[3])},i(y){if(!c){for(let k=0;k<d.length;k+=1)A(p[k]);c=!0}},o(y){p=p.filter(Boolean);for(let k=0;k<p.length;k+=1)I(p[k]);c=!1},d(y){y&&w(e),at(p,y),y&&w(t),g&&g.d(y),y&&w(i),y&&w(s),_&&_.d()}}}function JA(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Eh(n){let e,t=n[18],i,s;const l=()=>n[12](e,t),o=()=>n[12](null,t);function r(u){n[13](u,n[18])}let a={single:!0,key:n[18],title:n[19].title,icon:n[19].icon||"ri-fingerprint-line",optionsComponent:n[19].optionsComponent};return n[0][n[18]]!==void 0&&(a.config=n[0][n[18]]),e=new YA({props:a}),l(),se.push(()=>ge(e,"config",r)),{c(){V(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,f){n=u,t!==n[18]&&(o(),t=n[18],l());const c={};!i&&f&1&&(i=!0,c.config=n[0][n[18]],ke(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){I(e.$$.fragment,u),s=!1},d(u){o(),j(e,u)}}}function Ah(n){var s;let e,t,i=(n[4]||!n[19].hidden||((s=n[0][n[18]])==null?void 0:s.enabled))&&Eh(n);return{c(){i&&i.c(),e=we()},m(l,o){i&&i.m(l,o),S(l,e,o),t=!0},p(l,o){var r;l[4]||!l[19].hidden||(r=l[0][l[18]])!=null&&r.enabled?i?(i.p(l,o),o&17&&A(i,1)):(i=Eh(l),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){i&&i.d(l),l&&w(e)}}}function Ih(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),t=v("i"),i=D(),s=v("span"),l=B("Show all ("),o=B(n[6]),r=B(")"),m(t,"class","ri-arrow-down-s-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint m-t-10")},m(f,c){S(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),a||(u=K(e,"click",n[14]),a=!0)},p(f,c){c&64&&le(o,f[6])},d(f){f&&w(e),a=!1,u()}}}function Ph(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",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),b(e,t),i||(s=K(e,"click",n[15]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function ZA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[JA,KA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[7]),r=D(),a=v("div"),u=v("form"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=D(),p.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(u,"autocomplete","off"),m(a,"class","wrapper")},m($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[8])),g=!0)},p($,M){(!h||M&128)&&le(o,$[7]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function GA(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[ZA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&4194559&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function XA(n,e,t){let i,s,l,o;We(n,Ot,M=>t(7,o=M)),Gt(Ot,o="Auth providers",o);let r={},a={},u={},f=!1,c=!1,d=!1;p();async function p(){t(2,f=!0);try{const M=await me.settings.getAll()||{};g(M)}catch(M){me.errorResponseHandler(M)}t(2,f=!1)}async function h(){var M;if(!(c||!s)){t(3,c=!0);try{const C=await me.settings.update(H.filterRedactedProps(u));g(C),_n({}),(M=r[Object.keys(r)[0]])==null||M.collapseSiblings(),Ut("Successfully updated auth providers.")}catch(C){me.errorResponseHandler(C)}t(3,c=!1)}}function g(M){M=M||{},t(0,u={});for(const C in As)t(0,u[C]=Object.assign({enabled:!1},M[C]),u);t(10,a=JSON.parse(JSON.stringify(u)))}function _(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function y(M,C){se[M?"unshift":"push"](()=>{r[C]=M,t(1,r)})}function k(M,C){n.$$.not_equal(u[C],M)&&(u[C]=M,t(0,u))}const T=()=>t(4,d=!0),$=()=>_();return n.$$.update=()=>{n.$$.dirty&1024&&t(11,i=JSON.stringify(a)),n.$$.dirty&2049&&t(5,s=i!=JSON.stringify(u))},t(6,l=Object.values(As).filter(M=>M.hidden).length),[u,r,f,c,d,s,l,o,h,_,a,i,y,k,T,$]}class QA extends ve{constructor(e){super(),be(this,e,XA,GA,_e,{})}}function Lh(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function xA(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p,h=n[5];const g=y=>y[16].key;for(let y=0;y<h.length;y+=1){let k=Lh(n,h,y),T=g(k);t.set(T,e[y]=Nh(T,k))}let _=n[3]&&Fh(n);return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=D(),s=v("div"),l=v("div"),o=D(),_&&_.c(),r=D(),a=v("button"),u=v("span"),u.textContent="Save changes",m(l,"class","flex-fill"),m(u,"class","txt"),m(a,"type","submit"),m(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],Q(a,"btn-loading",n[2]),m(s,"class","flex")},m(y,k){for(let T=0;T<e.length;T+=1)e[T]&&e[T].m(y,k);S(y,i,k),S(y,s,k),b(s,l),b(s,o),_&&_.m(s,null),b(s,r),b(s,a),b(a,u),c=!0,d||(p=K(a,"click",n[13]),d=!0)},p(y,k){k&524321&&(h=y[5],re(),e=Ct(e,k,g,1,y,h,t,i.parentNode,an,Nh,i,Lh),ae()),y[3]?_?_.p(y,k):(_=Fh(y),_.c(),_.m(s,r)):_&&(_.d(1),_=null),(!c||k&12&&f!==(f=!y[3]||y[2]))&&(a.disabled=f),(!c||k&4)&&Q(a,"btn-loading",y[2])},i(y){if(!c){for(let k=0;k<h.length;k+=1)A(e[k]);c=!0}},o(y){for(let k=0;k<e.length;k+=1)I(e[k]);c=!1},d(y){for(let k=0;k<e.length;k+=1)e[k].d(y);y&&w(i),y&&w(s),_&&_.d(),d=!1,p()}}}function e6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function t6(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,p;function h(){n[10].call(r,n[16])}function g(){return n[11](n[16])}return{c(){e=v("label"),i=B(t),s=B(" duration (in seconds)"),o=D(),r=v("input"),u=D(),f=v("div"),c=v("span"),c.textContent="Invalidate all previously issued tokens",m(e,"for",l=n[19]),m(r,"type","number"),m(r,"id",a=n[19]),r.required=!0,m(c,"class","link-primary"),Q(c,"txt-success",n[0][n[16].key].secret),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,i),b(e,s),S(_,o,y),S(_,r,y),ue(r,n[0][n[16].key].duration),S(_,u,y),S(_,f,y),b(f,c),d||(p=[K(r,"input",h),K(c,"click",g)],d=!0)},p(_,y){n=_,y&524288&&l!==(l=n[19])&&m(e,"for",l),y&524288&&a!==(a=n[19])&&m(r,"id",a),y&33&&ht(r.value)!==n[0][n[16].key].duration&&ue(r,n[0][n[16].key].duration),y&33&&Q(c,"txt-success",n[0][n[16].key].secret)},d(_){_&&w(e),_&&w(o),_&&w(r),_&&w(u),_&&w(f),d=!1,Ae(p)}}}function Nh(n,e){let t,i,s;return i=new pe({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[t6,({uniqueId:l})=>({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=we(),V(i.$$.fragment),this.first=t},m(l,o){S(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(t),j(i,l)}}}function Fh(n){let e,t,i,s;return{c(){e=v("button"),t=v("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),b(e,t),i||(s=K(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&w(e),i=!1,s()}}}function n6(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[e6,xA],k=[];function T($,M){return $[1]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[4]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Adjust common token options.</p>",c=D(),p.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($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[6])),g=!0)},p($,M){(!h||M&16)&&le(o,$[4]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function i6(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[n6]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function s6(n,e,t){let i,s,l;We(n,Ot,T=>t(4,l=T));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];Gt(Ot,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const T=await me.settings.getAll()||{};p(T)}catch(T){me.errorResponseHandler(T)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const T=await me.settings.update(H.filterRedactedProps(a));p(T),Ut("Successfully saved tokens options.")}catch(T){me.errorResponseHandler(T)}t(2,f=!1)}}function p(T){var $;T=T||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:(($=T[M.key])==null?void 0:$.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(T){a[T.key].duration=ht(this.value),t(0,a)}const _=T=>{a[T.key].secret?(delete a[T.key].secret,t(0,a)):t(0,a[T.key].secret=H.randomString(50),a)},y=()=>h(),k=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,h,r,i,g,_,y,k]}class l6 extends ve{constructor(e){super(),be(this,e,s6,i6,_e,{})}}function o6(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h;return o=new H1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`<p>Below you&#39;ll find your current collections configuration that you could import in
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),V(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("button"),c.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(c,"type","button"),m(c,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(g,_){S(g,e,_),S(g,t,_),S(g,i,_),b(i,s),b(i,l),q(o,i,null),n[8](i),S(g,r,_),S(g,a,_),b(a,u),b(a,f),b(a,c),d=!0,p||(h=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],p=!0)},p(g,_){const y={};_&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){I(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),p=!1,Ae(h)}}}function r6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function a6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[r6,o6],h=[];function g(_,y){return _[1]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[3]),r=D(),a=v("div"),u=v("div"),c.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(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function u6(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[a6]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function f6(n,e,t){let i,s;We(n,Ot,_=>t(3,s=_)),Gt(Ot,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){me.errorResponseHandler(_)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Vg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function p(_){se[_?"unshift":"push"](()=>{o=_,t(0,o)})}const h=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,p,h,g]}class c6 extends ve{constructor(e){super(),be(this,e,f6,u6,_e,{})}}function Rh(n,e,t){const i=n.slice();return i[14]=e[t],i}function qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Hh(n,e,t){const i=n.slice();return i[14]=e[t],i}function zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Bh(n,e,t){const i=n.slice();return i[30]=e[t],i}function d6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Uh(),a=n[0].name!==n[1].name&&Wh(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=B(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),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=Uh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Wh(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 p6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=B(s),m(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(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 m6(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=D(),i=v("strong"),l=B(s),m(e,"class","label label-success")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(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 Uh(n){let e;return{c(){e=v("span"),e.textContent="Changed",m(e,"class","label label-warning")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Wh(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(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 Yh(n){var _,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((_=n[0])==null?void 0:_[n[30]])+"",f,c,d,p,h=n[12]((y=n[1])==null?void 0:y[n[30]])+"",g;return{c(){var k,T,$,M,C,O;e=v("tr"),t=v("td"),i=v("span"),l=B(s),o=D(),r=v("td"),a=v("pre"),f=B(u),c=D(),d=v("td"),p=v("pre"),g=B(h),m(t,"class","min-width svelte-lmkr38"),m(a,"class","txt"),m(r,"class","svelte-lmkr38"),Q(r,"changed-old-col",!n[10]&&cn((k=n[0])==null?void 0:k[n[30]],(T=n[1])==null?void 0:T[n[30]])),Q(r,"changed-none-col",n[10]),m(p,"class","txt"),m(d,"class","svelte-lmkr38"),Q(d,"changed-new-col",!n[5]&&cn(($=n[0])==null?void 0:$[n[30]],(M=n[1])==null?void 0:M[n[30]])),Q(d,"changed-none-col",n[5]),m(e,"class","svelte-lmkr38"),Q(e,"txt-primary",cn((C=n[0])==null?void 0:C[n[30]],(O=n[1])==null?void 0:O[n[30]]))},m(k,T){S(k,e,T),b(e,t),b(t,i),b(i,l),b(e,o),b(e,r),b(r,a),b(a,f),b(e,c),b(e,d),b(d,p),b(p,g)},p(k,T){var $,M,C,O,E,P,L,F;T[0]&1&&u!==(u=k[12](($=k[0])==null?void 0:$[k[30]])+"")&&le(f,u),T[0]&3075&&Q(r,"changed-old-col",!k[10]&&cn((M=k[0])==null?void 0:M[k[30]],(C=k[1])==null?void 0:C[k[30]])),T[0]&1024&&Q(r,"changed-none-col",k[10]),T[0]&2&&h!==(h=k[12]((O=k[1])==null?void 0:O[k[30]])+"")&&le(g,h),T[0]&2083&&Q(d,"changed-new-col",!k[5]&&cn((E=k[0])==null?void 0:E[k[30]],(P=k[1])==null?void 0:P[k[30]])),T[0]&32&&Q(d,"changed-none-col",k[5]),T[0]&2051&&Q(e,"txt-primary",cn((L=k[0])==null?void 0:L[k[30]],(F=k[1])==null?void 0:F[k[30]]))},d(k){k&&w(e)}}}function Kh(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=Zh(Hh(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=Hh(s,t,o);i[o]?i[o].p(r,l):(i[o]=Zh(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){at(i,s),s&&w(e)}}}function Jh(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=v("tr"),t=v("td"),s=B(i),l=D(),o=v("td"),r=v("pre"),u=B(a),f=D(),c=v("td"),d=D(),m(t,"class","min-width field-key-col svelte-lmkr38"),m(r,"class","txt"),m(o,"class","changed-old-col svelte-lmkr38"),m(c,"class","changed-none-col svelte-lmkr38"),m(e,"class","txt-primary svelte-lmkr38")},m(p,h){S(p,e,h),b(e,t),b(t,s),b(e,l),b(e,o),b(o,r),b(r,u),b(e,f),b(e,c),b(e,d)},p(p,h){h[0]&64&&i!==(i=p[17]+"")&&le(s,i),h[0]&64&&a!==(a=p[12](p[18])+"")&&le(u,a)},d(p){p&&w(e)}}}function Zh(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,p=n[14].name+"",h,g,_,y,k=Object.entries(n[14]),T=[];for(let $=0;$<k.length;$+=1)T[$]=Jh(zh(n,k,$));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=D(),a=v("span"),u=B("Deleted - "),f=v("small"),c=B("All stored data related to "),d=v("strong"),h=B(p),g=B(" will be deleted!"),_=D();for(let $=0;$<T.length;$+=1)T[$].c();y=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($,M){S($,e,M),b(e,t),b(t,i),b(i,s),b(i,o),b(t,r),b(t,a),b(a,u),b(a,f),b(f,c),b(f,d),b(d,h),b(f,g),S($,_,M);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m($,M);S($,y,M)},p($,M){if(M[0]&64&&l!==(l=$[14].name+"")&&le(o,l),M[0]&64&&p!==(p=$[14].name+"")&&le(h,p),M[0]&4160){k=Object.entries($[14]);let C;for(C=0;C<k.length;C+=1){const O=zh($,k,C);T[C]?T[C].p(O,M):(T[C]=Jh(O),T[C].c(),T[C].m(y.parentNode,y))}for(;C<T.length;C+=1)T[C].d(1);T.length=k.length}},d($){$&&w(e),$&&w(_),at(T,$),$&&w(y)}}}function Gh(n){let e;return{c(){e=v("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 Xh(n){var g;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((g=An(n[3],n[14].id))==null?void 0:g[n[17]])+"",u,f,c,d,p=n[12](n[23])+"",h;return{c(){var _,y,k;e=v("tr"),t=v("td"),s=B(i),l=D(),o=v("td"),r=v("pre"),u=B(a),f=D(),c=v("td"),d=v("pre"),h=B(p),m(t,"class","min-width field-key-col svelte-lmkr38"),m(r,"class","txt"),m(o,"class","svelte-lmkr38"),Q(o,"changed-old-col",cn((_=An(n[3],n[14].id))==null?void 0:_[n[17]],n[23])),m(d,"class","txt"),m(c,"class","svelte-lmkr38"),Q(c,"changed-new-col",cn((y=An(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),m(e,"class","svelte-lmkr38"),Q(e,"txt-primary",cn((k=An(n[3],n[14].id))==null?void 0:k[n[17]],n[23]))},m(_,y){S(_,e,y),b(e,t),b(t,s),b(e,l),b(e,o),b(o,r),b(r,u),b(e,f),b(e,c),b(c,d),b(d,h)},p(_,y){var k,T,$,M;y[0]&128&&i!==(i=_[17]+"")&&le(s,i),y[0]&136&&a!==(a=_[12]((k=An(_[3],_[14].id))==null?void 0:k[_[17]])+"")&&le(u,a),y[0]&136&&Q(o,"changed-old-col",cn((T=An(_[3],_[14].id))==null?void 0:T[_[17]],_[23])),y[0]&128&&p!==(p=_[12](_[23])+"")&&le(h,p),y[0]&136&&Q(c,"changed-new-col",cn(($=An(_[3],_[14].id))==null?void 0:$[_[17]],_[23])),y[0]&136&&Q(e,"txt-primary",cn((M=An(_[3],_[14].id))==null?void 0:M[_[17]],_[23]))},d(_){_&&w(e)}}}function Qh(n){let e,t,i,s,l=n[14].name+"",o,r,a=cn(An(n[3],n[14].id),An(n[4],n[14].id)),u,f,c=a&&Gh(),d=Object.entries(n[14]),p=[];for(let h=0;h<d.length;h+=1)p[h]=Xh(Vh(n,d,h));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=D(),c&&c.c(),u=D();for(let h=0;h<p.length;h+=1)p[h].c();f=we(),m(i,"class","txt"),m(t,"class","min-width svelte-lmkr38"),m(t,"colspan","3"),m(e,"class","svelte-lmkr38")},m(h,g){S(h,e,g),b(e,t),b(t,i),b(i,s),b(i,o),b(t,r),c&&c.m(t,null),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]&128&&l!==(l=h[14].name+"")&&le(o,l),g[0]&152&&(a=cn(An(h[3],h[14].id),An(h[4],h[14].id))),a?c||(c=Gh(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),g[0]&4232){d=Object.entries(h[14]);let _;for(_=0;_<d.length;_+=1){const y=Vh(h,d,_);p[_]?p[_].p(y,g):(p[_]=Xh(y),p[_].c(),p[_].m(f.parentNode,f))}for(;_<p.length;_+=1)p[_].d(1);p.length=d.length}},d(h){h&&w(e),c&&c.d(),h&&w(u),at(p,h),h&&w(f)}}}function xh(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=v("tr"),t=v("td"),s=B(i),l=D(),o=v("td"),r=D(),a=v("td"),u=v("pre"),c=B(f),d=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(p,h){S(p,e,h),b(e,t),b(t,s),b(e,l),b(e,o),b(e,r),b(e,a),b(a,u),b(u,c),b(e,d)},p(p,h){h[0]&256&&i!==(i=p[17]+"")&&le(s,i),h[0]&256&&f!==(f=p[12](p[18])+"")&&le(c,f)},d(p){p&&w(e)}}}function e_(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c=Object.entries(n[14]),d=[];for(let p=0;p<c.length;p+=1)d[p]=xh(qh(n,c,p));return{c(){e=v("tr"),t=v("th"),i=v("span"),s=B("field: "),o=B(l),r=D(),a=v("span"),a.textContent="Added",u=D();for(let p=0;p<d.length;p+=1)d[p].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(p,h){S(p,e,h),b(e,t),b(t,i),b(i,s),b(i,o),b(t,r),b(t,a),S(p,u,h);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(p,h);S(p,f,h)},p(p,h){if(h[0]&256&&l!==(l=p[14].name+"")&&le(o,l),h[0]&4352){c=Object.entries(p[14]);let g;for(g=0;g<c.length;g+=1){const _=qh(p,c,g);d[g]?d[g].p(_,h):(d[g]=xh(_),d[g].c(),d[g].m(f.parentNode,f))}for(;g<d.length;g+=1)d[g].d(1);d.length=c.length}},d(p){p&&w(e),p&&w(u),at(d,p),p&&w(f)}}}function h6(n){let e,t,i,s,l,o,r,a,u;function f($,M){var C,O;return(C=$[0])!=null&&C.id?(O=$[1])!=null&&O.id?d6:p6:m6}let c=f(n),d=c(n),p=n[11],h=[];for(let $=0;$<p.length;$+=1)h[$]=Yh(Bh(n,p,$));let g=(n[2]||n[5])&&Kh(n),_=n[7],y=[];for(let $=0;$<_.length;$+=1)y[$]=Qh(jh(n,_,$));let k=n[8],T=[];for(let $=0;$<k.length;$+=1)T[$]=e_(Rh(n,k,$));return{c(){e=v("div"),d.c(),t=D(),i=v("table"),s=v("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=D(),g&&g.c(),a=D();for(let $=0;$<y.length;$+=1)y[$].c();u=D();for(let $=0;$<T.length;$+=1)T[$].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){S($,e,M),d.m(e,null),S($,t,M),S($,i,M),b(i,s),b(i,l),b(i,o);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(o,null);b(o,r),g&&g.m(o,null),b(o,a);for(let C=0;C<y.length;C+=1)y[C]&&y[C].m(o,null);b(o,u);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){p=$[11];let C;for(C=0;C<p.length;C+=1){const O=Bh($,p,C);h[C]?h[C].p(O,M):(h[C]=Yh(O),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=p.length}if($[2]||$[5]?g?g.p($,M):(g=Kh($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){_=$[7];let C;for(C=0;C<_.length;C+=1){const O=jh($,_,C);y[C]?y[C].p(O,M):(y[C]=Qh(O),y[C].c(),y[C].m(o,u))}for(;C<y.length;C+=1)y[C].d(1);y.length=_.length}if(M[0]&4352){k=$[8];let C;for(C=0;C<k.length;C+=1){const O=Rh($,k,C);T[C]?T[C].p(O,M):(T[C]=e_(O),T[C].c(),T[C].m(o,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=k.length}},i:X,o:X,d($){$&&w(e),d.d(),$&&w(t),$&&w(i),at(h,$),g&&g.d(),at(y,$),at(T,$)}}}function An(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function cn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function _6(n,e,t){let i,s,l,{collectionA:o=new hn}=e,{collectionB:r=new hn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],p=[];const h=Object.keys(new hn().export()).filter(y=>!["schema","created","updated"].includes(y));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(k=>y.id==k.id))))}function _(y){return typeof y>"u"?"":H.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,p=f.filter(y=>!u.find(k=>k.id==y.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,p,l,s,h,_]}class g6 extends ve{constructor(e){super(),be(this,e,_6,h6,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function t_(n,e,t){const i=n.slice();return i[17]=e[t],i}function n_(n){let e,t;return e=new g6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=n_(t_(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=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=t_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=n_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function v6(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function y6(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("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],Q(s,"btn-loading",n[4])},m(a,u){S(a,e,u),b(e,t),S(a,i,u),S(a,s,u),b(s,l),o||(r=[K(e,"click",n[0]),K(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&Q(s,"btn-loading",a[4])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Ae(r)}}}function k6(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[y6],header:[v6],default:[b6]},$$scope:{ctx:n}};return e=new bn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[11](null),j(e,s)}}}function w6(n,e,t){const i=vt();let s,l=[],o=[],r=[],a=!1,u=!1;function f($,M,C=!1){t(7,l=$),t(8,o=M),t(3,a=C),s==null||s.show()}function c(){return s==null?void 0:s.hide()}function d(){t(2,r=[]);for(const $ of l){const M=H.findByKey(o,"id",$.id)||null;(a&&!(M!=null&&M.id)||M!=null&&M.id&&H.hasCollectionChanges($,M,a))&&r.push({old:$,new:M})}for(const $ of o){const M=H.findByKey(l,"id",$.id)||null;M!=null&&M.id||r.push({old:M,new:$})}}function p(){const $=[];if(a)for(const M of l){const C=H.findByKey(o,"id",M.id);if(!C)$.push(M.name+".*");else{const O=Array.isArray(M.schema)?M.schema:[];for(const E of O)H.findByKey(C.schema,"id",E.id)||$.push(`${M.name}.${E.name} (${E.id})`)}}$.length?pn(`Do you really want to delete the following collection fields and their related records data:
- ${$.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Ut("Successfully imported collections configuration."),i("submit")}catch($){me.errorResponseHandler($)}t(4,u=!1),c()}}const g=()=>p(),_=()=>!u;function y($){se[$?"unshift":"push"](()=>{s=$,t(1,s)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,p,f,l,o,g,_,y,k,T]}class S6 extends ve{constructor(e){super(),be(this,e,w6,k6,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function i_(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 l_(n,e,t){const i=n.slice();return i[32]=e[t],i}function T6(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[C6,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&r_(),L=n[6]&&n[1].length&&n[7]&&a_(n),F=n[13].length&&v_(n),N=!!n[0]&&y_(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=B(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),V(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),L&&L.c(),d=D(),F&&F.c(),p=D(),h=v("div"),N&&N.c(),g=D(),_=v("div"),y=D(),k=v("button"),T=v("span"),T.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"),Q(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(_,"class","flex-fill"),m(T,"class","txt"),m(k,"type","button"),m(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=$=!n[14],m(h,"class","flex m-t-base")},m(R,z){S(R,e,z),n[19](e),S(R,t,z),S(R,i,z),b(i,s),b(s,l),b(s,o),S(R,r,z),q(a,R,z),S(R,u,z),S(R,f,z),P&&P.m(R,z),S(R,c,z),L&&L.m(R,z),S(R,d,z),F&&F.m(R,z),S(R,p,z),S(R,h,z),N&&N.m(h,null),b(h,g),b(h,_),b(h,y),b(h,k),b(k,T),M=!0,C||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(k,"click",n[26])],C=!0)},p(R,z){(!M||z[0]&4096)&&Q(o,"btn-loading",R[12]);const W={};z[0]&64&&(W.class="form-field "+(R[6]?"":"field-error")),z[0]&65|z[1]&1536&&(W.$$scope={dirty:z,ctx:R}),a.$set(W),R[6]&&R[1].length&&!R[7]?P||(P=r_(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),R[6]&&R[1].length&&R[7]?L?L.p(R,z):(L=a_(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,z):(F=v_(R),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),R[0]?N?N.p(R,z):(N=y_(R),N.c(),N.m(h,g)):N&&(N.d(1),N=null),(!M||z[0]&16384&&$!==($=!R[14]))&&(k.disabled=$)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){I(a.$$.fragment,R),I(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),P&&P.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(p),R&&w(h),N&&N.d(),C=!1,Ae(O)}}}function $6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function o_(n){let e;return{c(){e=v("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 C6(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&o_();return{c(){e=v("label"),t=B("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.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(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0]),S(d,r,p),c&&c.m(d,p),S(d,a,p),u||(f=K(l,"input",n[22]),u=!0)},p(d,p){p[1]&512&&i!==(i=d[40])&&m(e,"for",i),p[1]&512&&o!==(o=d[40])&&m(l,"id",o),p[0]&1&&ue(l,d[0]),d[0]&&!d[6]?c||(c=o_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function r_(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,m(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function a_(n){let e,t,i,s,l,o=n[9].length&&u_(n),r=n[4].length&&d_(n),a=n[8].length&&__(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("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),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=u_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=d_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=__(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 u_(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=l_(n,s,o),a=l(r);t.set(a,e[o]=c_(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=Ct(e,r,l,1,o,s,t,i.parentNode,ns,c_,i,l_))},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=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function c_(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=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=B(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(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=f_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function d_(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]=h_(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=Ct(e,r,l,1,o,s,t,i.parentNode,ns,h_,i,s_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function p_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(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 m_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function h_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&p_(e),p=e[35].new.id&&m_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=B(a),f=D(),p&&p.c(),c=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(h,g){S(h,t,g),b(t,i),b(t,s),b(t,l),d&&d.m(l,null),b(l,o),b(l,r),b(r,u),b(l,f),p&&p.m(l,null),b(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=p_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?p?p.p(e,g):(p=m_(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},d(h){h&&w(t),d&&d.d(),p&&p.d()}}}function __(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=i_(n,s,o),a=l(r);t.set(a,e[o]=b_(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=Ct(e,r,l,1,o,s,t,i.parentNode,ns,b_,i,i_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function g_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function b_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&g_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Added",s=D(),l=v("strong"),r=B(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(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=g_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function v_(n){let e,t,i,s,l,o,r,a;return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("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=v("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),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function y_(n){let e,t,i;return{c(){e=v("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=K(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function M6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[$6,T6],h=[];function g(_,y){return _[5]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[15]),r=D(),a=v("div"),u=v("div"),c.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(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function O6(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[M6]},$$scope:{ctx:n}}});let r={};return l=new S6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function D6(n,e,t){let i,s,l,o,r,a,u;We(n,Ot,G=>t(15,u=G)),Gt(Ot,u="Import collections",u);let f,c,d="",p=!1,h=[],g=[],_=!0,y=[],k=!1;T();async function T(){t(5,k=!0);try{t(2,g=await me.collections.getFullList(200));for(let G of g)delete G.created,delete G.updated}catch(G){me.errorResponseHandler(G)}t(5,k=!1)}function $(){if(t(4,y=[]),!!i)for(let G of h){const fe=H.findByKey(g,"id",G.id);!(fe!=null&&fe.id)||!H.hasCollectionChanges(fe,G,_)||y.push({new:G,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let G of h)delete G.created,delete G.updated,G.schema=H.filterDuplicatesByKey(G.schema)}function C(){var G,fe;for(let Z of h){const ce=H.findByKey(g,"name",Z.name)||H.findByKey(g,"id",Z.id);if(!ce)continue;const he=Z.id,Ce=ce.id;Z.id=Ce;const Re=Array.isArray(ce.schema)?ce.schema:[],je=Array.isArray(Z.schema)?Z.schema:[];for(const ye of je){const $e=H.findByKey(Re,"name",ye.name);$e&&$e.id&&(ye.id=$e.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let $e of ye.schema)(G=$e.options)!=null&&G.collectionId&&((fe=$e.options)==null?void 0:fe.collectionId)===he&&($e.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function O(G){t(12,p=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,p=!1),t(10,f.value="",f),t(0,d=Z.target.result),await rn(),h.length||(pl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),pl("Failed to load the imported JSON."),t(12,p=!1),t(10,f.value="",f)},fe.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),_n({})}function P(G){se[G?"unshift":"push"](()=>{f=G,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const z=()=>C(),W=()=>E(),J=()=>c==null?void 0:c.show(g,h,_);function x(G){se[G?"unshift":"push"](()=>{c=G,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(G=>i&&_&&!H.findByKey(h,"id",G.id))),n.$$.dirty[0]&70&&t(8,l=h.filter(G=>i&&!H.findByKey(g,"id",G.id))),n.$$.dirty[0]&10&&(typeof h<"u"||typeof _<"u")&&$(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!k&&i&&o),n.$$.dirty[0]&6&&t(13,a=h.filter(G=>{let fe=H.findByKey(g,"name",G.name)||H.findByKey(g,"id",G.id);if(!fe)return!1;if(fe.id!=G.id)return!0;const Z=Array.isArray(fe.schema)?fe.schema:[],ce=Array.isArray(G.schema)?G.schema:[];for(const he of ce){if(H.findByKey(Z,"id",he.id))continue;const Re=H.findByKey(Z,"name",he.name);if(Re&&he.id!=Re.id)return!0}return!1}))},[d,h,g,_,y,k,i,o,l,s,f,c,p,a,r,u,C,O,E,P,L,F,N,R,z,W,J,x,ne]}class E6 extends ve{constructor(e){super(),be(this,e,D6,O6,_e,{},null,[-1,-1])}}const Ht=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Ei("/"):!0}],A6={"/login":Nt({component:CE,conditions:Ht.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>rt(()=>import("./PageAdminRequestPasswordReset-791a0927.js"),[],import.meta.url),conditions:Ht.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageAdminConfirmPasswordReset-fd0063fa.js"),[],import.meta.url),conditions:Ht.concat([n=>!me.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:GD,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:ZS,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:FE,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:yE,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:yA,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:FA,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:QA,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:l6,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:c6,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:E6,conditions:Ht.concat([n=>me.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-d28bb3b4.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmPasswordReset-d28bb3b4.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-6df37d96.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmVerification-6df37d96.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-7ad27c08.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>rt(()=>import("./PageRecordConfirmEmailChange-7ad27c08.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"*":Nt({component:gy,userData:{showAppSidebar:!1}})};function I6(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=p=>Math.sqrt(p)*120,easing:d=Uo}=i;return{delay:f,duration:Bt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(p,h)=>{const g=h*a,_=h*u,y=p+h*e.width/t.width,k=p+h*e.height/t.height;return`transform: ${l} translate(${g}px, ${_}px) scale(${y}, ${k});`}}}function k_(n,e,t){const i=n.slice();return i[2]=e[t],i}function P6(n){let e;return{c(){e=v("i"),m(e,"class","ri-alert-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function L6(n){let e;return{c(){e=v("i"),m(e,"class","ri-error-warning-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function N6(n){let e;return{c(){e=v("i"),m(e,"class","ri-checkbox-circle-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function F6(n){let e;return{c(){e=v("i"),m(e,"class","ri-information-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function w_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,p=X,h,g,_;function y(M,C){return M[2].type==="info"?F6:M[2].type==="success"?N6:M[2].type==="warning"?L6:P6}let k=y(e),T=k(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=D(),l=v("div"),r=B(o),a=D(),u=v("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"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,C){S(M,t,C),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),h=!0,g||(_=K(u,"click",ft($)),g=!0)},p(M,C){e=M,k!==(k=y(e))&&(T.d(1),T=k(e),T&&(T.c(),T.m(i,null))),(!h||C&1)&&o!==(o=e[2].message+"")&&le(r,o),(!h||C&1)&&Q(t,"alert-info",e[2].type=="info"),(!h||C&1)&&Q(t,"alert-success",e[2].type=="success"),(!h||C&1)&&Q(t,"alert-danger",e[2].type=="error"),(!h||C&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){gb(t),p(),A_(t,d)},a(){p(),p=_b(t,d,I6,{duration:150})},i(M){h||(et(()=>{h&&(c||(c=qe(t,vo,{duration:150},!0)),c.run(1))}),h=!0)},o(M){c||(c=qe(t,vo,{duration:150},!1)),c.run(0),h=!1},d(M){M&&w(t),T.d(),M&&c&&c.end(),g=!1,_()}}}function R6(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=k_(n,l,r),u=o(a);i.set(u,t[r]=w_(u,a))}return{c(){e=v("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],re();for(let u=0;u<t.length;u+=1)t[u].r();t=Ct(t,a,o,1,r,l,i,e,Tb,w_,null,k_);for(let u=0;u<t.length;u+=1)t[u].a();ae()}},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)I(t[a]);s=!1},d(r){r&&w(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function q6(n,e,t){let i;return We(n,zo,l=>t(0,i=l)),[i,l=>Hg(l)]}class j6 extends ve{constructor(e){super(),be(this,e,q6,R6,_e,{})}}function V6(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=B(t),m(e,"class","block center txt-break"),m(e,"slot","header")},m(l,o){S(l,e,o),b(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 H6(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=D(),s=v("button"),l=v("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],Q(s,"btn-loading",n[2])},m(a,u){S(a,e,u),b(e,t),S(a,i,u),S(a,s,u),b(s,l),e.focus(),o||(r=[K(e,"click",n[4]),K(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,Ae(r)}}}function z6(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:[H6],header:[V6]},$$scope:{ctx:n}};return e=new bn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[6](null),j(e,s)}}}function B6(n,e,t){let i;We(n,tu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){se[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await rn(),t(3,o=!1),U1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class U6 extends ve{constructor(e){super(),be(this,e,B6,z6,_e,{})}}function S_(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k;return g=new qn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[W6]},$$scope:{ctx:n}}}),{c(){var T;e=v("aside"),t=v("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=D(),s=v("nav"),l=v("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=D(),r=v("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=D(),u=v("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=D(),c=v("figure"),d=v("img"),h=D(),V(g.$$.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"),Un(d.src,p="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||m(d,"src",p),m(d,"alt","Avatar"),m(c,"class","thumb thumb-circle link-hint closable"),m(e,"class","app-sidebar")},m(T,$){S(T,e,$),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,h),q(g,c,null),_=!0,y||(k=[De(nn.call(null,t)),De(nn.call(null,l)),De(Hn.call(null,l,{path:"/collections/?.*",className:"current-route"})),De(ze.call(null,l,{text:"Collections",position:"right"})),De(nn.call(null,r)),De(Hn.call(null,r,{path:"/logs/?.*",className:"current-route"})),De(ze.call(null,r,{text:"Logs",position:"right"})),De(nn.call(null,u)),De(Hn.call(null,u,{path:"/settings/?.*",className:"current-route"})),De(ze.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var C;(!_||$&1&&!Un(d.src,p="./images/avatars/avatar"+(((C=T[0])==null?void 0:C.avatar)||0)+".svg"))&&m(d,"src",p);const M={};$&1024&&(M.$$scope={dirty:$,ctx:T}),g.$set(M)},i(T){_||(A(g.$$.fragment,T),_=!0)},o(T){I(g.$$.fragment,T),_=!1},d(T){T&&w(e),j(g),y=!1,Ae(k)}}}function W6(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("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=[De(nn.call(null,e)),K(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Ae(r)}}}function Y6(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&S_(n);return o=new Ib({props:{routes:A6}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new j6({}),f=new U6({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),m(l,"class","app-body"),m(i,"class","app-layout")},m(h,g){S(h,t,g),S(h,i,g),d&&d.m(i,null),b(i,s),b(i,l),q(o,l,null),b(l,r),q(a,l,null),S(h,u,g),q(f,h,g),c=!0},p(h,[g]){var _;(!c||g&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(_=h[0])!=null&&_.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=S_(h),d.c(),A(d,1),d.m(i,s)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){I(d),I(o.$$.fragment,h),I(a.$$.fragment,h),I(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function K6(n,e,t){let i,s,l,o;We(n,Cs,p=>t(8,i=p)),We(n,ko,p=>t(2,s=p)),We(n,Ea,p=>t(0,l=p)),We(n,Ot,p=>t(3,o=p));let r,a=!1;function u(p){var h,g,_,y;((h=p==null?void 0:p.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((_=(g=p==null?void 0:p.detail)==null?void 0:g.userData)!=null&&_.showAppSidebar)),r=(y=p==null?void 0:p.detail)==null?void 0:y.location,Gt(Ot,o="",o),_n({}),U1())}function f(){Ei("/")}async function c(){var p,h;if(l!=null&&l.id)try{const g=await me.settings.getAll({$cancelKey:"initialAppSettings"});Gt(ko,s=((p=g==null?void 0:g.meta)==null?void 0:p.appName)||"",s),Gt(Cs,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class J6 extends ve{constructor(e){super(),be(this,e,K6,Y6,_e,{})}}new J6({target:document.getElementById("app")});export{Ae as A,Ut as B,H as C,Ei as D,we as E,zg as F,va as G,gu as H,We as I,Pi as J,vt as K,Qt as L,se as M,H1 as N,Ct as O,ns as P,an as Q,hn as R,ve as S,Nr as T,I as a,D as b,V as c,j as d,v as e,m as f,S as g,b as h,be as i,De as j,re as k,nn as l,q as m,ae as n,w as o,me as p,pe as q,Q as r,_e as s,A as t,K as u,ft as v,B as w,le as x,X as y,ue as z};